From report at bugs.python.org  Wed Dec  1 00:08:15 2021
From: report at bugs.python.org (Collin Anderson)
Date: Wed, 01 Dec 2021 05:08:15 +0000
Subject: [issue45944] Avoid calling isatty() for most open() calls
Message-ID: <1638335295.8.0.118316980587.issue45944@roundup.psfhosted.org>


Change by Collin Anderson <cmawebsite at gmail.com>:


----------
components: IO
nosy: collinanderson
priority: normal
severity: normal
status: open
title: Avoid calling isatty() for most open() calls
type: performance
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45944>
_______________________________________

From report at bugs.python.org  Wed Dec  1 00:11:58 2021
From: report at bugs.python.org (Collin Anderson)
Date: Wed, 01 Dec 2021 05:11:58 +0000
Subject: [issue45944] Avoid calling isatty() for most open() calls
Message-ID: <1638335518.88.0.926181104136.issue45944@roundup.psfhosted.org>


Change by Collin Anderson <cmawebsite at gmail.com>:


----------
keywords: +patch
pull_requests: +28096
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29870

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45944>
_______________________________________

From report at bugs.python.org  Wed Dec  1 00:12:39 2021
From: report at bugs.python.org (Collin Anderson)
Date: Wed, 01 Dec 2021 05:12:39 +0000
Subject: [issue45944] Avoid calling isatty() for most open() calls
Message-ID: <1638335559.46.0.0192700736969.issue45944@roundup.psfhosted.org>


New submission from Collin Anderson <cmawebsite at gmail.com>:

isatty() is a system call on linux. Most open()s are files, and we're already getting the size of the file. If it has a size, then we know it's not a atty, and can avoid calling it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45944>
_______________________________________

From report at bugs.python.org  Wed Dec  1 00:17:00 2021
From: report at bugs.python.org (Zachary Ware)
Date: Wed, 01 Dec 2021 05:17:00 +0000
Subject: [issue45943] Spam
Message-ID: <1638335820.32.0.345644022899.issue45943@roundup.psfhosted.org>


Change by Zachary Ware <zachary.ware at gmail.com>:


----------
components:  -email
nosy:  -barry, oktaine57, r.david.murray
title: Kids10yrsapart at gmail.com -> Spam
type: behavior -> 
versions:  -Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45943>
_______________________________________

From report at bugs.python.org  Wed Dec  1 00:17:17 2021
From: report at bugs.python.org (Zachary Ware)
Date: Wed, 01 Dec 2021 05:17:17 +0000
Subject: [issue45943] Spam
Message-ID: <1638335837.55.0.759908704753.issue45943@roundup.psfhosted.org>


Change by Zachary Ware <zachary.ware at gmail.com>:


Removed file: https://bugs.python.org/file50463/PSX_20210903_080553.jpg

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45943>
_______________________________________

From report at bugs.python.org  Wed Dec  1 02:40:18 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 07:40:18 +0000
Subject: [issue11352] Update cgi module doc
In-Reply-To: <1298895261.86.0.965235067518.issue11352@psf.upfronthosting.co.za>
Message-ID: <1638344418.19.0.0491084333612.issue11352@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Marking as easy. What needs to be done here is to review the patches and see if there are any doc improvements in them worth having. Then make a PR.

----------
keywords: +easy, newcomer friendly

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue11352>
_______________________________________

From report at bugs.python.org  Wed Dec  1 02:55:52 2021
From: report at bugs.python.org (Min RK)
Date: Wed, 01 Dec 2021 07:55:52 +0000
Subject: [issue39529] Deprecate get_event_loop()
In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org>
Message-ID: <1638345352.83.0.865305048004.issue39529@roundup.psfhosted.org>


Min RK <benjaminrk at gmail.com> added the comment:

The comments in this thread suggest that `set_event_loop` should also be deprecated, but it hasn't been. It doesn't seem to have any use without `get_event_loop()`.

I'm trying to understand the consequences of these changes for IPython, and make the changes intended by asyncio folks, but am not quite clear, yet.

If I understand it correctly, this means that the whole concept of a 'current' event loop is deprecated while no event loop is running?

My interpretation of these changes is that it means any persistent handles on any event loop while it isn't running is fully the responsibility of individual libraries (e.g. tornado, IPython).

This is coming up in IPython where we need a handle on the event loop and advance it with `run_until_complete` for each iteration (it should be the same loop to maintain persistent state across advances, so `asyncio.run()` would not be appropriate). We previously relied on `get_event_loop` to manage this handle, but I think we have to now shift to tracking our own handle, and can no longer rely on standard APIs to track a shared instance across packages.

----------
nosy: +minrk

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39529>
_______________________________________

From report at bugs.python.org  Wed Dec  1 03:05:36 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 08:05:36 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638345936.92.0.659717641699.issue40280@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28098
pull_request: https://github.com/python/cpython/pull/29872

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Wed Dec  1 03:10:59 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 08:10:59 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638346259.73.0.0473763207866.issue40280@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28099
pull_request: https://github.com/python/cpython/pull/29873

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Wed Dec  1 03:22:53 2021
From: report at bugs.python.org (Min RK)
Date: Wed, 01 Dec 2021 08:22:53 +0000
Subject: [issue39529] Deprecate get_event_loop()
In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org>
Message-ID: <1638346973.22.0.724095177298.issue39529@roundup.psfhosted.org>


Min RK <benjaminrk at gmail.com> added the comment:

Further digging reveals that `policy.get_event_loop()` is _not_ deprecated while `asyncio.get_event_loop()` is. Is that intentional? Does that mean switching our calls to `get_event_loop_policy().get_event_loop()` should continue to work without deprecation?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39529>
_______________________________________

From report at bugs.python.org  Wed Dec  1 03:56:24 2021
From: report at bugs.python.org (hongweipeng)
Date: Wed, 01 Dec 2021 08:56:24 +0000
Subject: [issue30533] missing feature in inspect module: getmembers_static
In-Reply-To: <1496271168.24.0.639482608296.issue30533@psf.upfronthosting.co.za>
Message-ID: <1638348984.6.0.911419209438.issue30533@roundup.psfhosted.org>


Change by hongweipeng <hongweichen8888 at sina.com>:


----------
pull_requests: +28100
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/29874

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30533>
_______________________________________

From report at bugs.python.org  Wed Dec  1 03:58:17 2021
From: report at bugs.python.org (Alexander Kanavin)
Date: Wed, 01 Dec 2021 08:58:17 +0000
Subject: [issue45945] compileall.py throws a traceback when using -j0 and thus
 'make install' locks up
Message-ID: <1638349096.96.0.35958886089.issue45945@roundup.psfhosted.org>


New submission from Alexander Kanavin <alex.kanavin at gmail.com>:

Hello, Yocto project has had to disable -j0 for compileall, so that it runs serially. If it doesn't, then 'make install' locks up sporadically, with hanging processes:
```
3837320 ?        SN     0:00                  \_ make -j 16 -l 52 STAGING_LIBDIR=/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280438/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/recipe-sysroot/usr/lib STAGING_INCDIR=/
 157523 ?        SNl    0:02                      \_ python3.10 -Wi -OO /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280438/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/compileall.py -j0 -d /u
 160673 ?        SN     0:00                          \_ python3.10 -Wi -OO /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280438/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/compileall.py -j0 -
 160677 ?        SN     0:00                          \_ python3.10 -Wi -OO /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280438/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/compileall.py -j0 -
 160682 ?        SN     0:00                          \_ python3.10 -Wi -OO /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280438/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/compileall.py -j0 -
 160697 ?        SN     0:00                          \_ python3.10 -Wi -OO /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280438/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/compileall.py -j0 -
 160759 ?        SN     0:00                          \_ python3.10 -Wi -OO /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280438/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/compileall.py -j0 -
 160816 ?        SN     0:00                          \_ python3.10 -Wi -OO /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280438/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/compileall.py -j0 -
...
```

and installation log reveals:
```
poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/compileall.py \
        -j0 -d /usr/lib/python3.10 -f \
        -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
        /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10
Listing '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10'...
Listing '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/asyncio'...
Listing '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/collections'...
Listing '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/concurrent'...
Listing '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/concurrent/futures'...
Listing '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/config-3.10-x86_64-linux-gnu'...
Listing '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/ctypes'...
Listing '/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/ctypes/macholib'...
...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/concurrent/futures/process.py", line 317, in run
    result_item, is_broken, cause = self.wait_result_broken_or_wakeup()
  File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/concurrent/futures/process.py", line 376, in wait_result_broken_or_wakeup
    worker_sentinels = [p.sentinel for p in self.processes.values()]
  File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-1280388/tmp/work/core2-64-poky-linux/python3/3.10.0-r0/image/usr/lib/python3.10/concurrent/futures/process.py", line 376, in <listcomp>
    worker_sentinels = [p.sentinel for p in self.processes.values()]
RuntimeError: dictionary changed size during iteration
```

----------
components: Library (Lib)
messages: 407431
nosy: Alexander Kanavin
priority: normal
severity: normal
status: open
title: compileall.py throws a traceback when using -j0 and thus 'make install' locks up
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45945>
_______________________________________

From report at bugs.python.org  Wed Dec  1 04:05:49 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 01 Dec 2021 09:05:49 +0000
Subject: [issue39529] Deprecate get_event_loop()
In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org>
Message-ID: <1638349549.01.0.750794048264.issue39529@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

IMHO, asyncio.set_event_loop() and policy.get_event_loop()/policy.set_event_loop() are not deprecated by oversight.

In IPython, I think you could use new_event_loop() for getting a new loop instance.
Then, save the loop reference somewhere as a direct attribute, threading.local or ContextVar.
Calling loop.run_until_complete() looks pretty normal in your situation.

At my job, we have Runner class, the basic usage is:
with Runner() as runner:
    runner.run(async_func())

The implementation is pretty close to asyncio.run() but runner.run(...) can be called multiple times. Async context manager interface is responsible for resource closing.

Maybe I should extract the implementation into a third-party library, I've found this concept useful for CLI applications at least.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39529>
_______________________________________

From report at bugs.python.org  Wed Dec  1 04:09:21 2021
From: report at bugs.python.org (Alexander Kanavin)
Date: Wed, 01 Dec 2021 09:09:21 +0000
Subject: [issue45945] compileall.py throws a traceback when using -j0 and thus
 'make install' locks up
In-Reply-To: <1638349096.96.0.35958886089.issue45945@roundup.psfhosted.org>
Message-ID: <1638349761.15.0.721716716933.issue45945@roundup.psfhosted.org>


Alexander Kanavin <alex.kanavin at gmail.com> added the comment:

Here's the full log where you can see what happens.

----------
Added file: https://bugs.python.org/file50464/log.do_install.1905494

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45945>
_______________________________________

From report at bugs.python.org  Wed Dec  1 04:20:15 2021
From: report at bugs.python.org (Hai Shi)
Date: Wed, 01 Dec 2021 09:20:15 +0000
Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always
 exported
In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org>
Message-ID: <1638350415.88.0.874569346199.issue44133@roundup.psfhosted.org>


Change by Hai Shi <shihai1991 at 126.com>:


----------
nosy: +shihai1991
nosy_count: 4.0 -> 5.0
pull_requests: +28101
pull_request: https://github.com/python/cpython/pull/29876

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44133>
_______________________________________

From report at bugs.python.org  Wed Dec  1 04:22:53 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 01 Dec 2021 09:22:53 +0000
Subject: [issue45944] Avoid calling isatty() for most open() calls
In-Reply-To: <1638335559.46.0.0192700736969.issue45944@roundup.psfhosted.org>
Message-ID: <1638350573.4.0.866344479446.issue45944@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

What if change FileIO.isatty() instead? If make it returning False without invoking a system call if the file size is non-zero it will eliminate the need to expose _size.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45944>
_______________________________________

From report at bugs.python.org  Wed Dec  1 04:24:45 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 01 Dec 2021 09:24:45 +0000
Subject: [issue45944] Avoid calling isatty() for most open() calls
In-Reply-To: <1638335559.46.0.0192700736969.issue45944@roundup.psfhosted.org>
Message-ID: <1638350685.56.0.789019614225.issue45944@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
nosy: +benjamin.peterson, pitrou, stutzbach
versions:  -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45944>
_______________________________________

From report at bugs.python.org  Wed Dec  1 04:59:22 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 01 Dec 2021 09:59:22 +0000
Subject: [issue43153] tempfile seems to treat a file as a directory when
 processing an exception in the onerror()
In-Reply-To: <1612691564.38.0.627288937354.issue43153@roundup.psfhosted.org>
Message-ID: <1638352762.22.0.470261802848.issue43153@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I agree with Andrei. I'll test this approach on Windows.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43153>
_______________________________________

From report at bugs.python.org  Wed Dec  1 05:02:07 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 10:02:07 +0000
Subject: [issue11352] Update cgi module doc
In-Reply-To: <1298895261.86.0.965235067518.issue11352@psf.upfronthosting.co.za>
Message-ID: <1638352927.45.0.561063150826.issue11352@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
type:  -> enhancement
versions: +Python 3.11 -Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue11352>
_______________________________________

From report at bugs.python.org  Wed Dec  1 05:11:10 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 10:11:10 +0000
Subject: [issue12957] [doc] mmap.resize changes memory address of mmap'd region
In-Reply-To: <1315686259.57.0.0304440203891.issue12957@psf.upfronthosting.co.za>
Message-ID: <1638353470.96.0.0820956466196.issue12957@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
components: +Library (Lib), ctypes
title: mmap.resize changes memory address of mmap'd region -> [doc] mmap.resize changes memory address of mmap'd region
versions: +Python 3.11 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12957>
_______________________________________

From report at bugs.python.org  Wed Dec  1 05:15:35 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 10:15:35 +0000
Subject: [issue25810] Python 3 documentation for eval is incorrect
In-Reply-To: <1449346403.16.0.483198527619.issue25810@psf.upfronthosting.co.za>
Message-ID: <1638353735.38.0.879588841043.issue25810@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Help is now showing

eval(source, globals=None, locals=None, /)

with the / that indicates the args are positional only. The docs were updated here to state that the args are positional.

----------
nosy: +iritkatriel
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25810>
_______________________________________

From report at bugs.python.org  Wed Dec  1 05:16:19 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 01 Dec 2021 10:16:19 +0000
Subject: [issue45939] PyErr_SetObject documentation lacks mention of reference
 counting
In-Reply-To: <1638286636.68.0.690482450072.issue45939@roundup.psfhosted.org>
Message-ID: <1638353779.28.0.568408548893.issue45939@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I concur with Ronald. If we explicitly document that PyErr_SetObject() does not steal reference we would need to document it for every parameter of every function. It would make the documentation worse because it would be more difficult to distinguish ouliners which steal references from normal functions which does not steal references.

Use official Python documentation.

----------
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45939>
_______________________________________

From report at bugs.python.org  Wed Dec  1 05:19:19 2021
From: report at bugs.python.org (Gobot1234)
Date: Wed, 01 Dec 2021 10:19:19 +0000
Subject: [issue45946] RecursionError when annotating a field with the same
 name as a field
Message-ID: <1638353959.47.0.043888744355.issue45946@roundup.psfhosted.org>


New submission from Gobot1234 <gobot1234yt at gmail.com>:

Small snippet to reproduce:
```
from dataclasses import dataclass, field

@dataclass
class Foo:
    bool: bool = field()
```
Raises
```
---------------------------------------------------------------------------
RecursionError                            Traceback (most recent call last)
<ipython-input-1-dce9c97e78ae> in <module>
      2 
      3 @dataclass
----> 4 class Foo:
      5     bool: bool = field()
      6 

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py in dataclass(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots)
   1176 
   1177     # We're called as @dataclass without parens.
-> 1178     return wrap(cls)
   1179 
   1180 

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py in wrap(cls)
   1167 
   1168     def wrap(cls):
-> 1169         return _process_class(cls, init, repr, eq, order, unsafe_hash,
   1170                               frozen, match_args, kw_only, slots)
   1171 

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py in _process_class(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots)
   1085         # Create a class doc-string.
   1086         cls.__doc__ = (cls.__name__ +
-> 1087                        str(inspect.signature(cls)).replace(' -> None', ''))
   1088 
   1089     if match_args:

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/inspect.py in __str__(self)
   3200         render_kw_only_separator = True
   3201         for param in self.parameters.values():
-> 3202             formatted = str(param)
   3203 
   3204             kind = param.kind

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/inspect.py in __str__(self)
   2717         if self._annotation is not _empty:
   2718             formatted = '{}: {}'.format(formatted,
-> 2719                                        formatannotation(self._annotation))
   2720 
   2721         if self._default is not _empty:

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/inspect.py in formatannotation(annotation, base_module)
   1362             return annotation.__qualname__
   1363         return annotation.__module__+'.'+annotation.__qualname__
-> 1364     return repr(annotation)
   1365 
   1366 def formatannotationrelativeto(object):

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py in __repr__(self)
    281 
    282     def __repr__(self):
--> 283         return ('Field('
    284                 f'name={self.name!r},'
    285                 f'type={self.type!r},'

... last 1 frames repeated, from the frame below ...

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/dataclasses.py in __repr__(self)
    281 
    282     def __repr__(self):
--> 283         return ('Field('
    284                 f'name={self.name!r},'
    285                 f'type={self.type!r},'

RecursionError: maximum recursion depth exceeded while getting the repr of an object
```
This is due to the self.type being the field itself as the annotation is evaluated using the class namespace.

----------
components: Library (Lib)
messages: 407438
nosy: Gobot1234, eric.smith
priority: normal
severity: normal
status: open
title: RecursionError when annotating a field with the same name as a field
type: crash
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45946>
_______________________________________

From report at bugs.python.org  Wed Dec  1 05:38:24 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 01 Dec 2021 10:38:24 +0000
Subject: [issue12957] [doc] mmap.resize changes memory address of mmap'd region
In-Reply-To: <1315686259.57.0.0304440203891.issue12957@psf.upfronthosting.co.za>
Message-ID: <1638355104.6.0.509983464799.issue12957@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

mmap no longer allows resizing if the object has buffer exports. For example:

    >>> m = mmap.mmap(-1, 4096, access=mmap.ACCESS_WRITE)
    >>> p = (ctypes.c_char * 4096).from_buffer(m)
    >>> m.resize(8192)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    BufferError: mmap can't resize with extant buffers exported.

    >>> del p
    >>> m.resize(8192)
    >>> len(m)
    8192

----------
nosy: +eryksun
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12957>
_______________________________________

From report at bugs.python.org  Wed Dec  1 05:50:26 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 10:50:26 +0000
Subject: [issue23453] [doc] Clarify bytes vs text with non-seeking tarfile
 stream
In-Reply-To: <1423739998.49.0.706967373594.issue23453@psf.upfronthosting.co.za>
Message-ID: <1638355826.99.0.439273878068.issue23453@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: Clarify bytes vs text with non-seeking tarfile stream -> [doc] Clarify bytes vs text with non-seeking tarfile stream
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23453>
_______________________________________

From report at bugs.python.org  Wed Dec  1 06:03:39 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 11:03:39 +0000
Subject: [issue25743] [doc] Clarify exactly what \w matches in UNICODE mode
In-Reply-To: <1448639458.78.0.12264064003.issue25743@psf.upfronthosting.co.za>
Message-ID: <1638356619.51.0.147438119232.issue25743@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

It's too late for the 2.7 docs, but the current docs can still be updated.

----------
keywords: +easy
nosy: +iritkatriel
title: Clarify exactly what \w matches in UNICODE mode -> [doc] Clarify exactly what \w matches in UNICODE mode
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25743>
_______________________________________

From report at bugs.python.org  Wed Dec  1 06:19:52 2021
From: report at bugs.python.org (Min RK)
Date: Wed, 01 Dec 2021 11:19:52 +0000
Subject: [issue39529] Deprecate get_event_loop()
In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org>
Message-ID: <1638357592.86.0.0591602722394.issue39529@roundup.psfhosted.org>


Min RK <benjaminrk at gmail.com> added the comment:

Thank you! I think I have enough information to update.

> IMHO, asyncio.set_event_loop()...[is] not deprecated by oversight.

I'm curious, what is an appropriate use of `asyncio.set_event_loop()` if you can never get the event loop with `get_event_loop()`? If you always have to pass the handle around anyway, I'm not sure what the use case for a write-only global would be.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39529>
_______________________________________

From report at bugs.python.org  Wed Dec  1 06:45:51 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 01 Dec 2021 11:45:51 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638359151.06.0.513016785551.issue45941@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:

Works for me on Ubuntu.

Python 3.11.0a2+ (heads/main:0aa0bd0563, Dec  1 2021, 11:39:40) [GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> help("modules")

[lots of output, but no assertion failure or segfault]

>>> 


I note that your debug output includes `_cffi_backend.FFI object`
Is this a cffi bug?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 06:47:36 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 01 Dec 2021 11:47:36 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638359256.95.0.767692768204.issue45941@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:

When I say "cffi bug", I should say "is cffi not ported to 3.11 yet?"

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 06:53:13 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 01 Dec 2021 11:53:13 +0000
Subject: [issue45944] Avoid calling isatty() for most open() calls
In-Reply-To: <1638335559.46.0.0192700736969.issue45944@roundup.psfhosted.org>
Message-ID: <1638359593.4.0.00903354875923.issue45944@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> make it returning False without invoking a system call if the file
> size is non-zero it will eliminate the need to expose _size.

I suggest using the file type instead of the size. There's no reason to call isatty() if it's not an S_IFCHR file. This will avoid calling isatty() on regular files that happen to be empty.

In Windows, isatty(fd) is based solely on the file type, which is flagged in the fd record when a file descriptor is opened for a native file handle. It's not a system call, but it's also nearly worthless for how isatty() is typically used, since it's true for any S_IFCHR file (e.g. con, nul, com1).

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45944>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:09:41 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 01 Dec 2021 12:09:41 +0000
Subject: [issue45753] Further speed up Python-to-Python calls.
In-Reply-To: <1636391875.36.0.891525405866.issue45753@roundup.psfhosted.org>
Message-ID: <1638360581.06.0.297885004886.issue45753@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 49444fb807ecb396462c8e5f547eeb5c6bc5d4de by Mark Shannon in branch 'main':
bpo-45753: Interpreter internal tweaks (GH-29575)
https://github.com/python/cpython/commit/49444fb807ecb396462c8e5f547eeb5c6bc5d4de


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45753>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:12:41 2021
From: report at bugs.python.org (Malcolm Smith)
Date: Wed, 01 Dec 2021 12:12:41 +0000
Subject: [issue31196] Blank line inconsistency between InteractiveConsole and
 standard interpreter
In-Reply-To: <1502658757.92.0.0359191508861.issue31196@psf.upfronthosting.co.za>
Message-ID: <1638360761.77.0.15113673318.issue31196@roundup.psfhosted.org>


Malcolm Smith <malcolm.smith at gmail.com> added the comment:

I agree that both behaviors are reasonable. However, the InteractiveConsole documentation says it should "closely emulate the behavior of the interactive Python interpreter". Since people are familiar with the native interpreter, any difference in behavior is potentially annoying and could throw off somebody's flow. So I think the InteractiveConsole should be changed to match the native interpreter.

Like the native interpreter, InteractiveConsole allows other multi-line blocks to be terminated with a blank line:

>>> def foo(x):
...   pass
...
>>> for x in [1,2,3]:
...   pass
...
>>>


I guess the reason why "try" is different is that a "try" block isn't a complete statement on its own. If you follow it with an "except" block, then that can indeed be terminated with a blank line.

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31196>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:21:41 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Wed, 01 Dec 2021 12:21:41 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638361301.42.0.38332808927.issue45941@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

Unable to reproduce on macOS 12 with latest 3.11 official build, and my most recent dev build (HEAD at b394af13f69c1a2ac0e7d32dabf6d86443606ab2).

----------
nosy: +erlendaasland

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:23:40 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 01 Dec 2021 12:23:40 +0000
Subject: [issue39529] Deprecate get_event_loop()
In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org>
Message-ID: <1638361420.23.0.122795208504.issue39529@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

Ages ago, get_event_loop() did not return the current running loop if called from async function context; it returned a loop instance registered with previous set_event_loop(...) call instead.

Later we fixed get_event_loop() behavior in 3.5.4 IIRC and added get_running_loop() in 3.7

set_event_loop() doesn't make sense now from my perspective.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39529>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:24:54 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 01 Dec 2021 12:24:54 +0000
Subject: [issue45896] Conflicting statements in docs about default support for
 asyncio subprocesses on Windows
In-Reply-To: <1637792122.45.0.429203503373.issue45896@roundup.psfhosted.org>
Message-ID: <1638361494.77.0.59433475004.issue45896@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset f27bef30438d2f07f19de91e021f34b77ccc4b20 by Rob in branch 'main':
bpo-45896: Fix docs default asyncio event loop on Windows (GH-29857)
https://github.com/python/cpython/commit/f27bef30438d2f07f19de91e021f34b77ccc4b20


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45896>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:25:16 2021
From: report at bugs.python.org (miss-islington)
Date: Wed, 01 Dec 2021 12:25:16 +0000
Subject: [issue45896] Conflicting statements in docs about default support for
 asyncio subprocesses on Windows
In-Reply-To: <1637792122.45.0.429203503373.issue45896@roundup.psfhosted.org>
Message-ID: <1638361516.72.0.0735123676919.issue45896@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28102
pull_request: https://github.com/python/cpython/pull/29877

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45896>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:25:21 2021
From: report at bugs.python.org (miss-islington)
Date: Wed, 01 Dec 2021 12:25:21 +0000
Subject: [issue45896] Conflicting statements in docs about default support for
 asyncio subprocesses on Windows
In-Reply-To: <1637792122.45.0.429203503373.issue45896@roundup.psfhosted.org>
Message-ID: <1638361521.13.0.067373578832.issue45896@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28103
pull_request: https://github.com/python/cpython/pull/29878

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45896>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:27:07 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Wed, 01 Dec 2021 12:27:07 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638361627.55.0.26534360786.issue45941@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

Also unable to reproduce with HEAD at 49444fb807ecb396462c8e5f547eeb5c6bc5d4de.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:29:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 12:29:31 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638361771.94.0.356119888829.issue45941@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I'm using MacOS 11.6.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:31:08 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Wed, 01 Dec 2021 12:31:08 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638361868.84.0.951027088383.issue45941@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

Also unable to reproduce with HEAD at 8a45ca542a65ea27e7acaa44a4c833a27830e796. Perhaps it is related to your build/dev environment?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:40:43 2021
From: report at bugs.python.org (Min RK)
Date: Wed, 01 Dec 2021 12:40:43 +0000
Subject: [issue39529] Deprecate get_event_loop()
In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org>
Message-ID: <1638362443.85.0.484515595567.issue39529@roundup.psfhosted.org>


Min RK <benjaminrk at gmail.com> added the comment:

Oops, I interpreted "not deprecated by oversight" as the opposite of what you meant. Sorry! All clear, now.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39529>
_______________________________________

From report at bugs.python.org  Wed Dec  1 07:54:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 12:54:05 +0000
Subject: [issue31196] Blank line inconsistency between InteractiveConsole and
 standard interpreter
In-Reply-To: <1502658757.92.0.0359191508861.issue31196@psf.upfronthosting.co.za>
Message-ID: <1638363245.06.0.479999154734.issue31196@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

> any difference in behavior is potentially annoying and could throw off somebody's flow. So I think the InteractiveConsole should be changed to match the native interpreter.


That would make InteractiveConsole more restrictive and break code that is currently working. It could also be annoying and throw off somebody's flow.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31196>
_______________________________________

From report at bugs.python.org  Wed Dec  1 08:23:31 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Wed, 01 Dec 2021 13:23:31 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638365011.42.0.0172862944668.issue45941@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

I'm unable to reproduce on macOS 11.6 as well (head at 49444fb807ecb396462c8e5f547eeb5c6bc5d4de).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 08:29:04 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 01 Dec 2021 13:29:04 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638365344.01.0.195005660718.issue45476@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

I updated my ./search_pypi_top_5000.py script to ignore files generated by Cython.

On PyPI top 5000, I only found 16 projects impacted by the PEP 674 (16/5000 = 0.3%):

* datatable-1.0.0
* frozendict-2.1.1
* guppy3-3.1.2
* M2Crypto-0.38.0
* mecab-python3-1.0.4
* mypy-0.910
* Naked-0.1.31
* pickle5-0.0.12
* pycurl-7.44.1
* PyGObject-3.42.0
* pysha3-1.0.2
* python-snappy-0.6.0
* recordclass-0.16.3
* scipy-1.7.3
* zodbpickle-2.2.0
* zstd-1.5.0.2

I ignored manually two false positives in 3 projects:

* "#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)" in Cython
* "* Py_TYPE(obj) = new_type must be replaced with Py_SET_TYPE(obj, new_type)": comment in psycopg2 and psycopg2-binary

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Wed Dec  1 08:30:49 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 01 Dec 2021 13:30:49 +0000
Subject: [issue45947] Place dict (and values) pointers at a fixed (negative)
 offset from the base of the object.
Message-ID: <1638365448.99.0.213832334161.issue45947@roundup.psfhosted.org>


New submission from Mark Shannon <mark at hotpy.org>:

To get to the dict (or values array) of an object, we currently need 3 dependent loads.
By placing the dict at a fixed offset, this can be reduced to one.

What was `obj[obj->type->dictoffset]` becomes `obj[FIXED_OFFSET]`

See https://github.com/faster-cpython/ideas/issues/80, specifically
https://github.com/faster-cpython/ideas/issues/80#issuecomment-931504847 for more details.

----------
assignee: Mark.Shannon
components: Interpreter Core
messages: 407457
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Place dict (and values) pointers at a fixed (negative) offset from the base of the object.
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45947>
_______________________________________

From report at bugs.python.org  Wed Dec  1 09:04:55 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 01 Dec 2021 14:04:55 +0000
Subject: [issue45947] Place dict (and values) pointers at a fixed (negative)
 offset from the base of the object.
In-Reply-To: <1638365448.99.0.213832334161.issue45947@roundup.psfhosted.org>
Message-ID: <1638367495.95.0.769724225584.issue45947@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
keywords: +patch
pull_requests: +28104
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29879

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45947>
_______________________________________

From report at bugs.python.org  Wed Dec  1 09:07:53 2021
From: report at bugs.python.org (Robert Steed)
Date: Wed, 01 Dec 2021 14:07:53 +0000
Subject: [issue45948] Unexpected instantiation behavior for
 xml.etree.ElementTree.XMLParser(target=None)
Message-ID: <1638367672.95.0.357017255599.issue45948@roundup.psfhosted.org>


New submission from Robert Steed <rdsteed at steeds.us>:

Expected instantiation of xml.etree.ElementTree.XMLParser(target=None) to create a parser using default TreeBuilder

----------
components: XML
files: XMLParserFail.py
messages: 407458
nosy: rdsteed
priority: normal
severity: normal
status: open
title: Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50465/XMLParserFail.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45948>
_______________________________________

From report at bugs.python.org  Wed Dec  1 09:30:55 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Wed, 01 Dec 2021 14:30:55 +0000
Subject: [issue45946] RecursionError when annotating a field with the same
 name as a field
In-Reply-To: <1638353959.47.0.043888744355.issue45946@roundup.psfhosted.org>
Message-ID: <1638369055.72.0.570238379994.issue45946@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
assignee:  -> eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45946>
_______________________________________

From report at bugs.python.org  Wed Dec  1 10:33:08 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 15:33:08 +0000
Subject: [issue45607] Make it possible to enrich an exception's error message
In-Reply-To: <1635194281.32.0.0583100270803.issue45607@roundup.psfhosted.org>
Message-ID: <1638372788.11.0.979426330918.issue45607@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +patch
pull_requests: +28105
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29880

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45607>
_______________________________________

From report at bugs.python.org  Wed Dec  1 10:34:28 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 15:34:28 +0000
Subject: [issue45949] Provide pure-Python implementation of
 Programs/_freeze_module for cross building
Message-ID: <1638372868.47.0.982140813893.issue45949@roundup.psfhosted.org>


New submission from Christian Heimes <lists at cheimes.de>:

As of today 3.11-dev requires Programs/_freeze_module to compile Python code to byte code. The dependency on an extra and special tool makes cross building more complicated. The _freeze_module is trivial and can be easily implemented in pure Python code. The re-introduction of _bootstrap_python helper would allow us to use a pure Python freeze_module for all modules except two importlib bootstrap modules. I have a proof of concept implementation that works for me.

Proposal for standard builds:
- Use Programs/_freeze_module to create Python/frozen_modules/importlib._bootstrap.h and Python/frozen_modules/importlib._bootstrap_external.h
- build _bootstrap_python
- use new tool "./_bootstrap_python Tools/scripts/freezemodule.py" to create remaining Python/frozen_modules/*.h

Proposal for cross builds:
- use user-provider Python interpreter (./configure --with-build-python) to generate all Python/frozen_modules/*.h with new freezemodule.py tool.

When cross building the user must already provide a Python interpreter with same version and bytecode version as the build target. Users would no longer need to provide a _freeze_module binary with ./configure --with-freeze-module.

----------
assignee: christian.heimes
components: Build, Cross-Build
messages: 407459
nosy: Alex.Willmer, christian.heimes, gvanrossum
priority: normal
severity: normal
status: open
title: Provide pure-Python implementation of Programs/_freeze_module for cross building
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________

From report at bugs.python.org  Wed Dec  1 10:40:58 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 01 Dec 2021 15:40:58 +0000
Subject: [issue45896] Conflicting statements in docs about default support for
 asyncio subprocesses on Windows
In-Reply-To: <1637792122.45.0.429203503373.issue45896@roundup.psfhosted.org>
Message-ID: <1638373258.52.0.949191373174.issue45896@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset 4203a5d1918ca874e305806b787e3c8c6fc35e3e by Miss Islington (bot) in branch '3.9':
bpo-45896: Fix docs default asyncio event loop on Windows (GH-29857) (GH-29878)
https://github.com/python/cpython/commit/4203a5d1918ca874e305806b787e3c8c6fc35e3e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45896>
_______________________________________

From report at bugs.python.org  Wed Dec  1 10:43:26 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Wed, 01 Dec 2021 15:43:26 +0000
Subject: [issue45933] Illegal Instrution (Core Dumped)
In-Reply-To: <1638224710.52.0.0477949346292.issue45933@roundup.psfhosted.org>
Message-ID: <1638373406.9.0.855801300487.issue45933@roundup.psfhosted.org>


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

Is arch corei7-avx compatible with your CPU? One way to test is to leave out -mtune=... and -march=... when building python.

----------
nosy: +ronaldoussoren

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45933>
_______________________________________

From report at bugs.python.org  Wed Dec  1 10:44:18 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 01 Dec 2021 15:44:18 +0000
Subject: [issue45896] Conflicting statements in docs about default support for
 asyncio subprocesses on Windows
In-Reply-To: <1637792122.45.0.429203503373.issue45896@roundup.psfhosted.org>
Message-ID: <1638373458.02.0.850429983347.issue45896@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset e99c5e039b380199843db4e06974883d9f3ddad0 by Miss Islington (bot) in branch '3.10':
bpo-45896: Fix docs default asyncio event loop on Windows (GH-29857) (GH-29877)
https://github.com/python/cpython/commit/e99c5e039b380199843db4e06974883d9f3ddad0


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45896>
_______________________________________

From report at bugs.python.org  Wed Dec  1 10:44:36 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 01 Dec 2021 15:44:36 +0000
Subject: [issue45896] Conflicting statements in docs about default support for
 asyncio subprocesses on Windows
In-Reply-To: <1637792122.45.0.429203503373.issue45896@roundup.psfhosted.org>
Message-ID: <1638373476.74.0.357905697819.issue45896@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45896>
_______________________________________

From report at bugs.python.org  Wed Dec  1 10:54:33 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 01 Dec 2021 15:54:33 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638374073.71.0.474335416805.issue45476@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Oops, sorry, pycurl-7.44.1 and PyGObject-3.42.0 are not affected, they only define Py_SET_TYPE() macro for backward compatibility. So right now, only 14 projects are affected.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:06:24 2021
From: report at bugs.python.org (Malcolm Smith)
Date: Wed, 01 Dec 2021 16:06:24 +0000
Subject: [issue31196] Blank line inconsistency between InteractiveConsole and
 standard interpreter
In-Reply-To: <1502658757.92.0.0359191508861.issue31196@psf.upfronthosting.co.za>
Message-ID: <1638374783.99.0.410344175186.issue31196@roundup.psfhosted.org>


Malcolm Smith <malcolm.smith at gmail.com> added the comment:

I think it's unlikely that anyone is depending on the ability to enter blank lines in a "try" block in an InteractiveConsole, especially when blank lines terminate the input in almost every other context.

Conversely, everyone who's ever entered a multi-line statement into a Python console knows that blank lines usually terminate the input. And they may have gotten into the habit, as I did, of using a blank line to abandon an incomplete input, and they'll be surprised if it doesn't work in this context. 

On further experimentation, this also affects "def" statements, but only when the blank line is at the start of the block, causing the statement to be syntactically incomplete.

Native interpreter:

    >>> def f():
    ...
      File "<stdin>", line 2

        ^
    IndentationError: expected an indented block after function definition on line 1

InteractiveConsole:

    >>> def f():
    ...
    ...
    ...   pass
    ...
    >>>

So I think the current behavior is likely to annoy a much larger number of people, but whoever's responsible for this part of the standard library will have to judge that for themselves.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31196>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:07:25 2021
From: report at bugs.python.org (Malcolm Smith)
Date: Wed, 01 Dec 2021 16:07:25 +0000
Subject: [issue31196] Blank line inconsistency between InteractiveConsole and
 standard interpreter
In-Reply-To: <1502658757.92.0.0359191508861.issue31196@psf.upfronthosting.co.za>
Message-ID: <1638374845.64.0.240449436791.issue31196@roundup.psfhosted.org>


Change by Malcolm Smith <malcolm.smith at gmail.com>:


----------
versions: +Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31196>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:08:29 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 01 Dec 2021 16:08:29 +0000
Subject: [issue45949] Provide pure-Python implementation of
 Programs/_freeze_module for cross building
In-Reply-To: <1638372868.47.0.982140813893.issue45949@roundup.psfhosted.org>
Message-ID: <1638374909.04.0.727478269718.issue45949@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

IIRC, Programs/_freeze_module.c was originally a C implementation of the basic functionality in Tools/freeze/freeze.py.

----------
nosy: +eric.snow

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:08:58 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 01 Dec 2021 16:08:58 +0000
Subject: [issue45949] Provide pure-Python implementation of
 Programs/_freeze_module for cross building
In-Reply-To: <1638372868.47.0.982140813893.issue45949@roundup.psfhosted.org>
Message-ID: <1638374938.9.0.590298347182.issue45949@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

Ideally we would not have two scripts that do the same thing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:26:37 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 16:26:37 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
Message-ID: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>


New submission from Christian Heimes <lists at cheimes.de>:

bpo-45696 introduced a _bootstrap_python interpreter, which was used to create frozen and deepfrozen module files. bpo-45873 dropped the _bootstrap_python interpreter again. Instead Python used an existing Python installation to bootstrap the build.

After some internal discussion we agreed that the approach is flawed and puts too much of a burden on users. Users have to install a fairly recent Python interpreter in order to build 3.11. This makes it harder to build Python on platforms with no or a too old Python version. It also complicated things for container builds and pyenv.

Let's re-introduce a _bootstrap_python interpreter. Cross compiling will still require a build Python interpreter.

----------
components: Build
messages: 407467
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Reintroduce bootstrap_python for freezing
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:26:54 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 16:26:54 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638376014.49.0.361588158112.issue45950@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
assignee:  -> christian.heimes
dependencies: +"Deep-freeze": skip the marshal step by generating C code, Stop using bootstrap_python for deep-freeze in UNIX builds

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:29:12 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 16:29:12 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638376152.2.0.0668161320616.issue45950@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
keywords: +patch
pull_requests: +28106
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29859

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:29:24 2021
From: report at bugs.python.org (Julien Castiaux)
Date: Wed, 01 Dec 2021 16:29:24 +0000
Subject: [issue44637] Quoting issue on header Reply-To and other address
 headers
In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org>
Message-ID: <1638376164.84.0.409751553867.issue44637@roundup.psfhosted.org>


Change by Julien Castiaux <julien.castiaux at gmail.com>:


----------
keywords: +patch
pull_requests: +28107
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29881

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44637>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:29:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 16:29:28 +0000
Subject: [issue9226] erroneous behavior when creating classes inside a closure
In-Reply-To: <1278878196.2.0.124754685152.issue9226@psf.upfronthosting.co.za>
Message-ID: <1638376168.09.0.305748436785.issue9226@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.6, Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9226>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:30:55 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Wed, 01 Dec 2021 16:30:55 +0000
Subject: [issue45889] pathlib: Path.match does not work on paths
In-Reply-To: <1637740471.98.0.448189048749.issue45889@roundup.psfhosted.org>
Message-ID: <1638376255.23.0.758900836328.issue45889@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

I agree with ?ric and Ronald.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45889>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:31:56 2021
From: report at bugs.python.org (mike mcleod)
Date: Wed, 01 Dec 2021 16:31:56 +0000
Subject: [issue1284670] Allow to restrict ModuleFinder to get "direct"
 dependencies
Message-ID: <1638376316.17.0.603768002022.issue1284670@roundup.psfhosted.org>


mike mcleod <mikecmcleod at gmail.com> added the comment:

I have made the changes as indicated in the diff files. I have tested against the latest from my GitHub copy.
The result is:
./python -m test -j0
== CPython 3.11.0a2+ (heads/main:3a91617590, Dec 1 2021, 15:11:41) [GCC 11.2.0]
== Linux-5.13.0-22-generic-x86_64-with-glibc2.34 little-endian
== cwd: /home/dougal/Documents/cpython/build/test_python_300237?
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
...
0:01:34 load avg: 8.77 [221/430/1] test_modulefinder passed
== Tests result: FAILURE ==
409 tests OK.
1 test failed:
    test_embed
20 tests skipped:
    test_curses test_devpoll test_epoll test_ioctl test_kqueue
    test_msilib test_ossaudiodev test_smtpnet test_socketserver
    test_startfile test_tix test_tk test_ttk_guionly test_urllib2net
    test_urllibnet test_winconsoleio test_winreg test_winsound
    test_xmlrpc_net test_zipfile64
Total duration: 5 min 30 sec
Tests result: FAILURE

The first diff is attached. But there was a bug in the code and I will upload in next comment.

----------
Added file: https://bugs.python.org/file50466/1.html

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1284670>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:33:24 2021
From: report at bugs.python.org (mike mcleod)
Date: Wed, 01 Dec 2021 16:33:24 +0000
Subject: [issue1284670] Allow to restrict ModuleFinder to get "direct"
 dependencies
Message-ID: <1638376404.93.0.598307565995.issue1284670@roundup.psfhosted.org>


mike mcleod <mikecmcleod at gmail.com> added the comment:

Minor fix after test.

----------
Added file: https://bugs.python.org/file50467/2.html

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1284670>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:34:12 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 16:34:12 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638376452.24.0.116281097845.issue45950@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
nosy: +eric.snow, gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:36:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 16:36:05 +0000
Subject: [issue11455] issue a warning when populating a CPython type dict with
 non-string keys
In-Reply-To: <1299704028.56.0.168922481621.issue11455@psf.upfronthosting.co.za>
Message-ID: <1638376565.65.0.121264010143.issue11455@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

>>> A = type("A", (object,), {42: "abc"})
>>> dir(A())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'int' and 'str'

----------
nosy: +iritkatriel
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue11455>
_______________________________________

From report at bugs.python.org  Wed Dec  1 11:37:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 16:37:57 +0000
Subject: [issue31196] Blank line inconsistency between InteractiveConsole and
 standard interpreter
In-Reply-To: <1502658757.92.0.0359191508861.issue31196@psf.upfronthosting.co.za>
Message-ID: <1638376677.8.0.558463343751.issue31196@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions:  -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31196>
_______________________________________

From report at bugs.python.org  Wed Dec  1 12:48:23 2021
From: report at bugs.python.org (Ben)
Date: Wed, 01 Dec 2021 17:48:23 +0000
Subject: [issue45951] Debugger cannot be resolved
Message-ID: <1638380903.59.0.519590962782.issue45951@roundup.psfhosted.org>


New submission from Ben <benboettcher at rocketmail.com>:

First, I am not a programmer by any stretch of the imagination, and I am just trying to get this error solved.

I attempted to highlight and comment out a section of code, maybe 20 lines, and the program froze, greyed out, and gave me a spinning wheel mouse.

I closed & reopened program, attempted with one line of code and it worked, attempted again with 5 lines and same issue occurred.

I have attached a screenshot of the error message and didn't seen how the associated error related.  

https://bugs.python.org/issue1180193

The screen was greyed out yes, but I didn't change anything or close the program.  I left the night before and when I attempted it this morning it started behaving in this manner.

----------
files: Python error.png
messages: 407473
nosy: boett1
priority: normal
severity: normal
status: open
title: Debugger cannot be resolved
versions: Python 3.7
Added file: https://bugs.python.org/file50468/Python error.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45951>
_______________________________________

From report at bugs.python.org  Wed Dec  1 12:49:22 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 01 Dec 2021 17:49:22 +0000
Subject: [issue45952] Tools/c-analyzer is out-of-date.
Message-ID: <1638380962.78.0.734744265271.issue45952@roundup.psfhosted.org>


New submission from Eric Snow <ericsnowcurrently at gmail.com>:

Some relatively recent changes broke "./python Tools/c-analyzer/c-analyzer.py ...".  Also, Tools/c-analyzer/TODO is a bit out of date.

----------
assignee: eric.snow
components: Demos and Tools
messages: 407474
nosy: eric.snow
priority: normal
pull_requests: 28108
severity: normal
stage: patch review
status: open
title: Tools/c-analyzer is out-of-date.
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45952>
_______________________________________

From report at bugs.python.org  Wed Dec  1 13:20:36 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 01 Dec 2021 18:20:36 +0000
Subject: [issue45952] Tools/c-analyzer is out-of-date.
In-Reply-To: <1638380962.78.0.734744265271.issue45952@roundup.psfhosted.org>
Message-ID: <1638382836.59.0.0638430669425.issue45952@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:


New changeset ee94aa0850191712e6adfc1f4a9df08ec3240195 by Eric Snow in branch 'main':
bpo-45952: Get the C analyzer tool working again. (gh-29882)
https://github.com/python/cpython/commit/ee94aa0850191712e6adfc1f4a9df08ec3240195


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45952>
_______________________________________

From report at bugs.python.org  Wed Dec  1 13:20:52 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 01 Dec 2021 18:20:52 +0000
Subject: [issue45952] Tools/c-analyzer is out-of-date.
In-Reply-To: <1638380962.78.0.734744265271.issue45952@roundup.psfhosted.org>
Message-ID: <1638382852.8.0.326349881415.issue45952@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45952>
_______________________________________

From report at bugs.python.org  Wed Dec  1 13:28:59 2021
From: report at bugs.python.org (Ben)
Date: Wed, 01 Dec 2021 18:28:59 +0000
Subject: [issue45951] Debugger cannot be resolved
In-Reply-To: <1638380903.59.0.519590962782.issue45951@roundup.psfhosted.org>
Message-ID: <1638383339.41.0.803642600623.issue45951@roundup.psfhosted.org>


Change by Ben <benboettcher at rocketmail.com>:


----------
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45951>
_______________________________________

From report at bugs.python.org  Wed Dec  1 13:50:39 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 01 Dec 2021 18:50:39 +0000
Subject: [issue45953] Statically allocate interpreter states as much as
 possible.
Message-ID: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org>


New submission from Eric Snow <ericsnowcurrently at gmail.com>:

Currently we allocate each new PyInterpreterState in PyInterpreterState_New().  Furthermore, PyInterpreterState is full of pointers which are almost all allocated on the heap during runtime init.  We can statically allocate (and initialize?) most of what goes into PyInterpreterState, as well as the main interpreter itself (as part of _PyRuntimeState).  This includes each interpreter's initial PyThreadState.

TODO:

* [ ] add `PyInterpreterState main;` to _PyRuntimeState.interpreters and use it
* [ ] change references from the pointer to the value
* [ ] add `PyThreadState _main;` to PyInterpreterState.threads and use it
* [ ] change references from the pointer to the value
* [ ] change PyInterpreterState pointer fields to values (as much as possible)
* [ ] change PyThreadState pointer fields to values (as much as possible)


benefits:

* fewer possible failures (no memory) during runtime/interpreter/thread init
* improved memory locality for pointers looked up relative to interpreter/thread state


There is one non-trivial bit: embedding the various PyObject values in PyInterpreterState and PyThreadState means hard-coding the various pieces of the object there (e.g. for dict, its keys/values; for list, its array), as well as adding necessary init code to PyInterpreterState_New() and PyThreadState_New().  The resulting added complexity can be mitigated somewhat with macros or even code generation.  (In fact, there is probably significant overlap with Guido's deepfreeze tool.)  Regardless, we'll probably need to factor out init funcs for a number of object types, where currently there are only "Py*_New()" funcs that combine allocation and init.

----------
assignee: eric.snow
components: Interpreter Core
messages: 407476
nosy: Mark.Shannon, eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: Statically allocate interpreter states as much as possible.
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45953>
_______________________________________

From report at bugs.python.org  Wed Dec  1 13:52:19 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 18:52:19 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638384739.88.0.759686608935.issue45941@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010015fd26 python.exe`_PyObject_GenericGetAttrWithDict(obj=0x000000013feb7a50, name=0x0000000100fe9350, dict=0x0000000000000000, suppress=0) at object.c:1305:17
   1302	        PyDictValues **values_ptr = _PyObject_ValuesPointer(obj);
   1303	        if (values_ptr && *values_ptr) {
   1304	            if (PyUnicode_CheckExact(name)) {
-> 1305	                assert(*_PyObject_DictPointer(obj) == NULL);
   1306	                res = _PyObject_GetInstanceAttribute(obj, *values_ptr, name);
   1307	                if (res != NULL) {
   1308	                    goto done;
Target 0: (python.exe) stopped.
(lldb) p obj
(PyObject *) $0 = 0x000000013feb7a50
(lldb) p _PyObject_Dump((PyObject*)obj->ob_type)
object address  : 0x13ff25590
object refcount : 32
object type     : 0x100518680
object type name: type
object repr     : <class '_cffi_backend.FFI'>
(lldb) p (PyObject*)obj->ob_type
(PyObject *) $1 = 0x000000013ff25590
(lldb) p (PyObject*)obj->ob_type->tp_dict
(PyObject *) $2 = 0x000000013fedd910
(lldb) p _PyObject_Dump((PyObject*)obj->ob_type->tp_dict)
object address  : 0x13fedd910
object refcount : 1
object type     : 0x100511d50
object type name: dict
object repr     : {'__new__': <built-in method __new__ of type object at 0x13ff25590>, '__getattribute__': <slot wrapper '__getattribute__' of '_cffi_backend.FFI' objects>, '__init__': <slot wrapper '__init__' of '_cffi_backend.FFI' objects>, 'addressof': <method 'addressof' of '_cffi_backend.FFI' objects>, 'alignof': <method 'alignof' of '_cffi_backend.FFI' objects>, 'def_extern': <method 'def_extern' of '_cffi_backend.FFI' objects>, 'callback': <method 'callback' of '_cffi_backend.FFI' objects>, 'cast': <method 'cast' of '_cffi_backend.FFI' objects>, 'dlclose': <method 'dlclose' of '_cffi_backend.FFI' objects>, 'dlopen': <method 'dlopen' of '_cffi_backend.FFI' objects>, 'from_buffer': <method 'from_buffer' of '_cffi_backend.FFI' objects>, 'from_handle': <method 'from_handle' of '_cffi_backend.FFI' objects>, 'gc': <method 'gc' of '_cffi_backend.FFI' objects>, 'getctype': <method 'getctype' of '_cffi_backend.FFI' objects>, 'init_once': <method 'init_once' of '_cffi_backend.FFI' objects>, 'integer_const': <method 'integer_const' of '_cffi_backend.FFI' objects>, 'list_types': <method 'list_types' of '_cffi_backend.FFI' objects>, 'memmove': <method 'memmove' of '_cffi_backend.FFI' objects>, 'new': <method 'new' of '_cffi_backend.FFI' objects>, 'new_allocator': <method 'new_allocator' of '_cffi_backend.FFI' objects>, 'new_handle': <method 'new_handle' of '_cffi_backend.FFI' objects>, 'offsetof': <method 'offsetof' of '_cffi_backend.FFI' objects>, 'release': <method 'release' of '_cffi_backend.FFI' objects>, 'sizeof': <method 'sizeof' of '_cffi_backend.FFI' objects>, 'string': <method 'string' of '_cffi_backend.FFI' objects>, 'typeof': <method 'typeof' of '_cffi_backend.FFI' objects>, 'unpack': <method 'unpack' of '_cffi_backend.FFI' objects>, 'errno': <attribute 'errno' of '_cffi_backend.FFI' objects>, '__doc__': None, 'NULL': <cdata 'void *' NULL>, 'error': <class 'ffi.error'>, 'CType': <class '_cffi_backend.CType'>, 'CData': <class '_cffi_backend._CDataBase'>, 'buffer': <class '_cffi_backend.buffer'>, 'RTLD_LAZY': 1, 'RTLD_NOW': 2, 'RTLD_GLOBAL': 8, 'RTLD_LOCAL': 4, 'RTLD_NODELETE': 128, 'RTLD_NOLOAD': 16}
(lldb) p (PyObject*)obj->ob_type->tp_dictoffset
(PyObject *) $3 = NULL



Because the tp_dictoffset is 0, _PyObject_DictPointer(obj) returns NULL and in the assertion, where the return value is dereferenced, it crashes.

(Note: it's not that the assertion is failing, we don't get that far).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 13:54:08 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 01 Dec 2021 18:54:08 +0000
Subject: [issue45954] Rename PyConfig.no_debug_ranges to
 PyConfig.code_debug_ranges
Message-ID: <1638384848.75.0.0549104552795.issue45954@roundup.psfhosted.org>


New submission from STINNER Victor <vstinner at python.org>:

In the PyConfig, I tried to avoid double negative, so "no_debug_ranges" should be "debug_ranges". I propose to rename it to "code_debug_ranges" to make it more specific.

If there is an agreement on the member name, I can write a PR.

----------
components: C API
messages: 407478
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: Rename PyConfig.no_debug_ranges to PyConfig.code_debug_ranges
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45954>
_______________________________________

From report at bugs.python.org  Wed Dec  1 13:54:48 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 18:54:48 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638384888.91.0.685300788503.issue45941@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

This looks like an issue with 3rd party software cffi. Are you using a fresh build of cffi? The internal ABI of an alpha build changes very often.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 13:58:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 18:58:33 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638385113.93.0.246290052637.issue45941@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

How do I check that?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 14:01:50 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 19:01:50 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638385310.73.0.141106104264.issue45941@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

The easiest way is to remove and rebuild 3rd party software.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 14:12:05 2021
From: report at bugs.python.org (Matt Martz)
Date: Wed, 01 Dec 2021 19:12:05 +0000
Subject: [issue45955] Calling read() on HTTPError may cause KeyError in
 tempfile
Message-ID: <1638385925.39.0.609829377944.issue45955@roundup.psfhosted.org>


New submission from Matt Martz <matt at sivel.net>:

HTTPError may not be fully initialized in some scenarios leading to an inconsistent interface.  This is documented in code at:

https://github.com/python/cpython/blob/55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0/Lib/urllib/error.py#L45-L50

Unfortunately the way this is implemented creates an inconsistent interface, and opaque code, without a number of inline comments explaining the behavior of HTTPError.

Additionally, the way that it currently works, will cause a KeyError to be raised from tempfile, which is rather confusing.

Instead of "partially initializing" the HTTPError object, I'd propose that when fp is None, that we provide it with something like io.BytesIO to fulfill the interface.  There may be other recommended solutions, I've not thought through this extensively yet.

I think I just prefer always calling self.__super_init but passing in something like io.BytesIO if fp is None

I'm willing to create the PR once I know which direction seems to make the most sense.

>>> from urllib.error import HTTPError
>>> from urllib.request import HTTPDigestAuthHandler, HTTPPasswordMgrWithDefaultRealm, build_opener
>>> passman = HTTPPasswordMgrWithDefaultRealm()
>>> passman.add_password(None, 'httpbin.org', 'user', 'wrong')
>>> opener = build_opener(HTTPDigestAuthHandler(passman))
>>> try:
...     opener.open('https://httpbin.org/digest-auth/auth/user/passwd')
... except HTTPError as e:
...     e.read()
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File ".../3.10.0/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File ".../3.10.0/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File ".../3.10.0/lib/python3.10/urllib/request.py", line 557, in error
    result = self._call_chain(*args)
  File ".../3.10.0/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File ".../3.10.0/lib/python3.10/urllib/request.py", line 1238, in http_error_401
    retry = self.http_error_auth_reqed('www-authenticate',
  File ".../3.10.0/lib/python3.10/urllib/request.py", line 1111, in http_error_auth_reqed
    raise HTTPError(req.full_url, 401, "digest auth failed",


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File ".../3.10.0/lib/python3.10/tempfile.py", line 473, in __getattr__
    file = self.__dict__['file']
KeyError: 'file'

----------
components: Library (Lib)
messages: 407482
nosy: sivel
priority: normal
severity: normal
status: open
title: Calling read() on HTTPError may cause KeyError in tempfile
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45955>
_______________________________________

From report at bugs.python.org  Wed Dec  1 14:23:50 2021
From: report at bugs.python.org (Dino Viehland)
Date: Wed, 01 Dec 2021 19:23:50 +0000
Subject: [issue30533] missing feature in inspect module: getmembers_static
In-Reply-To: <1496271168.24.0.639482608296.issue30533@psf.upfronthosting.co.za>
Message-ID: <1638386630.6.0.966565014622.issue30533@roundup.psfhosted.org>


Dino Viehland <dinoviehland at gmail.com> added the comment:


New changeset c2bb29ce9ae4adb6a8123285ad3585907cd4cc73 by Weipeng Hong in branch 'main':
bpo-30533: Add docs for `inspect.getmembers_static` (#29874)
https://github.com/python/cpython/commit/c2bb29ce9ae4adb6a8123285ad3585907cd4cc73


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30533>
_______________________________________

From report at bugs.python.org  Wed Dec  1 14:24:09 2021
From: report at bugs.python.org (Dino Viehland)
Date: Wed, 01 Dec 2021 19:24:09 +0000
Subject: [issue30533] missing feature in inspect module: getmembers_static
In-Reply-To: <1496271168.24.0.639482608296.issue30533@psf.upfronthosting.co.za>
Message-ID: <1638386649.94.0.781192298986.issue30533@roundup.psfhosted.org>


Change by Dino Viehland <dinoviehland at gmail.com>:


----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30533>
_______________________________________

From report at bugs.python.org  Wed Dec  1 14:30:34 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 01 Dec 2021 19:30:34 +0000
Subject: [issue45953] Statically allocate interpreter states as much as
 possible.
In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org>
Message-ID: <1638387034.29.0.126748855957.issue45953@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
keywords: +patch
pull_requests: +28109
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29883

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45953>
_______________________________________

From report at bugs.python.org  Wed Dec  1 14:43:34 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 19:43:34 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638387814.16.0.116201067452.issue40280@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 9deb83468c56c7484645e6e3a6d0183cd6a0afd7 by Christian Heimes in branch 'main':
bpo-40280: Emscripten defaults to --with-ensurepip=no (GH-29873)
https://github.com/python/cpython/commit/9deb83468c56c7484645e6e3a6d0183cd6a0afd7


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Wed Dec  1 15:04:03 2021
From: report at bugs.python.org (Vishal Pandey)
Date: Wed, 01 Dec 2021 20:04:03 +0000
Subject: [issue45924] Incorrect traceback when future's exception is raised
 multiple times
In-Reply-To: <1638186926.45.0.137493772787.issue45924@roundup.psfhosted.org>
Message-ID: <1638389043.85.0.0411374282621.issue45924@roundup.psfhosted.org>


Vishal Pandey <vishalpandeyviptsk at gmail.com> added the comment:

hey Irit, Is this issue platform-dependent? I am on ubuntu 20.04, and running python 3.10. I am not getting the same error that you have mentioned below.
This is what I am getting.
###################################

hello ...
Traceback (most recent call last):
  File "error.py", line 17, in main
    print(await fut)
TypeError: 42

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "error.py", line 21, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "error.py", line 19, in main
    traceback.print_exception(e)
TypeError: print_exception() missing 2 required positional arguments: 'value' and 'tb'

###########################################################
and if I replace traceback.print_exception method with the print method, It runs perfectly fine, printing

hello ...
42
42
42

Can you please help me with this issue?

----------
nosy: +vishalpandeyvip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45924>
_______________________________________

From report at bugs.python.org  Wed Dec  1 15:12:11 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 20:12:11 +0000
Subject: [issue45924] Incorrect traceback when future's exception is raised
 multiple times
In-Reply-To: <1638186926.45.0.137493772787.issue45924@roundup.psfhosted.org>
Message-ID: <1638389531.11.0.67766199876.issue45924@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Vishal, your output shows you?re running 3.8, not 3.10.

traceback.print_exception() used to require 3 parameters, now it can make do with just one. See the docs for the details.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45924>
_______________________________________

From report at bugs.python.org  Wed Dec  1 15:21:03 2021
From: report at bugs.python.org (Vishal Pandey)
Date: Wed, 01 Dec 2021 20:21:03 +0000
Subject: [issue11352] Update cgi module doc
In-Reply-To: <1298895261.86.0.965235067518.issue11352@psf.upfronthosting.co.za>
Message-ID: <1638390063.24.0.343350624746.issue11352@roundup.psfhosted.org>


Vishal Pandey <vishalpandeyviptsk at gmail.com> added the comment:

i am working on it. will submit a PR soon.

----------
nosy: +vishalpandeyvip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue11352>
_______________________________________

From report at bugs.python.org  Wed Dec  1 15:26:07 2021
From: report at bugs.python.org (Vishal Pandey)
Date: Wed, 01 Dec 2021 20:26:07 +0000
Subject: [issue45924] Incorrect traceback when future's exception is raised
 multiple times
In-Reply-To: <1638186926.45.0.137493772787.issue45924@roundup.psfhosted.org>
Message-ID: <1638390367.87.0.288913363839.issue45924@roundup.psfhosted.org>


Vishal Pandey <vishalpandeyviptsk at gmail.com> added the comment:

thanks, It was my mistake, bug reproduced.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45924>
_______________________________________

From report at bugs.python.org  Wed Dec  1 15:29:35 2021
From: report at bugs.python.org (James Ferguson)
Date: Wed, 01 Dec 2021 20:29:35 +0000
Subject: [issue42130] AsyncIO's wait_for can hide cancellation in a rare race
 condition
In-Reply-To: <1603469429.01.0.760360212477.issue42130@roundup.psfhosted.org>
Message-ID: <1638390575.86.0.82428037272.issue42130@roundup.psfhosted.org>


James Ferguson <wjcferguson at gmail.com> added the comment:

Echoing nmatravolgyi's comments - I got here after hitting this bug and I too am amazed it's been around so long and hasn't been addressed.  

It makes cancellation in my application very unreliable, and the reason I need well-controlled cancellation semantics is to allow emergency stop of physical movement.

----------
nosy: +jamesf

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42130>
_______________________________________

From report at bugs.python.org  Wed Dec  1 15:48:09 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 01 Dec 2021 20:48:09 +0000
Subject: [issue45953] Statically allocate interpreter states as much as
 possible.
In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org>
Message-ID: <1638391689.16.0.704125564883.issue45953@roundup.psfhosted.org>


Change by Guido van Rossum <guido at python.org>:


----------
nosy: +gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45953>
_______________________________________

From report at bugs.python.org  Wed Dec  1 16:02:12 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 21:02:12 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638392532.8.0.232382096351.issue40280@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28110
pull_request: https://github.com/python/cpython/pull/29884

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Wed Dec  1 16:21:28 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Wed, 01 Dec 2021 21:21:28 +0000
Subject: [issue45954] Rename PyConfig.no_debug_ranges to
 PyConfig.code_debug_ranges
In-Reply-To: <1638384848.75.0.0549104552795.issue45954@roundup.psfhosted.org>
Message-ID: <1638393688.95.0.335182597358.issue45954@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Makes sense!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45954>
_______________________________________

From report at bugs.python.org  Wed Dec  1 16:37:32 2021
From: report at bugs.python.org (Maxwell Bernstein)
Date: Wed, 01 Dec 2021 21:37:32 +0000
Subject: [issue45956] Add scanf regular expressions to re
Message-ID: <1638394652.04.0.59126527646.issue45956@roundup.psfhosted.org>


New submission from Maxwell Bernstein <tekk.nolagi at gmail.com>:

The documentation for the `re` module suggests several regular expressions for use in simulating `scanf()`. Provide these directly in the `re` module.

----------
components: Library (Lib)
messages: 407491
nosy: tekknolagi
priority: normal
severity: normal
status: open
title: Add scanf regular expressions to re
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45956>
_______________________________________

From report at bugs.python.org  Wed Dec  1 16:38:29 2021
From: report at bugs.python.org (Nick Papior)
Date: Wed, 01 Dec 2021 21:38:29 +0000
Subject: [issue45889] pathlib: Path.match does not work on paths
In-Reply-To: <1637740471.98.0.448189048749.issue45889@roundup.psfhosted.org>
Message-ID: <1638394709.92.0.622009513168.issue45889@roundup.psfhosted.org>


Nick Papior <nickpapior at gmail.com> added the comment:

Ok, I can accept a no-fix ;)

I'll close this.

----------
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45889>
_______________________________________

From report at bugs.python.org  Wed Dec  1 16:39:16 2021
From: report at bugs.python.org (Maxwell Bernstein)
Date: Wed, 01 Dec 2021 21:39:16 +0000
Subject: [issue45956] Add scanf regular expressions to re
In-Reply-To: <1638394652.04.0.59126527646.issue45956@roundup.psfhosted.org>
Message-ID: <1638394756.64.0.16299851427.issue45956@roundup.psfhosted.org>


Change by Maxwell Bernstein <tekk.nolagi at gmail.com>:


----------
keywords: +patch
pull_requests: +28111
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29885

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45956>
_______________________________________

From report at bugs.python.org  Wed Dec  1 16:47:44 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 01 Dec 2021 21:47:44 +0000
Subject: [issue45954] Rename PyConfig.no_debug_ranges to
 PyConfig.code_debug_ranges
In-Reply-To: <1638384848.75.0.0549104552795.issue45954@roundup.psfhosted.org>
Message-ID: <1638395264.37.0.978508784212.issue45954@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
keywords: +patch
pull_requests: +28112
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29886

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45954>
_______________________________________

From report at bugs.python.org  Wed Dec  1 16:51:07 2021
From: report at bugs.python.org (Stephen Rosen)
Date: Wed, 01 Dec 2021 21:51:07 +0000
Subject: [issue45356] Calling `help` executes @classmethod @property decorated
 methods
In-Reply-To: <1633290355.98.0.210301350099.issue45356@roundup.psfhosted.org>
Message-ID: <1638395467.52.0.462072065428.issue45356@roundup.psfhosted.org>


Stephen Rosen <sirosen0 at gmail.com> added the comment:

Probably >90% of the use-cases for chaining classmethod are a read-only class property.
It's important enough that some tools (e.g. sphinx) even have special-cased support for classmethod(property(...)).

Perhaps the general case of classmethod(descriptor(...)) should be treated separately from the common case?

> I propose deprecating classmethod chaining.  It has become clear that it doesn't really do what people wanted and can't easily be made to work.

If classmethod(property(f)) is going to be removed, can an implementation of classproperty be considered as a replacement?

Or perhaps support via the other ordering, property(classmethod(f))?

----------
nosy: +sirosen2

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45356>
_______________________________________

From report at bugs.python.org  Wed Dec  1 16:54:38 2021
From: report at bugs.python.org (Ali Amin-Nejad)
Date: Wed, 01 Dec 2021 21:54:38 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
Message-ID: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>


New submission from Ali Amin-Nejad <aanejad at hotmail.co.uk>:

On macOS, the following minimal example:

```
import tkinter as tk

root = tk.Tk()
button = tk.Button(root, text="Exit", command=root.destroy)
button.pack()
root.wm_overrideredirect(True)

root.mainloop()
```

yields the following stack trace:

```
Traceback (most recent call last):
  File "blah.py", line 6, in <module>
    root.wm_overrideredirect(True)
  File "/Users/ali/miniconda3/envs/bitfount/lib/python3.8/tkinter/__init__.py", line 2176, in wm_overrideredirect
    return self._getboolean(self.tk.call(
  File "/Users/ali/miniconda3/envs/bitfount/lib/python3.8/tkinter/__init__.py", line 1448, in _getboolean
    return self.tk.getboolean(string)
_tkinter.TclError: expected boolean value but got ""
```

----------
components: Tkinter, macOS
messages: 407494
nosy: amin-nejad, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: _tkinter.TclError: expected boolean value but got ""
type: crash
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Wed Dec  1 16:57:56 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 21:57:56 +0000
Subject: [issue45941] help("modules") segfaults on 3.11, MacOS
In-Reply-To: <1638312355.41.0.606974934326.issue45941@roundup.psfhosted.org>
Message-ID: <1638395876.53.0.8552518291.issue45941@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Christian - that's what it was. I uninstalled cffi and now it works.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45941>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:03:06 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 22:03:06 +0000
Subject: [issue40748] Tutorial 4.7 More on Defining Functions missing screen
 prompts
In-Reply-To: <1590272831.41.0.177431778032.issue40748@roundup.psfhosted.org>
Message-ID: <1638396186.89.0.218928837563.issue40748@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
type:  -> behavior
versions: +Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40748>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:12:03 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 01 Dec 2021 22:12:03 +0000
Subject: [issue45956] Add scanf regular expressions to re
In-Reply-To: <1638394652.04.0.59126527646.issue45956@roundup.psfhosted.org>
Message-ID: <1638396723.67.0.474852001354.issue45956@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

The scanf() translation table primarily serves as a way to learn regex syntax for people who only know scanf syntax.  

It would defeat the educational purpose to immortalize the translation as fixed constants.  For the most part, people are better off writing their own customizations, for example not using [+-] unless a sign is known to be present.

Also, the table in the docs provides a translation between scanf tokens and regex patterns, but it does not assign names to each pattern.  The PR adds names but makes confusing choices.  

For example, \S+ in regex notation means "longest sequence contiguous sequence of non-space characters".  In the PR, '\S+' is aliased with "whitespace" which is the opposite of its usual meaning.

Another problem with the new names is that they take C scanf specific definitions and put them in a Python context where we use the words differently.  For example, "octal" in scanf means "[-+]?[0-7]+" but in Python oct(333) would give '0o515' which includes an 'o' and does not include a '+'.

Overall, I think it would be a mistake to put C world specific aliases into Python world.  Instead, it would be better to just leave the table for education purposes as it is now.

----------
assignee:  -> rhettinger
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45956>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:13:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 22:13:20 +0000
Subject: [issue28375] cgi.py spam in Apache server logs
In-Reply-To: <1475755223.43.0.818852294498.issue28375@psf.upfronthosting.co.za>
Message-ID: <1638396800.59.0.206401712108.issue28375@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Thanks Sebastian, I'll close this and if someone still sees this problem they will report it.

----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28375>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:16:35 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 01 Dec 2021 22:16:35 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638396995.45.0.37077289804.issue40280@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 309110f37cdfc78d160ed08ae8faa6f6160ba87e by Christian Heimes in branch 'main':
bpo-40280: Emscripten with_ensurepip=no, second attempt (GH-29884)
https://github.com/python/cpython/commit/309110f37cdfc78d160ed08ae8faa6f6160ba87e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:19:48 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 01 Dec 2021 22:19:48 +0000
Subject: [issue45356] Calling `help` executes @classmethod @property decorated
 methods
In-Reply-To: <1633290355.98.0.210301350099.issue45356@roundup.psfhosted.org>
Message-ID: <1638397188.01.0.774027695269.issue45356@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

In Python 3.10, classmethod() added a __wrapped__ attribute.  Presumably, any use case for implicit chaining can now be accomplished in an explicit and controlled manner.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45356>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:24:53 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 22:24:53 +0000
Subject: [issue25933] Unhandled exception (TypeError) with ftplib in function
 retrbinary/retrlines causes inoperable behavior without crashing
In-Reply-To: <1450899526.91.0.95420964187.issue25933@psf.upfronthosting.co.za>
Message-ID: <1638397493.27.0.900133571802.issue25933@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords:  -needs review, patch
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25933>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:33:41 2021
From: report at bugs.python.org (Tom E)
Date: Wed, 01 Dec 2021 22:33:41 +0000
Subject: [issue45933] Illegal Instrution (Core Dumped)
In-Reply-To: <1638224710.52.0.0477949346292.issue45933@roundup.psfhosted.org>
Message-ID: <1638398021.2.0.421713147461.issue45933@roundup.psfhosted.org>


Tom E <guacaplushy at icloud.com> added the comment:

its defos fine because ive tried it without the CFLAGS and same error

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45933>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:35:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 22:35:42 +0000
Subject: [issue35201] Recursive '**' matches non-existent directories.
In-Reply-To: <1541782491.74.0.788709270274.issue35201@psf.upfronthosting.co.za>
Message-ID: <1638398142.7.0.448449658915.issue35201@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution: not a bug -> 
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35201>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:46:38 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 22:46:38 +0000
Subject: [issue25952] code_context not available in exec()
In-Reply-To: <1451060087.44.0.968939849155.issue25952@psf.upfronthosting.co.za>
Message-ID: <1638398798.93.0.429774770625.issue25952@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25952>
_______________________________________

From report at bugs.python.org  Wed Dec  1 17:54:27 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 22:54:27 +0000
Subject: [issue35535] time.strptime() unexpectedly gives the same result for
 %U and %W for 2018
In-Reply-To: <1545224060.23.0.788709270274.issue35535@psf.upfronthosting.co.za>
Message-ID: <1638399267.44.0.255879292049.issue35535@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35535>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:03:53 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:03:53 +0000
Subject: [issue25403] urllib.parse.urljoin is broken in python 3.5
In-Reply-To: <1444823340.35.0.0533245258476.issue25403@psf.upfronthosting.co.za>
Message-ID: <1638399833.86.0.582032429371.issue25403@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

See also 37235, 40594.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25403>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:04:01 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:04:01 +0000
Subject: [issue40594] urljoin since 3.5 incorrectly filters out double slashes
In-Reply-To: <1589198030.38.0.614579410038.issue40594@roundup.psfhosted.org>
Message-ID: <1638399841.31.0.0592123604679.issue40594@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

See also 25403, 37235.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40594>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:04:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:04:05 +0000
Subject: [issue37235] urljoin behavior unclear/not following RFC 3986
In-Reply-To: <1560267918.98.0.870769323469.issue37235@roundup.psfhosted.org>
Message-ID: <1638399845.78.0.474706329286.issue37235@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

See also 25403, 40594.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37235>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:28:52 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:28:52 +0000
Subject: [issue25238] Version added of context parameter for
 xmlrpc.client.ServerProxy incorrect
In-Reply-To: <1443268662.53.0.0661786105223.issue25238@psf.upfronthosting.co.za>
Message-ID: <1638401332.47.0.0348386685799.issue25238@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Both 3.4 and 3.5 are out of maintenance now, so this is no longer relevant.

----------
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25238>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:38:41 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:38:41 +0000
Subject: [issue12706] timeout sentinel in ftplib and poplib documentation
In-Reply-To: <1312705981.24.0.601234287082.issue12706@psf.upfronthosting.co.za>
Message-ID: <1638401921.11.0.518706960778.issue12706@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12706>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:48:08 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:48:08 +0000
Subject: [issue23183] timeit CLI best of 3: undocumented output format
In-Reply-To: <1420620799.47.0.00516438922368.issue23183@psf.upfronthosting.co.za>
Message-ID: <1638402488.47.0.067694779064.issue23183@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23183>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:48:38 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:48:38 +0000
Subject: [issue23183] timeit CLI best of 3: undocumented output format
In-Reply-To: <1420620799.47.0.00516438922368.issue23183@psf.upfronthosting.co.za>
Message-ID: <1638402518.4.0.892135715604.issue23183@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The patch needs to be converted to a GitHub PR.

----------
keywords: +easy -patch
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23183>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:50:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:50:48 +0000
Subject: [issue38760] Document for urllib.error.HTTPError.headers Should
 Specify What Version
In-Reply-To: <1573341509.41.0.260213311106.issue38760@roundup.psfhosted.org>
Message-ID: <1638402648.27.0.0377336098863.issue38760@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38760>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:54:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:54:31 +0000
Subject: [issue10048] urllib.request documentation confusing
In-Reply-To: <1286535990.46.0.129844190964.issue10048@psf.upfronthosting.co.za>
Message-ID: <1638402871.53.0.095303869171.issue10048@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

FancyURLopener, URLopener etc are deprecated since 3.3.

Should we close this issue or repurpose it for removal?

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10048>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:56:00 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:56:00 +0000
Subject: [issue10048] urllib.request documentation confusing
In-Reply-To: <1286535990.46.0.129844190964.issue10048@psf.upfronthosting.co.za>
Message-ID: <1638402960.0.0.255910431543.issue10048@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Ah we already have issue40673 for removal.

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10048>
_______________________________________

From report at bugs.python.org  Wed Dec  1 18:56:25 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 01 Dec 2021 23:56:25 +0000
Subject: [issue10048] urllib.request documentation confusing
In-Reply-To: <1286535990.46.0.129844190964.issue10048@psf.upfronthosting.co.za>
Message-ID: <1638402985.46.0.156962143286.issue10048@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> out of date
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10048>
_______________________________________

From report at bugs.python.org  Wed Dec  1 21:08:40 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Thu, 02 Dec 2021 02:08:40 +0000
Subject: [issue45956] Add scanf regular expressions to re
In-Reply-To: <1638394652.04.0.59126527646.issue45956@roundup.psfhosted.org>
Message-ID: <1638410920.17.0.454721132076.issue45956@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Maxwell: thank you for your contribution. 

I agree that these don?t belong in the re module.

I think a personal library or something on PyPI (logically equivalent to more-itertools) would be more appropriate. 

I suggest closing this as rejected.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45956>
_______________________________________

From report at bugs.python.org  Wed Dec  1 21:45:07 2021
From: report at bugs.python.org (Hian-Kun Tenn)
Date: Thu, 02 Dec 2021 02:45:07 +0000
Subject: [issue45958] Document typo in unpack_from()
Message-ID: <1638413107.8.0.703943462848.issue45958@roundup.psfhosted.org>


New submission from Hian-Kun Tenn <hiankun at gmail.com>:

In the document of "struct" (https://docs.python.org/3.9/library/struct.html#struct.unpack_from), there's typo in it.

The document read
`struct.unpack_from(format, /, buffer, offset=0)`
and I believe it should be
`struct.unpack_from(format, buffer, offset=0)`.

Documents before Python 3.9 has no this typo.

----------
assignee: docs at python
components: Documentation
messages: 407510
nosy: docs at python, hiankun
priority: normal
severity: normal
status: open
title: Document typo in unpack_from()
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45958>
_______________________________________

From report at bugs.python.org  Wed Dec  1 22:33:55 2021
From: report at bugs.python.org (Maxwell Bernstein)
Date: Thu, 02 Dec 2021 03:33:55 +0000
Subject: [issue45956] Add scanf regular expressions to re
In-Reply-To: <1638394652.04.0.59126527646.issue45956@roundup.psfhosted.org>
Message-ID: <1638416035.9.0.537188987286.issue45956@roundup.psfhosted.org>


Change by Maxwell Bernstein <tekk.nolagi at gmail.com>:


----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45956>
_______________________________________

From report at bugs.python.org  Wed Dec  1 23:22:57 2021
From: report at bugs.python.org (Zachary Ware)
Date: Thu, 02 Dec 2021 04:22:57 +0000
Subject: [issue45958] Document typo in unpack_from()
In-Reply-To: <1638413107.8.0.703943462848.issue45958@roundup.psfhosted.org>
Message-ID: <1638418977.8.0.174421817731.issue45958@roundup.psfhosted.org>


Zachary Ware <zachary.ware at gmail.com> added the comment:

The `/` denotes that `format` is a positional-only argument; you cannot make a call like `struct.unpack_from(format=my_format, buffer=my_buffer)`, it must be `struct.unpack_from(my_format, buffer=my_buffer)` or `struct.unpack_from(my_format, my_buffer)`.  The same syntax can be used to define your own function with positional-only arguments, see https://docs.python.org/3/tutorial/controlflow.html#positional-only-parameters or https://docs.python.org/3/reference/compound_stmts.html#function-definitions

----------
nosy: +zach.ware
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45958>
_______________________________________

From report at bugs.python.org  Thu Dec  2 01:00:20 2021
From: report at bugs.python.org (Hian-Kun Tenn)
Date: Thu, 02 Dec 2021 06:00:20 +0000
Subject: [issue45958] Document typo in unpack_from()
In-Reply-To: <1638418977.8.0.174421817731.issue45958@roundup.psfhosted.org>
Message-ID: <CANRqPMKcea4WhfYGtpxT2OWR1d5H3OhAn=oOOYyxKTgS8FdsBw@mail.gmail.com>


Hian-Kun Tenn <hiankun at gmail.com> added the comment:

Hi,

I didn't know that and feel sorry to bother you with the non-bug "issue."

Thank you for the quick and thoughtful reply. :-)

Hiankun

On Thu, Dec 2, 2021 at 12:23 PM Zachary Ware <report at bugs.python.org> wrote:

>
> Zachary Ware <zachary.ware at gmail.com> added the comment:
>
> The `/` denotes that `format` is a positional-only argument; you cannot
> make a call like `struct.unpack_from(format=my_format, buffer=my_buffer)`,
> it must be `struct.unpack_from(my_format, buffer=my_buffer)` or
> `struct.unpack_from(my_format, my_buffer)`.  The same syntax can be used to
> define your own function with positional-only arguments, see
> https://docs.python.org/3/tutorial/controlflow.html#positional-only-parameters
> or
> https://docs.python.org/3/reference/compound_stmts.html#function-definitions
>
> ----------
> nosy: +zach.ware
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue45958>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45958>
_______________________________________

From report at bugs.python.org  Thu Dec  2 02:06:56 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 02 Dec 2021 07:06:56 +0000
Subject: [issue45959] Teach pprint about dict views
Message-ID: <1638428816.23.0.206050902249.issue45959@roundup.psfhosted.org>


New submission from Raymond Hettinger <raymond.hettinger at gmail.com>:

The pprint() code has a number of type or protocol specific handlers but doesn't have one for dict views.  So, we don't get pretty printing for the key(), values(), and items():

d = {i:i for i in range(100)}
pprint(d)             # This is handled correctly
pprint(d.keys())      # Printed on one line
pprint(d.values())    # Printed on one line
pprint(d.items())     # Printed on one line

----------
components: Library (Lib)
keywords: easy
messages: 407513
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Teach pprint about dict views
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45959>
_______________________________________

From report at bugs.python.org  Thu Dec  2 02:30:42 2021
From: report at bugs.python.org (primexx)
Date: Thu, 02 Dec 2021 07:30:42 +0000
Subject: [issue45451] IDLE - modify text frame and widget borders
In-Reply-To: <1634087096.76.0.0471723883661.issue45451@roundup.psfhosted.org>
Message-ID: <1638430242.33.0.261999886091.issue45451@roundup.psfhosted.org>


primexx <primexx at gmail.com> added the comment:

for what it's worth, Notepad++ is highly configurable. Here's what mine looks like with borders set to 0 and some sidebar items disabled. Even though it is the same classic theme, it looks a lot better than default.

There's the more substantial point to note that Notepad++ is not interactive, the need to have an extremely tight visual coupling between the margin and the main body on a line-per-line basis is significantly reduced. Likewise, the line numbers separated by a border in the IDLE editor are not really bothersome either, it looks natural enough. It only really sticks out in the interactive interpreter.

----------
Added file: https://bugs.python.org/file50469/Capture.PNG

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45451>
_______________________________________

From report at bugs.python.org  Thu Dec  2 03:19:20 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 02 Dec 2021 08:19:20 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638433160.36.0.411357827519.issue40280@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28113
pull_request: https://github.com/python/cpython/pull/29887

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Thu Dec  2 03:42:21 2021
From: report at bugs.python.org (Sascha Hesse)
Date: Thu, 02 Dec 2021 08:42:21 +0000
Subject: [issue45960] bullseye arm/v7 time.time() Operation not permitted
Message-ID: <1638434541.68.0.574461669418.issue45960@roundup.psfhosted.org>


New submission from Sascha Hesse <py at mnm-solutions.de>:

Given a docker container on raspbian 10.11
based on bullseye:

docker run --rm -it --entrypoint sh python:3.10-slim

time.time() fails with error

# python
Python 3.10.0 (default, Nov 18 2021, 00:56:34) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.time()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
PermissionError: [Errno 1] Operation not permitted

based on buster:

docker run --rm -it --entrypoint sh python:3.10-slim-buster

# python
Python 3.10.0 (default, Nov 18 2021, 02:00:41) [GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.time()
1638433441.9555993
>>> exit()
#

works as expected

----------
components: Interpreter Core
messages: 407515
nosy: SaschaJohn
priority: normal
severity: normal
status: open
title: bullseye arm/v7 time.time() Operation not permitted
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45960>
_______________________________________

From report at bugs.python.org  Thu Dec  2 03:59:29 2021
From: report at bugs.python.org (Alex)
Date: Thu, 02 Dec 2021 08:59:29 +0000
Subject: [issue45961] [doc] Missing documentation for wait_for module
Message-ID: <1638435569.2.0.657271084148.issue45961@roundup.psfhosted.org>


New submission from Alex <aizquier at redhat.com>:

I wondering why there is no documentation for the synchronous module "wait_for":

site-packages/wait_for/__init__.py

It's just missing or there are some reason? I didn't see any deprecation info about this module.

----------
messages: 407516
nosy: Alex-Izquierdo
priority: normal
severity: normal
status: open
title: [doc] Missing documentation for wait_for module
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45961>
_______________________________________

From report at bugs.python.org  Thu Dec  2 04:09:40 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 02 Dec 2021 09:09:40 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638436180.81.0.826129023401.issue45957@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

What is the result of

   root.tk.call('wm', 'overrideredirect', root._w, True)

?

Is it not an empty string?

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Thu Dec  2 04:15:17 2021
From: report at bugs.python.org (Antony Lee)
Date: Thu, 02 Dec 2021 09:15:17 +0000
Subject: [issue45962] Clarify that PyModule_AddString{Constant,
 Macro} use utf-8
Message-ID: <1638436517.15.0.508323988448.issue45962@roundup.psfhosted.org>


New submission from Antony Lee <anntzer.lee at gmail.com>:

The documentation for PyModule_AddString{Constant,Macro} does not specify the encoding used.  Checking the source shows that these simply call PyUnicode_FromString and thus use utf8, but perhaps this could be made explicit.

----------
assignee: docs at python
components: C API, Documentation
messages: 407518
nosy: Antony.Lee, docs at python
priority: normal
severity: normal
status: open
title: Clarify that PyModule_AddString{Constant,Macro} use utf-8
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45962>
_______________________________________

From report at bugs.python.org  Thu Dec  2 04:17:46 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 02 Dec 2021 09:17:46 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638436666.36.0.0848382741484.issue40280@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset cb2b3c8d3566ae46b3b8d0718019e1c98484589e by Christian Heimes in branch 'main':
bpo-40280: Emscripten has no support for subprocesses (GH-29872)
https://github.com/python/cpython/commit/cb2b3c8d3566ae46b3b8d0718019e1c98484589e


----------
nosy: +miss-islington

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Thu Dec  2 04:24:17 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 02 Dec 2021 09:24:17 +0000
Subject: [issue11455] issue a warning when populating a CPython type dict with
 non-string keys
In-Reply-To: <1299704028.56.0.168922481621.issue11455@psf.upfronthosting.co.za>
Message-ID: <1638437057.84.0.831566268559.issue11455@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Why not raise an error if it contradicts language spec?

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue11455>
_______________________________________

From report at bugs.python.org  Thu Dec  2 04:55:13 2021
From: report at bugs.python.org (Sam Bull)
Date: Thu, 02 Dec 2021 09:55:13 +0000
Subject: [issue42130] AsyncIO's wait_for can hide cancellation in a rare race
 condition
In-Reply-To: <1603469429.01.0.760360212477.issue42130@roundup.psfhosted.org>
Message-ID: <1638438913.18.0.684893684676.issue42130@roundup.psfhosted.org>


Sam Bull <m6f6g7 at sambull.org> added the comment:

It has been addressed, PR should be merged this week: https://github.com/python/cpython/pull/28149

Like most open source projects, it just needed someone to actually propose a fix.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42130>
_______________________________________

From report at bugs.python.org  Thu Dec  2 05:17:30 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 02 Dec 2021 10:17:30 +0000
Subject: [issue45961] [doc] Missing documentation for wait_for module
In-Reply-To: <1638435569.2.0.657271084148.issue45961@roundup.psfhosted.org>
Message-ID: <1638440250.66.0.594377956185.issue45961@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

If you mean this: https://pypi.org/project/wait-for/ then it is not part of the python library.


If you mean asyncio's wait_for, it's documented here: https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for

----------
nosy: +iritkatriel
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45961>
_______________________________________

From report at bugs.python.org  Thu Dec  2 05:43:41 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 02 Dec 2021 10:43:41 +0000
Subject: [issue45954] Rename PyConfig.no_debug_ranges to
 PyConfig.code_debug_ranges
In-Reply-To: <1638384848.75.0.0549104552795.issue45954@roundup.psfhosted.org>
Message-ID: <1638441821.49.0.453581542496.issue45954@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:


New changeset a6c3b0faa1d55e36539caf19bd3bcf1dea12df84 by Victor Stinner in branch 'main':
bpo-45954: Rename PyConfig.no_debug_ranges to code_debug_ranges (GH-29886)
https://github.com/python/cpython/commit/a6c3b0faa1d55e36539caf19bd3bcf1dea12df84


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45954>
_______________________________________

From report at bugs.python.org  Thu Dec  2 05:43:48 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 02 Dec 2021 10:43:48 +0000
Subject: [issue45954] Rename PyConfig.no_debug_ranges to
 PyConfig.code_debug_ranges
In-Reply-To: <1638384848.75.0.0549104552795.issue45954@roundup.psfhosted.org>
Message-ID: <1638441828.17.0.949533030732.issue45954@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45954>
_______________________________________

From report at bugs.python.org  Thu Dec  2 06:19:35 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 02 Dec 2021 11:19:35 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638443975.1.0.129712468074.issue40280@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset cb8f491f46e262549f6c447b31625cab7c20a60a by Christian Heimes in branch 'main':
bpo-40280: Optimize ints and and startup on wasm (GH-29887)
https://github.com/python/cpython/commit/cb8f491f46e262549f6c447b31625cab7c20a60a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Thu Dec  2 06:20:59 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 02 Dec 2021 11:20:59 +0000
Subject: [issue25403] urllib.parse.urljoin is broken in python 3.5
In-Reply-To: <1444823340.35.0.0533245258476.issue25403@psf.upfronthosting.co.za>
Message-ID: <1638444059.91.0.317190245966.issue25403@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
nosy:  -vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25403>
_______________________________________

From report at bugs.python.org  Thu Dec  2 07:23:48 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 02 Dec 2021 12:23:48 +0000
Subject: [issue45725] test_freeze doesn't clean up after itself
In-Reply-To: <1636111041.41.0.0249123262066.issue45725@roundup.psfhosted.org>
Message-ID: <1638447828.74.0.207476809199.issue45725@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:

This seems to be fixed.

----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45725>
_______________________________________

From report at bugs.python.org  Thu Dec  2 07:27:40 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 02 Dec 2021 12:27:40 +0000
Subject: [issue45963] Embed interpreter frame in generator.
Message-ID: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org>


New submission from Mark Shannon <mark at hotpy.org>:

Currently, the InterpreterFrame for a generator is allocated on the heap separately from the generator.
This means that 2 allocations are needed to create a generator, and an extra indirection is needed to get from the generator to the frame.

By embedding the frame in the generator, we only need one alloaction, we save an indirection *and* the code gets simpler: transferring the frame from generator to frame object is just a single memcpy.

----------
assignee: Mark.Shannon
components: Interpreter Core
messages: 407526
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Embed interpreter frame in generator.
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45963>
_______________________________________

From report at bugs.python.org  Thu Dec  2 07:37:21 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 02 Dec 2021 12:37:21 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1638448641.87.0.73312490679.issue45711@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28114
pull_request: https://github.com/python/cpython/pull/29890

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Thu Dec  2 08:05:23 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 02 Dec 2021 13:05:23 +0000
Subject: [issue45963] Embed interpreter frame in generator.
In-Reply-To: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org>
Message-ID: <1638450323.14.0.571026968403.issue45963@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
keywords: +patch
pull_requests: +28115
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29891

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45963>
_______________________________________

From report at bugs.python.org  Thu Dec  2 08:16:06 2021
From: report at bugs.python.org (Ethan Smith)
Date: Thu, 02 Dec 2021 13:16:06 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638450966.24.0.952481231546.issue40280@roundup.psfhosted.org>


Change by Ethan Smith <ethan at ethanhs.me>:


----------
pull_requests: +28116
pull_request: https://github.com/python/cpython/pull/29892

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Thu Dec  2 08:50:38 2021
From: report at bugs.python.org (Matej Cepl)
Date: Thu, 02 Dec 2021 13:50:38 +0000
Subject: [issue45964] 3.10.0 tests fail in
 test_pdb_breakpoints_preserved_across_interactive_sessions
Message-ID: <1638453038.24.0.528506960629.issue45964@roundup.psfhosted.org>


New submission from Matej Cepl <mcepl at cepl.eu>:

When running tests with 3.10.0 test_pdb_breakpoints_preserved_across_interactive_sessions test fails:

[  842s] ======================================================================
[  842s] FAIL: test_pdb_breakpoints_preserved_across_interactive_sessions (test.test_pdb)
[  842s] Doctest: test.test_pdb.test_pdb_breakpoints_preserved_across_interactive_sessions
[  842s] ----------------------------------------------------------------------
[  842s] Traceback (most recent call last):
[  842s]   File "/home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/doctest.py", line 2216, in runTest
[  842s]     raise self.failureException(self.format_failure(new.getvalue()))
[  842s] AssertionError: Failed doctest test for test.test_pdb.test_pdb_breakpoints_preserved_across_interactive_sessions
[  842s]   File "/home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py", line 327, in test_pdb_breakpoints_preserved_across_interactive_sessions
[  842s] 
[  842s] ----------------------------------------------------------------------
[  842s] File "/home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py", line 351, in test.test_pdb.test_pdb_breakpoints_preserved_across_interactive_sessions
[  842s] Failed example:
[  842s]     with PdbTestInput([  # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
[  842s]        'break',
[  842s]        'break pdb.find_function',
[  842s]        'break',
[  842s]        'clear 1',
[  842s]        'continue',
[  842s]     ]):
[  842s]        pdb.run('print()')
[  842s] Expected:
[  842s]     > <string>(1)<module>()...
[  842s]     (Pdb) break
[  842s]     Num Type         Disp Enb   Where
[  842s]     1   breakpoint   keep yes   at ...test_pdb.py:...
[  842s]     2   breakpoint   keep yes   at ...test_pdb.py:...
[  842s]     (Pdb) break pdb.find_function
[  842s]     Breakpoint 3 at ...pdb.py:94
[  842s]     (Pdb) break
[  842s]     Num Type         Disp Enb   Where
[  842s]     1   breakpoint   keep yes   at ...test_pdb.py:...
[  842s]     2   breakpoint   keep yes   at ...test_pdb.py:...
[  842s]     3   breakpoint   keep yes   at ...pdb.py:...
[  842s]     (Pdb) clear 1
[  842s]     Deleted breakpoint 1 at ...test_pdb.py:...
[  842s]     (Pdb) continue
[  842s] Got:
[  842s]     > <string>(1)<module>()
[  842s]     (Pdb) break
[  842s]     Num Type         Disp Enb   Where
[  842s]     1   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:425
[  842s]     2   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:422
[  842s]     (Pdb) break pdb.find_function
[  842s]     Breakpoint 3 at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/pdb.py:93
[  842s]     (Pdb) break
[  842s]     Num Type         Disp Enb   Where
[  842s]     1   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:425
[  842s]     2   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:422
[  842s]     3   breakpoint   keep yes   at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/pdb.py:93
[  842s]     (Pdb) clear 1
[  842s]     Deleted breakpoint 1 at /home/abuild/rpmbuild/BUILD/Python-3.10.0/Lib/test/test_pdb.py:425
[  842s]     (Pdb) continue
[  842s]     <BLANKLINE>
[  842s] 
[  842s] 
[  842s] ----------------------------------------------------------------------
[  842s] Ran 1 test in 0.005s
[  842s] 
[  842s] FAILED (failures=1)
[  842s] 1 test failed again:
[  842s]     test_pdb
[  842s] 
[  842s] == Tests result: FAILURE then FAILURE ==

The problem is completely trivial and the attached patch fixes it (wrong line number in one expected result).

----------
components: Demos and Tools
files: pdb_adjust_breakpoints.patch
keywords: patch
messages: 407527
nosy: mcepl
priority: normal
severity: normal
status: open
title: 3.10.0 tests fail in test_pdb_breakpoints_preserved_across_interactive_sessions
versions: Python 3.10, Python 3.11
Added file: https://bugs.python.org/file50470/pdb_adjust_breakpoints.patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45964>
_______________________________________

From report at bugs.python.org  Thu Dec  2 09:28:26 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 02 Dec 2021 14:28:26 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638455306.62.0.194429492397.issue40280@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28117
pull_request: https://github.com/python/cpython/pull/29893

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Thu Dec  2 09:34:53 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 02 Dec 2021 14:34:53 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1638455693.54.0.353490536791.issue23819@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
pull_requests: +28118
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29894

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Thu Dec  2 10:13:22 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 02 Dec 2021 15:13:22 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638458002.16.0.702365144391.issue45476@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> * zstd-1.5.0.2: src/python-zstd.c

I proposed a fix upstream: https://github.com/sergey-dryabzhinsky/python-zstd/pull/70

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Thu Dec  2 10:20:49 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 02 Dec 2021 15:20:49 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638458449.67.0.494447099644.issue45476@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> frozendict-2.1.1

If I understand correctly, this module is compatible with the PEP 674, it only has to copy Python 3.11 header files once Python 3.11 is released, to port the project to Python 3.11.

Incompatable code is not part of the "frozendict" implementation, but only in copies of the Python header files (Python 3.6, 3.7, 3.8, 3.9 and 3.10). For example, it contains the frozendict/src/3_10/cpython_src/Include/object.h header: copy of CPython Include/object.h file.

Source code: https://github.com/Marco-Sulla/python-frozendict

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Thu Dec  2 10:26:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 02 Dec 2021 15:26:28 +0000
Subject: [issue45964] 3.10.0 tests fail in
 test_pdb_breakpoints_preserved_across_interactive_sessions
In-Reply-To: <1638453038.24.0.528506960629.issue45964@roundup.psfhosted.org>
Message-ID: <1638458788.24.0.876290294229.issue45964@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This is not failing on our buildbots, so the fix is probably not right. 

Which system are you running on?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45964>
_______________________________________

From report at bugs.python.org  Thu Dec  2 10:27:52 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 02 Dec 2021 15:27:52 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638458872.64.0.458035808527.issue45476@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> pysha3-1.0.2

This module must not be used on Python 3.6 and newer which has a built-in support for SHA-3 hash functions. Example:

$ python3.6
Python 3.6.15 (default, Sep  5 2021, 00:00:00) 
>>> import hashlib
>>> h=hashlib.new('sha3_224'); h.update(b'hello'); print(h.hexdigest())
b87f88c72702fff1748e58b87e9141a42c0dbedc29a78cb0d4a5cd81

By the way, building pysha3 on Python 3.11 now fails with:

    Modules/_sha3/backport.inc:78:10: fatal error: pystrhex.h: No such file or directory

The pystrhex.h header file has been removed in Python 3.11 by bpo-45434. But I don't think that it's worth it trying to port it to Python 3.11, if the module must not be used on Python 3.6 and newer.

Environment markers can be used to skip the pysha3 dependency on Python 3.6 on newer.

Example: "pysha3; python_version < '3.6'"

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Thu Dec  2 10:41:06 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 02 Dec 2021 15:41:06 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638459665.99.0.758120219981.issue45476@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> Naked-0.1.31

Affected code is only code generated by Cython: the project only has to regenerated code with a recent Cython version.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Thu Dec  2 10:46:47 2021
From: report at bugs.python.org (Matej Cepl)
Date: Thu, 02 Dec 2021 15:46:47 +0000
Subject: [issue45964] 3.10.0 tests fail in
 test_pdb_breakpoints_preserved_across_interactive_sessions
In-Reply-To: <1638453038.24.0.528506960629.issue45964@roundup.psfhosted.org>
Message-ID: <1638460007.91.0.909727320095.issue45964@roundup.psfhosted.org>


Matej Cepl <mcepl at cepl.eu> added the comment:

> Which system are you running on?

Happens when packaging Python 3.10 for openSUSE/Linux.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45964>
_______________________________________

From report at bugs.python.org  Thu Dec  2 10:46:59 2021
From: report at bugs.python.org (Jamil Raichouni)
Date: Thu, 02 Dec 2021 15:46:59 +0000
Subject: [issue45965] fileinput.input(path,
 inplace=True) crashes for valid filename with 252-255 characters
Message-ID: <1638460019.0.0.188953265928.issue45965@roundup.psfhosted.org>


New submission from Jamil Raichouni <raichouni at gmail.com>:

import fileinput
from pathlib import Path
path = Path(252 * "x")
path.write_text("")
for line in fileinput.input(path, inplace=True):
    pass

raises an

OSError: [Errno 63] File name too long

for perfectly valid (yes, quite long) file names.

Reason:

Internally the fileinput library creates a backup file when we pass 'inplace=True' to fileinput.input() and that backup file gets a file name that is longer than the name for the file of interest.

Enhancement idea:

Work with a backup file name that is sth like GUID.bak or remove some chars from the original file name.

Hint:

vim /path/to/my/file creates a .swp file and can handle very long file names with 252-255 chars.

----------
components: Library (Lib)
files: long_filename_passed_to_fileinput.ipynb
messages: 407534
nosy: jamil.raichouni
priority: normal
severity: normal
status: open
title: fileinput.input(path, inplace=True) crashes for valid filename with 252-255 characters
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file50471/long_filename_passed_to_fileinput.ipynb

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45965>
_______________________________________

From report at bugs.python.org  Thu Dec  2 10:47:19 2021
From: report at bugs.python.org (Matej Cepl)
Date: Thu, 02 Dec 2021 15:47:19 +0000
Subject: [issue45964] 3.10.0 tests fail in
 test_pdb_breakpoints_preserved_across_interactive_sessions
In-Reply-To: <1638453038.24.0.528506960629.issue45964@roundup.psfhosted.org>
Message-ID: <1638460039.78.0.296584196988.issue45964@roundup.psfhosted.org>


Matej Cepl <mcepl at cepl.eu> added the comment:

And no there is no other patch touching pdb (or pdb tests).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45964>
_______________________________________

From report at bugs.python.org  Thu Dec  2 11:19:09 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 02 Dec 2021 16:19:09 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638461949.61.0.423224714013.issue45476@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> mypy-0.910

I proposed a fix: https://github.com/python/mypy/pull/11652

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Thu Dec  2 11:39:50 2021
From: report at bugs.python.org (Mukesh)
Date: Thu, 02 Dec 2021 16:39:50 +0000
Subject: [issue45966] Error in Multiplication
Message-ID: <1638463190.07.0.716534365359.issue45966@roundup.psfhosted.org>


New submission from Mukesh <mikebon007 at gmail.com>:

I've tried various methods to multiply some numbers but every time I get an unsatisfying result when I try to evaluate 48*1.2 or 41*1.2 or 51*1.4 etc. For example if I run

import math
NUM3 = eval(input("Your Input: "))
print(NUM3)

Output:
Your Input: 51*1.4
71.39999999999999

Now it should give me a straight 71.4 but instead it's giving 71.39999999999999

It's not an issue with the version of python that I'm using cause I've already tried it on various versions.

----------
components: Interpreter Core
messages: 407537
nosy: M1kE
priority: normal
severity: normal
status: open
title: Error in Multiplication
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45966>
_______________________________________

From report at bugs.python.org  Thu Dec  2 11:43:04 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Thu, 02 Dec 2021 16:43:04 +0000
Subject: [issue45966] Error in Multiplication
In-Reply-To: <1638463190.07.0.716534365359.issue45966@roundup.psfhosted.org>
Message-ID: <1638463384.91.0.269779979368.issue45966@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

This isn't a bug, it's a function of the IEEE-754 double precision floating point type that python uses. See: https://docs.python.org/3/tutorial/floatingpoint.html

You might want to consider the decimal module, although that will also have limitations.

----------
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45966>
_______________________________________

From report at bugs.python.org  Thu Dec  2 11:50:06 2021
From: report at bugs.python.org (Ethan Furman)
Date: Thu, 02 Dec 2021 16:50:06 +0000
Subject: [issue45535] Enum's dir() does not contain inherited members
In-Reply-To: <1634726106.14.0.525814954361.issue45535@roundup.psfhosted.org>
Message-ID: <1638463806.15.0.931370017707.issue45535@roundup.psfhosted.org>


Ethan Furman <ethan at stoneleaf.us> added the comment:


New changeset b2afdc95cc8f4e9228148730949a43cef0323f15 by Alex Waygood in branch 'main':
bpo-45535: Improve output of Enum ``dir()`` (GH-29316)
https://github.com/python/cpython/commit/b2afdc95cc8f4e9228148730949a43cef0323f15


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45535>
_______________________________________

From report at bugs.python.org  Thu Dec  2 11:55:46 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 02 Dec 2021 16:55:46 +0000
Subject: [issue45897] Frozen dataclasses with slots raise TypeError
In-Reply-To: <1637805231.22.0.691568548115.issue45897@roundup.psfhosted.org>
Message-ID: <1638464146.33.0.611479820179.issue45897@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

You get the same error if you subclass a frozen dataclass, then try to set an attribute that is not one of the superclass's __slots__:

```
>>> @dataclass(slots=True, frozen=True)
... class Point:
...     x: int
...     y: int
... 
...     
>>> class Subclass(Point): pass
... 
>>> s = Subclass(1, 2)
>>> s.z = 5
Traceback (most recent call last):
  File "<pyshell#15>", line 1, in <module>
    s.z = 5
  File "<string>", line 7, in __setattr__
TypeError: super(type, obj): obj must be an instance or subtype of type
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45897>
_______________________________________

From report at bugs.python.org  Thu Dec  2 12:20:40 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 02 Dec 2021 17:20:40 +0000
Subject: [issue45897] Frozen dataclasses with slots raise TypeError
In-Reply-To: <1637805231.22.0.691568548115.issue45897@roundup.psfhosted.org>
Message-ID: <1638465640.24.0.648381164552.issue45897@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
keywords: +patch
pull_requests: +28119
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29895

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45897>
_______________________________________

From report at bugs.python.org  Thu Dec  2 12:43:05 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 02 Dec 2021 17:43:05 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638466985.42.0.193433730528.issue40280@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset a31173c5ceb1708df687f942d714bdecae7cb759 by Christian Heimes in branch 'main':
bpo-40280: Update what's new (GH-29893)
https://github.com/python/cpython/commit/a31173c5ceb1708df687f942d714bdecae7cb759


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Thu Dec  2 13:20:31 2021
From: report at bugs.python.org (Ned Deily)
Date: Thu, 02 Dec 2021 18:20:31 +0000
Subject: [issue45920] make doctest fails
In-Reply-To: <1638140383.16.0.243032979083.issue45920@roundup.psfhosted.org>
Message-ID: <1638469231.66.0.707811398777.issue45920@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

> So I guess the only way to actually get make doctest to work is if the virtual env uses the version of python in main. Is there anyway to do that?

By default, the Doc/Makefile "venv" target uses the first "python3" it finds on your shell PATH to build the venv and sphinx. Either arrange for "python3" to point at a Python of the same release family on your PATH or you can use the PYTHON= command line argument to "make venv" to specify the path to the interpreter, for example:

cd cpython
./configure && make
cd Doc
make clean venv doctest PYTHON=../python
  [...]
  Doctest summary
  ===============
   2388 tests
      0 failures in tests
      0 failures in setup code
      0 failures in cleanup code
  build succeeded.
  [...]

----------
nosy: +ned.deily
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45920>
_______________________________________

From report at bugs.python.org  Thu Dec  2 14:27:33 2021
From: report at bugs.python.org (Ned Deily)
Date: Thu, 02 Dec 2021 19:27:33 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638473253.21.0.145953470478.issue45957@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

I am not able to reproduce this failure with various macOS Pythons from python.org that are built with either Tk 8.6.8 or 8.6.12. Perhaps it's an issue with the Tk provided with your Miniconda Python?  Besides answering Serhiy's question, it would be helpful to know the exact patch level of Tk that is being used and also the path to the Tk library.

The output from

/path/to/your/python -m test.pythoninfo

and

otool -L $(/path/to/your/python -c "import _tkinter;print(_tkinter.__file__)")

will give those answers.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Thu Dec  2 15:02:47 2021
From: report at bugs.python.org (Zachary Ware)
Date: Thu, 02 Dec 2021 20:02:47 +0000
Subject: [issue45916] documentation link error
In-Reply-To: <1638101696.82.0.501489879762.issue45916@roundup.psfhosted.org>
Message-ID: <1638475367.57.0.734165170012.issue45916@roundup.psfhosted.org>


Change by Zachary Ware <zachary.ware at gmail.com>:


----------
keywords: +patch
pull_requests: +28120
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29896

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45916>
_______________________________________

From report at bugs.python.org  Thu Dec  2 15:24:37 2021
From: report at bugs.python.org (Zachary Ware)
Date: Thu, 02 Dec 2021 20:24:37 +0000
Subject: [issue45916] documentation link error
In-Reply-To: <1638101696.82.0.501489879762.issue45916@roundup.psfhosted.org>
Message-ID: <1638476677.08.0.0919134565769.issue45916@roundup.psfhosted.org>


Zachary Ware <zachary.ware at gmail.com> added the comment:


New changeset 9f2f7e42269db74a89fc8cd74d82a875787f01d7 by Zachary Ware in branch 'main':
bpo-45916: Use HTTPS link for The Perils of Floating Point (GH-29896)
https://github.com/python/cpython/commit/9f2f7e42269db74a89fc8cd74d82a875787f01d7


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45916>
_______________________________________

From report at bugs.python.org  Thu Dec  2 15:25:02 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 02 Dec 2021 20:25:02 +0000
Subject: [issue45916] documentation link error
In-Reply-To: <1638101696.82.0.501489879762.issue45916@roundup.psfhosted.org>
Message-ID: <1638476702.95.0.991068477512.issue45916@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28121
pull_request: https://github.com/python/cpython/pull/29897

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45916>
_______________________________________

From report at bugs.python.org  Thu Dec  2 15:25:08 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 02 Dec 2021 20:25:08 +0000
Subject: [issue45916] documentation link error
In-Reply-To: <1638101696.82.0.501489879762.issue45916@roundup.psfhosted.org>
Message-ID: <1638476708.77.0.632335726917.issue45916@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28122
pull_request: https://github.com/python/cpython/pull/29898

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45916>
_______________________________________

From report at bugs.python.org  Thu Dec  2 15:44:28 2021
From: report at bugs.python.org (Alexander Mohr)
Date: Thu, 02 Dec 2021 20:44:28 +0000
Subject: [issue44637] Quoting issue on header Reply-To and other address
 headers
In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org>
Message-ID: <1638477868.94.0.819639276575.issue44637@roundup.psfhosted.org>


Alexander Mohr <thehesiod at gmail.com> added the comment:

btw my work-around was to set maxheaderlen=sys.maxsize, worked for AWS SES at least

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44637>
_______________________________________

From report at bugs.python.org  Thu Dec  2 15:45:20 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 02 Dec 2021 20:45:20 +0000
Subject: [issue45916] documentation link error
In-Reply-To: <1638101696.82.0.501489879762.issue45916@roundup.psfhosted.org>
Message-ID: <1638477920.55.0.176983273094.issue45916@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset f6648e229edf07a1e4897244d7d34989dd9ea647 by Miss Islington (bot) in branch '3.10':
bpo-45916: Use HTTPS link for The Perils of Floating Point (GH-29896)
https://github.com/python/cpython/commit/f6648e229edf07a1e4897244d7d34989dd9ea647


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45916>
_______________________________________

From report at bugs.python.org  Thu Dec  2 15:58:32 2021
From: report at bugs.python.org (Harold Meneley)
Date: Thu, 02 Dec 2021 20:58:32 +0000
Subject: [issue45967] treeview
Message-ID: <1638478712.78.0.334069010053.issue45967@roundup.psfhosted.org>


New submission from Harold Meneley <hmeneley at gmail.com>:

treeview does not clear after opening and reopening another using same code block, You can see leftover treeview after clear and reopen. Simply clikc on file > view all, clear > clear, and then search > author and you should see problem

----------
components: Tkinter
files: MyBooks.py
messages: 407547
nosy: hmeneley
priority: normal
severity: normal
status: open
title: treeview
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50472/MyBooks.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45967>
_______________________________________

From report at bugs.python.org  Thu Dec  2 16:07:08 2021
From: report at bugs.python.org (Tom E)
Date: Thu, 02 Dec 2021 21:07:08 +0000
Subject: [issue45933] Illegal Instrution (Core Dumped)
In-Reply-To: <1638224710.52.0.0477949346292.issue45933@roundup.psfhosted.org>
Message-ID: <1638479228.22.0.549925272005.issue45933@roundup.psfhosted.org>


Tom E <guacaplushy at icloud.com> added the comment:

Well I updated the kernel to 5.15.0 and used my succeeding 3.9.9 build and now it works.

----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45933>
_______________________________________

From report at bugs.python.org  Thu Dec  2 16:08:01 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 02 Dec 2021 21:08:01 +0000
Subject: [issue45967] Tkinter.ttk.Treeview does not clear after opening and
 reopening another using same code block
In-Reply-To: <1638478712.78.0.334069010053.issue45967@roundup.psfhosted.org>
Message-ID: <1638479281.53.0.671515985051.issue45967@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +gpolo, serhiy.storchaka
title: treeview -> Tkinter.ttk.Treeview does not clear after opening and reopening another using same code block

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45967>
_______________________________________

From report at bugs.python.org  Thu Dec  2 16:20:33 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 02 Dec 2021 21:20:33 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638480033.18.0.152978915368.issue45476@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
nosy:  -mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Thu Dec  2 17:16:46 2021
From: report at bugs.python.org (Ali Amin-Nejad)
Date: Thu, 02 Dec 2021 22:16:46 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638483406.67.0.780696101527.issue45957@roundup.psfhosted.org>


Ali Amin-Nejad <aanejad at hotmail.co.uk> added the comment:

@serhiy.storchaka I tried that command, the returned value is not an empty string, it is an object of type <class '_tkinter.Tcl_Obj'>. However including that line in my script immediately after creating the `root` object actually fixes the problem - no more error and the button appears and is responsive.

@ned.deily I am on tkinter 8.6.11. The output from the second command is:

```
/Users/ali/miniconda3/envs/bitfount/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so:
        @rpath/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.11)
        @rpath/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.11)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
```

I have just tried the same script in a separate python 3.9 environment with python 3.9.6 and tkinter 8.6.10 and the error is not there so it seems like it is introduced in 8.6.11. Happy to try on 8.6.12 but I'm not sure how to upgrade to it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Thu Dec  2 17:23:08 2021
From: report at bugs.python.org (Luca)
Date: Thu, 02 Dec 2021 22:23:08 +0000
Subject: [issue45968] Windows installer should add also
 "%USERPROFILE%\AppData\Roaming\Python\Python3x\Scripts" folder to the PATH
 environment variable
Message-ID: <1638483787.98.0.55945714586.issue45968@roundup.psfhosted.org>


New submission from Luca <lucatrv at hotmail.com>:

This issue is related to https://bugs.python.org/issue3561

When installing Python under Windows, if the "Add Python 3.x to PATH" option is flagged, the following two folders are added to the PATH environment variable:
%USERPROFILE%\AppData\Local\Programs\Python\Python3x\
%USERPROFILE%\AppData\Local\Programs\Python\Python3x\Scripts\

However also the following folder should be added, which is where scripts reside when packages are installed with "pip install --user":
%USERPROFILE%\AppData\Roaming\Python\Python3x\Scripts\

----------
components: Installation, Windows
messages: 407550
nosy: lucatrv, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows installer should add also "%USERPROFILE%\AppData\Roaming\Python\Python3x\Scripts" folder to the PATH environment variable
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45968>
_______________________________________

From report at bugs.python.org  Thu Dec  2 17:23:30 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 02 Dec 2021 22:23:30 +0000
Subject: [issue45949] Provide pure-Python implementation of
 Programs/_freeze_module for cross building
In-Reply-To: <1638372868.47.0.982140813893.issue45949@roundup.psfhosted.org>
Message-ID: <1638483810.22.0.949439677656.issue45949@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
keywords: +patch
pull_requests: +28123
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29899

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________

From report at bugs.python.org  Thu Dec  2 17:36:06 2021
From: report at bugs.python.org (Luca)
Date: Thu, 02 Dec 2021 22:36:06 +0000
Subject: [issue45969] When uninstalling Python under Windows the "Scripts"
 folders should be removed from the PATH environment variable
Message-ID: <1638484566.06.0.085894454168.issue45969@roundup.psfhosted.org>


New submission from Luca <lucatrv at hotmail.com>:

This issue is related to:
  https://bugs.python.org/issue3561
and:
  https://bugs.python.org/issue45968

When installing Python under Windows, if the "Add Python 3.x to PATH" option is flagged, the following two folders are added to the PATH environment variable:
  %USERPROFILE%\AppData\Local\Programs\Python\Python3x\
  %USERPROFILE%\AppData\Local\Programs\Python\Python3x\Scripts\

However when uninstalling Pyhton only the former folder is removed from the PATH environment variable, and not the latter one.

Moreover if also the following folder will be added to the PATH environment variable in future (see issue #45968):
  %USERPROFILE%\AppData\Roaming\Python\Python3x\Scripts\
then the same would apply to it.

----------
components: Installation, Windows
messages: 407551
nosy: lucatrv, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: When uninstalling Python under Windows the "Scripts" folders should be removed from the PATH environment variable
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45969>
_______________________________________

From report at bugs.python.org  Thu Dec  2 17:39:53 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 02 Dec 2021 22:39:53 +0000
Subject: [issue45959] Teach pprint about dict views
In-Reply-To: <1638428816.23.0.206050902249.issue45959@roundup.psfhosted.org>
Message-ID: <1638484793.43.0.25867084959.issue45959@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45959>
_______________________________________

From report at bugs.python.org  Thu Dec  2 17:40:18 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 02 Dec 2021 22:40:18 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638484818.8.0.290167418142.issue45957@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Thank you Ali. It confirms my guess, but it is still not clear why we get a Tcl_Obj rather of None or empty string.

Please examine what is the output of the following code:

res = root.tk.call('wm', 'overrideredirect', root._w, True)
print([res.typename])
print([res.string])

If the first print crashes comment out it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Thu Dec  2 17:45:04 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 02 Dec 2021 22:45:04 +0000
Subject: [issue45878] Use `self.assertRaises` instead of `try/except` in
 `ctypes/test_functions.py::test_mro`
In-Reply-To: <1637659974.6.0.574362436807.issue45878@roundup.psfhosted.org>
Message-ID: <1638485104.06.0.779213825566.issue45878@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45878>
_______________________________________

From report at bugs.python.org  Thu Dec  2 17:54:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 02 Dec 2021 22:54:45 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638485685.43.0.641959455764.issue27946@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This is a bug in elementtree - the caller should own a reference to the dict during the entire PyDict_GetItem call.

We won't add the refcount change you propose because it's not free and this is a hot function. 

The test in your patch doesn't fail for me (I tried on version 3.11 on a Mac). Are you still seeing the problem on version >= 3.9, or perhaps it was fixed in eaementtree by now?

----------
nosy: +iritkatriel
title: issues in elementtree and elsewhere due to PyDict_GetItem -> elementtree calls PyDict_GetItem without owning a reference to the dict

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Thu Dec  2 18:05:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 02 Dec 2021 23:05:57 +0000
Subject: [issue24966] shutil.get_terminal_size() throws ValueError if stdout
 is detached, no fallback
In-Reply-To: <1440975553.42.0.716947211383.issue24966@psf.upfronthosting.co.za>
Message-ID: <1638486357.56.0.714936807863.issue24966@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I am unable to reproduce this, was it fixed?

>>> import os, sys, codecs, shutil
>>> sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
>>> os.get_terminal_size()
os.terminal_size(columns=79, lines=36)
>>> shutil.get_terminal_size((200, 30))
os.terminal_size(columns=200, lines=30)
>>>

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24966>
_______________________________________

From report at bugs.python.org  Thu Dec  2 18:11:09 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 02 Dec 2021 23:11:09 +0000
Subject: [issue14856] argparse: creating an already defined subparsers does
 not raises an exception
In-Reply-To: <1337430471.4.0.633032333136.issue14856@psf.upfronthosting.co.za>
Message-ID: <1638486669.24.0.500936347506.issue14856@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The open patch deprecates overriding the parser with add_parser, but it does not add the new set_parser method that Steven suggested.

----------
nosy: +iritkatriel
stage: patch review -> 
type:  -> enhancement
versions: +Python 3.11 -Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14856>
_______________________________________

From report at bugs.python.org  Thu Dec  2 18:22:51 2021
From: report at bugs.python.org (Eryk Sun)
Date: Thu, 02 Dec 2021 23:22:51 +0000
Subject: [issue24966] shutil.get_terminal_size() throws ValueError if stdout
 is detached, no fallback
In-Reply-To: <1440975553.42.0.716947211383.issue24966@psf.upfronthosting.co.za>
Message-ID: <1638487371.98.0.752272719604.issue24966@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

This was fixed in 3.5.

----------
nosy: +eryksun
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Fix shutil.get_terminal_size() to catch AttributeError

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24966>
_______________________________________

From report at bugs.python.org  Thu Dec  2 18:24:42 2021
From: report at bugs.python.org (Ali Amin-Nejad)
Date: Thu, 02 Dec 2021 23:24:42 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638487482.57.0.187494834827.issue45957@roundup.psfhosted.org>


Ali Amin-Nejad <aanejad at hotmail.co.uk> added the comment:

Thanks Serhiy, the output is:

['StateSpec']
['']

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Thu Dec  2 18:31:38 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 02 Dec 2021 23:31:38 +0000
Subject: [issue36338] urlparse of urllib returns wrong hostname
In-Reply-To: <1552896371.92.0.122580708995.issue36338@roundup.psfhosted.org>
Message-ID: <1638487898.17.0.0208270041269.issue36338@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

It produces a deprecation warning on 3.11, but still does the same.

>>> urlparse('http://benign.com\[attacker.com]').hostname
<stdin>:1: DeprecationWarning: invalid escape sequence '\['
'attacker.com'

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36338>
_______________________________________

From report at bugs.python.org  Thu Dec  2 18:55:19 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 02 Dec 2021 23:55:19 +0000
Subject: [issue28533] Remove asyncore, asynchat and smtpd modules
In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za>
Message-ID: <1638489319.35.0.0282813720047.issue28533@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

According to a code search in the PyPI top 5000 projects: the source code of 21 projects contains "import asyncore", "import asynchat" or "import smtpd":

* ansible-5.0.0
* cassandra-driver-3.25.0
* django-extensions-3.1.5
* eth_abi-2.1.1
* eth-account-0.5.6
* eth-hash-0.3.2
* eth-utils-2.0.0
* gevent-21.8.0
* h5py-3.6.0
* hexbytes-0.2.2
* jedi-0.18.1
* M2Crypto-0.38.0
* mercurial-6.0
* mypy-0.910
* plac-1.3.3
* pyftpdlib-1.5.6
* pyinotify-0.9.6
* pysnmp-4.4.12
* pytest-localserver-0.5.1
* pytype-2021.11.29
* tlslite-0.4.9

I ignored false positives like "from eventlet(...) import asyncore".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28533>
_______________________________________

From report at bugs.python.org  Thu Dec  2 19:00:20 2021
From: report at bugs.python.org (STINNER Victor)
Date: Fri, 03 Dec 2021 00:00:20 +0000
Subject: [issue28533] Remove asyncore, asynchat and smtpd modules
In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za>
Message-ID: <1638489620.69.0.178898273959.issue28533@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> ansible-5.0.0

Reported upstream (it's a single file, used for tests):
https://github.com/ansible/ansible/issues/76452


> gevent-21.8.0

It's https://github.com/gevent/gevent/tree/master/src/greentest directory which contains subsets of the Python test suite. I guess that when they will copy the Python 3.11 tests, it will be fine.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28533>
_______________________________________

From report at bugs.python.org  Thu Dec  2 19:01:27 2021
From: report at bugs.python.org (STINNER Victor)
Date: Fri, 03 Dec 2021 00:01:27 +0000
Subject: [issue36338] urlparse of urllib returns wrong hostname
In-Reply-To: <1552896371.92.0.122580708995.issue36338@roundup.psfhosted.org>
Message-ID: <1638489687.94.0.091711607802.issue36338@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
nosy:  -vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36338>
_______________________________________

From report at bugs.python.org  Thu Dec  2 19:08:49 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 00:08:49 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638490129.71.0.831403938763.issue45582@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset 99fcf1505218464c489d419d4500f126b6d6dc28 by Steve Dower in branch 'main':
bpo-45582: Port getpath[p].c to Python (GH-29041)
https://github.com/python/cpython/commit/99fcf1505218464c489d419d4500f126b6d6dc28


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Thu Dec  2 19:10:47 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 00:10:47 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638490247.34.0.851540685015.issue45582@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

It's done! Those were some of the hardest memory leaks I've had to track down, but it should be clear now.

As I mentioned in the commit message, this change attempts to preserve every known quirk. However, I think these ought to be streamlined across platforms to improve the code and/or startup performance.

But at least we know now that any changes in the future that require test changes are expected, and not the result of this change :)

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Thu Dec  2 19:25:29 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Fri, 03 Dec 2021 00:25:29 +0000
Subject: [issue45966] Error in Multiplication
In-Reply-To: <1638463190.07.0.716534365359.issue45966@roundup.psfhosted.org>
Message-ID: <1638491129.11.0.16873812379.issue45966@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

https://docs.python.org/3/faq/design.html#why-am-i-getting-strange-results-with-simple-arithmetic-operations

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45966>
_______________________________________

From report at bugs.python.org  Thu Dec  2 19:30:34 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 00:30:34 +0000
Subject: [issue45969] When uninstalling Python under Windows the "Scripts"
 folders should be removed from the PATH environment variable
In-Reply-To: <1638484566.06.0.085894454168.issue45969@roundup.psfhosted.org>
Message-ID: <1638491434.43.0.932109963728.issue45969@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

Unless someone can find an authoring bug under Tools/msi, I don't think we can do anything about this. We rely on the built-in Windows support for adding and removing these variables, and if that's broken, we can't do anything with our current setup.

I really want to get us out of this addiction to cluttering up PATH with lots of different directories - it's bad for security/reliability/etc. of the system as a whole, and I don't like Python being the cause of issues here. But I haven't quite come up with the better design yet... 

Anyway, all that to say that I'm not in any rush to expand or seriously mess with the current PATH settings. If there's an authoring bug we can fix, great, but I don't think this one is on us in a way we can easily deal with.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45969>
_______________________________________

From report at bugs.python.org  Thu Dec  2 20:32:33 2021
From: report at bugs.python.org (Eric Snow)
Date: Fri, 03 Dec 2021 01:32:33 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1638490247.34.0.851540685015.issue45582@roundup.psfhosted.org>
Message-ID: <CALFfu7Ba1k6u_vD-V=TmLkGw5MNQ=xWoHPwRDaXG_d=Uq7G5Ug@mail.gmail.com>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

Hurray!  Thanks, Steve!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Fri Dec  3 00:35:05 2021
From: report at bugs.python.org (Jason Haslam)
Date: Fri, 03 Dec 2021 05:35:05 +0000
Subject: [issue45970] Py_NewInterpreter causes bogus fatal error along the
 failure path
Message-ID: <1638509705.87.0.0666625525238.issue45970@roundup.psfhosted.org>


New submission from Jason Haslam <jason.haslam at gmail.com>:

The failure cleanup of `Py_NewInterpreter` causes a bogus fatal error on the call to `PyThreadState_Delete`. The error is about deleting the current thread state. The saved thread state should be swapped back in *before* deleting the new thread state.

----------
components: C API
messages: 407566
nosy: jason.haslam
priority: normal
severity: normal
status: open
title: Py_NewInterpreter causes bogus fatal error along the failure path
type: crash
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45970>
_______________________________________

From report at bugs.python.org  Fri Dec  3 00:44:54 2021
From: report at bugs.python.org (Roundup Robot)
Date: Fri, 03 Dec 2021 05:44:54 +0000
Subject: [issue45970] Py_NewInterpreter causes bogus fatal error along the
 failure path
In-Reply-To: <1638509705.87.0.0666625525238.issue45970@roundup.psfhosted.org>
Message-ID: <1638510294.38.0.47574670971.issue45970@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +28124
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29900

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45970>
_______________________________________

From report at bugs.python.org  Fri Dec  3 02:26:06 2021
From: report at bugs.python.org (Venkata Raman S S V)
Date: Fri, 03 Dec 2021 07:26:06 +0000
Subject: [issue45971] calendar module issue
Message-ID: <1638516366.75.0.743197554563.issue45971@roundup.psfhosted.org>


New submission from Venkata Raman S S V <ssv5088 at gmail.com>:

In Ubuntu 20.04.3 LTS  -  OS Type: 64-bit.

$ cal sep 1752
   September 1752     
Su Mo Tu We Th Fr Sa  
       1  2 14 15 16  
17 18 19 20 21 22 23  
24 25 26 27 28 29 30  

--------------------------------

$ python3
Python 3.8.10 (default, Sep 28 2021, 16:10:42) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import calendar as cl
yy=1752
mm=9

print(cl.month(yy,mm))
   September 1752
Mo Tu We Th Fr Sa Su
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 

Note: Sep. 1752 had only 19 days. ( 11 days skipped )

----------
components: Extension Modules
messages: 407567
nosy: ssv5088
priority: normal
severity: normal
status: open
title: calendar module issue
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45971>
_______________________________________

From report at bugs.python.org  Fri Dec  3 02:49:23 2021
From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=)
Date: Fri, 03 Dec 2021 07:49:23 +0000
Subject: [issue45971] calendar module issue
In-Reply-To: <1638516366.75.0.743197554563.issue45971@roundup.psfhosted.org>
Message-ID: <1638517763.27.0.632698092071.issue45971@roundup.psfhosted.org>


Vedran ?a?i? <vedgar at gmail.com> added the comment:

https://docs.python.org/3/library/calendar.html#module-calendar

The functions and classes defined in this module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions.

https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar

Even if we decide to change this, this is the thing locale should worry about: not every place adopted Gregorian Calendar at the same time, nor in the same way.

----------
nosy: +veky

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45971>
_______________________________________

From report at bugs.python.org  Fri Dec  3 03:22:21 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Fri, 03 Dec 2021 08:22:21 +0000
Subject: [issue45756] mock raises exception when using a spec with an
 attribute that raises exception on access
In-Reply-To: <1636400873.51.0.88200985051.issue45756@roundup.psfhosted.org>
Message-ID: <1638519741.53.0.511005356849.issue45756@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
nosy: +sobolevn
nosy_count: 3.0 -> 4.0
pull_requests: +28125
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29901

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45756>
_______________________________________

From report at bugs.python.org  Fri Dec  3 03:26:01 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Fri, 03 Dec 2021 08:26:01 +0000
Subject: [issue41768] unittest.mock spec calls class properties
In-Reply-To: <1599873024.24.0.929930382889.issue41768@roundup.psfhosted.org>
Message-ID: <1638519961.36.0.829491484417.issue41768@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Related PR: https://github.com/python/cpython/pull/29901

----------
nosy: +sobolevn

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41768>
_______________________________________

From report at bugs.python.org  Fri Dec  3 03:45:33 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 03 Dec 2021 08:45:33 +0000
Subject: [issue41768] unittest.mock spec calls class properties
In-Reply-To: <1599873024.24.0.929930382889.issue41768@roundup.psfhosted.org>
Message-ID: <1638521133.64.0.378082873421.issue41768@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41768>
_______________________________________

From report at bugs.python.org  Fri Dec  3 03:45:38 2021
From: report at bugs.python.org (Erik Montnemery)
Date: Fri, 03 Dec 2021 08:45:38 +0000
Subject: [issue45972] typing.NamedTuple with default arguments without type
 annotations is falsy
Message-ID: <1638521138.51.0.177788503063.issue45972@roundup.psfhosted.org>


New submission from Erik Montnemery <erik at montnemery.com>:

typing.NamedTuple behaves in surprising ways when it has default arguments which lack type annotations:

>>> from typing import NamedTuple
>>> class MyTuple(NamedTuple):
...     a = 1000
...
>>> tmp = MyTuple()
>>> tmp.a
1000
>>> len(tmp)
0
>>> bool(tmp)
False

Tested in Python 3.8 and 3.9

----------
messages: 407570
nosy: emontnemery
priority: normal
severity: normal
status: open
title: typing.NamedTuple with default arguments without type annotations is falsy
type: behavior
versions: Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45972>
_______________________________________

From report at bugs.python.org  Fri Dec  3 03:46:16 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 03 Dec 2021 08:46:16 +0000
Subject: [issue45756] mock raises exception when using a spec with an
 attribute that raises exception on access
In-Reply-To: <1636400873.51.0.88200985051.issue45756@roundup.psfhosted.org>
Message-ID: <1638521176.9.0.965709285145.issue45756@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45756>
_______________________________________

From report at bugs.python.org  Fri Dec  3 03:47:11 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 03 Dec 2021 08:47:11 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638521231.7.0.341842390164.issue45582@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
nosy: +christian.heimes
nosy_count: 5.0 -> 6.0
pull_requests: +28126
pull_request: https://github.com/python/cpython/pull/29902

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Fri Dec  3 03:50:08 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 03 Dec 2021 08:50:08 +0000
Subject: [issue45972] typing.NamedTuple with default arguments without type
 annotations is falsy
In-Reply-To: <1638521138.51.0.177788503063.issue45972@roundup.psfhosted.org>
Message-ID: <1638521408.82.0.146678275982.issue45972@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
components: +Library (Lib)
nosy: +AlexWaygood, gvanrossum, kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45972>
_______________________________________

From report at bugs.python.org  Fri Dec  3 03:58:36 2021
From: report at bugs.python.org (Spencer Brown)
Date: Fri, 03 Dec 2021 08:58:36 +0000
Subject: [issue45972] typing.NamedTuple with default arguments without type
 annotations is falsy
In-Reply-To: <1638521138.51.0.177788503063.issue45972@roundup.psfhosted.org>
Message-ID: <1638521916.75.0.199168284891.issue45972@roundup.psfhosted.org>


Spencer Brown <spencerb21 at live.com> added the comment:

What's happening is that typing.NamedTuple ignores non-annotated attributes entirely when computing the names it passes along to namedtuple(), so here "a" is just a class attribute. You're accessing it from there, but the tuple itself is entirely empty. Perhaps it should error out if no names at all are found?

----------
nosy: +Spencer Brown

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45972>
_______________________________________

From report at bugs.python.org  Fri Dec  3 04:27:05 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Fri, 03 Dec 2021 09:27:05 +0000
Subject: [issue45972] typing.NamedTuple with default arguments without type
 annotations is falsy
In-Reply-To: <1638521138.51.0.177788503063.issue45972@roundup.psfhosted.org>
Message-ID: <1638523625.7.0.251814702934.issue45972@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

I don't think we'd want to prohibit zero-length namedtuples (or NamedTuples). I've used them, especially when I'm dynamically creating them.

This is just a side effect of how Python works. I don't think there's anything to do here, except maybe mention it in the docs, and I'm not even sure that's a good idea.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45972>
_______________________________________

From report at bugs.python.org  Fri Dec  3 04:33:21 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 03 Dec 2021 09:33:21 +0000
Subject: [issue45972] typing.NamedTuple with default arguments without type
 annotations is falsy
In-Reply-To: <1638521138.51.0.177788503063.issue45972@roundup.psfhosted.org>
Message-ID: <1638524001.81.0.897158640149.issue45972@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

I agree that prohibiting zero-length NamedTuples seems like a bad idea, and also agree that this probably doesn't need to be documented.

The behaviour here definitely looks weird at first glance, but it's probably not a good idea to tamper with the __bool__() methods of NamedTuple classes either: an empty NamedTuple probably *should* be falsey by default, even if it has a class attribute.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45972>
_______________________________________

From report at bugs.python.org  Fri Dec  3 04:41:18 2021
From: report at bugs.python.org (E. Paine)
Date: Fri, 03 Dec 2021 09:41:18 +0000
Subject: [issue45967] Tkinter.ttk.Treeview does not clear after opening and
 reopening another using same code block
In-Reply-To: <1638478712.78.0.334069010053.issue45967@roundup.psfhosted.org>
Message-ID: <1638524478.29.0.878890622126.issue45967@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

This is because your code isn't clearing the Treeview, it's hiding it by setting the parent Frame's width and height to 0. When this parent Frame is reshown, because you want to put a new TreeView on it, the old one is still there.

The easiest way to solve this is to probably create `xtree` just below where you set-up the menu instead of in the function (since you're already calling `xtree.delete`, problem is it's currently being called on the empty tree you've just created).

In the future, for issues such as this, please try posting on Stack Overflow first before then raising it with us. Additionally, please post a minimal reproducible example, rather than your full code since it makes it much harder for us to get to the bottom of the problem. One final thing: you may wish to change your MariaDB password for security, since this was included in the file you uploaded.

----------
nosy: +epaine

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45967>
_______________________________________

From report at bugs.python.org  Fri Dec  3 05:20:56 2021
From: report at bugs.python.org (Erik Montnemery)
Date: Fri, 03 Dec 2021 10:20:56 +0000
Subject: [issue45972] typing.NamedTuple with default arguments without type
 annotations is falsy
In-Reply-To: <1638521138.51.0.177788503063.issue45972@roundup.psfhosted.org>
Message-ID: <1638526856.2.0.235260257366.issue45972@roundup.psfhosted.org>


Erik Montnemery <erik at montnemery.com> added the comment:

I think elaborating in the documentation that only annotated attributes make it to the underlying namedtuple() would be helpful, it's not obvious that they are instead just class attributes.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45972>
_______________________________________

From report at bugs.python.org  Fri Dec  3 05:32:54 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 03 Dec 2021 10:32:54 +0000
Subject: [issue45972] typing.NamedTuple with default arguments without type
 annotations is falsy
In-Reply-To: <1638521138.51.0.177788503063.issue45972@roundup.psfhosted.org>
Message-ID: <1638527574.57.0.279255459507.issue45972@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

To me, the fact that NamedTuple uses class attributes to provide field defaults feels like an implementation detail that is only relevant to an unusual edge case.

Where do you think the documentation should be improved, and what is your suggested wording? :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45972>
_______________________________________

From report at bugs.python.org  Fri Dec  3 06:17:38 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Fri, 03 Dec 2021 11:17:38 +0000
Subject: [issue45654] Freeze the runpy module.
In-Reply-To: <1635444830.43.0.574749380857.issue45654@roundup.psfhosted.org>
Message-ID: <1638530258.4.0.316841690491.issue45654@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 2.0 -> 3.0
pull_requests: +28127
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29903

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45654>
_______________________________________

From report at bugs.python.org  Fri Dec  3 06:29:16 2021
From: report at bugs.python.org (Mark Shannon)
Date: Fri, 03 Dec 2021 11:29:16 +0000
Subject: [issue45885] Specialize COMPARE_OP
In-Reply-To: <1637701224.16.0.881347004039.issue45885@roundup.psfhosted.org>
Message-ID: <1638530956.25.0.647482889607.issue45885@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 03768c4d139df46212a091ed931aad03bec18b57 by Dennis Sweeney in branch 'main':
bpo-45885: Specialize COMPARE_OP (GH-29734)
https://github.com/python/cpython/commit/03768c4d139df46212a091ed931aad03bec18b57


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45885>
_______________________________________

From report at bugs.python.org  Fri Dec  3 06:39:03 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 11:39:03 +0000
Subject: [issue20750] Roundtrip-test tokenize.untokenize(iterable_of_5_tuples)
In-Reply-To: <1393193226.83.0.860669897793.issue20750@psf.upfronthosting.co.za>
Message-ID: <1638531543.94.0.933918473254.issue20750@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The 7 tests are still removed and need to be checked:

https://github.com/python/cpython/blob/03768c4d139df46212a091ed931aad03bec18b57/Lib/test/test_tokenize.py#L1620

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20750>
_______________________________________

From report at bugs.python.org  Fri Dec  3 06:44:35 2021
From: report at bugs.python.org (Erik Montnemery)
Date: Fri, 03 Dec 2021 11:44:35 +0000
Subject: [issue45972] typing.NamedTuple with default arguments without type
 annotations is falsy
In-Reply-To: <1638521138.51.0.177788503063.issue45972@roundup.psfhosted.org>
Message-ID: <1638531875.32.0.4151754765.issue45972@roundup.psfhosted.org>


Erik Montnemery <erik at montnemery.com> added the comment:

Maybe something like this:

diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 735d477db4..8de913d8db 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -1291,7 +1291,8 @@ These are not used in annotations. They are building blocks for declaring types.

 .. class:: NamedTuple

-   Typed version of :func:`collections.namedtuple`.
+   Typed version of :func:`collections.namedtuple`, annotated fields are passed
+   to an underlying `collections.namedtuple`.

    Usage::

@@ -1311,9 +1312,20 @@ These are not used in annotations. They are building blocks for declaring types.

       employee = Employee('Guido')
       assert employee.id == 3
+      assert employee == ('Guido', 3)

    Fields with a default value must come after any fields without a default.

+   Non-annotated fields will not be part of the `collections.namedtuple`::
+
+      class Employee(NamedTuple):
+          name = 'Guido'
+          id = 3
+
+      employee = Employee()
+      assert employee.id == 3
+      assert not employee  # Passes because the collections.namedtuple is empty
+
    The resulting class has an extra attribute ``__annotations__`` giving a
    dict that maps the field names to the field types.  (The field names are in

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45972>
_______________________________________

From report at bugs.python.org  Fri Dec  3 07:22:16 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 12:22:16 +0000
Subject: [issue7727] xmlrpc library returns string which contain null ( \x00 )
In-Reply-To: <1263758368.94.0.169057465263.issue7727@psf.upfronthosting.co.za>
Message-ID: <1638534136.51.0.61429406654.issue7727@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

2.7 is no longer relevant, and it looks like these examples are working now:

>>> xmlrpc.client.dumps(('\u20ac',), encoding='iso-8859-1')
'<params>\n<param>\n<value><string>?</string></value>\n</param>\n</params>\n'
>>> xmlrpc.client.dumps((u'\u20ac',), encoding='iso-8859-1')
'<params>\n<param>\n<value><string>?</string></value>\n</param>\n</params>\n'

There is possibly still a documentation enhancement to make regarding non-ascii strings. This is what I get now with Serhiy's examples:

>>> xmlrpc.client.loads(xmlrpc.client.dumps(('\xe2\x82\xac',)))
(('?\x82?',), None)
>>> xmlrpc.client.loads(xmlrpc.client.dumps(('\r',)))
(('\n',), None)
>>> xmlrpc.client.loads(xmlrpc.client.dumps(('\r\n',)))
(('\n',), None)

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue7727>
_______________________________________

From report at bugs.python.org  Fri Dec  3 07:34:25 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 12:34:25 +0000
Subject: [issue23538] New Windows installer in 3.5.0a1 breaks compatibility
 with Wine
In-Reply-To: <1425058127.83.0.0230104914567.issue23538@psf.upfronthosting.co.za>
Message-ID: <1638534865.34.0.707310968829.issue23538@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

There doesn't seem to be information here that can help do anything about it, and version 3.5 is no longer maintained.

Please create a new issue if you are still having this problem with current versions (>= 3.9).

----------
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23538>
_______________________________________

From report at bugs.python.org  Fri Dec  3 07:45:17 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 03 Dec 2021 12:45:17 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638535517.76.0.415313703231.issue27946@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Concur with Irit. We should patch the caller of PyDict_GetItem, not PyDict_GetItem.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Fri Dec  3 07:48:18 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 12:48:18 +0000
Subject: [issue20970] [doc] contradictory documentation for prog option of
 argparse
In-Reply-To: <1395160969.17.0.758674872934.issue20970@psf.upfronthosting.co.za>
Message-ID: <1638535698.7.0.787830384547.issue20970@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy -patch
title: contradictory documentation for prog option of argparse -> [doc] contradictory documentation for prog option of argparse
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20970>
_______________________________________

From report at bugs.python.org  Fri Dec  3 08:05:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 13:05:22 +0000
Subject: [issue30214] make_zip.py lacks command a few line options.
In-Reply-To: <1493526948.12.0.00156119032978.issue30214@psf.upfronthosting.co.za>
Message-ID: <1638536722.16.0.280055785963.issue30214@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Tools/msi/make_zip.py does not exist since 3.7.

----------
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30214>
_______________________________________

From report at bugs.python.org  Fri Dec  3 08:06:13 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 03 Dec 2021 13:06:13 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638536773.66.0.0650232608097.issue45957@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It looks like a bug in Tk 8.6.11. It is expected that the implementation of "wm overrideredirect" returns an empty string if pass the boolean argument. The returned value is an empty string, but its type is not cleared. Seems it keeps the type of previous result.

I think that we can add a workaround for this bug, although it may be inconvenient to test it. Do we still use Tk 8.6.11 on any platform with Python 3.9+? Note that Python 3.8 only takes security fixes, so any changes can only be made in 3.9+.

----------
nosy: +epaine, terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Fri Dec  3 08:17:20 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 03 Dec 2021 13:17:20 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638537440.46.0.450171127901.issue45957@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Fri Dec  3 08:20:29 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 03 Dec 2021 13:20:29 +0000
Subject: [issue45695] Out-of-tree builds are not tested.
In-Reply-To: <1635895785.09.0.174517598815.issue45695@roundup.psfhosted.org>
Message-ID: <1638537629.19.0.305675880526.issue45695@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
keywords: +patch
pull_requests: +28128
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/29904

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45695>
_______________________________________

From report at bugs.python.org  Fri Dec  3 08:24:12 2021
From: report at bugs.python.org (E. Paine)
Date: Fri, 03 Dec 2021 13:24:12 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638537852.88.0.80306094297.issue45957@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

> Do we still use Tk 8.6.11 on any platform with Python 3.9+

No, none of the python.org installers include it now. On Linux, according to https://pkgs.org/download/tk, several distros still use 8.6.11 (most notably Ubuntu 21.04). I'll see if I can reproduce it on Linux using 8.6.11 and then we can decide whether or not a workaround is required.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Fri Dec  3 08:39:48 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 03 Dec 2021 13:39:48 +0000
Subject: [issue45971] calendar module issue
In-Reply-To: <1638516366.75.0.743197554563.issue45971@roundup.psfhosted.org>
Message-ID: <1638538788.08.0.772281710442.issue45971@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

> Note: Sep. 1752 had only 19 days. ( 11 days skipped )

That statement is only correct for countries where the Church of England was predominant: Great Britain and colonies of the British Empire in e.g, North America (later known as US of A). Alaska changed later when Russia sold it to the US.

Catholic countries such as Italy, Spain, Portugal, and France adopted the Gregorian calendar 170 years earlier. For Germany it gets really complicated and depends on county, kingdom, and the current religion of sovereign.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45971>
_______________________________________

From report at bugs.python.org  Fri Dec  3 08:47:16 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 03 Dec 2021 13:47:16 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638539236.11.0.210592692042.issue45582@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset ccb73a0d50dd03bc8455fe210cb83e41a6dc91d8 by Christian Heimes in branch 'main':
bpo-45582: Fix out-of-tree build issues with new getpath (GH-29902)
https://github.com/python/cpython/commit/ccb73a0d50dd03bc8455fe210cb83e41a6dc91d8


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Fri Dec  3 08:47:51 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 03 Dec 2021 13:47:51 +0000
Subject: [issue45962] Clarify that PyModule_AddString{Constant,
 Macro} use utf-8
In-Reply-To: <1638436517.15.0.508323988448.issue45962@roundup.psfhosted.org>
Message-ID: <1638539271.03.0.0876888489143.issue45962@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45962>
_______________________________________

From report at bugs.python.org  Fri Dec  3 08:48:21 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 03 Dec 2021 13:48:21 +0000
Subject: [issue45964] 3.10.0 tests fail in
 test_pdb_breakpoints_preserved_across_interactive_sessions
In-Reply-To: <1638453038.24.0.528506960629.issue45964@roundup.psfhosted.org>
Message-ID: <1638539301.91.0.0287966742632.issue45964@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45964>
_______________________________________

From report at bugs.python.org  Fri Dec  3 09:02:29 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 14:02:29 +0000
Subject: [issue45964] gdb test fails when packaging Python 3.10 for
 openSUSE/Linux
In-Reply-To: <1638453038.24.0.528506960629.issue45964@roundup.psfhosted.org>
Message-ID: <1638540149.29.0.468554537847.issue45964@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
title: 3.10.0 tests fail in test_pdb_breakpoints_preserved_across_interactive_sessions -> gdb test fails when packaging Python 3.10 for openSUSE/Linux

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45964>
_______________________________________

From report at bugs.python.org  Fri Dec  3 09:01:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 14:01:20 +0000
Subject: [issue45964] 3.10.0 tests fail in
 test_pdb_breakpoints_preserved_across_interactive_sessions
In-Reply-To: <1638453038.24.0.528506960629.issue45964@roundup.psfhosted.org>
Message-ID: <1638540080.18.0.0481278797355.issue45964@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

> Happens when packaging Python 3.10 for openSUSE/Linux.

Can you give full details of what you're doing?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45964>
_______________________________________

From report at bugs.python.org  Fri Dec  3 09:04:56 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 14:04:56 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1638540296.54.0.510509029289.issue45635@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +patch
pull_requests: +28129
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29905

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Fri Dec  3 09:10:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 14:10:48 +0000
Subject: [issue20741] Documentation archives should be available also in
 tar.xz format
In-Reply-To: <1393142720.31.0.255845110134.issue20741@psf.upfronthosting.co.za>
Message-ID: <1638540648.88.0.653736633796.issue20741@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Those archives seem to go only up to 3.9. Is this still relevant?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20741>
_______________________________________

From report at bugs.python.org  Fri Dec  3 09:11:14 2021
From: report at bugs.python.org (Daniel)
Date: Fri, 03 Dec 2021 14:11:14 +0000
Subject: [issue45973] Not possible to clear PyImport_Inittab after
 PyImport_AppendInittab
Message-ID: <1638540674.64.0.96956184479.issue45973@roundup.psfhosted.org>


New submission from Daniel <danielfa at fixedit.ai>:

Hello,

When embedding Python into a C application and not using Py_RunMain it is not possible to remove a module added to PyImport_Inittab even if the interpreter is finalized and a new is created.

One reason for not using Py_RunMain is to use python as a subprocessor to my primary C application by initializing an interpreter, run some python code, then go back to execute some C code and again execute some python code in the same interpreter. After a while I might want to finalize the interpreter and create a new one without the module added to inittab, still being in the same process.

See example:

#include <Python.h>


/*
 * Create a python interpreter, run a command and delete the interpreter
 */
void run_in_new_interpreter(char *cmd) {
    Py_Initialize();

    PyRun_SimpleString(cmd);

    if (Py_FinalizeEx() < 0) {
        exit(120);
    }
}

/*
 * Create a module "my_spam" but do not append it to inittab
 */
static PyModuleDef EmbModule = {
      PyModuleDef_HEAD_INIT, "my_spam", NULL, -1,
      NULL,
      NULL, NULL, NULL, NULL
};

static PyObject* PyInit_emb(void) {
    return PyModule_Create(&EmbModule);
}

/*
 * Main program
 */
char *LIST_MODULES_CMD="try:\n import my_spam; print('SPAM!');\nexcept:\n print('no mod my_spam')";

int main(int argc, char *argv[]) {
    // Run with no "my_spam" module
    run_in_new_interpreter(LIST_MODULES_CMD);

    // Run with "my_spam" module
    PyImport_AppendInittab("my_spam", &PyInit_emb);
    run_in_new_interpreter(LIST_MODULES_CMD);

    // How to run without my_spam? The module is still in the PyImport_Inittab
    // despite the Py_FinalizeEx() call. This list is not reset until
    // _PyImport_Fini2() is called, but that is never exposed in anyi public header,
    // only in Include/internal/pycore_pylifecycle.h
    run_in_new_interpreter(LIST_MODULES_CMD);
    return 0;
}



The output of the program is:

>>> gcc test_embed.c `pkg-config --cflags --libs python-3.6` && ./a.out
no mod my_spam
SPAM!
SPAM!

----------
components: C API
messages: 407590
nosy: daniel-falk
priority: normal
severity: normal
status: open
title: Not possible to clear PyImport_Inittab after PyImport_AppendInittab
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45973>
_______________________________________

From report at bugs.python.org  Fri Dec  3 09:16:17 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 03 Dec 2021 14:16:17 +0000
Subject: [issue45695] Out-of-tree builds are not tested.
In-Reply-To: <1635895785.09.0.174517598815.issue45695@roundup.psfhosted.org>
Message-ID: <1638540977.81.0.715282907627.issue45695@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Good news: I got a test case for OOT build with read-only sources

Bad news: 15 test cases are failing and testing takes much longer because pyc files are missing.

15 re-run tests:
    test__xxsubinterpreters test_ast test_bdb test_capi test_doctest
    test_import test_importlib test_interpreters test_pickle
    test_pydoc test_runpy test_support test_threading test_trace
    test_unicodedata

We have to live with read-only OOT builds and writable tests for now.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45695>
_______________________________________

From report at bugs.python.org  Fri Dec  3 09:18:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 14:18:05 +0000
Subject: [issue20751] Misleading descriptor protocol documentation: direct
 call, super binding
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638541085.52.0.281005682453.issue20751@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Fri Dec  3 10:01:19 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 03 Dec 2021 15:01:19 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638543679.59.0.150124174704.issue45950@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 84ca1232b0f1e4be368e89550a9ceb46f64a0eff by Christian Heimes in branch 'main':
bpo-45950: Introduce Bootstrap Python again (#29859)
https://github.com/python/cpython/commit/84ca1232b0f1e4be368e89550a9ceb46f64a0eff


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Fri Dec  3 10:37:53 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 03 Dec 2021 15:37:53 +0000
Subject: [issue45964] gdb test fails when packaging Python 3.10 for
 openSUSE/Linux
In-Reply-To: <1638453038.24.0.528506960629.issue45964@roundup.psfhosted.org>
Message-ID: <1638545873.83.0.440322373012.issue45964@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

This looks like a problem on your side. Line 94 is the correct line for the function in 3.10.0 release.

$ git checkout v3.10.0
$ sed -n '94p' Lib/pdb.py 
def find_function(funcname, filename):

Matej, does your build system perhaps strip off the shebang of Lib/pdb.py? That would explain why you are getting the function on line 93.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45964>
_______________________________________

From report at bugs.python.org  Fri Dec  3 11:17:57 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 03 Dec 2021 16:17:57 +0000
Subject: [issue20751] Misleading descriptor protocol documentation: direct
 call, super binding
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638548277.46.0.308903613083.issue20751@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
assignee: docs at python -> rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Fri Dec  3 11:19:24 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 03 Dec 2021 16:19:24 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638548364.79.0.694682475856.issue20751@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
title: Misleading descriptor protocol documentation: direct call, super binding -> Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Fri Dec  3 12:16:24 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 17:16:24 +0000
Subject: [issue27582] Mispositioned SyntaxError caret for unknown code points
In-Reply-To: <1469102054.52.0.839726574023.issue27582@psf.upfronthosting.co.za>
Message-ID: <1638551784.5.0.272773008236.issue27582@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: needs patch -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27582>
_______________________________________

From report at bugs.python.org  Fri Dec  3 12:18:40 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 03 Dec 2021 17:18:40 +0000
Subject: [issue45695] Out-of-tree builds are not tested.
In-Reply-To: <1635895785.09.0.174517598815.issue45695@roundup.psfhosted.org>
Message-ID: <1638551920.78.0.281594822603.issue45695@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:

Nice trick with that RO bind mount.  tests... yes we do have some writable source tree messes in there to be dealt with.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45695>
_______________________________________

From report at bugs.python.org  Fri Dec  3 13:09:57 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Fri, 03 Dec 2021 18:09:57 +0000
Subject: [issue45695] Out-of-tree builds are not tested.
In-Reply-To: <1635895785.09.0.174517598815.issue45695@roundup.psfhosted.org>
Message-ID: <1638554997.59.0.587818059605.issue45695@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

FWIW, it is also impossible to build the docs OOT without cluttering the source tree.

    $ cd ../build
    $ make -C ../cpython.git/Doc venv
    $ make -C ../cpython.git/Doc html  # <= modifies Doc/build in the source tree

----------
nosy: +erlendaasland

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45695>
_______________________________________

From report at bugs.python.org  Fri Dec  3 13:48:31 2021
From: report at bugs.python.org (Ned Deily)
Date: Fri, 03 Dec 2021 18:48:31 +0000
Subject: [issue45967] Tkinter.ttk.Treeview does not clear after opening and
 reopening another using same code block
In-Reply-To: <1638478712.78.0.334069010053.issue45967@roundup.psfhosted.org>
Message-ID: <1638557311.13.0.881675903736.issue45967@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45967>
_______________________________________

From report at bugs.python.org  Fri Dec  3 13:51:37 2021
From: report at bugs.python.org (Harold Meneley)
Date: Fri, 03 Dec 2021 18:51:37 +0000
Subject: [issue45967] Tkinter.ttk.Treeview does not clear after opening and
 reopening another using same code block
In-Reply-To: <1638557311.19.0.0926048909987.issue45967@roundup.psfhosted.org>
Message-ID: <CAPPnVKRBtZkX89Nk1zs6e0ku3xO=1ZECwjDsoEE5Nf7ChVN8Og@mail.gmail.com>


Harold Meneley <hmeneley at gmail.com> added the comment:

Some times , I forget the program languages differences. Sorry. Thanks for
your time. Harold

On Fri, Dec 3, 2021, 12:48 PM Ned Deily <report at bugs.python.org> wrote:

>
> Change by Ned Deily <nad at python.org>:
>
>
> ----------
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue45967>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45967>
_______________________________________

From report at bugs.python.org  Fri Dec  3 14:05:23 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 19:05:23 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1638558323.64.0.863824772999.issue45711@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 2ff758bd1a144ee712e96ae1db91f476c3b252bb by Irit Katriel in branch 'main':
bpo-45711: [asyncio] Normalize exceptions immediately after Fetch, before they are stored as StackItem, which should be normalized (GH-29890)
https://github.com/python/cpython/commit/2ff758bd1a144ee712e96ae1db91f476c3b252bb


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Fri Dec  3 14:34:10 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 03 Dec 2021 19:34:10 +0000
Subject: [issue45960] bullseye arm/v7 time.time() Operation not permitted
In-Reply-To: <1638434541.68.0.574461669418.issue45960@roundup.psfhosted.org>
Message-ID: <1638560050.98.0.0830255610879.issue45960@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

time.time() is a wrapper for libc function call clock_gettime() with CLOCK_REALTIME. This is either a problem with the container build or a Kernel ABI issue between the container build and your operating system.

I suggest that you report the issue to https://github.com/docker-library/python . The Dockerhub Python image is not maintained by us.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45960>
_______________________________________

From report at bugs.python.org  Fri Dec  3 14:47:48 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 19:47:48 +0000
Subject: [issue45816] Python does not support standalone MSVC v143 (VS 2022)
 Build Tools
In-Reply-To: <1637073304.41.0.776528442295.issue45816@roundup.psfhosted.org>
Message-ID: <1638560868.58.0.0575978616765.issue45816@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset d9301703fb1086cafbd730c17e3d450a192485d6 by Crowthebird in branch 'main':
bpo-45816: Support building with VS 2022 (v143 toolset) on Windows (GH-29577)
https://github.com/python/cpython/commit/d9301703fb1086cafbd730c17e3d450a192485d6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45816>
_______________________________________

From report at bugs.python.org  Fri Dec  3 14:48:45 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 19:48:45 +0000
Subject: [issue45816] Python does not support standalone MSVC v143 (VS 2022)
 Build Tools
In-Reply-To: <1637073304.41.0.776528442295.issue45816@roundup.psfhosted.org>
Message-ID: <1638560925.04.0.302231341569.issue45816@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45816>
_______________________________________

From report at bugs.python.org  Fri Dec  3 14:50:26 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 19:50:26 +0000
Subject: [issue44530] Propagate qualname from the compiler unit to code
 objects for finer grained profiling data
In-Reply-To: <1624919733.39.0.974767657181.issue44530@roundup.psfhosted.org>
Message-ID: <1638561026.04.0.661895463419.issue44530@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44530>
_______________________________________

From report at bugs.python.org  Fri Dec  3 14:52:45 2021
From: report at bugs.python.org (Ben Darnell)
Date: Fri, 03 Dec 2021 19:52:45 +0000
Subject: [issue39529] Deprecate get_event_loop()
In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org>
Message-ID: <1638561165.58.0.836768924173.issue39529@roundup.psfhosted.org>


Ben Darnell <ben.darnell at gmail.com> added the comment:

> In IPython, I think you could use new_event_loop() for getting a new loop instance.
> Then, save the loop reference somewhere as a direct attribute, threading.local or ContextVar.
> Calling loop.run_until_complete() looks pretty normal in your situation.

That works if you're a leaf in the dependency tree, but what about a library like Tornado (which IPython depends on)? If intermediate libraries (say Tornado and Twisted) introduce their own thread-local loops for backwards compatibility of their existing interfaces, the ecosystem gets fragmented again. Having the thread-local live in asyncio is useful for seamless interoperability across frameworks. 

> asyncio.run() is entirely self-reliant in that it creates all needed resources at the start and closes them in finalization, rather than depending on existing resources. I believe this to be significantly safer and better guaranteed to function as intended, although perhaps at some cost to convenience in cases like your own where there only needs to be one event loop.

Whether or not this is more likely to function as intended depends on assumptions about user expectations. In Tornado (and other async systems I have used in the past), it is the norm to set up handlers on an event loop while it is not running and then start it afterwards. The behavior of asyncio.run is surprising to me. Maybe I'm weird, but regardless of which behavior is surprising to the fewest people, my point is that this change is very disruptive to Tornado and most applications using it, contrary to the claim that the maintenance burden should be pretty low.

I realize it may be too late to change course, but my preference would have been to resolve the conflict between get_event_loop and asyncio.run by making asyncio.run essentially an alias for asyncio.get_event_loop().run_until_complete. This would relax the isolation of asyncio.run, but that doesn't seem very important to me. The comparable idioms in Tornado (using the IOLoop.run_sync method) all work this way and I've never seen any confusion related to this or a situation in which creating a brand-new event loop in run_sync would be desirable.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39529>
_______________________________________

From report at bugs.python.org  Fri Dec  3 15:27:52 2021
From: report at bugs.python.org (neonene)
Date: Fri, 03 Dec 2021 20:27:52 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638563272.29.0.800472579265.issue45582@roundup.psfhosted.org>


Change by neonene <nicesalmon at gmail.com>:


----------
nosy: +neonene
nosy_count: 6.0 -> 7.0
pull_requests: +28130
pull_request: https://github.com/python/cpython/pull/29906

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Fri Dec  3 16:02:37 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 21:02:37 +0000
Subject: [issue35419] Thread.is_alive while running Process.is_alive causes
 either premature termination or never-terminating.
In-Reply-To: <1544014510.18.0.788709270274.issue35419@psf.upfronthosting.co.za>
Message-ID: <1638565357.16.0.299594696585.issue35419@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Use this queue for multithreaded applications: https://docs.python.org/3/library/queue.html


Mixing multiprocessing with multithreading often doesn't work.

----------
nosy: +iritkatriel
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35419>
_______________________________________

From report at bugs.python.org  Fri Dec  3 16:04:14 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 21:04:14 +0000
Subject: [issue45877] Inconsistency in minimal supported version of Microsoft
 Visual Studio
In-Reply-To: <1637658070.78.0.512777632516.issue45877@roundup.psfhosted.org>
Message-ID: <1638565454.48.0.0940111541913.issue45877@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

It probably all needs straightening out:

* Microsoft Visual Studio 2015 *or later* can be used to build the project files
* Microsoft Visual C++ 14.3 is what we use to build the official releases for the main branch (3.11)
* earlier branches may still be using prior compiler versions for the official releases

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45877>
_______________________________________

From report at bugs.python.org  Fri Dec  3 16:16:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 21:16:31 +0000
Subject: [issue31735] Documentation incorrectly states how descriptors are
 invoked
In-Reply-To: <1507561484.86.0.213398074469.issue31735@psf.upfronthosting.co.za>
Message-ID: <1638566191.02.0.511464530013.issue31735@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

See also Issue20751

----------
nosy: +iritkatriel, rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31735>
_______________________________________

From report at bugs.python.org  Fri Dec  3 16:27:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 21:27:55 +0000
Subject: [issue12384] difflib.SequenceMatcher and Match: code and doc bugs
In-Reply-To: <1308686441.84.0.396418173173.issue12384@psf.upfronthosting.co.za>
Message-ID: <1638566875.64.0.531724255462.issue12384@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12384>
_______________________________________

From report at bugs.python.org  Fri Dec  3 16:35:04 2021
From: report at bugs.python.org (neonene)
Date: Fri, 03 Dec 2021 21:35:04 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638567304.14.0.693448026756.issue45582@roundup.psfhosted.org>


neonene <nicesalmon at gmail.com> added the comment:

PGO-instrumented binary seems not to specify the stdlib directory on PR29041. I can run it with PYTHONPATH set.


Python path configuration:
  PYTHONHOME = 'C:\Py311\'
  PYTHONPATH = (not set)
  program name = 'C:\Py311\PCbuild\amd64\instrumented\python.exe'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  is in build tree = 1
  stdlib dir = 'C:\Py311\PCbuild\Lib'
  sys._base_executable = 'C:\\py311\\PCbuild\\amd64\\instrumented\\python.exe'
  sys.base_prefix = 'C:\\py311\\'
  sys.base_exec_prefix = 'C:\\py311\\'
  sys.platlibdir = 'DLLs'
  sys.executable = 'C:\\py311\\PCbuild\\amd64\\instrumented\\python.exe'
  sys.prefix = 'C:\\py311\\'
  sys.exec_prefix = 'C:\\py311\\'
  sys.path = [
    'C:\\py311\\PCbuild\\amd64\\instrumented\\python311.zip',
    'C:\\py311\\PCbuild\\Lib',
    'C:\\py311\\PCbuild\\amd64\\instrumented',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Fri Dec  3 16:44:28 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 03 Dec 2021 21:44:28 +0000
Subject: [issue31735] Documentation incorrectly states how descriptors are
 invoked
In-Reply-To: <1507561484.86.0.213398074469.issue31735@psf.upfronthosting.co.za>
Message-ID: <1638567868.53.0.895345866992.issue31735@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
assignee: docs at python -> rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31735>
_______________________________________

From report at bugs.python.org  Fri Dec  3 16:46:26 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 21:46:26 +0000
Subject: [issue31735] Documentation incorrectly states how descriptors are
 invoked
In-Reply-To: <1507561484.86.0.213398074469.issue31735@psf.upfronthosting.co.za>
Message-ID: <1638567986.34.0.0238211783639.issue31735@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
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 <report at bugs.python.org>
<https://bugs.python.org/issue31735>
_______________________________________

From report at bugs.python.org  Fri Dec  3 16:48:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 21:48:31 +0000
Subject: [issue23317] Incorrect description of descriptor invocation in Python
 Language Reference
In-Reply-To: <1422206163.24.0.274216799196.issue23317@psf.upfronthosting.co.za>
Message-ID: <1638568111.79.0.922710544583.issue23317@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

See also issue20751.

----------
nosy: +iritkatriel, rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23317>
_______________________________________

From report at bugs.python.org  Fri Dec  3 16:49:26 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 21:49:26 +0000
Subject: [issue31441] Descriptor example in documentation is confusing,
 possibly wrong
In-Reply-To: <1505291907.9.0.809761592922.issue31441@psf.upfronthosting.co.za>
Message-ID: <1638568166.11.0.22459323258.issue31441@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

see also issue20751.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31441>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:01:23 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 22:01:23 +0000
Subject: [issue45607] Make it possible to enrich an exception's error message
In-Reply-To: <1635194281.32.0.0583100270803.issue45607@roundup.psfhosted.org>
Message-ID: <1638568883.78.0.111505673312.issue45607@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 5bb7ef2768be5979b306e4c7552862b1746c251d by Irit Katriel in branch 'main':
bpo-45607: Make it possible to enrich exception displays via setting their __note__ field (GH-29880)
https://github.com/python/cpython/commit/5bb7ef2768be5979b306e4c7552862b1746c251d


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45607>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:02:13 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 22:02:13 +0000
Subject: [issue45607] Make it possible to enrich an exception's error message
In-Reply-To: <1635194281.32.0.0583100270803.issue45607@roundup.psfhosted.org>
Message-ID: <1638568933.82.0.622047371212.issue45607@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45607>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:02:59 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 22:02:59 +0000
Subject: [issue28953] Use `raise from` when raising new IncompleteRead
In-Reply-To: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za>
Message-ID: <1638568979.29.0.269673554044.issue28953@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I just pushed a new feature which may provide a simpler way to do this: https://bugs.python.org/issue45607

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28953>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:04:21 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 22:04:21 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638569061.12.0.568091980974.issue45582@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset 7d7c91a8e8c0bb04105a21a17d1061ffc1c04d80 by neonene in branch 'main':
bpo-45582: Add a NOT operator to the condition in getpath_isxfile (GH-29906)
https://github.com/python/cpython/commit/7d7c91a8e8c0bb04105a21a17d1061ffc1c04d80


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:07:41 2021
From: report at bugs.python.org (Fatih Kilic)
Date: Fri, 03 Dec 2021 22:07:41 +0000
Subject: [issue45974] Using walrus produces different/unoptimized bytecode
Message-ID: <1638569261.56.0.379053627232.issue45974@roundup.psfhosted.org>


New submission from Fatih Kilic <me at fklc.dev>:

So, what I mean by unoptimized bytecode is, for example when you type `a = 10 * 10`, the resulting bytecode is the following: 
```
LOAD_CONST 0 (100)
STORE_NAME 0 (a)
...
```

However, when you type, `(a := 10 * 10) == None`, the resulting bytecode is the following:
```
LOAD_CONST 0 (10)
LOAD_CONST 0 (10)
BINARY_MULTIPLY
DUP_TOP
STORE_NAME 0 (a)
...
```

I don't know if this is intentional, but shouldn't the resulting bytecode be the following:
```
LOAD_CONST 0 (100)
DUP_TOP
STORE_NAME 0 (a)
...
```

----------
components: Parser
messages: 407610
nosy: FKLC, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Using walrus produces different/unoptimized bytecode
type: behavior
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45974>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:25:53 2021
From: report at bugs.python.org (Batuhan Taskaya)
Date: Fri, 03 Dec 2021 22:25:53 +0000
Subject: [issue45974] Using walrus produces different/unoptimized bytecode
In-Reply-To: <1638569261.56.0.379053627232.issue45974@roundup.psfhosted.org>
Message-ID: <1638570353.09.0.244826062958.issue45974@roundup.psfhosted.org>


Batuhan Taskaya <isidentical at gmail.com> added the comment:

See: https://bugs.python.org/issue42282 
and the reason for not backporting this: https://bugs.python.org/issue42282#msg380506

----------
components: +Interpreter Core -Parser
nosy: +BTaskaya
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
type: behavior -> performance
versions:  -Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45974>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:34:23 2021
From: report at bugs.python.org (Fatih Kilic)
Date: Fri, 03 Dec 2021 22:34:23 +0000
Subject: [issue45974] Using walrus produces different/unoptimized bytecode
In-Reply-To: <1638569261.56.0.379053627232.issue45974@roundup.psfhosted.org>
Message-ID: <1638570863.14.0.205066520034.issue45974@roundup.psfhosted.org>


Fatih Kilic <me at fklc.dev> added the comment:

Ah, I see. Thanks!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45974>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:48:54 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 22:48:54 +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: <1638571734.57.0.733965329262.issue44844@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
pull_requests:  -27916

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44844>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:56:53 2021
From: report at bugs.python.org (Benjamin Peterson)
Date: Fri, 03 Dec 2021 22:56:53 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638572213.59.0.412150141095.issue45582@roundup.psfhosted.org>


Change by Benjamin Peterson <benjamin at python.org>:


----------
nosy: +benjamin.peterson
nosy_count: 7.0 -> 8.0
pull_requests: +28131
pull_request: https://github.com/python/cpython/pull/29907

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Fri Dec  3 17:58:42 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 03 Dec 2021 22:58:42 +0000
Subject: [issue31441] Descriptor example in documentation is confusing,
 possibly wrong
In-Reply-To: <1505291907.9.0.809761592922.issue31441@psf.upfronthosting.co.za>
Message-ID: <1638572322.63.0.140957306596.issue31441@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

This example was removed and replaced with better examples.

----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31441>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:08:46 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 23:08:46 +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: <1638572926.2.0.592204101992.issue44844@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
pull_requests: +28132
pull_request: https://github.com/python/cpython/pull/29908

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44844>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:10:09 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 03 Dec 2021 23:10:09 +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: <1638573009.36.0.540080208235.issue44844@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

@Ray I posted a PR that works fine on Windows, would you be able to try it on Linux? The executables seem to have different names, so I'm a little concerned about the change, but I think it should be alright.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44844>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:10:41 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 23:10:41 +0000
Subject: [issue33909] PyObject_CallFinalizerFromDealloc is not referenced in
 any documentation
In-Reply-To: <1529483004.36.0.56676864532.issue33909@psf.upfronthosting.co.za>
Message-ID: <1638573041.8.0.0419700626012.issue33909@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +pitrou
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33909>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:15:50 2021
From: report at bugs.python.org (Nick Drozd)
Date: Fri, 03 Dec 2021 23:15:50 +0000
Subject: [issue45975] Simplify some while-loops with walrus operator
Message-ID: <1638573350.23.0.80297686747.issue45975@roundup.psfhosted.org>


New submission from Nick Drozd <nicholasdrozd at gmail.com>:

The following pattern occurs a few times in the codebase:

  while 1:
      data = conn.recv(blocksize)
      if not data:
          break
      ...

There is an unbounded while loop in which some kind of input is read. If the input is there, it is processed and the loop is continued; otherwise the loop is broken.

This can be expressed more cleanly with the walrus operator:

  while data := conn.recv(blocksize):
     ...

Some of this code goes back to the days of Python 1. I assume that the original authors would have used the walrus idiom if it had been available, which it wasn't. But now it is.

Rewriting the instances of this pattern shaves off 148 lines from the codebase. Removing the manual break statements makes the logic more straightforward.

This should not change the behavior of anything. I'm assuming that this code is all under test and that any deviations from the existing behavior will be caught. Anything that isn't tested shouldn't be changed (and should be tested).

----------
components: Library (Lib)
messages: 407615
nosy: nickdrozd
priority: normal
pull_requests: 28133
severity: normal
status: open
title: Simplify some while-loops with walrus operator
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45975>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:22:05 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 03 Dec 2021 23:22:05 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638573725.05.0.566370306635.issue45582@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 0ae4e0c959bbc90ec18180ef3cc957759d346ced by Benjamin Peterson in branch 'main':
bpo-45582 Fix prototype of _Py_Get_Getpath_CodeObject. (GH-29907)
https://github.com/python/cpython/commit/0ae4e0c959bbc90ec18180ef3cc957759d346ced


----------
nosy: +miss-islington

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:23:09 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 23:23:09 +0000
Subject: [issue26160] [doc] Tutorial incorrectly claims that (explicit)
 relative imports don't work in the main module
In-Reply-To: <1453273352.49.0.425335373136.issue26160@psf.upfronthosting.co.za>
Message-ID: <1638573789.61.0.423964868534.issue26160@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
title: Tutorial incorrectly claims that (explicit) relative imports don't work in the main module -> [doc] Tutorial incorrectly claims that (explicit) relative imports don't work in the main module
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26160>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:39:41 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 03 Dec 2021 23:39:41 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638574781.2.0.22898103265.issue20751@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Regarding comment #1, The wording is correct and there was a reason for using a method.  While super() can be used for attribute lookup, use cases are almost entirely dominated by method lookups.  For many users, an attribute lookup with super() is unconventional, weird, hard to grok, awkward to demonstrate, and not well motivated by the way super() is actually used.

    ##############################################################
    # Demonstration code for the example in text

    class A:
        def m(self):
            return 42

    class B(A):
        def m(obj):
            return super(B, obj).m()

    >>> b = B()
    >>> b.m()                             # Normal invocation 
    42
    >>> A.__dict__['m'].__get__(b, B)()   # Equivalent call
    42

That said, I will switch it to an attribute lookup for consistency with the other examples in the section and with the current version of the DescriptorHowto.


Regarding comment #2, the objtype argument is optional as shown in all of the examples.  The call from object.__getattribute__() always passes in both parameters, even though only the first is required.
  
    ################################################################
    # Demonstration of __get__() being called with one or two params

    class A:
        def __init__(self, x):
            self.x = x
        def m(self, y):
            return self.x * y

    >>> a = A(10)
    >>> a.m(5)
    50
    >>> vars(A)['m'].__get__(a)(5)     # objtype is not required
    50
    >>> vars(A)['m'].__get__(a, A)(5)  # objtype may be used
    50


    ################################################################
    # Demonstration of object.__getattribute__ supplying both args

    class Desc:
        def __get__(self, *args):
            return args
      
    class B:
        z = Desc()
     
    >>> b = B()
    >>> b.z
    (<__main__.B object at 0x109156110>, <class '__main__.B'>)

----------
resolution:  -> not a bug

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:42:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 03 Dec 2021 23:42:33 +0000
Subject: [issue9544] [doc] xdrlib.Packer().pack_fstring throws a TypeError
 when called with a str()
In-Reply-To: <1281333086.43.0.820305754452.issue9544@psf.upfronthosting.co.za>
Message-ID: <1638574953.02.0.805658897266.issue9544@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
title: xdrlib.Packer().pack_fstring throws a TypeError when called with a str() -> [doc] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9544>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:44:33 2021
From: report at bugs.python.org (Ammar Askar)
Date: Fri, 03 Dec 2021 23:44:33 +0000
Subject: [issue24709] Unix build uses '-Wno-unused-result',
 which icc doesn't recognize
In-Reply-To: <1437767034.87.0.232698584454.issue24709@psf.upfronthosting.co.za>
Message-ID: <1638575073.23.0.28697034034.issue24709@roundup.psfhosted.org>


Ammar Askar <ammar at ammaraskar.com> added the comment:

Looks like the latest versions of icc support this flag: https://www.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/compiler-options/compiler-option-details/compiler-diagnostic-options/wunused-variable.html

Closing as outdated.

----------
nosy: +ammar2
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24709>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:45:56 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Fri, 03 Dec 2021 23:45:56 +0000
Subject: [issue45885] Specialize COMPARE_OP
In-Reply-To: <1637701224.16.0.881347004039.issue45885@roundup.psfhosted.org>
Message-ID: <1638575156.15.0.286436101963.issue45885@roundup.psfhosted.org>


Change by Dennis Sweeney <sweeney.dennis650 at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45885>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:46:36 2021
From: report at bugs.python.org (Zachary Ware)
Date: Fri, 03 Dec 2021 23:46:36 +0000
Subject: [issue45975] Simplify some while-loops with walrus operator
In-Reply-To: <1638573350.23.0.80297686747.issue45975@roundup.psfhosted.org>
Message-ID: <1638575196.83.0.889786918425.issue45975@roundup.psfhosted.org>


Zachary Ware <zachary.ware at gmail.com> added the comment:

As a general rule, refactorings like this tend to be rejected as the risk of inadvertently adding a new bug outweighs the benefit of subjectively cleaner code ("if it ain't broke, don't fix it!").

Is there any measurable performance benefit from this? Reducing several hundred thousand lines of code by 148 is not a compelling benefit :)

----------
nosy: +zach.ware

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45975>
_______________________________________

From report at bugs.python.org  Fri Dec  3 18:47:23 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 03 Dec 2021 23:47:23 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638575243.1.0.287884879761.issue20751@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
keywords: +patch
pull_requests: +28134
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29909

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Fri Dec  3 19:12:50 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 04 Dec 2021 00:12:50 +0000
Subject: [issue20907] behavioral differences between shutil.unpack_archive and
 ZipFile.extractall
In-Reply-To: <1394703965.34.0.603199781912.issue20907@psf.upfronthosting.co.za>
Message-ID: <1638576770.39.0.78528655432.issue20907@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
nosy: +andrei.avk
nosy_count: 6.0 -> 7.0
pull_requests: +28135
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29910

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20907>
_______________________________________

From report at bugs.python.org  Fri Dec  3 19:29:55 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 04 Dec 2021 00:29:55 +0000
Subject: [issue20907] behavioral differences between shutil.unpack_archive and
 ZipFile.extractall
In-Reply-To: <1394703965.34.0.603199781912.issue20907@psf.upfronthosting.co.za>
Message-ID: <1638577795.24.0.847777515278.issue20907@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

I think it may be good enough to add a warning on skipped files in _unpack_zipfile().

 - this way we keep backwards compatibility (especially since behavior in both modules differed for such a long time.)

 - it's not clear that ZipFile behavior is superior -- for example, what if a file with stripped path components overwrites existing files?

 - if requested in the future, a parameter can be added to enable ZipFile-like behavior

 - it can be very confusing if files are silently skipped, especially if an archive has thousands of files. 

I've added a PR, note that the test in PR also tests that files with '..' are indeed skipped, we don't have a test for that now, so that's an added benefit.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20907>
_______________________________________

From report at bugs.python.org  Fri Dec  3 19:38:54 2021
From: report at bugs.python.org (Ammar Askar)
Date: Sat, 04 Dec 2021 00:38:54 +0000
Subject: [issue27831] Python 3.4.5 leaks memory when attempting to load
 non-existent file
In-Reply-To: <1471917436.63.0.291205173926.issue27831@psf.upfronthosting.co.za>
Message-ID: <1638578334.43.0.827231208685.issue27831@roundup.psfhosted.org>


Ammar Askar <ammar at ammaraskar.com> added the comment:

Looks like this got fixed somewhere along between 3.5 and 3.6


---
3.5
---

./python: can't open file 'id:000109': [Errno 2] No such file or directory

=================================================================
==28078==ERROR: LeakSanitizer: detected memory leak



---
3.6
---

./python id:000109     
./python: can't open file 'id:000109': [Errno 2] No such file or directory


Closing as 3.5 is no longer a supported version.

----------
nosy: +ammar2
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27831>
_______________________________________

From report at bugs.python.org  Fri Dec  3 20:34:53 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 04 Dec 2021 01:34:53 +0000
Subject: [issue20907] behavioral differences between shutil.unpack_archive and
 ZipFile.extractall
In-Reply-To: <1394703965.34.0.603199781912.issue20907@psf.upfronthosting.co.za>
Message-ID: <1638581693.42.0.576612369893.issue20907@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

I forgot to add this:

 - we may not want to follow the behavior of command line unzip - it's interactive so considerations are somewhat different. For example, it will warn if file is being overwritten and show a prompt on whether to skip, overwrite, abort, etc.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20907>
_______________________________________

From report at bugs.python.org  Fri Dec  3 20:44:12 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 01:44:12 +0000
Subject: [issue31735] Documentation incorrectly states how descriptors are
 invoked
In-Reply-To: <1507561484.86.0.213398074469.issue31735@psf.upfronthosting.co.za>
Message-ID: <1638582252.44.0.0747756989777.issue31735@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> it should have
>
> d.__get__(obj, type(obj)) instead of d.__get__(obj)


The objtype argument is optional as shown in all of the examples.  The call from object.__getattribute__() always passes in both parameters, even though only the first is required.
  
    ################################################################
    # Demonstration of __get__() being called with one or two params

    class A:
        def __init__(self, x):
            self.x = x
        def m(self, y):
            return self.x * y

    >>> a = A(10)
    >>> a.m(5)
    50
    >>> vars(A)['m'].__get__(a)(5)     # objtype is not required
    50
    >>> vars(A)['m'].__get__(a, A)(5)  # objtype may be used
    50


    ################################################################
    # Demonstration of object.__getattribute__ supplying both args

    class Desc:
        def __get__(self, *args):
            return args
      
    class B:
        z = Desc()
     
    >>> b = B()
    >>> b.z
    (<__main__.B object at 0x109156110>, <class '__main__.B'>)

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31735>
_______________________________________

From report at bugs.python.org  Fri Dec  3 20:54:16 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 01:54:16 +0000
Subject: [issue23317] Incorrect description of descriptor invocation in Python
 Language Reference
In-Reply-To: <1422206163.24.0.274216799196.issue23317@psf.upfronthosting.co.za>
Message-ID: <1638582856.74.0.751969489503.issue23317@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I think we can leave this as-is.  It does a reasonable job of communicating where the descriptor is found and the arguments used when it is called.

Marking this as out of date because later in the howto guide there is a precise pure python equivalent for the lookup and invocation steps.

----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23317>
_______________________________________

From report at bugs.python.org  Fri Dec  3 21:20:56 2021
From: report at bugs.python.org (Andrew Lin)
Date: Sat, 04 Dec 2021 02:20:56 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
Message-ID: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>


New submission from Andrew Lin <onethreeseven at gmail.com>:

This PR obtains a performance improvement in the random module by removing a cached attribute lookup in Random._randbelow_with_getrandbits() that costs time on average.  In the best cases (on my machine) I get 10% improvement for randrange(), 7% for shuffle(), and 11% for sample(), with no change in the worst cases.

To elaborate...  If n is slightly less than a power of 2, _randbelow_with_getrandbits(n) almost always makes just one call to getrandbits(), so caching the attribute lookup never pays for itself.  Even in the worst case, when n is exactly a power of 2, the expected number of calls to getrandbits() is still only 2, and on my machine caching just breaks even.  (A friend ran it on ARM and got even more favorable results.)

I included a similar change to _randbelow_without_getrandbits() on similar grounds, although I didn't benchmark it.

(Brand new here; let me know if I've left anything out!)

----------
components: Library (Lib)
messages: 407625
nosy: onethreeseven
priority: normal
severity: normal
status: open
title: Random._randbelow() loses time by caching an attribute lookup
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Fri Dec  3 21:22:38 2021
From: report at bugs.python.org (Roundup Robot)
Date: Sat, 04 Dec 2021 02:22:38 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638584558.93.0.0923656640553.issue45976@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +28136
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29911

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Fri Dec  3 21:32:54 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 02:32:54 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638585174.49.0.995472206746.issue45976@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Thanks for the suggestion.  I'll try this out on various builds and machines to see how it works out.  The speed of locals is consistently fast, but the speed of method calls has varied over the last few versions of Python (generally getting faster).  When this code was first written, it was benchmarked and localizing was a net win.

----------
assignee:  -> rhettinger
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Fri Dec  3 21:37:15 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 02:37:15 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638585435.21.0.309990321684.issue20751@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:


New changeset 135ecc3492cee259090fd4aaed9056c130cd2eba by Raymond Hettinger in branch 'main':
bpo-20751:  Replace method example with attribute example, matching the descriptor howto (GH-29909)
https://github.com/python/cpython/commit/135ecc3492cee259090fd4aaed9056c130cd2eba


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Fri Dec  3 21:39:44 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 02:39:44 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638585584.73.0.898875495656.issue20751@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Fri Dec  3 21:46:49 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 02:46:49 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638586009.03.0.937880822734.issue45976@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

* If you post a timing script, it will make it easier for me to verify this across versions and across machine and for various input sizes.

* If you have time, do run some benchmarks for _randbelow_without_getrandbits()

* Try your change with and without the walrus operator.  If it doesn't make a difference in the timings, let's us the non-walrus version which is more readable.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Fri Dec  3 21:49:48 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 02:49:48 +0000
Subject: [issue45975] Simplify some while-loops with walrus operator
In-Reply-To: <1638573350.23.0.80297686747.issue45975@roundup.psfhosted.org>
Message-ID: <1638586188.65.0.625749431.issue45975@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

The general rule as stated by Zachary is correct; however, I'm in mildly favor of this PR because these are the use cases that the walrus operator was specifically designed for.  That said, it would be nice to verify that timings don't get worse and to carefully review each edit to make sure it doesn't introduce a bug.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45975>
_______________________________________

From report at bugs.python.org  Fri Dec  3 22:03:35 2021
From: report at bugs.python.org (Andrew Lin)
Date: Sat, 04 Dec 2021 03:03:35 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638587015.88.0.937656818818.issue45976@roundup.psfhosted.org>


Andrew Lin <onethreeseven at gmail.com> added the comment:

Timings are unaffected by updating to non-walrus, so I'll do so in the PR.

Using _randbelow_without_getrandbits() I get 5% improvement to sample([None] * 2047, 50); 6% to shuffle([None] * 2000); and approximately 6% to randrange() for any number significantly less than 2**32.  It's not surprising that the absolute speedup is smaller, because _randbelow_without_getrandbits() does a lot more work that is untouched by the change.  On the other hand, the speedup is more consistent, since _randbelow_without_getrandbits(n) almost never calls random() more than once for any n significantly less than 2**32.

I will clean up my benchmark script and post it.

Thanks for the feedback!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Fri Dec  3 22:45:20 2021
From: report at bugs.python.org (Ivan Pozdeev)
Date: Sat, 04 Dec 2021 03:45:20 +0000
Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1
In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org>
Message-ID: <1638589520.55.0.611871922276.issue43799@roundup.psfhosted.org>


Ivan Pozdeev <ivan.pozdeev.gm at gmail.com> added the comment:

@christian.heimes https://github.com/python/cpython/pull/25481 also needs backporting to 3.9 and 3.8.

A Pyenv user has been affected by the "implicit declaration of function ?SSLv3_method?" compliation error that it fixes in 3.9.9: https://github.com/pyenv/pyenv/issues/2181

----------
nosy: +ivan.pozdeev.gm

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43799>
_______________________________________

From report at bugs.python.org  Fri Dec  3 22:58:31 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 04 Dec 2021 03:58:31 +0000
Subject: [issue45977] Unexpected effect of sys.pycache_prefix = ""
Message-ID: <1638590311.18.0.778355816492.issue45977@roundup.psfhosted.org>


New submission from Andrei Kulakov <andrei.avk at gmail.com>:

Setting sys.pycache_prefix = "", re-creates CWD structure under current directory, e.g. if run from /Users/foo/test, will create /Users/foo/test/Users/foo/test/myfile.pyc . Is that intentional? It seems a little weird. At least it might be good to document it.

----------
components: Interpreter Core
messages: 407632
nosy: andrei.avk
priority: low
severity: normal
status: open
title: Unexpected effect of sys.pycache_prefix = ""
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45977>
_______________________________________

From report at bugs.python.org  Fri Dec  3 22:59:05 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 04 Dec 2021 03:59:05 +0000
Subject: [issue45977] Unexpected effect of sys.pycache_prefix = ""
In-Reply-To: <1638590311.18.0.778355816492.issue45977@roundup.psfhosted.org>
Message-ID: <1638590345.63.0.500219183342.issue45977@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

(I forgot to mention this happens on MacOS).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45977>
_______________________________________

From report at bugs.python.org  Fri Dec  3 23:06:10 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 04:06:10 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638590770.77.0.137358097304.issue45976@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I just did a few timings using the stock python.org Mac builds.  Only Python 3.10 gave the expected speed-up.  Python 3.8 and Python 3.9 got slower.  Python 3.11 was slightly slower.

I think we should pass on this proposed change.  The current code is safer in that it has been consistently good while the proposed change is inconsistent and can't be relied upon across builds.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Fri Dec  3 23:22:33 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 04:22:33 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638591753.38.0.130081231239.issue45976@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

On the current 3.11, I do get a speedup below a power of two, but a slight degradation (as expected) at power of two.

python3.11 -m timeit -s 'from random import randrange' 'randrange(65535)'
python3.11 -m timeit -s 'from random import randrange' 'randrange(65536)'

Also, I used PyPy3 on its 3.7 version of random.py but with the modern code for _getrandbits.  There was no discernible change with and without the proposed edit.

Please go ahead and update to the best version of your patch.

I'll mark this BPO issue as "later" and will run tests again as 3.11 gets close to a release.  Right now, CPython's performance is still in flux and it is too early to try tune application code the current version.

----------
resolution:  -> later
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Fri Dec  3 23:36:47 2021
From: report at bugs.python.org (Andrew Lin)
Date: Sat, 04 Dec 2021 04:36:47 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638592607.3.0.183676000411.issue45976@roundup.psfhosted.org>


Andrew Lin <onethreeseven at gmail.com> added the comment:

I finally cleaned up my benchmark script, which feels like a big hack.  I should really learn to use pyperf or something.

Inspired by your comment about 3.8 on the Mac I tried my Ubuntu installation's stock 3.8.  I get a small degradation (~0.5%) for powers of two and 4-5% speedups just below powers of two and for shuffle.  (This is under the slightly strange situation where _randbelow is using the main branch code but everything else in the class is imported from 3.8.)

_randbelow_without_getrandbits() is consistently (if only slightly) faster, as you would expect for cases that are basically guaranteed to call self.random() only once.

I am impressed (if not necessarily surprised) by the variation between builds, especially with my friend's ARM builds which reached nearly 20% for one case.  So I completely understand if it's less uncertain just to pass.  Thanks for your attention, in any event!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Fri Dec  3 23:37:12 2021
From: report at bugs.python.org (Andrew Lin)
Date: Sat, 04 Dec 2021 04:37:12 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638592632.83.0.035549474788.issue45976@roundup.psfhosted.org>


Change by Andrew Lin <onethreeseven at gmail.com>:


Added file: https://bugs.python.org/file50473/randbelow_timing.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Sat Dec  4 00:00:02 2021
From: report at bugs.python.org (David Jack)
Date: Sat, 04 Dec 2021 05:00:02 +0000
Subject: [issue31148] Can we get an MSI installer for something past 3.4.4?
In-Reply-To: <1502210311.11.0.464984034279.issue31148@psf.upfronthosting.co.za>
Message-ID: <1638594002.13.0.123225742491.issue31148@roundup.psfhosted.org>


David Jack <davidjack2344 at gmail.com> added the comment:

Thank you for the information. That will definitely be helpful. Also, thank you for being so detailed with your explanation.?Thank you so much. my name is david. i am provide?mac optimizer pro software your mac has been speed slow and?malware attack and junk files & more issues solve any time.?feel free to reach out at @ +1-866-252-2104 for instant and assured support for any queries regarding the mac optimizer pro Download best mac optimizer pc goto this link and download https://macoptimizerpro.com/

----------
nosy: +macoptimizer

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31148>
_______________________________________

From report at bugs.python.org  Sat Dec  4 00:26:55 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 04 Dec 2021 05:26:55 +0000
Subject: [issue45914] Very first multiprocessing example not working on
 Windows 11
In-Reply-To: <1638074274.33.0.534994157782.issue45914@roundup.psfhosted.org>
Message-ID: <1638595615.27.0.608295889163.issue45914@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I think something should be said right after the example.  But the 20 line  note seems a bit too much at this location.  Perhaps insert

(For reasons given _below_, this will raise error if enter interactively.)

with _below_, say, linked to the 20 line note.

It is not quite clear to me it this only applies on Windows or is general.

----------
assignee:  -> docs at python
components: +Documentation
nosy: +docs at python, rhettinger, terry.reedy
versions: +Python 3.11 -Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45914>
_______________________________________

From report at bugs.python.org  Sat Dec  4 00:28:38 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 04 Dec 2021 05:28:38 +0000
Subject: [issue45916] documentation link error
In-Reply-To: <1638101696.82.0.501489879762.issue45916@roundup.psfhosted.org>
Message-ID: <1638595718.44.0.518786937022.issue45916@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:


New changeset 257eea55860c5f35acce49c062c5823c7a3a1317 by Miss Islington (bot) in branch '3.9':
bpo-45916: Use HTTPS link for The Perils of Floating Point (GH-29896)
https://github.com/python/cpython/commit/257eea55860c5f35acce49c062c5823c7a3a1317


----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45916>
_______________________________________

From report at bugs.python.org  Sat Dec  4 00:29:45 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 04 Dec 2021 05:29:45 +0000
Subject: [issue45916] documentation link error
In-Reply-To: <1638101696.82.0.501489879762.issue45916@roundup.psfhosted.org>
Message-ID: <1638595785.15.0.515205880691.issue45916@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Zach, I presume you wanted the last backport merged and issue closed.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45916>
_______________________________________

From report at bugs.python.org  Sat Dec  4 00:43:21 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 04 Dec 2021 05:43:21 +0000
Subject: [issue45922] Make more methods, functions, built-ins ... clickable
In-Reply-To: <1638151109.2.0.445399231307.issue45922@roundup.psfhosted.org>
Message-ID: <1638596601.83.0.0377531271374.issue45922@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I am generally in favor of adding more links.  PR-29633, covering one doc file, has more than enough changes for one PR.  Please read the original patch, the comments, and the subsequent changes.  I plan to do the same.

----------
nosy: +terry.reedy
title: Many method, function, built-in... are not clickable and should be -> Make more methods, functions, built-ins ... clickable

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45922>
_______________________________________

From report at bugs.python.org  Sat Dec  4 01:00:06 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 04 Dec 2021 06:00:06 +0000
Subject: [issue45971] calendar module does not recognize switch to Gregorian
In-Reply-To: <1638516366.75.0.743197554563.issue45971@roundup.psfhosted.org>
Message-ID: <1638597606.83.0.515836798046.issue45971@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
components: +Library (Lib) -Extension Modules
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> calendar bug related to September 2-14, 1752
title: calendar module issue -> calendar module does not recognize switch to Gregorian
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45971>
_______________________________________

From report at bugs.python.org  Sat Dec  4 01:50:30 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 04 Dec 2021 06:50:30 +0000
Subject: [issue37198] _parse_localename fail to parse 'en_IL'
In-Reply-To: <1559925201.97.0.400746291459.issue37198@roundup.psfhosted.org>
Message-ID: <1638600630.36.0.952541252517.issue37198@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

I confirmed that it works on 3.9 so I think this can be closed as not a bug:

[ins] In [4]: _parse_localename('en_IL')
Out[4]: ('en_IL', 'UTF-8')

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37198>
_______________________________________

From report at bugs.python.org  Sat Dec  4 01:52:35 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 04 Dec 2021 06:52:35 +0000
Subject: [issue43098] tarfile list() method does not show file type
In-Reply-To: <1612240547.16.0.611621491067.issue43098@roundup.psfhosted.org>
Message-ID: <1638600755.81.0.0271831918626.issue43098@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Val: contributions are only now accepted in form of github PRs, not patches.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43098>
_______________________________________

From report at bugs.python.org  Sat Dec  4 01:55:34 2021
From: report at bugs.python.org (Joe Cool)
Date: Sat, 04 Dec 2021 06:55:34 +0000
Subject: [issue40467] subprocess: replacement shell on windows with
 executable="..." arg
In-Reply-To: <1588340057.85.0.281023369912.issue40467@roundup.psfhosted.org>
Message-ID: <1638600934.54.0.771663662246.issue40467@roundup.psfhosted.org>


Joe Cool <snoopyjc at gmail.com> added the comment:

Proposed solution:

                if comspec.endswith('sh.exe') or comspec.endswith('sh'):    # issue 40467
                    args = '{} -c "{}"'.format (comspec, args)              # issue 40467
                else:                                                       # issue 40467
                    args = '{} /c "{}"'.format (comspec, args)

----------
nosy: +snoopyjc

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40467>
_______________________________________

From report at bugs.python.org  Sat Dec  4 02:26:13 2021
From: report at bugs.python.org (Ram Rachum)
Date: Sat, 04 Dec 2021 07:26:13 +0000
Subject: [issue28953] Use `raise from` when raising new IncompleteRead
In-Reply-To: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za>
Message-ID: <1638602773.21.0.445566633331.issue28953@roundup.psfhosted.org>


Ram Rachum <ram at rachum.com> added the comment:

Interesting feature Irit, thank you 

Two things:

1. Is there better documentation for that feature than what was in the CL of the issue you linked to? Because that documentation was more lawyery than explanatory.

2. If I understand correctly, the note is meant for things that don't exactly fit in the exception message for some reason or another. (A better documentation with examples would have given me a clearer understanding of your use cases.) I'm not sure why the message included here should be relegated to a note.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28953>
_______________________________________

From report at bugs.python.org  Sat Dec  4 02:37:31 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 04 Dec 2021 07:37:31 +0000
Subject: [issue45914] Very first multiprocessing example not working on
 Windows 11
In-Reply-To: <1638074274.33.0.534994157782.issue45914@roundup.psfhosted.org>
Message-ID: <1638603451.19.0.130733832528.issue45914@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> not quite clear to me it this only applies on Windows or is general.

macOS defaults to the spawn method (bpo-33725).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45914>
_______________________________________

From report at bugs.python.org  Sat Dec  4 04:08:33 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 04 Dec 2021 09:08:33 +0000
Subject: [issue40467] subprocess: replacement shell on windows with
 executable="..." arg
In-Reply-To: <1588340057.85.0.281023369912.issue40467@roundup.psfhosted.org>
Message-ID: <1638608913.8.0.839347602233.issue40467@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> it might be nice if it's possible to give some sort of useful 
> warning/error when this happens -- perhaps say that specifying 
> both shell=True and executable="..." isn't supported on Windows?

The `shell` parameter is documented as follows for Windows:

    On Windows with shell=True, the COMSPEC environment variable 
    specifies the default shell. The only time you need to specify 
    shell=True on Windows is when the command you wish to execute is 
    built into the shell (e.g. dir or copy). You do not need
    shell=True to run a batch file or console-based executable.

It wouldn't hurt to clarify that the COMSPEC shell has to support `/c`. This is required by CreateProcessW(), which uses COMSPEC to run BAT and CMD files.

The discussion about using `executable` with `shell` could be extended for Windows. But this would also require new behavior. For example:

Original:

    if shell:
        startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
        startupinfo.wShowWindow = _winapi.SW_HIDE
        comspec = os.environ.get("COMSPEC", "cmd.exe")
        args = '{} /c "{}"'.format (comspec, args)

Proposed:

    if shell:
        startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
        startupinfo.wShowWindow = _winapi.SW_HIDE
        if executable is not None:
            cmd = executable
        else:
            cmd = os.path.normpath(os.environ.get("COMSPEC", "cmd.exe"))
            if "\\" in cmd:
                executable = cmd
        args = '"{}" /c "{}"'.format(cmd, args)

> if comspec.endswith('sh.exe') or comspec.endswith('sh'):
>     args = '{} -c "{}"'.format (comspec, args)         

sh is not a valid COMSPEC shell. To use sh automatically, subprocess would have to support and prefer the SHELL [1] environment variable in Windows -- and in POSIX for that matter.

---
[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40467>
_______________________________________

From report at bugs.python.org  Sat Dec  4 04:14:59 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 04 Dec 2021 09:14:59 +0000
Subject: [issue40467] subprocess: replacement shell on windows with
 executable="..." arg
In-Reply-To: <1588340057.85.0.281023369912.issue40467@roundup.psfhosted.org>
Message-ID: <1638609299.41.0.409868208109.issue40467@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


----------
versions: +Python 3.10, Python 3.11 -Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40467>
_______________________________________

From report at bugs.python.org  Sat Dec  4 04:39:30 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 04 Dec 2021 09:39:30 +0000
Subject: [issue37198] _parse_localename fail to parse 'en_IL'
In-Reply-To: <1559925201.97.0.400746291459.issue37198@roundup.psfhosted.org>
Message-ID: <1638610770.15.0.673150888156.issue37198@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37198>
_______________________________________

From report at bugs.python.org  Sat Dec  4 04:47:09 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Sat, 04 Dec 2021 09:47:09 +0000
Subject: [issue45978] deepfreeze opaquely fails on Windows when building from
 Visual Studio
Message-ID: <1638611229.31.0.384123662554.issue45978@roundup.psfhosted.org>


New submission from Dennis Sweeney <sweeney.dennis650 at gmail.com>:

I'd love to know if there is something I'm doing wrong, but with recent deepfreeze changes, my Visual Studio 2019 setup has been having trouble build things. It seems PCBuild/build.bat works perfectly and all tests pass and everything, but using the GUI in Visual Studio 2019 to build with the "Local Windows Debugger" green play button leads to a build failure. It gives the following output:

Build started...
1>------ Build started: Project: _freeze_module, Configuration: Debug x64 ------
1>_freeze_module.vcxproj -> C:\Users\sween\Source\Repos\temp\cpython\PCbuild\amd64\_freeze_module_d.exe
1>C:\Users\sween\Source\Repos\temp\cpython\PCbuild\_freeze_module.vcxproj(413,5): error MSB3073: The command " "C:\Users\sween\Source\Repos\temp\cpython\Tools\scripts\deepfreeze.py" "C:\Users\sween\Source\Repos\temp\cpython\Python\frozen_modules\importlib._bootstrap.h" "-m" "importlib._bootstrap" -o "C:\Users\sween\Source\Repos\temp\cpython\PCbuild\obj\311amd64_Debug\_freeze_module\importlib._bootstrap.g.h"" exited with code 103.
1>Done building project "_freeze_module.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========

I wonder if it has something to do with how .py files are set to open? (shouldn't that be made not to matter?)

Attached are my more detailed steps to reproduce the failure.

----------
components: Build, Windows
files: reproducer.txt
messages: 407648
nosy: Dennis Sweeney, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: deepfreeze opaquely fails on Windows when building from Visual Studio
type: compile error
versions: Python 3.11
Added file: https://bugs.python.org/file50474/reproducer.txt

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45978>
_______________________________________

From report at bugs.python.org  Sat Dec  4 04:53:06 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 04 Dec 2021 09:53:06 +0000
Subject: [issue45975] Simplify some while-loops with walrus operator
In-Reply-To: <1638573350.23.0.80297686747.issue45975@roundup.psfhosted.org>
Message-ID: <1638611586.42.0.70339831241.issue45975@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

As I mentioned in the PR, merging this can make future backports to 3.6 and 3.7 more complicated.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45975>
_______________________________________

From report at bugs.python.org  Sat Dec  4 04:54:05 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Sat, 04 Dec 2021 09:54:05 +0000
Subject: [issue45978] deepfreeze opaquely fails on Windows when building from
 Visual Studio
In-Reply-To: <1638611229.31.0.384123662554.issue45978@roundup.psfhosted.org>
Message-ID: <1638611645.1.0.644816944018.issue45978@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

I think I've been getting similar issues for a little while that I've been able to work around until now. If I git checkout 3.10 and then hit the "Local Windows Debugger" button, I get this:

Build started...
1>------ Build started: Project: pythoncore, Configuration: Debug x64 ------
1>Killing any running python_d.exe instances...
1>Regenerate opcode.h opcode_targets.h
1>C:\Users\sween\Source\Repos\temp\cpython\PCbuild\regen.targets(62,5): error MSB3073: The command " Tools\scripts\generate_opcode_h.py Lib\opcode.py Include\opcode.h" exited with code 103.
1>Done building project "pythoncore.vcxproj" -- FAILED.
2>------ Build started: Project: _ctypes, Configuration: Debug x64 ------
3>------ Build started: Project: python, Configuration: Debug x64 ------
========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========

However, if I then run .\PCbuild\build.bat, and then hit the "Local Windows Debugger" button, the build succeeds.

Is there some difference in which python executable is chosen to run .py files between build.bat versus what Visual Studio does?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45978>
_______________________________________

From report at bugs.python.org  Sat Dec  4 04:57:26 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 04 Dec 2021 09:57:26 +0000
Subject: [issue28953] Use `raise from` when raising new IncompleteRead
In-Reply-To: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za>
Message-ID: <1638611846.41.0.792246677763.issue28953@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

It?s meant for thing you want to add to the msg after the exception was created. The PR here seems to create a new exception of the same type in order to chain it with an additional msg. I?m suggesting that it might be sufficient to attach a note to the existing exception instead.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28953>
_______________________________________

From report at bugs.python.org  Sat Dec  4 05:08:03 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 04 Dec 2021 10:08:03 +0000
Subject: [issue45695] Out-of-tree builds are not tested.
In-Reply-To: <1635895785.09.0.174517598815.issue45695@roundup.psfhosted.org>
Message-ID: <1638612483.7.0.948696340331.issue45695@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset cee07b162843694e8166ad8715162d4d5886b50f by Christian Heimes in branch 'main':
bpo-45695: Test out-of-tree builds on GHA (GH-29904)
https://github.com/python/cpython/commit/cee07b162843694e8166ad8715162d4d5886b50f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45695>
_______________________________________

From report at bugs.python.org  Sat Dec  4 05:18:40 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Sat, 04 Dec 2021 10:18:40 +0000
Subject: [issue45978] deepfreeze opaquely fails on Windows when building from
 Visual Studio
In-Reply-To: <1638611229.31.0.384123662554.issue45978@roundup.psfhosted.org>
Message-ID: <1638613120.04.0.0579819336767.issue45978@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

Sure enough, if I go to "Choose Default Apps by File Type" in Windows settings and associate ".py" --> "Notepad", then Visual studio keeps opening Notepad windows during build.

Can the Visual Studio build configurations be made to run python scripts as "SOME_SPECIFIC_PYTHON_EXECUTABLE ./script.py" or perhaps "py ./script.py" instead of just "./script.py"?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45978>
_______________________________________

From report at bugs.python.org  Sat Dec  4 05:21:49 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 04 Dec 2021 10:21:49 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638613309.27.0.273656665125.issue45847@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 4045392e0e3446362841b3336497cb6eeccfcd23 by Christian Heimes in branch 'main':
bpo-45847: Port _ctypes partly to PY_STDLIB_MOD (GH-29747)
https://github.com/python/cpython/commit/4045392e0e3446362841b3336497cb6eeccfcd23


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Sat Dec  4 05:24:25 2021
From: report at bugs.python.org (Ram Rachum)
Date: Sat, 04 Dec 2021 10:24:25 +0000
Subject: [issue28953] Use `raise from` when raising new IncompleteRead
In-Reply-To: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za>
Message-ID: <1638613465.29.0.0390483182756.issue28953@roundup.psfhosted.org>


Ram Rachum <ram at rachum.com> added the comment:

This might work here, but you'd need to be sure there isn't any important code that looks at the IncompleteRead exception and expects the data to be in its message.

Also I hope that various tools like IDEs would learn quickly that they need to display the note in their traceback views, otherwise all of these notes would be hidden from many people.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28953>
_______________________________________

From report at bugs.python.org  Sat Dec  4 05:41:31 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Sat, 04 Dec 2021 10:41:31 +0000
Subject: [issue45978] deepfreeze opaquely fails on Windows when building from
 Visual Studio
In-Reply-To: <1638611229.31.0.384123662554.issue45978@roundup.psfhosted.org>
Message-ID: <1638614491.49.0.549238044303.issue45978@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

Actually, it seems $(PythonForBuild) is already used everywhere, it's just that $(PythonForBuild) is giving the empty string when VS uses it.

On the other hand, PCBuild/build.bat sets $(PythonForBuild) by calling out to find_python.bat, and that works great.

So perhaps the VS build should just be made to invoke find_python.bat.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45978>
_______________________________________

From report at bugs.python.org  Sat Dec  4 05:53:10 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 04 Dec 2021 10:53:10 +0000
Subject: [issue28953] Use `raise from` when raising new IncompleteRead
In-Reply-To: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za>
Message-ID: <1638615190.82.0.379625350192.issue28953@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Exception message text is not part of the api. The type is.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28953>
_______________________________________

From report at bugs.python.org  Sat Dec  4 05:57:33 2021
From: report at bugs.python.org (David Jack)
Date: Sat, 04 Dec 2021 10:57:33 +0000
Subject: [issue31148] Can we get an MSI installer for something past 3.4.4?
In-Reply-To: <1502210311.11.0.464984034279.issue31148@psf.upfronthosting.co.za>
Message-ID: <1638615453.81.0.625508352782.issue31148@roundup.psfhosted.org>


David Jack <davidjack2344 at gmail.com> added the comment:

Thank you for the information. That will definitely be helpful. https://pcoptimizerpro.com/

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31148>
_______________________________________

From report at bugs.python.org  Sat Dec  4 05:58:36 2021
From: report at bugs.python.org (Ram Rachum)
Date: Sat, 04 Dec 2021 10:58:36 +0000
Subject: [issue28953] Use `raise from` when raising new IncompleteRead
In-Reply-To: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za>
Message-ID: <1638615516.74.0.734075003431.issue28953@roundup.psfhosted.org>


Ram Rachum <ram at rachum.com> added the comment:

Okay, works for me.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28953>
_______________________________________

From report at bugs.python.org  Sat Dec  4 06:33:45 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 04 Dec 2021 11:33:45 +0000
Subject: [issue45978] deepfreeze opaquely fails on Windows when building from
 Visual Studio
In-Reply-To: <1638611229.31.0.384123662554.issue45978@roundup.psfhosted.org>
Message-ID: <1638617625.14.0.70820497527.issue45978@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Main requires a recent version of Python in order to bootstrap the build process. I just re-introduced _bootstrap_python for configure & make builds in bpo-45950. Could somebody with a Windows system re-add _bootstrap_python to Windows build process? bpo-45850 and bpo-45873 have more context.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45978>
_______________________________________

From report at bugs.python.org  Sat Dec  4 06:38:47 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 04 Dec 2021 11:38:47 +0000
Subject: [issue45979] Fix Tkinter tests with old Tk
Message-ID: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org>


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

Some recently added tests are not compatible with old Tk versions. I have build all 8.5 and 8.6 versions and build and test Tkinter against them. The proposed PR makes tests passes on Tk versions 8.5.4 to 8.5.19 and 8.6.0 to 8.6.12. There are some issues with running the pure Tk shell for versions < 8.5.4 so I skipped them.

----------
components: Tests, Tkinter
messages: 407661
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Fix Tkinter tests with old Tk
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45979>
_______________________________________

From report at bugs.python.org  Sat Dec  4 06:42:24 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 04 Dec 2021 11:42:24 +0000
Subject: [issue45979] Fix Tkinter tests with old Tk
In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org>
Message-ID: <1638618144.36.0.151018071975.issue45979@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
keywords: +patch
pull_requests: +28138
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29913

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45979>
_______________________________________

From report at bugs.python.org  Sat Dec  4 06:43:43 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 04 Dec 2021 11:43:43 +0000
Subject: [issue45979] Fix Tkinter tests with old Tk
In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org>
Message-ID: <1638618223.34.0.204508389464.issue45979@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
nosy: +epaine

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45979>
_______________________________________

From report at bugs.python.org  Sat Dec  4 07:05:19 2021
From: report at bugs.python.org (Julius Hamilton)
Date: Sat, 04 Dec 2021 12:05:19 +0000
Subject: [issue45934] python curses newterm implementation
Message-ID: <1638619519.48.0.50416526918.issue45934@roundup.psfhosted.org>


Change by Julius Hamilton <juliushamilton100 at gmail.com>:


----------
nosy: +Guido.van.Rossum, juliushamilton100

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Sat Dec  4 07:07:29 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sat, 04 Dec 2021 12:07:29 +0000
Subject: [issue45823] python stopped working
In-Reply-To: <1637091661.28.0.129849432506.issue45823@roundup.psfhosted.org>
Message-ID: <1638619649.47.0.0441982079607.issue45823@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

The reproducer is absent, closing

----------
nosy: +asvetlov
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45823>
_______________________________________

From report at bugs.python.org  Sat Dec  4 07:39:59 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 04 Dec 2021 12:39:59 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638621599.87.0.850715315144.issue45847@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28139
pull_request: https://github.com/python/cpython/pull/29914

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Sat Dec  4 08:12:15 2021
From: report at bugs.python.org (chen-y0y0)
Date: Sat, 04 Dec 2021 13:12:15 +0000
Subject: =?utf-8?q?=5Bissue45980=5D_Why_there_isn=27t_a_=E2=80=9CPython_2=2E2?=
 =?utf-8?b?4oCdIGZvciBQeVBJJ3MgY2xhc3NpZmllcnM/?=
Message-ID: <1638623535.66.0.141979014031.issue45980@roundup.psfhosted.org>


New submission from chen-y0y0 <cyy144881 at icloud.com>:

The output:
Upload failed (400): Invalid value for classifiers. Error: Classifier ' Programming Language :: Python :: 2.2' is not a valid classifier.
error: Upload failed (400): Invalid value for classifiers. Error: Classifier ' Programming Language :: Python :: 2.2' is not a valid classifier.
So, why is there no Python 2.2? Is it because it is outdated or because it is discriminated against?

----------
components: Distutils
messages: 407663
nosy: dstufft, eric.araujo, prasechen
priority: normal
severity: normal
status: open
title: Why there isn't a ?Python 2.2? for PyPI's classifiers?
type: performance
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45980>
_______________________________________

From report at bugs.python.org  Sat Dec  4 08:26:48 2021
From: report at bugs.python.org (chen-y0y0)
Date: Sat, 04 Dec 2021 13:26:48 +0000
Subject: =?utf-8?q?=5Bissue45980=5D_Why_there_isn=27t_a_=E2=80=9CPython_2=2E2?=
 =?utf-8?b?4oCdIGZvciBQeVBJJ3MgY2xhc3NpZmllcnM/?=
In-Reply-To: <1638623535.66.0.141979014031.issue45980@roundup.psfhosted.org>
Message-ID: <1638624408.04.0.337480893867.issue45980@roundup.psfhosted.org>


chen-y0y0 <cyy144881 at icloud.com> added the comment:

And NOT ONLY Python 2.2, there aren't also Python 2.1 or earlier version.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45980>
_______________________________________

From report at bugs.python.org  Sat Dec  4 08:39:26 2021
From: report at bugs.python.org (Devourer Station)
Date: Sat, 04 Dec 2021 13:39:26 +0000
Subject: [issue45981] Get raw file name in bytes from ZipFile
Message-ID: <1638625166.93.0.299659631229.issue45981@roundup.psfhosted.org>


New submission from Devourer Station <accelerator0099 at gmail.com>:

It's quite annoying that ZipFile corrupts the filename by simply replacing '\\' with '/', not providing the raw file name in bytes to us.

----------
components: Library (Lib)
messages: 407665
nosy: accelerator0099
priority: normal
severity: normal
status: open
title: Get raw file name in bytes from ZipFile
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45981>
_______________________________________

From report at bugs.python.org  Sat Dec  4 09:01:19 2021
From: report at bugs.python.org (Devourer Station)
Date: Sat, 04 Dec 2021 14:01:19 +0000
Subject: [issue45981] Get raw file name in bytes from ZipFile
In-Reply-To: <1638625166.93.0.299659631229.issue45981@roundup.psfhosted.org>
Message-ID: <1638626479.32.0.427915201739.issue45981@roundup.psfhosted.org>


Devourer Station <accelerator0099 at gmail.com> added the comment:

In file Lib/zipfile.py:
1357>  flags = centdir[5]
1358>  if flags & 0x800:
1359>    # UTF-8 file names extension
1360>    filename = filename.decode('utf-8')
1361>  else:
1362>    # Historical ZIP filename encoding
1363>    filename = filename.decode('cp437')

ZipFile simply decodes all non-utf8 file names by encoding CP437.

In file Lib/zipfile.py:
352>  # This is used to ensure paths in generated ZIP files always use
353>  # forward slashes as the directory separator, as required by the
354>  # ZIP format specification.
355>  if os.sep != "/" and os.sep in filename:
356>    filename = filename.replace(os.sep, "/")

And it replaces every '\\' with '/' on windows.

Consider we have a file named '\x97\x5c\x92\x9b', which is '??' in Japanese encoded in SHIFT_JIS.
You may have noticed the problem:

  '\x5c' is '\\'(backslash) in ASCII

So you will see ZipFile decodes the bytes by CP437, and replaces all '\\' with '/'.
And the Japanese character '?' is replaced partially, it is no longer itself.

Someone says we can replace '/' with '\\' back, and decode it by CP437 to get the raw bytes.
But what if both '/'('\x2f') and '\\'('\x5c') appear in the raw filename?

Simply replacing '\\' in a bytestream without knowning the encoding is by no means a good way.
Maybe we can provide a rawname field in the ZipInfo struct?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45981>
_______________________________________

From report at bugs.python.org  Sat Dec  4 09:09:46 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 04 Dec 2021 14:09:46 +0000
Subject: =?utf-8?q?=5Bissue45980=5D_Why_there_isn=27t_a_=E2=80=9CPython_2=2E2?=
 =?utf-8?b?4oCdIGZvciBQeVBJJ3MgY2xhc3NpZmllcnM/?=
In-Reply-To: <1638623535.66.0.141979014031.issue45980@roundup.psfhosted.org>
Message-ID: <1638626986.19.0.0178117151066.issue45980@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

What's the use case for this? Can wheels even be installed in 2.2?

I think it's safe to assume the classifiers are not present because they're outdated.

I think https://github.com/pypa/pypi-support/issues would be the best place to report this, since it's not a bug in python itself.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45980>
_______________________________________

From report at bugs.python.org  Sat Dec  4 09:14:56 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 04 Dec 2021 14:14:56 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638627296.94.0.58061761225.issue45847@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 64be8d369b7e3878078dbef466804ae8be49c1cf by Christian Heimes in branch 'main':
bpo-45847: Update whatsnew and add place holder entries for missing extensions (GH-29914)
https://github.com/python/cpython/commit/64be8d369b7e3878078dbef466804ae8be49c1cf


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Sat Dec  4 09:16:18 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 04 Dec 2021 14:16:18 +0000
Subject: [issue45981] Get raw file name in bytes from ZipFile
In-Reply-To: <1638625166.93.0.299659631229.issue45981@roundup.psfhosted.org>
Message-ID: <1638627378.0.0.697154974166.issue45981@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

You would also need to decide what to do with these lines, just before the os.sep test:

        # Terminate the file name at the first null byte.  Null bytes in file
        # names are used as tricks by viruses in archives.
        null_byte = filename.find(chr(0))
        if null_byte >= 0:
            filename = filename[0:null_byte]

I don't think you'd want to do this on an encoded (raw) filename, but on the other hand the comment makes a good point.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45981>
_______________________________________

From report at bugs.python.org  Sat Dec  4 09:55:58 2021
From: report at bugs.python.org (UnknownLITE)
Date: Sat, 04 Dec 2021 14:55:58 +0000
Subject: [issue45982] Bug in Error messages
Message-ID: <1638629758.22.0.232820967453.issue45982@roundup.psfhosted.org>


New submission from UnknownLITE <unknownlite20 at gmail.com>:

A dot is missing between `now()` and `strftime` but it is suggesting that most probably a comma is missing.

----------
components: Interpreter Core
files: Screenshot 2021-12-04 202054.png
messages: 407670
nosy: UnknownLITE
priority: normal
severity: normal
status: open
title: Bug in Error messages
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file50475/Screenshot 2021-12-04 202054.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45982>
_______________________________________

From report at bugs.python.org  Sat Dec  4 09:56:56 2021
From: report at bugs.python.org (Zachary Ware)
Date: Sat, 04 Dec 2021 14:56:56 +0000
Subject: [issue31148] Can we get an MSI installer for something past 3.4.4?
In-Reply-To: <1502210311.11.0.464984034279.issue31148@psf.upfronthosting.co.za>
Message-ID: <1638629816.56.0.267121660337.issue31148@roundup.psfhosted.org>


Change by Zachary Ware <zachary.ware at gmail.com>:


----------
Removed message: https://bugs.python.org/msg407637

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31148>
_______________________________________

From report at bugs.python.org  Sat Dec  4 09:57:11 2021
From: report at bugs.python.org (Zachary Ware)
Date: Sat, 04 Dec 2021 14:57:11 +0000
Subject: [issue31148] Can we get an MSI installer for something past 3.4.4?
In-Reply-To: <1502210311.11.0.464984034279.issue31148@psf.upfronthosting.co.za>
Message-ID: <1638629831.17.0.818038483233.issue31148@roundup.psfhosted.org>


Change by Zachary Ware <zachary.ware at gmail.com>:


----------
Removed message: https://bugs.python.org/msg407658

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31148>
_______________________________________

From report at bugs.python.org  Sat Dec  4 10:16:12 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Sat, 04 Dec 2021 15:16:12 +0000
Subject: [issue45982] Bug in Error messages
In-Reply-To: <1638629758.22.0.232820967453.issue45982@roundup.psfhosted.org>
Message-ID: <1638630972.89.0.536576183465.issue45982@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
nosy: +corona10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45982>
_______________________________________

From report at bugs.python.org  Sat Dec  4 10:18:36 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Sat, 04 Dec 2021 15:18:36 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638631116.36.0.626925693374.issue27946@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
nosy: +corona10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sat Dec  4 10:46:31 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 04 Dec 2021 15:46:31 +0000
Subject: [issue45982] Bug in Error messages
In-Reply-To: <1638629758.22.0.232820967453.issue45982@roundup.psfhosted.org>
Message-ID: <1638632791.95.0.136611453485.issue45982@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Syntactically, this could be many possible errors: missing comma, missing period, missing parens, missing brackets, etc.

A human can figure it out based on semantics, but based purely on syntax, I think this error message is good enough.

----------
components: +Parser -Interpreter Core
nosy: +eric.smith, lys.nikolaou, pablogsal

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45982>
_______________________________________

From report at bugs.python.org  Sat Dec  4 10:53:44 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 04 Dec 2021 15:53:44 +0000
Subject: [issue45982] Bug in Error messages
In-Reply-To: <1638629758.22.0.232820967453.issue45982@roundup.psfhosted.org>
Message-ID: <1638633224.97.0.272665270998.issue45982@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I concur with Eric: the purpose of the error message is a suggestion based in the most likely cause. Also  we have recently refined this so I will trigger in less uncommon situations.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45982>
_______________________________________

From report at bugs.python.org  Sat Dec  4 10:54:08 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Sat, 04 Dec 2021 15:54:08 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <1638619519.53.0.693758482199.issue45934@roundup.psfhosted.org>
Message-ID: <CAP7+vJJ3F3ywP2kHgVS5=Ec7g+vPBaLSh1SHjmMDHRCuZ3epfg@mail.gmail.com>


New submission from Guido van Rossum <gvanrossum at gmail.com>:

Since this is an enhancement, it should only target 3.11.--
--Guido (mobile)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Sat Dec  4 10:57:51 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Sat, 04 Dec 2021 15:57:51 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <CAP7+vJJ3F3ywP2kHgVS5=Ec7g+vPBaLSh1SHjmMDHRCuZ3epfg@mail.gmail.com>
Message-ID: <1638633471.05.0.694312733031.issue45934@roundup.psfhosted.org>


Guido van Rossum <gvanrossum at gmail.com> added the comment:

This does not apply to Windows (we don?t support curses there).

----------
components: +Library (Lib) -C API, Windows

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Sat Dec  4 10:58:33 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 15:58:33 +0000
Subject: [issue45975] Simplify some while-loops with walrus operator
In-Reply-To: <1638573350.23.0.80297686747.issue45975@roundup.psfhosted.org>
Message-ID: <1638633513.35.0.648908019713.issue45975@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> As I mentioned in the PR, merging this can make future
> backports to 3.6 and 3.7 more complicated.

That's correct, but it is also true that we do very few of those and the likelihood of a conflict with one of these edits is low.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45975>
_______________________________________

From report at bugs.python.org  Sat Dec  4 11:25:52 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Sat, 04 Dec 2021 16:25:52 +0000
Subject: [issue45906] Python github installation issue
In-Reply-To: <1637957258.27.0.535906199774.issue45906@roundup.psfhosted.org>
Message-ID: <1638635152.08.0.23806398261.issue45906@roundup.psfhosted.org>


Change by ?ric Araujo <merwok at netwok.org>:


----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45906>
_______________________________________

From report at bugs.python.org  Sat Dec  4 11:32:04 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Sat, 04 Dec 2021 16:32:04 +0000
Subject: [issue45983] PyType_Spec.name must remain valid after PyType_FromSpec
Message-ID: <1638635524.2.0.650786330944.issue45983@roundup.psfhosted.org>


New submission from Ronald Oussoren <ronaldoussoren at mac.com>:

The documentation for PyType_Spec and the related functions is not clear about the required lifetime of fields of PyType_Spec. 

In particular, PyType_Spec.name must remain valid for the entire lifetime of types created with PyType_FromSpec*.  The documentation doesn't mention this.

I ran into this with code that calculates the name as needed an cleans up the memory used for the type spec after creating the type. The type appears to work fine when looking at it in Python scripts, but the tp_name slot is wrong.

----------
assignee: docs at python
components: Documentation
messages: 407676
nosy: docs at python, ronaldoussoren
priority: normal
severity: normal
status: open
title: PyType_Spec.name must remain valid after PyType_FromSpec
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45983>
_______________________________________

From report at bugs.python.org  Sat Dec  4 11:45:18 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Sat, 04 Dec 2021 16:45:18 +0000
Subject: [issue45983] PyType_Spec.name must remain valid after PyType_FromSpec
In-Reply-To: <1638635524.2.0.650786330944.issue45983@roundup.psfhosted.org>
Message-ID: <1638636318.14.0.84227281739.issue45983@roundup.psfhosted.org>


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

I just noticed this duplicates #45315, sorry about the noise.

----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> `PyType_FromSpec` does not copy the name

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45983>
_______________________________________

From report at bugs.python.org  Sat Dec  4 12:31:40 2021
From: report at bugs.python.org (Ken Jin)
Date: Sat, 04 Dec 2021 17:31:40 +0000
Subject: [issue45947] Place dict (and values) pointers at a fixed (negative)
 offset from the base of the object.
In-Reply-To: <1638365448.99.0.213832334161.issue45947@roundup.psfhosted.org>
Message-ID: <1638639100.66.0.00609816689536.issue45947@roundup.psfhosted.org>


Change by Ken Jin <kenjin4096 at gmail.com>:


----------
nosy: +kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45947>
_______________________________________

From report at bugs.python.org  Sat Dec  4 12:35:54 2021
From: report at bugs.python.org (Matej Cepl)
Date: Sat, 04 Dec 2021 17:35:54 +0000
Subject: [issue45964] gdb test fails when packaging Python 3.10 for
 openSUSE/Linux
In-Reply-To: <1638453038.24.0.528506960629.issue45964@roundup.psfhosted.org>
Message-ID: <1638639354.71.0.834491912941.issue45964@roundup.psfhosted.org>


Matej Cepl <mcepl at cepl.eu> added the comment:

> Matej, does your build system perhaps strip off the shebang of Lib/pdb.py? That would explain why you are getting the function on line 93.

Yes, that?s it. Thank you.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45964>
_______________________________________

From report at bugs.python.org  Sat Dec  4 13:38:16 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 04 Dec 2021 18:38:16 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638643096.55.0.413546350552.issue45976@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Notes
=====

Without Boundmethod
-------------------
  LOAD FAST self
  LOAD METHOD getrandbits
  LOAD FAST k
  CALL_METHOD 1

Form Boundmethod
----------------
   LOAD FAST self
   LOAD ATTR getrandbits
   STORE FAST getrandbits

Call Boundmethod
----------------
   LOAD FAST getrandbits
   LOAD FAST k
   CALL FUNCTION 1

Expected Call Frequency
-----------------------

n = 1000
r = 0 .. 1024
P(r > n) 24 / 1024 = 2.3%
E[calls] = 1 / (1 - 24/1024) = 1.024

n = 1024
r = 0 .. 2048
P(r > n) = 1024 / 2048 = 50%
E[calls] = 1 / (1 - 1024/2048) = 2.0

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Sat Dec  4 13:45:21 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 04 Dec 2021 18:45:21 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638643521.38.0.2475547427.issue27946@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
pull_requests: +28140
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29915

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sat Dec  4 13:53:34 2021
From: report at bugs.python.org (Andrew Lin)
Date: Sat, 04 Dec 2021 18:53:34 +0000
Subject: [issue45976] Random._randbelow() loses time by caching an attribute
 lookup
In-Reply-To: <1638584456.65.0.012587553781.issue45976@roundup.psfhosted.org>
Message-ID: <1638644014.79.0.280214960392.issue45976@roundup.psfhosted.org>


Andrew Lin <onethreeseven at gmail.com> added the comment:

E[calls] reduces down to 2**k / n.  I only just realized from working that out that it therefore doesn't quite vary linearly over [2**k, 2**(k+1)), although by what weight one wants to average I couldn't say.

Personally if the change adversely impacts performance for any n on any major platform I will retract the PR.  I was under the impression based on my own machine that this would not happen, but it is only my one machine.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45976>
_______________________________________

From report at bugs.python.org  Sat Dec  4 13:55:25 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 04 Dec 2021 18:55:25 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638644125.36.0.00121739703253.issue27946@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

The issue is no longer reproduced by the original test because of the cache for dict key tables. But it is not gone, and can be reproduced with modified test.

There may be many similar bugs in the Python core end extensions. Adding incref/decref in PyDict_GetItem and similar C API functions could fix many of them, but perhaps not all, and it would hit performance. I suppose modt of uses of PyDict_GetItem are safe.

----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sat Dec  4 13:57:27 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 04 Dec 2021 18:57:27 +0000
Subject: [issue13236] unittest needs more flush calls
In-Reply-To: <1319137324.16.0.266090134048.issue13236@psf.upfronthosting.co.za>
Message-ID: <1638644247.58.0.66588784066.issue13236@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset f42a06ba279c916fb67289e47f9bc60dc5dee4ee by Serhiy Storchaka in branch 'main':
bpo-13236: Flush the output stream more often in unittest (GH-29864)
https://github.com/python/cpython/commit/f42a06ba279c916fb67289e47f9bc60dc5dee4ee


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13236>
_______________________________________

From report at bugs.python.org  Sat Dec  4 14:16:46 2021
From: report at bugs.python.org (Matt Wozniski)
Date: Sat, 04 Dec 2021 19:16:46 +0000
Subject: [issue45982] Bug in Error messages
In-Reply-To: <1638629758.22.0.232820967453.issue45982@roundup.psfhosted.org>
Message-ID: <1638645406.89.0.300039862788.issue45982@roundup.psfhosted.org>


Matt Wozniski <godlygeek at gmail.com> added the comment:

> Syntactically, this could be many possible errors: missing comma, missing period, missing parens, missing brackets, etc.

Syntactically, it cannot be a missing comma. Adding the comma is a syntax error.

$ python3 -c 'if datetime.now(),strftime(...) != "19:50:00": pass'
  File "<string>", line 1
    if datetime.now(),strftime(...) != "19:50:00": pass
                     ^
SyntaxError: invalid syntax

Granted this is a heuristic, but it would be nice if it was able to not suggest a change that it would reject as syntactically incorrect.

----------
nosy: +godlygeek

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45982>
_______________________________________

From report at bugs.python.org  Sat Dec  4 15:22:08 2021
From: report at bugs.python.org (Nick Drozd)
Date: Sat, 04 Dec 2021 20:22:08 +0000
Subject: [issue45975] Simplify some while-loops with walrus operator
In-Reply-To: <1638573350.23.0.80297686747.issue45975@roundup.psfhosted.org>
Message-ID: <1638649328.86.0.503829722143.issue45975@roundup.psfhosted.org>


Nick Drozd <nicholasdrozd at gmail.com> added the comment:

> Is there any measurable performance benefit from this?

I wouldn't expect any performance changes either way. If it worked out to be slower, that would an unpleasant surprise and a good reason to reject this change. If it worked out to be faster, well, that would be great!

> Reducing several hundred thousand lines of code by 148 is not a compelling benefit :)

But it's not just any old 148 lines. By my count it includes the removal of 47 `break` statements. For a change of this nature there's certainly a chance of introducing errors. On the other hand, every one of those `break` statements is a site of manual loop-handling logic, and those already present some risk of introducing errors.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45975>
_______________________________________

From report at bugs.python.org  Sat Dec  4 15:27:35 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 04 Dec 2021 20:27:35 +0000
Subject: [issue45975] Simplify some while-loops with walrus operator
In-Reply-To: <1638573350.23.0.80297686747.issue45975@roundup.psfhosted.org>
Message-ID: <1638649655.57.0.756661243611.issue45975@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45975>
_______________________________________

From report at bugs.python.org  Sat Dec  4 16:04:39 2021
From: report at bugs.python.org (mike mcleod)
Date: Sat, 04 Dec 2021 21:04:39 +0000
Subject: [issue10483] http.server - what is executable on Windows
In-Reply-To: <1290324390.55.0.445837984524.issue10483@psf.upfronthosting.co.za>
Message-ID: <1638651879.58.0.860641178108.issue10483@roundup.psfhosted.org>


Change by mike mcleod <mikecmcleod at gmail.com>:


----------
keywords: +patch
pull_requests: +28141
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29624

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10483>
_______________________________________

From report at bugs.python.org  Sat Dec  4 16:15:49 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 04 Dec 2021 21:15:49 +0000
Subject: [issue45982] Bug in Error messages
In-Reply-To: <1638629758.22.0.232820967453.issue45982@roundup.psfhosted.org>
Message-ID: <1638652549.29.0.746456558915.issue45982@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

It doesn't happen anymore with the latest 3.10:

>>> if datetime.now(),strftime(...) != "19:50:00": pass
  File "<stdin>", line 1
    if datetime.now(),strftime(...) != "19:50:00": pass
                     ^
SyntaxError: invalid syntax

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45982>
_______________________________________

From report at bugs.python.org  Sat Dec  4 16:16:39 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 04 Dec 2021 21:16:39 +0000
Subject: [issue45982] Bug in Error messages
In-Reply-To: <1638629758.22.0.232820967453.issue45982@roundup.psfhosted.org>
Message-ID: <1638652599.83.0.755770718684.issue45982@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

It doesn't happen anymore with the latest 3.10:

>>> if datetime.now()strftime(...) != "19:50:00": pass
  File "<stdin>", line 1
    if datetime.now()strftime(...) != "19:50:00": pass
                     ^^^^^^^^
SyntaxError: invalid syntax

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45982>
_______________________________________

From report at bugs.python.org  Sat Dec  4 16:16:42 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 04 Dec 2021 21:16:42 +0000
Subject: [issue45982] Bug in Error messages
In-Reply-To: <1638629758.22.0.232820967453.issue45982@roundup.psfhosted.org>
Message-ID: <1638652602.51.0.0955786189138.issue45982@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
Removed message: https://bugs.python.org/msg407685

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45982>
_______________________________________

From report at bugs.python.org  Sat Dec  4 16:31:23 2021
From: report at bugs.python.org (STINNER Victor)
Date: Sat, 04 Dec 2021 21:31:23 +0000
Subject: [issue10483] http.server - what is executable on Windows
In-Reply-To: <1290324390.55.0.445837984524.issue10483@psf.upfronthosting.co.za>
Message-ID: <1638653483.88.0.651465227248.issue10483@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
nosy:  -vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10483>
_______________________________________

From report at bugs.python.org  Sat Dec  4 17:08:32 2021
From: report at bugs.python.org (theeshallnotknowethme)
Date: Sat, 04 Dec 2021 22:08:32 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
Message-ID: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>


New submission from theeshallnotknowethme <nohackingofkrowten at gmail.com>:

In the current version of CPython, this code:

if datetime.now()strftime(...) != "19:50:00": return

produces this error:

  File "<stdin>", line 4
    if datetime.now()strftime(...) != "19:50:00": return
                     ^^^^^^^^
SyntaxError: invalid syntax

This is a potential attribute access, and this bug report proposes it would produce this error instead:

  File "<stdin>", line 4
    if datetime.now()strftime(...) != "19:50:00": return
       ^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a dot?

Also, for string prefixes, this is the current error:

>>> kf'dsdsfddsf'
  File "<stdin>", line 1
    kf'dsdsfddsf'
      ^^^^^^^^^^^
SyntaxError: invalid syntax

This bug report proposes this error instead:

>>> kf'dsdsfddsf'
  File "<stdin>", line 1
    kf'dsdsfddsf'
    ^^
SyntaxError: invalid string prefix 'kf'

----------
components: Parser
messages: 407687
nosy: February291948, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Error messages for invalid string prefixes and potential attribute accesses
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sat Dec  4 17:10:14 2021
From: report at bugs.python.org (theeshallnotknowethme)
Date: Sat, 04 Dec 2021 22:10:14 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
In-Reply-To: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>
Message-ID: <1638655814.61.0.845005172455.issue45984@roundup.psfhosted.org>


Change by theeshallnotknowethme <nohackingofkrowten at gmail.com>:


----------
keywords: +patch
pull_requests: +28142
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29916

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sat Dec  4 17:10:57 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 04 Dec 2021 22:10:57 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
In-Reply-To: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>
Message-ID: <1638655857.59.0.60299054877.issue45984@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Duplicate of https://bugs.python.org/issue45982

----------
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sat Dec  4 17:18:45 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 04 Dec 2021 22:18:45 +0000
Subject: [issue45906] Python github installation issue
In-Reply-To: <1637957258.27.0.535906199774.issue45906@roundup.psfhosted.org>
Message-ID: <1638656325.68.0.891717893094.issue45906@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Could you please provide your operating system / Linux distro and the steps and commands you used to download Python from GitHub. Please also attach config.log file.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45906>
_______________________________________

From report at bugs.python.org  Sat Dec  4 17:20:01 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 04 Dec 2021 22:20:01 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
In-Reply-To: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>
Message-ID: <1638656401.28.0.0460416311392.issue45984@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Actually, is not technically a duplicate of https://bugs.python.org/issue45982 but is related.

----------
resolution: duplicate -> rejected

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sat Dec  4 17:27:49 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 04 Dec 2021 22:27:49 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
In-Reply-To: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>
Message-ID: <1638656869.31.0.141309746115.issue45984@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Since the two reported problems are unrelated, this should be two bug reports. The first one does seem like a duplicate, as Pablo mentions. I haven?t checked to see if the second one already has an issue.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sat Dec  4 17:30:16 2021
From: report at bugs.python.org (theeshallnotknowethme)
Date: Sat, 04 Dec 2021 22:30:16 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
In-Reply-To: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>
Message-ID: <1638657016.85.0.181332709736.issue45984@roundup.psfhosted.org>


theeshallnotknowethme <nohackingofkrowten at gmail.com> added the comment:

I actually didn't know bpo-45982 existed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sat Dec  4 18:01:23 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Sat, 04 Dec 2021 23:01:23 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <CAP7+vJJ3F3ywP2kHgVS5=Ec7g+vPBaLSh1SHjmMDHRCuZ3epfg@mail.gmail.com>
Message-ID: <1638658883.32.0.988486851875.issue45934@roundup.psfhosted.org>


Change by ?ric Araujo <merwok at netwok.org>:


----------
stage:  -> needs patch
versions:  -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Sat Dec  4 18:56:38 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 04 Dec 2021 23:56:38 +0000
Subject: [issue44534] unittest.mock.Mock.unsafe doc is garbled
In-Reply-To: <1624968855.9.0.632630406188.issue44534@roundup.psfhosted.org>
Message-ID: <1638662198.45.0.593217659989.issue44534@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11 -Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44534>
_______________________________________

From report at bugs.python.org  Sat Dec  4 19:22:33 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sun, 05 Dec 2021 00:22:33 +0000
Subject: [issue43474] http.server.BaseHTTPRequestHandler  end_header() fails
In-Reply-To: <1615460999.3.0.75730553286.issue43474@roundup.psfhosted.org>
Message-ID: <1638663753.6.0.715451154342.issue43474@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

It seems like sending zero headers is not supported, because:

- if using http/1.0
https://www.rfc-editor.org/rfc/rfc7230#section-6.1  -- Connection: close must be sent

- if using http/1.1 -- https://docs.python.org/3.11/library/http.server.html#http.server.BaseHTTPRequestHandler.protocol_version

Content-Length must be included.

Therefore closing as not a bug.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43474>
_______________________________________

From report at bugs.python.org  Sat Dec  4 19:44:21 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Sun, 05 Dec 2021 00:44:21 +0000
Subject: =?utf-8?q?=5Bissue45980=5D_Why_there_isn=27t_a_=E2=80=9CPython_2=2E2?=
 =?utf-8?b?4oCdIGZvciBQeVBJJ3MgY2xhc3NpZmllcnM/?=
In-Reply-To: <1638623535.66.0.141979014031.issue45980@roundup.psfhosted.org>
Message-ID: <1638665061.26.0.215889368213.issue45980@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

This is not a performance issue. Why did you flag it as performance?

Python 2.2 and 2.1 are so out of date that I'm just going to close this and not even ask why you are bothering to write and publish code for Python 2.2 :-)

----------
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: performance -> 
versions:  -Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45980>
_______________________________________

From report at bugs.python.org  Sat Dec  4 19:48:11 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sun, 05 Dec 2021 00:48:11 +0000
Subject: [issue43418] FTPLib error when server returns byte message instead of
 string
In-Reply-To: <1615037606.06.0.879407636626.issue43418@roundup.psfhosted.org>
Message-ID: <1638665291.2.0.296886025987.issue43418@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Closing as third party. Cowrie overrides ftplib.FTP class and implements __init__ in a way that doesn't work properly with some other methods of `FTP` class.

----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43418>
_______________________________________

From report at bugs.python.org  Sat Dec  4 21:02:49 2021
From: report at bugs.python.org (Devourer Station)
Date: Sun, 05 Dec 2021 02:02:49 +0000
Subject: [issue45981] Get raw file name in bytes from ZipFile
In-Reply-To: <1638625166.93.0.299659631229.issue45981@roundup.psfhosted.org>
Message-ID: <1638669769.73.0.149919078639.issue45981@roundup.psfhosted.org>


Devourer Station <accelerator0099 at gmail.com> added the comment:

Null bytes appear in abnormal zip files. (I haven't seen any multibyte encoding that represents a character with null bytes)

But non-utf8 encodings are common in normal zip files, as windows uses different encodings for different language settings. (On the other hand, Linux suggests everyone use UTF8 regardless of their language settings.)

It's a pity that nowadays few software supports specifying encoding when extracting archives.
(We have unzip-iconv patch on Linux, even if the patch is never accepted by unzip)

Changing the language and rebooting my OS makes no sense, and I don't know why.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45981>
_______________________________________

From report at bugs.python.org  Sat Dec  4 21:06:34 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sun, 05 Dec 2021 02:06:34 +0000
Subject: [issue45981] Get raw file name in bytes from ZipFile
In-Reply-To: <1638625166.93.0.299659631229.issue45981@roundup.psfhosted.org>
Message-ID: <1638669994.1.0.504808079801.issue45981@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

UTF-16 uses null bytes. I'm sure there are other encodings that do, too.

But I don't know if these encodings are permitted or common in zip files.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45981>
_______________________________________

From report at bugs.python.org  Sat Dec  4 22:04:26 2021
From: report at bugs.python.org (theeshallnotknowethme)
Date: Sun, 05 Dec 2021 03:04:26 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
In-Reply-To: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>
Message-ID: <1638673466.73.0.52649935821.issue45984@roundup.psfhosted.org>


Change by theeshallnotknowethme <nohackingofkrowten at gmail.com>:


----------
resolution: rejected -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sat Dec  4 22:04:45 2021
From: report at bugs.python.org (theeshallnotknowethme)
Date: Sun, 05 Dec 2021 03:04:45 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
In-Reply-To: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>
Message-ID: <1638673485.54.0.658798652203.issue45984@roundup.psfhosted.org>


Change by theeshallnotknowethme <nohackingofkrowten at gmail.com>:


----------
resolution:  -> rejected

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sat Dec  4 21:54:32 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sun, 05 Dec 2021 02:54:32 +0000
Subject: [issue44735] Failed venv Activation With "&" In Folder Name
In-Reply-To: <1627190638.68.0.811624039795.issue44735@roundup.psfhosted.org>
Message-ID: <1638672872.7.0.874135272622.issue44735@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Duplicate of https://bugs.python.org/issue44540

----------
nosy: +andrei.avk
superseder:  -> venv: activate.bat fails for venv with special characters in PATH

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44735>
_______________________________________

From report at bugs.python.org  Sat Dec  4 22:43:01 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sun, 05 Dec 2021 03:43:01 +0000
Subject: [issue44540] venv: activate.bat fails for venv with special
 characters in PATH
In-Reply-To: <1625057041.78.0.250792490415.issue44540@roundup.psfhosted.org>
Message-ID: <1638675781.54.0.485377471446.issue44540@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


----------
stage:  -> needs patch
versions: +Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44540>
_______________________________________

From report at bugs.python.org  Sat Dec  4 22:43:14 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sun, 05 Dec 2021 03:43:14 +0000
Subject: [issue44735] Failed venv Activation With "&" In Folder Name
In-Reply-To: <1627190638.68.0.811624039795.issue44735@roundup.psfhosted.org>
Message-ID: <1638675794.71.0.53020214016.issue44735@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44735>
_______________________________________

From report at bugs.python.org  Sat Dec  4 23:55:28 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sun, 05 Dec 2021 04:55:28 +0000
Subject: [issue36392] IPv4Interface Object has no attributte prefixlen
In-Reply-To: <1553197512.13.0.766410741462.issue36392@roundup.psfhosted.org>
Message-ID: <1638680128.38.0.777778490405.issue36392@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

The docs for current bugfix releases (3.9+) have clear links from the Interface class attribute `network` to the Network class which lists the `prefixlen` attribute. I don't think it can be made clearer - there's two ways to find it - either searching for `prefixlen` and working backwards from network to interface, or following the link from Interface.network.

----------
nosy: +andrei.avk, kj
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36392>
_______________________________________

From report at bugs.python.org  Sun Dec  5 04:52:08 2021
From: report at bugs.python.org (E. Paine)
Date: Sun, 05 Dec 2021 09:52:08 +0000
Subject: [issue45979] Fix Tkinter tests with old Tk
In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org>
Message-ID: <1638697928.61.0.54456051545.issue45979@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

Is support for such old Tk versions useful? 8.5.4 was released in late 2008, and I highly doubt anyone would still be using it. IMO, 8.5.12 would be a good compromise, since we're giving support to a version more than 9 years old, but would simplify PR-29913 by removing several 8.5.x specific branches. (FYI, 8.5.12 was released on 2012-07-27 and 8.6.0 on 2012-12-20)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45979>
_______________________________________

From report at bugs.python.org  Sun Dec  5 06:02:26 2021
From: report at bugs.python.org (Ofer Koren)
Date: Sun, 05 Dec 2021 11:02:26 +0000
Subject: [issue45985] AttributeError from @property inadvertantly flows into
 __getattr__
Message-ID: <1638702146.56.0.573091484317.issue45985@roundup.psfhosted.org>


New submission from Ofer Koren <koreno at gmail.com>:

There's For quite a long time I've been seeing this bug:

>>> class A():

...     @property
...     def foo(self):
...         return self.bar  # <---- this is where it all starts ('bar' isn't found)
... 
...     def __getattr__(self, attr):
...         raise AttributeError(attr)  # <--- let's pretend our getattr couldn't find the attr


>>> A().foo


Traceback (most recent call last):
  File "t.py", line 13, in <module>
    A().foo
  File "t.py", line 10, in __getattr__
    raise AttributeError(attr)
AttributeError: foo


So an AttributeError spawned by `self.bar` caused us to "fallback" on __getattr__ with attr='foo', leading the naive code there to produce a very confusing error message.


My workaround was to use a @safe_property decorator, one that catches AttributeError exceptions and converts them to RuntimeErrors instead, so that they don't flow into the unsuspecting __getattr__.
I believe python should adopt this behavior into the built-in property decorator, perhaps with a more appropriate exception type.

----------
messages: 407701
nosy: koreno
priority: normal
severity: normal
status: open
title: AttributeError from @property inadvertantly flows into __getattr__
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45985>
_______________________________________

From report at bugs.python.org  Sun Dec  5 06:25:03 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Sun, 05 Dec 2021 11:25:03 +0000
Subject: [issue7946] Convoy effect with I/O bound threads and New GIL
In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za>
Message-ID: <1638703503.1.0.693962109037.issue7946@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
nosy: +mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue7946>
_______________________________________

From report at bugs.python.org  Sun Dec  5 06:35:40 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 05 Dec 2021 11:35:40 +0000
Subject: [issue45985] AttributeError from @property inadvertantly flows into
 __getattr__
In-Reply-To: <1638702146.56.0.573091484317.issue45985@roundup.psfhosted.org>
Message-ID: <1638704140.99.0.0999974724937.issue45985@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45985>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:05:52 2021
From: report at bugs.python.org (Marko)
Date: Sun, 05 Dec 2021 12:05:52 +0000
Subject: [issue43806] asyncio.StreamReader hangs when reading from pipe and
 other process exits unexpectedly
In-Reply-To: <1618143469.5.0.154132734242.issue43806@roundup.psfhosted.org>
Message-ID: <1638705952.9.0.189300365022.issue43806@roundup.psfhosted.org>


Marko <ivanovic.marko at yandex.com> added the comment:

Thanks, takluyver!

You are right. Synchronous code that I was comparing it to had os.close(ctx), but I forgot to add it in the async example, so I thought it was a bug.

Closing this issue.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43806>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:06:49 2021
From: report at bugs.python.org (Athanasius)
Date: Sun, 05 Dec 2021 12:06:49 +0000
Subject: [issue45986] 3.10.0 ships with older tcl/tk DLLs than 3.9.9 causing
 Windows Installer problems
Message-ID: <1638706009.9.0.557448740254.issue45986@roundup.psfhosted.org>


New submission from Athanasius <github at miggy.org>:

Python 3.10.0 ships with version 8.6.2.10 of both tcl86t.dll and tk86t.dll.

Python 3.9.9, released after 3.10.0, ships with the later version 8.6.2.12 of both files.

Releasing a project using py2exe and WiX to build a windows MSI installer file means that upgrading Python we use from 3.9.9 to 3.10.0 then refuses to install the files tcl86t.dll and tk86t.dll because their versions are older than the already installed files (but for some reason it *does* remove those older versions).

For the user this then means the application crashes on startup when import of _tkinter.pyd fails due to the missing DLLs.  There are two workarounds of: 1) Do a subsequent repair install of the MSI, 2) Manually uninstall the application before installing our version based on Python 3.10.  Neither of these are attractive given the often non-technical backgrounds of our users.

How soon is a 3.10.1 expected that will address this ?  In the meantime I'm either going to have to special-case things and pull in the Python 3.9.9 versions of the files, or just not upgrade the project to Python 3.10.

----------
components: Tkinter
messages: 407703
nosy: Athanasius
priority: normal
severity: normal
status: open
title: 3.10.0 ships with older tcl/tk DLLs than 3.9.9 causing Windows Installer problems
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45986>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:19:33 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 05 Dec 2021 12:19:33 +0000
Subject: [issue45986] 3.10.0 ships with older tcl/tk DLLs than 3.9.9 causing
 Windows Installer problems
In-Reply-To: <1638706009.9.0.557448740254.issue45986@roundup.psfhosted.org>
Message-ID: <1638706773.67.0.869128070943.issue45986@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

You can find the release schedule here, which says that 3.10.1 is expected... tomorrow https://www.python.org/dev/peps/pep-0619/#id6

----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45986>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:23:24 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 12:23:24 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638707004.33.0.999645256343.issue27946@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +28143
pull_request: https://github.com/python/cpython/pull/29919

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:23:24 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 12:23:24 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638707004.85.0.341115936785.issue27946@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset d15cdb2f32f572ce56d7120135da24b9fdce4c99 by Serhiy Storchaka in branch 'main':
bpo-27946: Fix possible crash in ElementTree.Element (GH-29915)
https://github.com/python/cpython/commit/d15cdb2f32f572ce56d7120135da24b9fdce4c99


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:23:29 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 12:23:29 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638707009.03.0.845964372069.issue27946@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28144
pull_request: https://github.com/python/cpython/pull/29920

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:28:32 2021
From: report at bugs.python.org (Athanasius)
Date: Sun, 05 Dec 2021 12:28:32 +0000
Subject: [issue45986] 3.10.0 ships with older tcl/tk DLLs than 3.9.9 causing
 Windows Installer problems
In-Reply-To: <1638706009.9.0.557448740254.issue45986@roundup.psfhosted.org>
Message-ID: <1638707312.03.0.608567853483.issue45986@roundup.psfhosted.org>


Athanasius <github at miggy.org> added the comment:

Thanks, I have my fingers crossed that 3.10.1 will have automatically picked up >= 8.6.2.12 versions of the files.  I'll check once it's available.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45986>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:29:53 2021
From: report at bugs.python.org (Akash Mishra)
Date: Sun, 05 Dec 2021 12:29:53 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638707393.94.0.102931472437.issue44166@roundup.psfhosted.org>


Akash Mishra <mishra.akash.myself at gmail.com> added the comment:

While browsing some traceback error reporting i land on this solution threads. 

Specially beginner face traceback error for 
- KeyError
- IndexError (As mentioned in current message thread) 
- ValueError
..

It is sometime self explanatory from error reports but may be it can help to design some error document in python to more generalize errors.

Found some of traceback error with some possible cause explanations. Sharing if this is useful.  

https://github.com/pablorgarcia/Learn-to-program-with-Python-guide/blob/master/Understanding%20errors/IndexError-list-index-out-of-range.py

https://www.quizcure.com/python/traceback-most-recent-call-last-in-python#Keyerror-dictionary

https://stackoverflow.com/questions/64428188/deep-learning-chatbot-specific-index-error-list-index-out-of-range

----------
nosy: +mishra.akash.myself

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:34:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 12:34:31 +0000
Subject: [issue19153] [doc] Embedding into a shared library fails again
In-Reply-To: <1380818213.13.0.0445211197564.issue19153@psf.upfronthosting.co.za>
Message-ID: <1638707671.23.0.407947190697.issue19153@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
title: Embedding into a shared library fails again -> [doc] Embedding into a shared library fails again
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19153>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:47:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 12:47:05 +0000
Subject: [issue29251] [doc] Class __dict__ is only a mapping proxy
In-Reply-To: <1484222660.7.0.65822313324.issue29251@psf.upfronthosting.co.za>
Message-ID: <1638708425.89.0.0241103402877.issue29251@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The patch would still apply to Doc/library/functions.rst.


https://docs.python.org/3.10/reference/datamodel.html#the-standard-type-hierarchy  seems to have been changed quite a lot, but still has:

1. "Special read-only attribute: __dict__ is the module?s namespace as a dictionary object."


2. "__dict__
The dictionary containing the class?s namespace."

----------
keywords: +easy -patch
nosy: +iritkatriel
title: Class __dict__ is only a mapping proxy -> [doc] Class __dict__ is only a mapping proxy
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29251>
_______________________________________

From report at bugs.python.org  Sun Dec  5 07:49:40 2021
From: report at bugs.python.org (Marko)
Date: Sun, 05 Dec 2021 12:49:40 +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: <1638708580.0.0.0326831424004.issue43805@roundup.psfhosted.org>


Marko <ivanovic.marko at yandex.com> added the comment:

Yes, something like that would indeed be really helpful.
How likely is that something like that gets implemented?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43805>
_______________________________________

From report at bugs.python.org  Sun Dec  5 08:37:24 2021
From: report at bugs.python.org (Ladislav Heller)
Date: Sun, 05 Dec 2021 13:37:24 +0000
Subject: [issue44245] Cross-compilation of CPython 3.8 with _socket module
 using Anddroid NDK fails
In-Reply-To: <1622116302.56.0.159914345765.issue44245@roundup.psfhosted.org>
Message-ID: <1638711444.15.0.923395188461.issue44245@roundup.psfhosted.org>


Ladislav Heller <ladislav.heller at gmail.com> added the comment:

Tried to cross-compile with an old version of Android NDK.
Using the latest NDK it works perfectly.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44245>
_______________________________________

From report at bugs.python.org  Sun Dec  5 09:25:09 2021
From: report at bugs.python.org (Toshihiro Kamiya)
Date: Sun, 05 Dec 2021 14:25:09 +0000
Subject: [issue45987] os.chdir in unittest's test case causes RecursionError
 on Windows
Message-ID: <1638714309.05.0.538480655841.issue45987@roundup.psfhosted.org>


New submission from Toshihiro Kamiya <kamiya at mbj.nifty.com>:

When I was writing unit tests, I noticed that os.chdir in the unittest test case failed with RecursionError.

It seems to work fine on Ubuntu 20.04, but fails on Windows 10 (might fail on macOS).

The attached file is a minimal code to reproduce this.

When I run it, I got an error message as follows

```
PS C:\Users\toshihiro\tmp> python .\test_chdir_fails.py
Traceback (most recent call last):
  File "C:\Users\toshihiro\tmp\test_chdir_fails.py", line 11, in <module>
    unittest.main()
  File "C:\Users\toshihiro\AppData\Local\Programs\Python\Python39\lib\unittest\main.py", line 101, in __init__
    self.runTests()
(snip)
  File "C:\Users\toshihiro\AppData\Local\Programs\Python\Python39\lib\traceback.py", line 493, in __init__
    context = TracebackException(
  [Previous line repeated 487 more times]
RecursionError: maximum recursion depth exceeded
PS C:\Users\toshihiro\tmp>
```

The version of python was:
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32

Regards,

----------
components: Library (Lib)
files: test_chdir_fails.py
messages: 407711
nosy: tos-kamiya
priority: normal
severity: normal
status: open
title: os.chdir in unittest's test case causes RecursionError on Windows
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file50476/test_chdir_fails.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45987>
_______________________________________

From report at bugs.python.org  Sun Dec  5 10:51:21 2021
From: report at bugs.python.org (hongweipeng)
Date: Sun, 05 Dec 2021 15:51:21 +0000
Subject: [issue33632] undefined behaviour: signed integer overflow in
 threadmodule.c
In-Reply-To: <1527151195.18.0.682650639539.issue33632@psf.upfronthosting.co.za>
Message-ID: <1638719481.91.0.206786446259.issue33632@roundup.psfhosted.org>


hongweipeng <hongweichen8888 at sina.com> added the comment:

I think PR https://github.com/python/cpython/pull/28674 has resolved this issue.

----------
nosy: +hongweipeng

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33632>
_______________________________________

From report at bugs.python.org  Sun Dec  5 10:57:52 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 15:57:52 +0000
Subject: [issue3687] Popen() object stdout attribute reassignment behaviour
In-Reply-To: <1219766265.83.0.904411616188.issue3687@psf.upfronthosting.co.za>
Message-ID: <1638719872.57.0.628090277014.issue3687@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The situation is the same in 3.11, both doc and implementation.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue3687>
_______________________________________

From report at bugs.python.org  Sun Dec  5 11:00:54 2021
From: report at bugs.python.org (E. Paine)
Date: Sun, 05 Dec 2021 16:00:54 +0000
Subject: [issue45986] 3.10.0 ships with older tcl/tk DLLs than 3.9.9 causing
 Windows Installer problems
In-Reply-To: <1638706009.9.0.557448740254.issue45986@roundup.psfhosted.org>
Message-ID: <1638720054.91.0.0302885587451.issue45986@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

I can confirm that 3.10.1 is going to use Tk 8.6.12 (see #45732). Python 3.10.0 was meant to use Tk 8.6.11, but there was an issue with the build process (#43652).

----------
nosy: +epaine

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45986>
_______________________________________

From report at bugs.python.org  Sun Dec  5 11:07:11 2021
From: report at bugs.python.org (Filippo Vicentini)
Date: Sun, 05 Dec 2021 16:07:11 +0000
Subject: [issue45988] inspect.signature fails on a @staticmethod
Message-ID: <1638720431.62.0.74657433322.issue45988@roundup.psfhosted.org>


New submission from Filippo Vicentini <filippovicentini at gmail.com>:

Attempting to inspect the signature of a method marked as @staticmethod during class construction fails.
This happens in 3.8, 3.9.

A MWE is given here:
```python
from typing import signature

def decorator(fun):
	print(signature(fun))
	return fun

class Test2:
	@decorator
	@staticmethod
	def test(arg):
		return arg
```
which fails with error
```python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 4, in Test
  File "<stdin>", line 2, in decorator
  File "/Users/filippovicentini/.pyenv/versions/3.9.7/lib/python3.9/inspect.py", line 3111, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "/Users/filippovicentini/.pyenv/versions/3.9.7/lib/python3.9/inspect.py", line 2860, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
  File "/Users/filippovicentini/.pyenv/versions/3.9.7/lib/python3.9/inspect.py", line 2259, in _signature_from_callable
    raise TypeError('{!r} is not a callable object'.format(obj))
TypeError: <staticmethod object at 0x108865250> is not a callable object
```

----------
components: Library (Lib)
messages: 407715
nosy: PhilipVinc
priority: normal
severity: normal
status: open
title: inspect.signature fails on a @staticmethod
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45988>
_______________________________________

From report at bugs.python.org  Sun Dec  5 11:10:36 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 16:10:36 +0000
Subject: [issue28816] [doc] Clarify that zipimport does not invoke import
 hooks to load custom files from zip.
In-Reply-To: <1480326340.52.0.39566018579.issue28816@psf.upfronthosting.co.za>
Message-ID: <1638720636.66.0.830971482004.issue28816@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I think that
(1) the patch is not worded very clearly
(2) the docs should not reference py2exe for instructions how to do something

Perhaps it would suffice to change the sentence:

Any files may be present in the ZIP archive, but only files .py and .pyc are available for import

to:

Any files may be present in the ZIP archive, but the importer is only invoked for .py and .pyc files

?

----------
keywords: +easy
nosy: +iritkatriel
status: open -> pending
title: Document if zipimport can respect import hooks to load custom files from zip. -> [doc] Clarify that zipimport does not invoke import hooks to load custom files from zip.
type:  -> enhancement
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28816>
_______________________________________

From report at bugs.python.org  Sun Dec  5 11:14:40 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sun, 05 Dec 2021 16:14:40 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638720880.82.0.537118914399.issue45582@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28145
pull_request: https://github.com/python/cpython/pull/29921

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Sun Dec  5 11:22:00 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 16:22:00 +0000
Subject: [issue12833] Document the need to pass the prompt to raw_input() with
 readline
In-Reply-To: <1314205212.4.0.313319940132.issue12833@psf.upfronthosting.co.za>
Message-ID: <1638721319.99.0.672036033463.issue12833@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I agree with Martin that this belongs in the input() rather than readline() docs. However, the input() does is quite concise, and the sole example specifies the right way to use it:

https://docs.python.org/3/library/functions.html#input

I find it hard to justify real estate in this doc in which to explain what happens if you combine input with readline and do the wrong thing. 

I suggest we leave it as it is.

----------
nosy: +iritkatriel
resolution:  -> wont fix
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12833>
_______________________________________

From report at bugs.python.org  Sun Dec  5 11:26:40 2021
From: report at bugs.python.org (Andre Roberge)
Date: Sun, 05 Dec 2021 16:26:40 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638721600.81.0.877756857728.issue44166@roundup.psfhosted.org>


Change by Andre Roberge <andre.roberge at gmail.com>:


----------
nosy: +aroberge

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 11:59:15 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 16:59:15 +0000
Subject: [issue1705393] Document select() failure with buffered file
Message-ID: <1638723555.13.0.676265815888.issue1705393@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1705393>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:06:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 17:06:55 +0000
Subject: [issue26897] [doc] Clarify Popen stdin, stdout, stderr
In-Reply-To: <1462077137.11.0.0338937138998.issue26897@psf.upfronthosting.co.za>
Message-ID: <1638724015.48.0.352236659117.issue26897@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: Clarify Popen stdin, stdout, stderr -> [doc] Clarify Popen stdin, stdout, stderr
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26897>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:14:45 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 05 Dec 2021 17:14:45 +0000
Subject: [issue45987] os.chdir in unittest's test case causes RecursionError
 on Windows
In-Reply-To: <1638714309.05.0.538480655841.issue45987@roundup.psfhosted.org>
Message-ID: <1638724485.05.0.9109127036.issue45987@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45987>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:24:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 17:24:28 +0000
Subject: [issue28546] [doc] Clarify setting pdb breakpoints
In-Reply-To: <1477659342.78.0.0469891681289.issue28546@psf.upfronthosting.co.za>
Message-ID: <1638725068.48.0.845310938094.issue28546@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy -patch
title: Better explain setting pdb breakpoints -> [doc] Clarify setting pdb breakpoints
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28546>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:24:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 17:24:45 +0000
Subject: [issue28546] [doc] Clarify setting pdb breakpoints
In-Reply-To: <1477659342.78.0.0469891681289.issue28546@psf.upfronthosting.co.za>
Message-ID: <1638725085.42.0.895338377059.issue28546@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The patch needs to be converted to a GitHub PR.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28546>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:31:12 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 17:31:12 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1638725472.83.0.647138835902.issue45711@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28146
pull_request: https://github.com/python/cpython/pull/29922

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:37:28 2021
From: report at bugs.python.org (Masoud Azizi)
Date: Sun, 05 Dec 2021 17:37:28 +0000
Subject: [issue45989] Getting key of max value of dict really dose not sense
Message-ID: <1638725848.56.0.191951522901.issue45989@roundup.psfhosted.org>


New submission from Masoud Azizi <mablue92 at gmail.com>:

Maximum_signal_key=max(collective_signals,key=collective_signals.get)
This code is really hard to learn and remember.
Please change it to something that more sense.

----------
messages: 407719
nosy: mablue
priority: normal
severity: normal
status: open
title: Getting key of max value of dict really dose not sense
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45989>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:41:54 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sun, 05 Dec 2021 17:41:54 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638726114.85.0.211987034444.issue45582@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 628abe4463ed40cd54ca952a2b4cc2d6e74073f7 by Christian Heimes in branch 'main':
bpo-45582: Fix signature of _Py_Get_Getpath_CodeObject (GH-29921)
https://github.com/python/cpython/commit/628abe4463ed40cd54ca952a2b4cc2d6e74073f7


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:43:07 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 17:43:07 +0000
Subject: [issue21761] [doc] language reference describes the role of
 module.__file__ inaccurately
In-Reply-To: <1402778004.82.0.418404996295.issue21761@psf.upfronthosting.co.za>
Message-ID: <1638726187.74.0.894314198731.issue21761@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Would it suffice to change

"Ultimately, the loader is what makes use of __file__ and/or __cached__"

to 

"Ultimately, the loader set the values of __file__ and/or __cached__"

?

----------
nosy: +iritkatriel
title: language reference describes the role of module.__file__ inaccurately -> [doc] language reference describes the role of module.__file__ inaccurately
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21761>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:49:09 2021
From: report at bugs.python.org (Ram Rachum)
Date: Sun, 05 Dec 2021 17:49:09 +0000
Subject: [issue45990] Exception notes need more documentation
Message-ID: <1638726549.23.0.192280798069.issue45990@roundup.psfhosted.org>


New submission from Ram Rachum <ram at rachum.com>:

The new __note__ feature for exception could be useful, but the documentation (and the section in "What's new") aren't good enough:

"__note__: A mutable field which is :const:`None` by default and can be set to a string. If it is not :const:`None`, it is included in the traceback. This field can be used to enrich exceptions after they have been caught."

This is more of a definition than an explanation. If this is solving a problem, there should be an explanation that starts from the problem being solved, hopefully with 2-3 examples where this is useful. If people start using this feature without some guidance, they might put things in the note that should have been in the message.

----------
assignee: docs at python
components: Documentation
messages: 407722
nosy: cool-RR, docs at python, iritkatriel
priority: normal
severity: normal
status: open
title: Exception notes need more documentation
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45990>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:53:00 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Sun, 05 Dec 2021 17:53:00 +0000
Subject: [issue45989] Getting key of max value of dict really dose not sense
In-Reply-To: <1638725848.56.0.191951522901.issue45989@roundup.psfhosted.org>
Message-ID: <1638726780.69.0.62520562613.issue45989@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

The code makes perfect sense. If you want to find the maximum key in a dict, you write:

    max(collective_signals)

If you want to find the maximum key according to some key function, you write:

    max(collective_signals, key=function)


If you want to find the maximum key according to its associated value, the key function that will work is collective_signals.get. That makes perfect sense.

Not every one-line piece of code needs to be a builtin function.

In any case, Python 3.6 to 3.10 are all in feature-freeze. Even if we added some special function to do this, which I doubt we will do, it could only go into 3.11.

----------
nosy: +steven.daprano
versions:  -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45989>
_______________________________________

From report at bugs.python.org  Sun Dec  5 12:54:14 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Sun, 05 Dec 2021 17:54:14 +0000
Subject: [issue45989] Add new function or method to return the dict key with
 the maximum value
In-Reply-To: <1638725848.56.0.191951522901.issue45989@roundup.psfhosted.org>
Message-ID: <1638726854.32.0.755188472937.issue45989@roundup.psfhosted.org>


Change by Steven D'Aprano <steve+python at pearwood.info>:


----------
title: Getting key of max value of dict really dose not sense -> Add new function or method to return the dict key with the maximum value

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45989>
_______________________________________

From report at bugs.python.org  Sun Dec  5 13:06:14 2021
From: report at bugs.python.org (Julius Hamilton)
Date: Sun, 05 Dec 2021 18:06:14 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <CAP7+vJJ3F3ywP2kHgVS5=Ec7g+vPBaLSh1SHjmMDHRCuZ3epfg@mail.gmail.com>
Message-ID: <1638727574.53.0.443979859548.issue45934@roundup.psfhosted.org>


Julius Hamilton <juliushamilton100 at gmail.com> added the comment:

I?m trying to patch this bug.

Here are my current working questions:

1. What is the relationship between an fd (file descriptor) and a terminal? What software / hardware component goes to ?fd 0? to receive input from it? Is there a GNU Screen command to receive stdin from ?fd n?, fd 3 for example?

2. Looking at the source code:

def initscr():
    import _curses, curses
    # we call setupterm() here because it raises an error
    # instead of calling exit() in error cases.
    setupterm(term=_os.environ.get("TERM", "unknown"),
              fd=_sys.__stdout__.fileno())
    stdscr = _curses.initscr()
    for key, value in _curses.__dict__.items():
        if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
            setattr(curses, key, value)

    return stdscr

- why does initscr() begin by importing _curses and curses? Precompiled C curses and non-compiled C or is the second importing Python? How can a module be importing itself?

- they call ?setupterm?, a C curses function, because it raises an error if there?s a problem in case of just quitting. But how so, specifically? Do the errors get detected at stderr and then the terminal raises another error or something? I?m not clear on the details. Plus, why can they call this function without referring to the enclosing package, curses.setupterm? Is that a C thing that all functions are automatically added to the namespace?

- Someone wrote that ?initscr? actually calls ?newterm?, in the code. So I guess I should look at the C newterm code, see how it works and see if a direct implementation is possible.


(I said in an email I would double post an email I sent but instead I?m posting more specific questions here related to that email. Also, I?m still studying an email Guido sent, so apologies for any redundant questions here.)

Thanks,
Julius

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Sun Dec  5 13:21:30 2021
From: report at bugs.python.org (Julius Hamilton)
Date: Sun, 05 Dec 2021 18:21:30 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <1638658883.36.0.145478613.issue45934@roundup.psfhosted.org>
Message-ID: <CAEsMKX3MxtmKopcYSYFLZLKDj9Az8TpAstPW_MoN4m3bZw-whg@mail.gmail.com>


Julius Hamilton <juliushamilton100 at gmail.com> added the comment:

I?m trying to patch this bug.

Here are my current working questions:

1. What is the relationship between an fd (file descriptor) and a terminal?
What software / hardware component goes to ?fd 0? to receive input from it?
Is there a GNU Screen command to receive stdin from ?fd n?, fd 3 for
example?

2. Looking at the source code:

def initscr():
import _curses, curses
# we call setupterm() here because it raises an error
# instead of calling exit() in error cases.
setupterm(term=_os.environ.get("TERM", "unknown"),
fd=_sys.__stdout__.fileno())
stdscr = _curses.initscr()
for key, value in _curses.__dict__.items():
if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
setattr(curses, key, value)
return stdscr

- why does initscr() begin by importing _curses and curses? Precompiled C
curses and non-compiled C or is the second importing Python? How can a
module be importing itself?

- they call ?setupterm?, a C curses function, because it raises an error if
there?s a problem in case of just quitting. But how so, specifically? Do
the errors get detected at stderr and then the terminal raises another
error or something? I?m not clear on the details. Plus, why can they call
this function without referring to the enclosing package, curses.setupterm?
Is that a C thing that all functions are automatically added to the
namespace?

- Someone wrote that ?initscr? actually calls ?newterm?, in the code. So I
guess I should look at the C newterm code, see how it works and see if a
direct implementation is possible.

(I said in an email I would double post an email I sent but instead I?m
posting more specific questions here related to that email. Also, I?m still
studying an email Guido sent, so apologies for any redundant questions
here.)

Thanks,
Julius

On Sun 5. Dec 2021 at 00:01, ?ric Araujo <report at bugs.python.org> wrote:

>
> Change by ?ric Araujo <merwok at netwok.org>:
>
>
> ----------
> stage:  -> needs patch
> versions:  -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue45934>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Sun Dec  5 13:44:45 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sun, 05 Dec 2021 18:44:45 +0000
Subject: [issue45989] Add new function or method to return the dict key with
 the maximum value
In-Reply-To: <1638725848.56.0.191951522901.issue45989@roundup.psfhosted.org>
Message-ID: <1638729885.46.0.755740005843.issue45989@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

I agree that we don't need a special function for this, so I'm going to close this.

----------
nosy: +eric.smith
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45989>
_______________________________________

From report at bugs.python.org  Sun Dec  5 13:56:47 2021
From: report at bugs.python.org (Kevin Hock)
Date: Sun, 05 Dec 2021 18:56:47 +0000
Subject: [issue45991] Improve ambiguous docstrings in pkgutil
Message-ID: <1638730607.25.0.754715317111.issue45991@roundup.psfhosted.org>


New submission from Kevin Hock <khock at pinterest.com>:

# Issue

If you search for "list of paths" in https://github.com/KevinHock/cpython/blob/main/Lib/pkgutil.py

A lot of people mistake this as `PosixPath`. You can see an example here: https://github.com/duo-labs/parliament/pull/207 that references other OSS repositories.

# Solution

We can
- Change the wording. e.g. "list of strings of the paths" or some variation of that.

and perhaps additionally

- Throw a ValueError similar to: https://github.com/python/cpython/blob/628abe4463ed40cd54ca952a2b4cc2d6e74073f7/Lib/pkgutil.py#L122

----------
assignee: docs at python
components: Documentation
messages: 407727
nosy: docs at python, khock
priority: normal
severity: normal
status: open
title: Improve ambiguous docstrings in pkgutil
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45991>
_______________________________________

From report at bugs.python.org  Sun Dec  5 13:59:14 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sun, 05 Dec 2021 18:59:14 +0000
Subject: [issue45977] Unexpected effect of sys.pycache_prefix = ""
In-Reply-To: <1638590311.18.0.778355816492.issue45977@roundup.psfhosted.org>
Message-ID: <1638730754.44.0.637777509589.issue45977@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

It works as designed and documented. An empty string is considered a relative directory.

https://docs.python.org/3/library/sys.html#sys.pycache_prefix


> If this is set (not None), Python will write bytecode-cache .pyc files to (and read them from) a parallel directory tree rooted at this directory...
>
> A relative path is interpreted relative to the current working directory.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45977>
_______________________________________

From report at bugs.python.org  Sun Dec  5 14:05:06 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 19:05:06 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638731106.75.0.590632576516.issue27946@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 52a9a71fe682e47f6c78a9c34aa9a797ca632c86 by Miss Islington (bot) in branch '3.9':
bpo-27946: Fix possible crash in ElementTree.Element (GH-29915)
https://github.com/python/cpython/commit/52a9a71fe682e47f6c78a9c34aa9a797ca632c86


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sun Dec  5 14:05:06 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 19:05:06 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638731106.55.0.04427935371.issue27946@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset beb834292db54fea129dd073cc822179430cee52 by Miss Islington (bot) in branch '3.10':
bpo-27946: Fix possible crash in ElementTree.Element (GH-29915)
https://github.com/python/cpython/commit/beb834292db54fea129dd073cc822179430cee52


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sun Dec  5 14:05:06 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 19:05:06 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638731106.55.0.04427935371.issue27946@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset beb834292db54fea129dd073cc822179430cee52 by Miss Islington (bot) in branch '3.10':
bpo-27946: Fix possible crash in ElementTree.Element (GH-29915)
https://github.com/python/cpython/commit/beb834292db54fea129dd073cc822179430cee52


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sun Dec  5 14:07:13 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 19:07:13 +0000
Subject: [issue27946] elementtree calls PyDict_GetItem without owning a
 reference to the dict
In-Reply-To: <1472852881.19.0.987799736928.issue27946@psf.upfronthosting.co.za>
Message-ID: <1638731233.25.0.199388045112.issue27946@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________

From report at bugs.python.org  Sun Dec  5 14:10:45 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 19:10:45 +0000
Subject: [issue45987] os.chdir in unittest's test case causes RecursionError
 on Windows
In-Reply-To: <1638714309.05.0.538480655841.issue45987@roundup.psfhosted.org>
Message-ID: <1638731445.67.0.691865512536.issue45987@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

What is (snip)?

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45987>
_______________________________________

From report at bugs.python.org  Sun Dec  5 14:15:01 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 19:15:01 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <CAP7+vJJ3F3ywP2kHgVS5=Ec7g+vPBaLSh1SHjmMDHRCuZ3epfg@mail.gmail.com>
Message-ID: <1638731701.09.0.874083588737.issue45934@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

What is it about? The first message is by Guido, but not this message nor the title does not give me any idea what is it about.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Sun Dec  5 14:20:49 2021
From: report at bugs.python.org (theeshallnotknowethme)
Date: Sun, 05 Dec 2021 19:20:49 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
In-Reply-To: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>
Message-ID: <1638732049.21.0.261733580759.issue45984@roundup.psfhosted.org>


theeshallnotknowethme <nohackingofkrowten at gmail.com> added the comment:

Can I know the reason for rejection?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:05:14 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sun, 05 Dec 2021 20:05:14 +0000
Subject: [issue45987] os.chdir in unittest's test case causes RecursionError
 on Windows
In-Reply-To: <1638714309.05.0.538480655841.issue45987@roundup.psfhosted.org>
Message-ID: <1638734714.81.0.230891087589.issue45987@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

Windows opens the working directory without delete sharing, so trying to delete it fails with a PermissionError for ERROR_SHARING_VIOLATION (winerror 32).

I discussed a modified version of the _rmtree() method in msg377358. The proposed version would try to reset the permissions in the first pass, recur once, and then give up because the permission error cannot be handled.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45987>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:26:19 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 20:26:19 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1638735979.38.0.731253681189.issue37295@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 60c320c38e4e95877cde0b1d8562ebd6bc02ac61 by Serhiy Storchaka in branch 'main':
bpo-37295: Optimize math.comb() and math.perm() (GH-29090)
https://github.com/python/cpython/commit/60c320c38e4e95877cde0b1d8562ebd6bc02ac61


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:35:28 2021
From: report at bugs.python.org (Spencer Brown)
Date: Sun, 05 Dec 2021 20:35:28 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638736528.04.0.22354708558.issue44166@roundup.psfhosted.org>


Spencer Brown <spencerb21 at live.com> added the comment:

One potential solution would be to add two Py_ssize_t to IndexError, storing the index and length along with the existing exception value. Then __str__() can append that to the message if set, perhaps having len be negative to signal they're not passed. 

An issue though is that it might be backwards incompatible with classes trying to multiply inherit from other exceptions too. To deal with that it could put the values in the args tuple, though then it'd have to allocate the tuple and ints which might hurt perf.

----------
nosy: +Spencer Brown

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:42:05 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 20:42:05 +0000
Subject: [issue45662] Incorrect repr of InitVar of a type alias
In-Reply-To: <1635450363.22.0.969198768309.issue45662@roundup.psfhosted.org>
Message-ID: <1638736925.52.0.834482466324.issue45662@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 1fd4de5bddbbf2a97cdbac4d298c89e1156bdc6c by Serhiy Storchaka in branch 'main':
bpo-45662: Fix the repr of InitVar with a type alias to the built-in class (GH-29291)
https://github.com/python/cpython/commit/1fd4de5bddbbf2a97cdbac4d298c89e1156bdc6c


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45662>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:42:18 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 20:42:18 +0000
Subject: [issue45662] Incorrect repr of InitVar of a type alias
In-Reply-To: <1635450363.22.0.969198768309.issue45662@roundup.psfhosted.org>
Message-ID: <1638736938.06.0.257830165785.issue45662@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28147
pull_request: https://github.com/python/cpython/pull/29923

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45662>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:42:22 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 20:42:22 +0000
Subject: [issue45662] Incorrect repr of InitVar of a type alias
In-Reply-To: <1635450363.22.0.969198768309.issue45662@roundup.psfhosted.org>
Message-ID: <1638736942.54.0.125302618942.issue45662@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28148
pull_request: https://github.com/python/cpython/pull/29924

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45662>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:42:54 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 20:42:54 +0000
Subject: [issue45663] is_dataclass() does not work for dataclasses which are
 subclasses of types.GenericAlias
In-Reply-To: <1635451831.16.0.493312475993.issue45663@roundup.psfhosted.org>
Message-ID: <1638736974.19.0.18535178012.issue45663@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 446be166861b2f08f87f74018113dd98ca5fca02 by Serhiy Storchaka in branch 'main':
bpo-45663: Fix is_dataclass() for dataclasses which are subclasses of types.GenericAlias (GH-29294)
https://github.com/python/cpython/commit/446be166861b2f08f87f74018113dd98ca5fca02


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45663>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:42:57 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 20:42:57 +0000
Subject: [issue45663] is_dataclass() does not work for dataclasses which are
 subclasses of types.GenericAlias
In-Reply-To: <1635451831.16.0.493312475993.issue45663@roundup.psfhosted.org>
Message-ID: <1638736977.47.0.556468296051.issue45663@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28149
pull_request: https://github.com/python/cpython/pull/29925

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45663>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:43:01 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 20:43:01 +0000
Subject: [issue45663] is_dataclass() does not work for dataclasses which are
 subclasses of types.GenericAlias
In-Reply-To: <1635451831.16.0.493312475993.issue45663@roundup.psfhosted.org>
Message-ID: <1638736981.55.0.738121156274.issue45663@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28150
pull_request: https://github.com/python/cpython/pull/29926

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45663>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:44:08 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 20:44:08 +0000
Subject: [issue45664] resolve_bases() and new_class() do not work with type
 alias of a built-in type
In-Reply-To: <1635453507.8.0.842225708276.issue45664@roundup.psfhosted.org>
Message-ID: <1638737048.58.0.207361510473.issue45664@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +28151
pull_request: https://github.com/python/cpython/pull/29927

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45664>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:44:08 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 20:44:08 +0000
Subject: [issue45664] resolve_bases() and new_class() do not work with type
 alias of a built-in type
In-Reply-To: <1635453507.8.0.842225708276.issue45664@roundup.psfhosted.org>
Message-ID: <1638737048.97.0.485994330678.issue45664@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 2b318ce1c988b7b6e3caf293d55f289e066b6e0f by Serhiy Storchaka in branch 'main':
bpo-45664: Fix resolve_bases() and new_class() for GenericAlias instance as a base (GH-29298)
https://github.com/python/cpython/commit/2b318ce1c988b7b6e3caf293d55f289e066b6e0f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45664>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:44:12 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 20:44:12 +0000
Subject: [issue45664] resolve_bases() and new_class() do not work with type
 alias of a built-in type
In-Reply-To: <1635453507.8.0.842225708276.issue45664@roundup.psfhosted.org>
Message-ID: <1638737052.64.0.266239613227.issue45664@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28152
pull_request: https://github.com/python/cpython/pull/29928

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45664>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:49:44 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 20:49:44 +0000
Subject: [issue45840] Improve cross-references in the data model documentation
In-Reply-To: <1637287286.96.0.846227383123.issue45840@roundup.psfhosted.org>
Message-ID: <1638737384.76.0.00811680446978.issue45840@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset c0521fe49fd75e794a38a216813658ab40185834 by Alex Waygood in branch 'main':
bpo-45840: Improve cross-references in the data model documentation (GH-29633)
https://github.com/python/cpython/commit/c0521fe49fd75e794a38a216813658ab40185834


----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45840>
_______________________________________

From report at bugs.python.org  Sun Dec  5 15:54:52 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 05 Dec 2021 20:54:52 +0000
Subject: [issue13236] unittest needs more flush calls
In-Reply-To: <1319137324.16.0.266090134048.issue13236@psf.upfronthosting.co.za>
Message-ID: <1638737692.27.0.00577182629268.issue13236@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
pull_requests: +28153
pull_request: https://github.com/python/cpython/pull/29929

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13236>
_______________________________________

From report at bugs.python.org  Sun Dec  5 16:02:51 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 21:02:51 +0000
Subject: [issue45662] Incorrect repr of InitVar of a type alias
In-Reply-To: <1635450363.22.0.969198768309.issue45662@roundup.psfhosted.org>
Message-ID: <1638738171.92.0.318765334194.issue45662@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset f1dd5ed1f35a7ed5c3833c822e9965de2400d77e by Miss Islington (bot) in branch '3.10':
bpo-45662: Fix the repr of InitVar with a type alias to the built-in class (GH-29291)
https://github.com/python/cpython/commit/f1dd5ed1f35a7ed5c3833c822e9965de2400d77e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45662>
_______________________________________

From report at bugs.python.org  Sun Dec  5 16:04:37 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 21:04:37 +0000
Subject: [issue45663] is_dataclass() does not work for dataclasses which are
 subclasses of types.GenericAlias
In-Reply-To: <1635451831.16.0.493312475993.issue45663@roundup.psfhosted.org>
Message-ID: <1638738277.73.0.236558281575.issue45663@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset abceb66c7e33d165361d8a26efb3770faa721aff by Miss Islington (bot) in branch '3.10':
bpo-45663: Fix is_dataclass() for dataclasses which are subclasses of types.GenericAlias (GH-29294)
https://github.com/python/cpython/commit/abceb66c7e33d165361d8a26efb3770faa721aff


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45663>
_______________________________________

From report at bugs.python.org  Sun Dec  5 16:17:35 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 05 Dec 2021 21:17:35 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638739055.31.0.995311007709.issue44166@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I also share Serhiy's concerns and prefer that it be left as-is.

Conceptually, adding more information in the error message would make it more useful for debugging, but in practice, it would rarely be helpful.  In teaching and coaching Python, I've learned that the intended, dominant effect of seeing "IndexError: list index out of range" is that a person understands that index is invalid because it is out of range.  That is a helpful dominant impression.  IMO it would be distracting and rarely helpful to focus on the specific index and length.  The important point is that a nonsense lookup was being made.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 16:25:54 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 21:25:54 +0000
Subject: [issue45663] is_dataclass() does not work for dataclasses which are
 subclasses of types.GenericAlias
In-Reply-To: <1635451831.16.0.493312475993.issue45663@roundup.psfhosted.org>
Message-ID: <1638739554.35.0.692302202573.issue45663@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 19050711f5a68e50b942b3b7f1f4cf398f27efff by Miss Islington (bot) in branch '3.9':
bpo-45663: Fix is_dataclass() for dataclasses which are subclasses of types.GenericAlias (GH-29294)
https://github.com/python/cpython/commit/19050711f5a68e50b942b3b7f1f4cf398f27efff


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45663>
_______________________________________

From report at bugs.python.org  Sun Dec  5 16:26:46 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 05 Dec 2021 21:26:46 +0000
Subject: [issue45664] resolve_bases() and new_class() do not work with type
 alias of a built-in type
In-Reply-To: <1635453507.8.0.842225708276.issue45664@roundup.psfhosted.org>
Message-ID: <1638739606.58.0.971992471041.issue45664@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset cb68c0a3a4aeb4ec58ab1f71b70bc8bfecbceef6 by Miss Islington (bot) in branch '3.10':
bpo-45664: Fix resolve_bases() and new_class() for GenericAlias instance as a base (GH-29298)
https://github.com/python/cpython/commit/cb68c0a3a4aeb4ec58ab1f71b70bc8bfecbceef6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45664>
_______________________________________

From report at bugs.python.org  Sun Dec  5 16:31:17 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 05 Dec 2021 21:31:17 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638739877.67.0.978595337095.issue44166@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Here's another way to think of it:  

The call s[i] raising an IndexError isn't a numerical error, it is a conceptual error.  Knowing that i==15 and len(s)==10 doesn't usually help resolve the problem.  The fix typically isn't replacing s[i] with s[i - 5].  Usually the issue is usually deeper than that.

Note, this is different than KeyError where misspellings are common and where the fix can be indicated by knowing the key:   d['missteak'] -> d['mistake'].

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 16:55:02 2021
From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=)
Date: Sun, 05 Dec 2021 21:55:02 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638741302.0.0.654708435791.issue44166@roundup.psfhosted.org>


Vedran ?a?i? <vedgar at gmail.com> added the comment:

> fix typically isn't replacing s[i] with s[i - 5]

... especially since that will still raise IndexError (in case when i==15 and len(s)==10). ;-P

----------
nosy: +veky

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 16:58:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 21:58:33 +0000
Subject: [issue1512163] mailbox (2.5b1): locking doesn't work (esp. on FreeBSD)
Message-ID: <1638741513.39.0.063196597159.issue1512163@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The original bug has been fixed, so I am closing this. Please create a new issue (probably of type enhancement) for the .lock()/.unlock() override support if this is still an issue.  The use case/test can be discussed on that issue.

----------
nosy: +iritkatriel
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1512163>
_______________________________________

From report at bugs.python.org  Sun Dec  5 17:00:56 2021
From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=)
Date: Sun, 05 Dec 2021 22:00:56 +0000
Subject: [issue45988] inspect.signature fails on a @staticmethod
In-Reply-To: <1638720431.62.0.74657433322.issue45988@roundup.psfhosted.org>
Message-ID: <1638741656.71.0.611529646159.issue45988@roundup.psfhosted.org>


Vedran ?a?i? <vedgar at gmail.com> added the comment:

Of course, signature should be imported from inspect, not from typing. In that case, the example works on Python 3.10 and 3.11.

----------
nosy: +veky

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45988>
_______________________________________

From report at bugs.python.org  Sun Dec  5 17:32:23 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sun, 05 Dec 2021 22:32:23 +0000
Subject: [issue45984] Error messages for invalid string prefixes and potential
 attribute accesses
In-Reply-To: <1638655712.59.0.26828555414.issue45984@roundup.psfhosted.org>
Message-ID: <1638743543.45.0.951950604633.issue45984@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Check my multiple comments in PR29916

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45984>
_______________________________________

From report at bugs.python.org  Sun Dec  5 17:35:22 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sun, 05 Dec 2021 22:35:22 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638743722.57.0.0852386444446.issue44166@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I concur with Serhiy and Raymond and I would prefer to leave as is.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 17:46:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 22:46:55 +0000
Subject: [issue25668] Deadlock in logging caused by a possible race condition
 with "format"
In-Reply-To: <1447942973.46.0.788007678714.issue25668@psf.upfronthosting.co.za>
Message-ID: <1638744415.97.0.836496154292.issue25668@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

> Please tell me what is unusual for you with this testcase?

Grabbing a lock in __str__/__repr__ strikes me as unusual and a recipe for problems.

You don't really know when those functions are called - from the debugger, from exception handlers, etc..   Even if the logging module protected you from the deadlock you found, you won't be safe from similar situations with other libraries that use locks.

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25668>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:01:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:01:22 +0000
Subject: [issue13821] [doc] misleading return from isidentifier
In-Reply-To: <1326934459.59.0.614334427327.issue13821@psf.upfronthosting.co.za>
Message-ID: <1638745282.53.0.331461551432.issue13821@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: misleading return from isidentifier -> [doc] misleading return from isidentifier
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13821>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:03:56 2021
From: report at bugs.python.org (Toshihiro Kamiya)
Date: Sun, 05 Dec 2021 23:03:56 +0000
Subject: [issue45987] os.chdir in unittest's test case causes RecursionError
 on Windows
In-Reply-To: <1638714309.05.0.538480655841.issue45987@roundup.psfhosted.org>
Message-ID: <1638745436.99.0.857915662822.issue45987@roundup.psfhosted.org>


Toshihiro Kamiya <kamiya at mbj.nifty.com> added the comment:

Sorry, the "(snip)" means that it was omitted because it was too long.
I' ll attach a screenshot.

----------
Added file: https://bugs.python.org/file50477/FF2dfQ_acAc497b.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45987>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:10:56 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:10:56 +0000
Subject: [issue12290] __setstate__ is called for false values
In-Reply-To: <1307586060.34.0.652262251036.issue12290@psf.upfronthosting.co.za>
Message-ID: <1638745856.45.0.69229194488.issue12290@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

See also issue26695.

----------
nosy: +iritkatriel
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12290>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:11:25 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:11:25 +0000
Subject: [issue26695] pickle and _pickle accelerator have different behavior
 when unpickling an object with falsy __getstate__ return
In-Reply-To: <1459868506.3.0.857595967516.issue26695@psf.upfronthosting.co.za>
Message-ID: <1638745885.49.0.779874877102.issue26695@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

See also issue12290.

----------
nosy: +iritkatriel
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26695>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:18:44 2021
From: report at bugs.python.org (Toshihiro Kamiya)
Date: Sun, 05 Dec 2021 23:18:44 +0000
Subject: [issue45987] os.chdir in unittest's test case causes RecursionError
 on Windows
In-Reply-To: <1638714309.05.0.538480655841.issue45987@roundup.psfhosted.org>
Message-ID: <1638746324.97.0.989897943234.issue45987@roundup.psfhosted.org>


Toshihiro Kamiya <kamiya at mbj.nifty.com> added the comment:

Thank you, eryksun, for pointing out the cause of the problem. I have modified the test script and it can now be run on Windows.

The attached file is a revised version of the reproduction script, which reflects the modifications made to the test script to prevent the error.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
Added file: https://bugs.python.org/file50478/test_chdir_wo_fail.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45987>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:21:32 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:21:32 +0000
Subject: [issue38836] Links are duplicated in documentation search result
In-Reply-To: <1574096104.71.0.223088739291.issue38836@roundup.psfhosted.org>
Message-ID: <1638746492.38.0.0910641750519.issue38836@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

On a Mac I was unable to reproduce this - the link to the search results give me a list of two items:

1. os.walk linking to https://docs.python.org/3.9/library/os.html?highlight=os.walk#os.walk

2. Changelog linking to https://docs.python.org/3.9/whatsnew/changelog.html?highlight=os.walk

However, on windows I got a list of 4 items:

1. os.walk : https://docs.python.org/3.9/library/os.html?highlight=os%20walk#os.walk

2. os.fwalk: https://docs.python.org/3.9/library/os.html?highlight=os%20walk#os.fwalk

3. os.fwalk: https://docs.python.org/3.9/library/os.html?highlight=os%20walk#os.fwalk

4. os.walk: https://docs.python.org/3.9/library/os.html?highlight=os%20walk#os.walk


In summary: 

Mac didn't know os.fwalk. Windows didn't show the Changelog. Windows showed each link twice.

----------
nosy: +iritkatriel
status: open -> pending
versions: +Python 3.10, Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38836>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:25:12 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:25:12 +0000
Subject: [issue29317] test_copyxattr_symlinks fails
In-Reply-To: <1484782411.92.0.520036190929.issue29317@psf.upfronthosting.co.za>
Message-ID: <1638746712.68.0.775064107272.issue29317@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29317>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:29:00 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:29:00 +0000
Subject: [issue26894] Readline not aborting line edition on sigint
In-Reply-To: <1462027506.98.0.545203031593.issue26894@psf.upfronthosting.co.za>
Message-ID: <1638746940.97.0.876234232.issue26894@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26894>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:33:23 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:33:23 +0000
Subject: [issue31879] Launcher fails on custom command starting with "python"
In-Reply-To: <1509037268.43.0.213398074469.issue31879@psf.upfronthosting.co.za>
Message-ID: <1638747203.93.0.134704738781.issue31879@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +loewis, mhammond
type: behavior -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31879>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:38:16 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:38:16 +0000
Subject: [issue16247] Report failing url in URLError?
In-Reply-To: <1350390680.77.0.132205585956.issue16247@psf.upfronthosting.co.za>
Message-ID: <1638747496.71.0.882492949014.issue16247@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Senthil, can this issue be closed now or is there something left to do?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16247>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:49:21 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:49:21 +0000
Subject: [issue29221] ABC Recursion Error on isinstance() with less than
 recursion limit class hierarchy depth
In-Reply-To: <1484021927.49.0.387886726852.issue29221@psf.upfronthosting.co.za>
Message-ID: <1638748161.91.0.395008596839.issue29221@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I am unable to reproduce this on 3.11. Is it still a problem?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29221>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:51:21 2021
From: report at bugs.python.org (Toshihiro Kamiya)
Date: Sun, 05 Dec 2021 23:51:21 +0000
Subject: [issue45987] os.chdir in unittest's test case causes RecursionError
 on Windows
In-Reply-To: <1638714309.05.0.538480655841.issue45987@roundup.psfhosted.org>
Message-ID: <1638748281.51.0.855697362072.issue45987@roundup.psfhosted.org>


Toshihiro Kamiya <kamiya at mbj.nifty.com> added the comment:

I think it may be difficult to understand the error message that deleting a directory causes "RecursionError or stack overflow", though.

I hope the issue reported as msg377358 will be resolved in some way.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45987>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:56:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:56:48 +0000
Subject: [issue27920] Embedding python in a shared library fails to import the
 Python module
In-Reply-To: <1472672150.5.0.175635801824.issue27920@psf.upfronthosting.co.za>
Message-ID: <1638748608.84.0.0120851329091.issue27920@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Did Antoine's fix from issue19153 solve your problem?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27920>
_______________________________________

From report at bugs.python.org  Sun Dec  5 18:57:06 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 05 Dec 2021 23:57:06 +0000
Subject: [issue27920] Embedding python in a shared library fails to import the
 Python module
In-Reply-To: <1472672150.5.0.175635801824.issue27920@psf.upfronthosting.co.za>
Message-ID: <1638748626.83.0.466595134142.issue27920@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27920>
_______________________________________

From report at bugs.python.org  Sun Dec  5 19:07:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 00:07:05 +0000
Subject: [issue17179] Misleading error from type() when passing unknown
 keyword argument
In-Reply-To: <1360571201.2.0.86006347662.issue17179@psf.upfronthosting.co.za>
Message-ID: <1638749225.67.0.633783034771.issue17179@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: needs patch -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17179>
_______________________________________

From report at bugs.python.org  Sun Dec  5 19:07:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 00:07:55 +0000
Subject: [issue24851] infinite loop in faulthandler._stack_overflow
In-Reply-To: <1439412048.1.0.772925582506.issue24851@psf.upfronthosting.co.za>
Message-ID: <1638749275.11.0.731081085665.issue24851@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24851>
_______________________________________

From report at bugs.python.org  Sun Dec  5 19:08:26 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 00:08:26 +0000
Subject: [issue23360] Content-Type when sending data with urlopen()
In-Reply-To: <1422794612.5.0.505084736818.issue23360@psf.upfronthosting.co.za>
Message-ID: <1638749306.54.0.801203258356.issue23360@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: patch review -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23360>
_______________________________________

From report at bugs.python.org  Sun Dec  5 19:52:45 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Mon, 06 Dec 2021 00:52:45 +0000
Subject: [issue45977] Unexpected effect of sys.pycache_prefix = ""
In-Reply-To: <1638590311.18.0.778355816492.issue45977@roundup.psfhosted.org>
Message-ID: <1638751965.6.0.291626063415.issue45977@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

If CWD=/a/b and pycache_prefix=c, the resulting dir is /a/b/c as I would expect.

If CWD=/a/b and pycache_prefix='', I would expect resulting dir to be /a/b 
 instead of /a/b/a/b .

For example as the shell `cd` command accepts relative path as arg, I would expect that `cd c` changes to /a/b/c ; but it would be very strange to expect `cd ` with empty arg to change to /a/b/a/b .

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45977>
_______________________________________

From report at bugs.python.org  Sun Dec  5 19:54:53 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Mon, 06 Dec 2021 00:54:53 +0000
Subject: [issue45977] Unexpected effect of sys.pycache_prefix = ""
In-Reply-To: <1638590311.18.0.778355816492.issue45977@roundup.psfhosted.org>
Message-ID: <1638752093.62.0.384810276816.issue45977@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Can this also create the risk of 'path too long' issues?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45977>
_______________________________________

From report at bugs.python.org  Sun Dec  5 19:57:31 2021
From: report at bugs.python.org (neonene)
Date: Mon, 06 Dec 2021 00:57:31 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638752251.83.0.600345827737.issue45582@roundup.psfhosted.org>


Change by neonene <nicesalmon at gmail.com>:


----------
pull_requests: +28154
pull_request: https://github.com/python/cpython/pull/29930

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Sun Dec  5 20:27:54 2021
From: report at bugs.python.org (Daniel Hillier)
Date: Mon, 06 Dec 2021 01:27:54 +0000
Subject: [issue45981] Get raw file name in bytes from ZipFile
In-Reply-To: <1638625166.93.0.299659631229.issue45981@roundup.psfhosted.org>
Message-ID: <1638754074.77.0.405177301479.issue45981@roundup.psfhosted.org>


Daniel Hillier <daniel.hillier at gmail.com> added the comment:

Handling different character sets is not completely supported yet. There are a couple of open issues relating to this: https://bugs.python.org/issue40407 (reading file names), https://bugs.python.org/issue41928 (support for reading and writing filenames using the unicode filename extra field) and https://bugs.python.org/issue40172 (issues with reading and then writing a filename from and back into a zip where the initial filename isn't encoded in cp437).

Most modern zip programs that deal with characters outside ascii or cp437 either set the utf-8 flag or write both an ascii or cp437 compatible filename (to the original filename field in the zip header) and the actual filename with all non-ascii characters in the unicode filename extra field. I think adding support for the unicode field to Python would probably cover the majority files generated by modern zip programs.

For complete support, including older zip programs that don't support the utf-8 flag or unicode filename extra field, we may need to provide another parameter in Python's ZipFile's read and write functions to be able to override the charset used for the filename stored directly in the zip file header.

I've added my thoughts on how to approach this in https://bugs.python.org/issue40172 but haven't had time to implement these myself.

----------
nosy: +dhillier

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45981>
_______________________________________

From report at bugs.python.org  Sun Dec  5 21:22:29 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Mon, 06 Dec 2021 02:22:29 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638757349.96.0.683308779319.issue44166@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 21:23:10 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Mon, 06 Dec 2021 02:23:10 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638757390.9.0.302761310891.issue44166@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
assignee:  -> rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 21:33:35 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Mon, 06 Dec 2021 02:33:35 +0000
Subject: [issue44166] Make IndexError messages for list more informative
In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org>
Message-ID: <1638758015.61.0.176173428719.issue44166@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Thank for the suggestion.  While we're going to a pass on this one, no doubt there are other places that language can improve its communication with the user.  Please continue to submit ideas and patches.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44166>
_______________________________________

From report at bugs.python.org  Sun Dec  5 22:51:51 2021
From: report at bugs.python.org (Ma Lin)
Date: Mon, 06 Dec 2021 03:51:51 +0000
Subject: [issue44092] [sqlite3] Remove special rollback handling
In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org>
Message-ID: <1638762711.81.0.938440705838.issue44092@roundup.psfhosted.org>


Ma Lin <malincns at 163.com> added the comment:

I think this change is no problem.
Erlend E. Aasland's explanation is very clear. 

There is only one situation that a problem may occur. Write code with SQLite 3.8.7.2+ (2014-11-18), and run it on 3.7.15 (2012-12-12) ~ 3.8.7.1-, but this situation may be difficult to happen, we can note this situation in doc.

More securely, if run on SQLite 3.8.7.1-, and encounter SQLITE_ABORT_ROLLBACK error code, a prompt can be given to explain the reason.

Also note that the current main branch is buggy. If don't adopt this change or revert this change later, don't forget to fix the bug of msg407185 (`pysqlite_Statement.in_use` flag is not reset).

----------
nosy: +malin

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44092>
_______________________________________

From report at bugs.python.org  Sun Dec  5 23:36:01 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Mon, 06 Dec 2021 04:36:01 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <CAP7+vJJ3F3ywP2kHgVS5=Ec7g+vPBaLSh1SHjmMDHRCuZ3epfg@mail.gmail.com>
Message-ID: <1638765361.21.0.297782951127.issue45934@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Serhiy, this started with a post by Julius to the core-mentorship list. He wants to add newterm(), and found that an issue about that was just created by a different user (draganic1) -- apparently without a comment body, so it appears the first comment is mine (I didn't know that was possible in bpo).

Windows experts are welcome to take themselves off the nosy list.

----------
nosy: +gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Mon Dec  6 02:00:11 2021
From: report at bugs.python.org (Tzu-ping Chung)
Date: Mon, 06 Dec 2021 07:00:11 +0000
Subject: [issue45992] distutils paths are scattered between PythonXY and
 PythonXY-32 on WoW64
Message-ID: <1638774011.75.0.410629931242.issue45992@roundup.psfhosted.org>


New submission from Tzu-ping Chung <uranusjr at gmail.com>:

Should be reproducible with a 32-bit Python 3.10 running on 64-bit Windows.

    $ py -3.10-32 -q
    >>> from distutils.command.install import install
    <stdin>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    >>> from distutils.dist import Distribution
    >>> c = install(Distribution())
    >>> c.user = 1
    >>> c.finalize_options()
    >>> for k in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
    ...  print(f'{k}\t{getattr(c, "install_" + k)}')
    ...
    purelib C:\Users\uranusjr\AppData\Roaming\Python\Python310-32\site-packages
    platlib C:\Users\uranusjr\AppData\Roaming\Python\Python310-32\site-packages
    headers C:\Users\uranusjr\AppData\Roaming\Python\Python310\Include\UNKNOWN
    scripts C:\Users\uranusjr\AppData\Roaming\Python\Python310\Scripts
    data    C:\Users\uranusjr\AppData\Roaming\Python

This is different from sysconfig, where all files are placed in the *-32 suffix:

    >>> import sysconfig
    >>> for k in ('purelib', 'platlib', 'include', 'scripts', 'data'):
    ...  print(f'{k}\t{paths[k]}')
    ...
    purelib C:\Users\uranusjr\AppData\Roaming\Python\Python310-32\site-packages
    platlib C:\Users\uranusjr\AppData\Roaming\Python\Python310-32\site-packages
    include C:\Users\uranusjr\AppData\Roaming\Python\Python310-32\Include
    scripts C:\Users\uranusjr\AppData\Roaming\Python\Python310-32\Scripts
    data    C:\Users\uranusjr\AppData\Roaming\Python

And also different from Python 3.9 (and prior), which does not use the *-32 prefix:

    $ py -3.9-32 -q
    >>> from distutils.command.install import install
    >>> from distutils.dist import Distribution
    >>> c = install(Distribution())
    >>> c.user = 1
    >>> c.finalize_options()
    >>> for k in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
    ...  print(f'{k}\t{getattr(c, "install_" + k)}')
    ...
    purelib C:\Users\uranusjr\AppData\Roaming\Python\Python39\site-packages
    platlib C:\Users\uranusjr\AppData\Roaming\Python\Python39\site-packages
    headers C:\Users\uranusjr\AppData\Roaming\Python\Python39\Include\UNKNOWN
    scripts C:\Users\uranusjr\AppData\Roaming\Python\Python39\Scripts
    data    C:\Users\uranusjr\AppData\Roaming\Python

It?s of course not a problem to change the prefix and add the *-32 suffix on 3.10 (since the only thing that?s important is to have a consistent prefix for a given version), but the change should likely need to be applied consistently. I think we should fix distutils to match sysconfig?

----------
components: Distutils, Windows
messages: 407769
nosy: dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, uranusjr, zach.ware
priority: normal
severity: normal
status: open
title: distutils paths are scattered between PythonXY and PythonXY-32 on WoW64
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45992>
_______________________________________

From report at bugs.python.org  Mon Dec  6 02:22:18 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 07:22:18 +0000
Subject: [issue45732] Make python.org Windows and macOS installers use Tk
 8.6.12
In-Reply-To: <1636154121.05.0.278439369914.issue45732@roundup.psfhosted.org>
Message-ID: <1638775338.1.0.0806334220684.issue45732@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
pull_requests: +28155
pull_request: https://github.com/python/cpython/pull/29931

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45732>
_______________________________________

From report at bugs.python.org  Mon Dec  6 02:24:10 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 07:24:10 +0000
Subject: [issue45732] Make python.org Windows and macOS installers use Tk
 8.6.12
In-Reply-To: <1636154121.05.0.278439369914.issue45732@roundup.psfhosted.org>
Message-ID: <1638775450.3.0.440739792639.issue45732@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
pull_requests: +28156
pull_request: https://github.com/python/cpython/pull/29932

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45732>
_______________________________________

From report at bugs.python.org  Mon Dec  6 02:26:42 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 07:26:42 +0000
Subject: [issue45732] Make python.org Windows and macOS installers use Tk
 8.6.12
In-Reply-To: <1636154121.05.0.278439369914.issue45732@roundup.psfhosted.org>
Message-ID: <1638775602.45.0.0455562610329.issue45732@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
pull_requests: +28157
pull_request: https://github.com/python/cpython/pull/29933

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45732>
_______________________________________

From report at bugs.python.org  Mon Dec  6 02:39:15 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 07:39:15 +0000
Subject: [issue45732] Make python.org Windows and macOS installers use Tk
 8.6.12
In-Reply-To: <1636154121.05.0.278439369914.issue45732@roundup.psfhosted.org>
Message-ID: <1638776355.69.0.890312505008.issue45732@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:


New changeset 20801982fa696a01ad2c116925bddf2fda106338 by Ned Deily in branch '3.10':
bpo-45732: Update python.org macOS installer to use Tcl/Tk 8.6.12. (GH-29932)
https://github.com/python/cpython/commit/20801982fa696a01ad2c116925bddf2fda106338


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45732>
_______________________________________

From report at bugs.python.org  Mon Dec  6 02:40:00 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 07:40:00 +0000
Subject: [issue45732] Make python.org Windows and macOS installers use Tk
 8.6.12
In-Reply-To: <1636154121.05.0.278439369914.issue45732@roundup.psfhosted.org>
Message-ID: <1638776400.71.0.896099852595.issue45732@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:


New changeset 7accb4fdb3dc1b4140089edee290998aff496fe2 by Ned Deily in branch '3.9':
bpo-45732: Update python.org macOS installer to use Tcl/Tk 8.6.12. (GH-29933)
https://github.com/python/cpython/commit/7accb4fdb3dc1b4140089edee290998aff496fe2


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45732>
_______________________________________

From report at bugs.python.org  Mon Dec  6 02:44:20 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 07:44:20 +0000
Subject: [issue45732] Make python.org Windows and macOS installers use Tk
 8.6.12
In-Reply-To: <1636154121.05.0.278439369914.issue45732@roundup.psfhosted.org>
Message-ID: <1638776660.94.0.916215147573.issue45732@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:


New changeset f34d181fa15e1f082140a4e4a8fa3b77118f8e98 by Ned Deily in branch 'main':
bpo-45732: Update python.org macOS installer to use Tcl/Tk 8.6.12. (GH-29931)
https://github.com/python/cpython/commit/f34d181fa15e1f082140a4e4a8fa3b77118f8e98


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45732>
_______________________________________

From report at bugs.python.org  Mon Dec  6 02:47:19 2021
From: report at bugs.python.org (hongweipeng)
Date: Mon, 06 Dec 2021 07:47:19 +0000
Subject: [issue42918] Nested multi-line expression will lead to "compile()"
 fails
In-Reply-To: <1610517717.73.0.740461753555.issue42918@roundup.psfhosted.org>
Message-ID: <1638776839.38.0.226059867888.issue42918@roundup.psfhosted.org>


Change by hongweipeng <hongweichen8888 at sina.com>:


----------
keywords: +patch
nosy: +hongweipeng
nosy_count: 4.0 -> 5.0
pull_requests: +28158
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29934

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42918>
_______________________________________

From report at bugs.python.org  Mon Dec  6 02:48:20 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 07:48:20 +0000
Subject: [issue45732] Make python.org Windows and macOS installers use Tk
 8.6.12
In-Reply-To: <1636154121.05.0.278439369914.issue45732@roundup.psfhosted.org>
Message-ID: <1638776900.09.0.867935533451.issue45732@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45732>
_______________________________________

From report at bugs.python.org  Mon Dec  6 03:00:18 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Mon, 06 Dec 2021 08:00:18 +0000
Subject: [issue45993] Main branch of CPython does not build anymore on macOS
Message-ID: <1638777618.8.0.921239379718.issue45993@roundup.psfhosted.org>


New submission from Nikita Sobolev <mail at sobolevn.me>:

New version of `main` branch does not build for me anymore.

Command: `make -j`
System information: 
- macOS 10.14.6
- Apple clang version 11.0.0 (clang-1100.0.33.16)

I am also attaching resulting Makefile.

Output:

```
? make -j
gcc -L/usr/local/opt/openssl/lib -L/usr/local/opt/openssl/lib   -o Programs/_freeze_module Programs/_freeze_module.o Modules/getpath_noop.o Modules/getbuildinfo.o Parser/token.o  Parser/pegen.o Parser/pegen_errors.o Parser/action_helpers.o Parser/parser.o Parser/string_parser.o Parser/peg_api.o Parser/myreadline.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genericaliasobject.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/unionobject.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/Python-tokenize.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frame.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/hamt.o Python/hashtable.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/specialize.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/suggestions.o Python/dynload_shlib.o    Modules/config.o Modules/main.o Modules/gcmodule.o Modules/xxsubtype.o -lintl -ldl  -framework CoreFoundation    
Undefined symbols for architecture x86_64:
  "_PyErr_CheckSignals", referenced from:
      _my_fgets in myreadline.o
      _long_to_decimal_string_internal in longobject.o
      _x_mul in longobject.o
      _x_divrem in longobject.o
      _PyObject_Print in object.o
      _PyObject_Str in object.o
      _PyObject_Repr in object.o
      ...
  "_PyOS_FSPath", referenced from:
      _PyUnicode_FSConverter in unicodeobject.o
      _PyUnicode_FSDecoder in unicodeobject.o
  "__PyAtExit_Call", referenced from:
      _Py_FinalizeEx in pylifecycle.o
      _Py_EndInterpreter in pylifecycle.o
  "__PyAtExit_Fini", referenced from:
      _interpreter_clear in pystate.o
  "__PyAtExit_Init", referenced from:
      _pycore_interp_init in pylifecycle.o
  "__PyErr_CheckSignalsTstate", referenced from:
      _handle_signals in ceval.o
  "__PyFaulthandler_Fini", referenced from:
      _Py_FinalizeEx in pylifecycle.o
      _fatal_error in pylifecycle.o
  "__PyFaulthandler_Init", referenced from:
      _init_interp_main in pylifecycle.o
  "__PyMem_DumpTraceback", referenced from:
      __PyObject_AssertFailed in object.o
      __PyObject_DebugDumpAddress in obmalloc.o
  "__PyOS_InterruptOccurred", referenced from:
      _my_fgets in myreadline.o
  "__PySignal_Fini", referenced from:
      _Py_FinalizeEx in pylifecycle.o
  "__PySignal_Init", referenced from:
      _init_interp_main in pylifecycle.o
  "__PyTraceMalloc_Fini", referenced from:
      _Py_FinalizeEx in pylifecycle.o
  "__PyTraceMalloc_Init", referenced from:
      _init_interp_main in pylifecycle.o
  "__PyTraceMalloc_NewReference", referenced from:
      __Py_NewReference in object.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_freeze_module] Error 1
```

----------
components: Build
files: Makefile
messages: 407773
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Main branch of CPython does not build anymore on macOS
type: compile error
versions: Python 3.11
Added file: https://bugs.python.org/file50479/Makefile

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45993>
_______________________________________

From report at bugs.python.org  Mon Dec  6 03:27:42 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 08:27:42 +0000
Subject: [issue45993] Main branch of CPython does not build anymore on macOS
In-Reply-To: <1638777618.8.0.921239379718.issue45993@roundup.psfhosted.org>
Message-ID: <1638779262.27.0.071313603483.issue45993@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Did you run "make distclean" or "git clean -xdf" before ./configure?

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45993>
_______________________________________

From report at bugs.python.org  Mon Dec  6 03:31:51 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 08:31:51 +0000
Subject: [issue44035] Regenerating the configure script fails even if
 dependencies are satisfied
In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org>
Message-ID: <1638779511.23.0.417186886001.issue44035@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
keywords: +patch
pull_requests: +28159
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29935

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44035>
_______________________________________

From report at bugs.python.org  Mon Dec  6 04:04:21 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 09:04:21 +0000
Subject: [issue45977] Unexpected effect of sys.pycache_prefix = ""
In-Reply-To: <1638590311.18.0.778355816492.issue45977@roundup.psfhosted.org>
Message-ID: <1638781461.71.0.0818314843256.issue45977@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

The cache prefix mirrors the directory structure. Python takes the absolute path to the .py file, converts the path to a relative path by stripping off the leading slash, and finally joins the path with the prefix.

Take this example:

$ PYTHONPYCACHEPREFIX=/tmp/pycache python3.10 -c pass

This will create the cache file "/tmp/pycache/usr/lib64/python3.10/os.cpython-310.pyc" for the Python file "/usr/lib64/python3.10/os.py.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45977>
_______________________________________

From report at bugs.python.org  Mon Dec  6 04:10:47 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 09:10:47 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638781847.6.0.647362084647.issue45950@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

Framework builds on macOS now fail with a bus error when trying to run the newly built _bootstrap_python. A simplified example:

$ ./configure --enable-framework=$PWD/Library/Frameworks
checking for git... found
checking build system type... x86_64-apple-darwin20.6.0
checking host system type... x86_64-apple-darwin20.6.0
checking for Python interpreter freezing... ./_bootstrap_python
checking for python3.11... no
checking for python3.10... no
checking for python3.9... no
checking for python3.8... no
checking for python3.7... no
checking for python3.6... no
checking for python3... python3
checking Python for regen version... Python 3.8.9
[...]
creating Modules/Setup.local
creating Makefile

pkg-config is missing. Some dependencies may not be detected correctly.


If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure --enable-optimizations


$ make
[...]
gcc     -o _bootstrap_python Modules/getbuildinfo.o Parser/token.o  Parser/pegen.o Parser/pegen_errors.o Parser/action_helpers.o Parser/parser.o Parser/string_parser.o Parser/peg_api.o Parser/myreadline.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genericaliasobject.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/unionobject.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/Python-tokenize.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frame.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/hamt.o Python/hashtable.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/specialize.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/suggestions.o Python/dynload_shlib.o    Modules/config.o Modules/main.o Modules/gcmodule.o Modules/atexitmodule.o  Modules/faulthandler.o  Modules/posixmodule.o  Modules/signalmodule.o  Modules/_tracemalloc.o  Modules/_codecsmodule.o  Modules/_collectionsmodule.o  Modules/errnomodule.o  Modules/_io/_iomodule.o Modules/_io/iobase.o Modules/_io/fileio.o Modules/_io/bytesio.o Modules/_io/bufferedio.o Modules/_io/textio.o Modules/_io/stringio.o  Modules/itertoolsmodule.o  Modules/_sre.o  Modules/_threadmodule.o  Modules/timemodule.o  Modules/_weakref.o  Modules/_abc.o  Modules/_functoolsmodule.o  Modules/_localemodule.o  Modules/_operator.o  Modules/_stat.o  Modules/symtablemodule.o  Modules/pwdmodule.o  Modules/xxsubtype.o \
		Programs/_bootstrap_python.o Modules/getpath.o -ldl  -framework CoreFoundation
./_bootstrap_python ./Tools/scripts/deepfreeze.py Python/frozen_modules/importlib._bootstrap.h -m importlib._bootstrap -o Python/deepfreeze/importlib._bootstrap.c
make: *** [Python/deepfreeze/importlib._bootstrap.c] Bus error: 10
$

--enable-framework causes a number of changes in interpreter building and initialization. Since, as it stands, _bootstrap_python executable isn't and doesn't need to be built as a framework, there is probably some path confusion in getpath.c or elsewhere.

Prior to these changes (at 3.11.0a2 at least), it was still possible to run a framework build executable in the build directory through some careful use of build variables in Makefile (like how "make test" works). Without delving deeper into it at the moment, I'm not sure what to suggest. It may be simpler to just do a clean separate non-framework build to provide _bootstrap_python. And/or possibly re-allow the use of --with-build-python to specify a user-supplied build python. I wonder if there are certain configurations on other platforms where there might be similar problems with the current approach.

I'm marking this as a "release blocker" since it is preventing building the usual python.org macOS binary installer for 3.11.0a3. Since it is still early in the release cycle for 3.11, the release manager might reasonably decide to not delay the release for a fix and thus skip having a macOS installer for a3.

----------
nosy: +ned.deily
priority: normal -> release blocker

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 04:25:31 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 09:25:31 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638782731.1.0.804210369686.issue45950@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Ned, does this change solve the issue with framework builds?

$ git diff
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 8e6e553554d..2068db30855 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -106,7 +106,7 @@ PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include
 PY_CPPFLAGS=   $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
 PY_LDFLAGS=    $(CONFIGURE_LDFLAGS) $(LDFLAGS)
 PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)
-PY_LDFLAGS_NOLTO=$(PY_LDFLAGS) $(CONFIGURE_LDFLAGS_NOLTO) $(LDFLAGS_NODIST)
+PY_LDFLAGS_NOLTO=$(PY_LDFLAGS_NODIST) $(CONFIGURE_LDFLAGS_NOLTO) $(LDFLAGS_NODIST)
 NO_AS_NEEDED=  @NO_AS_NEEDED@
 CCSHARED=      @CCSHARED@
 # LINKFORSHARED are the flags passed to the $(CC) command that links

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 04:32:49 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Mon, 06 Dec 2021 09:32:49 +0000
Subject: [issue45993] Main branch of CPython does not build anymore on macOS
In-Reply-To: <1638777618.8.0.921239379718.issue45993@roundup.psfhosted.org>
Message-ID: <1638783169.9.0.636398836859.issue45993@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Looks like removing cache worked. Thanks!

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45993>
_______________________________________

From report at bugs.python.org  Mon Dec  6 04:40:28 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 09:40:28 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638783628.93.0.42937167806.issue45950@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

> Ned, does this change solve the issue with framework builds?

No. I would guess at a minimum getpath.c for _bootstrap_python might need to be built without WITH_NEXT_FRAMEWORK defined. But I'm out of time for today and don't expect to have much time available in the immediate future.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:02:48 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 10:02:48 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638784968.07.0.497905644281.issue45950@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28160
pull_request: https://github.com/python/cpython/pull/29936

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:10:58 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 10:10:58 +0000
Subject: [issue41921] REDoS in parseentities
In-Reply-To: <1601737969.46.0.495788645161.issue41921@roundup.psfhosted.org>
Message-ID: <1638785458.8.0.876957108885.issue41921@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +lemburg
versions: +Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41921>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:13:34 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Mon, 06 Dec 2021 10:13:34 +0000
Subject: [issue44092] [sqlite3] Remove special rollback handling
In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org>
Message-ID: <1638785614.27.0.298647506409.issue44092@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

> I think this change is no problem.

Thanks, and thank you for looking reviewing this change.

> There is only one situation that a problem may occur. Write code with SQLite
> 3.8.7.2+ (2014-11-18), and run it on 3.7.15 (2012-12-12) ~ 3.8.7.1-, but
> this situation may be difficult to happen, we can note this situation in
> doc.

How realistic is this scenario? If you compile with, for example 3.14.0 or newer, you'd link with sqlite3_trace_v2, not sqlite3_trace, so the loader would prevent you from running with anything pre 3.14. AFAIK, we've never had such problems.

> More securely, if run on SQLite 3.8.7.1-, and encounter
> SQLITE_ABORT_ROLLBACK error code, a prompt can be given to explain the
> reason.

You already get both an error message, an (extended) error code. That should be sufficient.

> Also note that the current main branch is buggy. If don't adopt this change
> or revert this change later, don't forget to fix the bug of msg407185
> (`pysqlite_Statement.in_use` flag is not reset).

It is a change of behaviour of the internal machinery. Does the change lead to wrong results (duplicate rows, wrong rows returned, no rows returned)? Corrupted/garbage data? Non-deterministic behaviour? Does any of the API's provided by sqlite3 not behave according to the documentation anymore?

NB: I plan to get rid of the in_use flag long before the beta sets in.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44092>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:13:59 2021
From: report at bugs.python.org (Mark Shannon)
Date: Mon, 06 Dec 2021 10:13:59 +0000
Subject: [issue45963] Embed interpreter frame in generator.
In-Reply-To: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org>
Message-ID: <1638785639.68.0.194066020478.issue45963@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 299483c95d601ddcfdce2f96418b6499c1fc7b9f by Mark Shannon in branch 'main':
bpo-45963: Make space for the InterpreterFrame of a generator in that generator. (GH-29891)
https://github.com/python/cpython/commit/299483c95d601ddcfdce2f96418b6499c1fc7b9f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45963>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:23:33 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 10:23:33 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638786213.43.0.167060727801.issue45950@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Ronald, Pablo, could you please test GH-29936 on macOS with --enable-framework?

----------
nosy: +pablogsal, ronaldoussoren

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:24:39 2021
From: report at bugs.python.org (Marc-Andre Lemburg)
Date: Mon, 06 Dec 2021 10:24:39 +0000
Subject: [issue41921] REDoS in parseentities
In-Reply-To: <1601737969.46.0.495788645161.issue41921@roundup.psfhosted.org>
Message-ID: <1638786279.26.0.286877049196.issue41921@roundup.psfhosted.org>


Marc-Andre Lemburg <mal at egenix.com> added the comment:

Interesting that the tool still exists. It uses mxTextTools, but in a non-packaged version, so it's been broken for two decades now :-)

I think it's safe to remove it from Tools\scripts.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41921>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:30:32 2021
From: report at bugs.python.org (Ma Lin)
Date: Mon, 06 Dec 2021 10:30:32 +0000
Subject: [issue44092] [sqlite3] Remove special rollback handling
In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org>
Message-ID: <1638786632.09.0.220750844955.issue44092@roundup.psfhosted.org>


Ma Lin <malincns at 163.com> added the comment:

> How realistic is this scenario? If you compile with, for example 3.14.0 or
> newer, you'd link with sqlite3_trace_v2, not sqlite3_trace, so the loader
> would prevent you from running with anything pre 3.14. AFAIK, we've never
> had such problems.

I mean, after this change, different versions of SQLite will behave differently. And give a message for SQLITE_ABORT_ROLLBACK to explain this problem.

> It is a change of behaviour of the internal machinery. Does the change lead
> to wrong results (duplicate rows, wrong rows returned, no rows returned)?
> Corrupted/garbage data? Non-deterministic behaviour? Does any of the API's
> provided by sqlite3 not behave according to the documentation anymore?

It just leaks resource, apart from this, there seems to be no problem.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44092>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:37:11 2021
From: report at bugs.python.org (Thomas Kluyver)
Date: Mon, 06 Dec 2021 10:37:11 +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: <1638787031.6.0.511494580487.issue43805@roundup.psfhosted.org>


Thomas Kluyver <thomas at kluyver.me.uk> added the comment:

It's not my decision, so I can't really say. But the Queue API is pretty stable, and exists 3 times over in Python (the queue module for use with threads, in multiprocessing and in asyncio). So I'd guess that anyone wanting to add to that API would need to make a compelling case for why it's important, and be prepared for a lot of wrangling over API details (like method names and exceptions).

If you want to push that idea, you could try the ideas board on the Python discourse forum: https://discuss.python.org/c/ideas/6 .

You might also want to look at previous discussions about adding a Queue.close() method: issue29701 and issue40888.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43805>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:38:14 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Mon, 06 Dec 2021 10:38:14 +0000
Subject: [issue44092] [sqlite3] Remove special rollback handling
In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org>
Message-ID: <1638787094.27.0.189738452765.issue44092@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

> I mean, after this change, different versions of SQLite will behave differently.

Yes, this is explained in the news item:

    Fetch across rollback no longer raises :exc:`~sqlite3.InterfaceError`.
    Instead we leave it to the SQLite library to handle these cases.

> And give a message for SQLITE_ABORT_ROLLBACK to explain this problem.

I'm not sure this is a good idea; I believe letting the underlying SQLite library explain the error is better than trying to deduce stuff based on what was known at compile time and what we know at runtime.

> It just leaks resource, apart from this, there seems to be no problem.

Can you provide a reproducer? We've run this change through the ref. leak bots, and they are all green, so if there's a ref. leak, the test suite needs improvements.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44092>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:43:11 2021
From: report at bugs.python.org (Ma Lin)
Date: Mon, 06 Dec 2021 10:43:11 +0000
Subject: [issue44092] [sqlite3] Remove special rollback handling
In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org>
Message-ID: <1638787391.12.0.67904455813.issue44092@roundup.psfhosted.org>


Ma Lin <malincns at 163.com> added the comment:

Imagine a person write a code with Python 3.11 and SQLite 3.8.7.2+, and then deploying it to Python 3.11 and SQLite 3.8.7.1-, error may occur. However, this situation is difficult to happen.

> Can you provide a reproducer? We've run this change through the ref.
> leak bots, and they are all green, so if there's a ref. leak, the
> test suite needs improvements.

The statement in cache will be never reused. If you don't mind, it's not a big problem.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44092>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:44:20 2021
From: report at bugs.python.org (Taiga Katarao)
Date: Mon, 06 Dec 2021 10:44:20 +0000
Subject: [issue45994] Add simple usage to email module
Message-ID: <1638787460.4.0.146511552632.issue45994@roundup.psfhosted.org>


Change by Taiga Katarao <taiga4562 at gmail.com>:


----------
assignee: docs at python
components: Documentation
nosy: docs at python, tarao1006
priority: normal
severity: normal
status: open
title: Add simple usage to email module
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45994>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:55:37 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Mon, 06 Dec 2021 10:55:37 +0000
Subject: [issue44092] [sqlite3] Remove special rollback handling
In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org>
Message-ID: <1638788137.36.0.061201856449.issue44092@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

> Imagine a person write a code with Python 3.11 and SQLite 3.8.7.2+, and then
> deploying it to Python 3.11 and SQLite 3.8.7.1-, error may occur. However,
> this situation is difficult to happen.

Yes, I also think this is a far fetched case. I'll see if there's an easy way to handle this. If there isn't, I'm not sure the added complexity will be worth it.

> The statement in cache will be never reused.

That is not necessarily correct; if the "problematic cursor" executes a new statement, the statement in the cache will be reset, thus it can be reused. Also, if the "problematic cursor" is closed (or deleted), the statement can also be reused. But, if the "problematic cursor" just gets stale and is _never_ used again, it may be a performance issue if it is a hot statement. But, as soon as I can land my changes related to the in_use flag, this will not be an issue anyway.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44092>
_______________________________________

From report at bugs.python.org  Mon Dec  6 05:57:16 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 10:57:16 +0000
Subject: [issue38836] Links are duplicated in documentation search result
In-Reply-To: <1574096104.71.0.223088739291.issue38836@roundup.psfhosted.org>
Message-ID: <1638788236.47.0.360220223256.issue38836@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38836>
_______________________________________

From report at bugs.python.org  Mon Dec  6 06:29:24 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 11:29:24 +0000
Subject: [issue30988] Exception parsing invalid email address headers starting
 or ending with dot
In-Reply-To: <1500699002.76.0.343337119039.issue30988@psf.upfronthosting.co.za>
Message-ID: <1638790164.57.0.50099435322.issue30988@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30988>
_______________________________________

From report at bugs.python.org  Mon Dec  6 06:35:20 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 11:35:20 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638790520.59.0.93143716302.issue45950@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

If the patch does not help then I can re-enable --with-build-python for non-cross builds.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 06:43:40 2021
From: report at bugs.python.org (pmp-p)
Date: Mon, 06 Dec 2021 11:43:40 +0000
Subject: [issue45256] Remove the usage of the C stack in Python to Python calls
In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org>
Message-ID: <1638791020.35.0.96513591363.issue45256@roundup.psfhosted.org>


Change by pmp-p <pmpp.pub at gmail.com>:


----------
nosy: +pmpp

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45256>
_______________________________________

From report at bugs.python.org  Mon Dec  6 06:43:48 2021
From: report at bugs.python.org (pmp-p)
Date: Mon, 06 Dec 2021 11:43:48 +0000
Subject: [issue45829] Remove C stack use by specializing BINARY_SUBSCR,
 STORE_SUBSCR, LOAD_ATTR, and STORE_ATTR
In-Reply-To: <1637142611.15.0.521267590311.issue45829@roundup.psfhosted.org>
Message-ID: <1638791028.62.0.836349413296.issue45829@roundup.psfhosted.org>


Change by pmp-p <pmpp.pub at gmail.com>:


----------
nosy: +pmpp

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45829>
_______________________________________

From report at bugs.python.org  Mon Dec  6 06:43:58 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 11:43:58 +0000
Subject: [issue18774] There is still last bit of GNU Pth code in signalmodule.c
In-Reply-To: <1376801880.96.0.197365143686.issue18774@psf.upfronthosting.co.za>
Message-ID: <1638791038.61.0.472394878642.issue18774@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Two of the three remaining comments Christian mentioned are still there:

% grep -r "gnu pth" Python/ configure.ac
Python//thread.c:   library (e.g. gnu pth in pthread emulation) */
configure.ac:    # (e.g. gnu pth with pthread emulation)

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18774>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:03:47 2021
From: report at bugs.python.org (John Belmonte)
Date: Mon, 06 Dec 2021 12:03:47 +0000
Subject: [issue45995] string formatting: normalize negative zero
Message-ID: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>


New submission from John Belmonte <john at neggie.net>:

proposal: add a string formatting option to normalize negative 0 values to 0

use case:  rounded display of a float that is nominally 0, where the distraction of a flashing minus sign from minute changes around 0 is unwanted

example:
>>> '%~5.1f' % -.00001
'  0.0'

format spec before:
  format_spec     ::=  [[fill]align][sign][#][0][width][grouping_option][.precision][type]
after:
  format_spec     ::=  [[fill]align][sign][~][#][0][width][grouping_option][.precision][type]
  where '~' is only allowed for number types

implementation: if '~' is present in the spec, add 0 to the value after applying precision

----------
components: Library (Lib)
messages: 407792
nosy: John Belmonte
priority: normal
severity: normal
status: open
title: string formatting: normalize negative zero
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:15:51 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 06 Dec 2021 12:15:51 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638792951.69.0.120734385745.issue45995@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

To normalize negative 0.0 to 0.0 you can just add 0.0. It will work with any method of converting floats to string, there is no need to change all formatting specifications.

>>> x = -0.0
>>> x
-0.0
>>> x + 0.0
0.0

----------
nosy: +mark.dickinson, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:19:14 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 06 Dec 2021 12:19:14 +0000
Subject: [issue44035] Regenerating the configure script fails even if
 dependencies are satisfied
In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org>
Message-ID: <1638793154.74.0.698419433641.issue44035@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +28161
pull_request: https://github.com/python/cpython/pull/29937

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44035>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:19:30 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 12:19:30 +0000
Subject: [issue44035] Regenerating the configure script fails even if
 dependencies are satisfied
In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org>
Message-ID: <1638793170.71.0.532948081103.issue44035@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 98fac8bc183c113903403793ffe411358ee40d8a by Christian Heimes in branch 'main':
bpo-44035: Check autoconf files thoroughly (GH-29935)
https://github.com/python/cpython/commit/98fac8bc183c113903403793ffe411358ee40d8a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44035>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:21:33 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 12:21:33 +0000
Subject: [issue44035] Regenerating the configure script fails even if
 dependencies are satisfied
In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org>
Message-ID: <1638793293.08.0.683940135699.issue44035@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28162
pull_request: https://github.com/python/cpython/pull/29938

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44035>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:29:47 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 06 Dec 2021 12:29:47 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <CAP7+vJJ3F3ywP2kHgVS5=Ec7g+vPBaLSh1SHjmMDHRCuZ3epfg@mail.gmail.com>
Message-ID: <1638793787.08.0.970261878166.issue45934@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Thank you Guido for clarification. I have found that post:

https://mail.python.org/archives/list/core-mentorship at python.org/thread/YGSMPKP7G3HO73ISEQZFAWPPGCOA3JYZ/

I agree that it is worth to implement newterm. In particular it would be useful in tests.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:30:06 2021
From: report at bugs.python.org (John Belmonte)
Date: Mon, 06 Dec 2021 12:30:06 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638793806.3.0.575370955252.issue45995@roundup.psfhosted.org>


John Belmonte <john at neggie.net> added the comment:

> To normalize negative 0.0 to 0.0 you can just add 0.0.

yes, I'm aware-- see "implementation" in the original post

> there is no need to change all formatting specifications

For adding 0 to work, it must be done after the rounding.  That means if you want make use of anything in the current formatting spec regarding precision, normalizing negative zero would need to be a proper option of the formatting spec.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:41:59 2021
From: report at bugs.python.org (Chris Wesseling)
Date: Mon, 06 Dec 2021 12:41:59 +0000
Subject: [issue45664] resolve_bases() and new_class() do not work with type
 alias of a built-in type
In-Reply-To: <1635453507.8.0.842225708276.issue45664@roundup.psfhosted.org>
Message-ID: <1638794519.6.0.381680184428.issue45664@roundup.psfhosted.org>


Change by Chris Wesseling <chris.wesseling at protonmail.com>:


----------
nosy:  -CharString, CharString

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45664>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:47:51 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 12:47:51 +0000
Subject: [issue44035] Regenerating the configure script fails even if
 dependencies are satisfied
In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org>
Message-ID: <1638794871.17.0.933105537537.issue44035@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 1528d249a5f8492801d09755f402618688337006 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-44035: Check autoconf files thoroughly (GH-29935) (GH-29937)
https://github.com/python/cpython/commit/1528d249a5f8492801d09755f402618688337006


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44035>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:48:58 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 12:48:58 +0000
Subject: [issue44035] Regenerating the configure script fails even if
 dependencies are satisfied
In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org>
Message-ID: <1638794938.02.0.865607116894.issue44035@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset f147248795bf22be05bbc891053d60ef6a2f035d by Christian Heimes in branch '3.9':
[3.9] bpo-44035: Check autoconf files thoroughly (GH-29935) (GH-29938)
https://github.com/python/cpython/commit/f147248795bf22be05bbc891053d60ef6a2f035d


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44035>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:50:28 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 12:50:28 +0000
Subject: [issue44035] Regenerating the configure script fails even if
 dependencies are satisfied
In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org>
Message-ID: <1638795028.77.0.7343181038.issue44035@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44035>
_______________________________________

From report at bugs.python.org  Mon Dec  6 07:52:06 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 06 Dec 2021 12:52:06 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <CAP7+vJJ3F3ywP2kHgVS5=Ec7g+vPBaLSh1SHjmMDHRCuZ3epfg@mail.gmail.com>
Message-ID: <1638795126.19.0.328686775111.issue45934@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
assignee:  -> serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:17:21 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 13:17:21 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638796641.15.0.682648528732.issue45950@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28163
pull_request: https://github.com/python/cpython/pull/29939

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:17:24 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 13:17:24 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638796644.91.0.973593159743.issue45950@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28163, 28164
pull_request: https://github.com/python/cpython/pull/29939

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:23:16 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 13:23:16 +0000
Subject: [issue45256] Remove the usage of the C stack in Python to Python calls
In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org>
Message-ID: <1638796996.12.0.369460924092.issue45256@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
nosy:  -vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45256>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:24:20 2021
From: report at bugs.python.org (Dima Tisnek)
Date: Mon, 06 Dec 2021 13:24:20 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
Message-ID: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>


New submission from Dima Tisnek <dimaqq at gmail.com>:

Consider this illegal code:



import logging
from asyncio import sleep, gather, run
from contextlib import asynccontextmanager

@asynccontextmanager
async def foo():
    await sleep(1)
    yield


async def test():
    f = foo()
    await gather(f.__aenter__(), f.__aenter__())

run(test())



If it's ran with Python 3.9, user gets a sensible error:


  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 175, in __aenter__
    return await self.gen.__anext__()
RuntimeError: anext(): asynchronous generator is already running



However, if it's ran with Python 3.10, user gets a cryptic error:


  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 197, in __aenter__
    del self.args, self.kwds, self.func
AttributeError: args



Which makes it harder to pinpoint what's wrong when the stack is complex.
I've hit this with fastapi/starlette/mangum combo and a custom middleware.

----------
components: asyncio
messages: 407799
nosy: Dima.Tisnek, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Worse error from asynccontextmanager in Python 3.10
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:26:08 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 13:26:08 +0000
Subject: [issue33632] undefined behaviour: signed integer overflow in
 threadmodule.c
In-Reply-To: <1527151195.18.0.682650639539.issue33632@psf.upfronthosting.co.za>
Message-ID: <1638797168.54.0.162356056183.issue33632@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> I think PR https://github.com/python/cpython/pull/28674 has resolved this issue.

You're right.

_threadmodule.c now uses _PyDeadline_Init() which calls _PyTime_Add(), and _PyTime_Add() prevents integer overflows; Extract of its implementation:

// Compute t1 + t2. Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
static inline int
pytime_add(_PyTime_t *t1, _PyTime_t t2)
{
    if (t2 > 0 && *t1 > _PyTime_MAX - t2) {
        *t1 = _PyTime_MAX;
        return -1;
    }
    else if (t2 < 0 && *t1 < _PyTime_MIN - t2) {
        *t1 = _PyTime_MIN;
        return -1;
    }
    else {
        *t1 += t2;
        return 0;
    }
}

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
superseder:  -> threading.Lock.acquire(timeout) should use sem_clockwait(CLOCK_MONOTONIC)

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33632>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:27:11 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 13:27:11 +0000
Subject: [issue41710] threading.Lock.acquire(timeout) should use
 sem_clockwait(CLOCK_MONOTONIC)
In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org>
Message-ID: <1638797231.09.0.146466790308.issue41710@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

bpo-33632 "undefined behaviour: signed integer overflow in threadmodule.c" has been fixed by this change:

New changeset 833fdf126c8fe77fd17e8a8ffbc5c571b3bf64bd by Victor Stinner in branch 'main':
bpo-41710: Add private _PyDeadline_Get() function (GH-28674)
https://github.com/python/cpython/commit/833fdf126c8fe77fd17e8a8ffbc5c571b3bf64bd

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41710>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:27:11 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 13:27:11 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638797231.24.0.908021627881.issue45950@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

I added --enable-framework=yes to macOS GHA builder.

GH-29939 has ./configure --enable-framework=yes without proposed bootstrap fix. The build is failing early:

./_bootstrap_python ./Tools/scripts/deepfreeze.py Python/frozen_modules/importlib._bootstrap.h -m importlib._bootstrap -o Python/deepfreeze/importlib._bootstrap.c
make: *** [Python/deepfreeze/importlib._bootstrap.c] Bus error: 10


GH-29936 has ./configure --enable-framework=yes and introduces a Modules/getpath_bootstrap.o file. It is the same build as Modules/getpath.o except it does not use the framework feature. The target compiles getpath.c with an additional -DPY_BOOTSTRAP_PYTHON=1 option. The build fails later:

/bin/sh: line 1: 14772 Bus error: 10           DYLD_FRAMEWORK_PATH=/Users/runner/work/cpython/cpython ./python.exe -E -S -m sysconfig --generate-posix-vars
generate-posix-vars failed

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:30:53 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Mon, 06 Dec 2021 13:30:53 +0000
Subject: [issue45994] Add simple usage to email module
Message-ID: <1638797453.53.0.368114444849.issue45994@roundup.psfhosted.org>


New submission from Eric V. Smith <eric at trueblade.com>:

What sort of usage example would help you?

Is https://docs.python.org/3/library/email.examples.html lacking something?

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45994>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:42:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 13:42:33 +0000
Subject: [issue37927] No Instantiation Restrictions for AbstractBaseClasses
 derived from builtin types
In-Reply-To: <1566546715.82.0.869555987333.issue37927@roundup.psfhosted.org>
Message-ID: <1638798153.63.0.212677731449.issue37927@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Closed issue35362 as duplicate of this issue because there is a bit more info here.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11 -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37927>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:42:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 13:42:45 +0000
Subject: [issue35362] list inheritor with abstract content does not raise
In-Reply-To: <1543591825.01.0.788709270274.issue35362@psf.upfronthosting.co.za>
Message-ID: <1638798165.08.0.55155242703.issue35362@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> No Instantiation Restrictions for AbstractBaseClasses derived from builtin types

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35362>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:46:09 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 13:46:09 +0000
Subject: [issue35063] Checking for abstractmethod implementation fails to
 consider MRO for builtins
In-Reply-To: <1540457504.91.0.788709270274.issue35063@psf.upfronthosting.co.za>
Message-ID: <1638798369.45.0.538440051498.issue35063@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

See also issue37927.

----------
nosy: +iritkatriel
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35063>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:49:24 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 06 Dec 2021 13:49:24 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1638798564.01.0.567131525214.issue45996@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
nosy: +graingert, lukasz.langa, ncoghlan

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:55:09 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 13:55:09 +0000
Subject: [issue34338] abstractmethod can run on classes
In-Reply-To: <1533486586.96.0.56676864532.issue34338@psf.upfronthosting.co.za>
Message-ID: <1638798909.53.0.427925657541.issue34338@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34338>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:55:49 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 06 Dec 2021 13:55:49 +0000
Subject: [issue37927] No Instantiation Restrictions for AbstractBaseClasses
 derived from builtin types
In-Reply-To: <1566546715.82.0.869555987333.issue37927@roundup.psfhosted.org>
Message-ID: <1638798949.91.0.0765110343582.issue37927@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

See also #5996

----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37927>
_______________________________________

From report at bugs.python.org  Mon Dec  6 08:59:39 2021
From: report at bugs.python.org (Akuli)
Date: Mon, 06 Dec 2021 13:59:39 +0000
Subject: [issue45620] A misleading url in 'Floating Point Arithmetic' page
In-Reply-To: <1635313160.15.0.740336077946.issue45620@roundup.psfhosted.org>
Message-ID: <1638799179.77.0.0755001945109.issue45620@roundup.psfhosted.org>


Akuli <akuviljanen17 at gmail.com> added the comment:

To me, it redirects or doesn't redirect to the drugs site, depending on what Accept-Language header your browser sends. And when the redirecting happens, the site is in chinese. (I don't speak chinese, and I don't know why my browser is sending zh-CN in Accept-Language.)


akuli at akuli-desktop:~$ curl -s -H 'Accept-Language: en-US,en;q=0.9' https://www.lahey.com/float.htm | head
<html>
<head>
<title>Lahey - Floating point</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="scripts\jrs.css">
</head>

<body>
<HTML>
<HEAD>


akuli at akuli-desktop:~$ curl -s -H 'Accept-Language: en-US,en;q=0.9,zh-CN;q=0.4' https://www.lahey.com/float.htm | head
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a HREF="https://www.hmbags.tw/">here</a></body>


Incognito mode worked for me, because it sends `Accept-Language: en-US,en;q=0.9` without any additional languages.

----------
nosy: +Akuli

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45620>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:03:59 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Mon, 06 Dec 2021 14:03:59 +0000
Subject: [issue45620] A misleading url in 'Floating Point Arithmetic' page
In-Reply-To: <1635313160.15.0.740336077946.issue45620@roundup.psfhosted.org>
Message-ID: <1638799439.35.0.8964726751.issue45620@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

That's interesting. I see the same behavior.

So this seems to be a problem on www.lahey.com. I'll see if I can report it to them.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45620>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:04:23 2021
From: report at bugs.python.org (Yevhenii Hyzyla)
Date: Mon, 06 Dec 2021 14:04:23 +0000
Subject: [issue45997] asyncio.Semaphore waiters deqeueu doesn't work
Message-ID: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org>


New submission from Yevhenii Hyzyla <hyzyla at gmail.com>:

Class `asyncio.Semaphore` has dequeue in implementation for waiters of semaphore and seems like the intention of this dequeue is to maintain FIFO queue of waiters. But it doesn't work, coroutine that releases semaphore can acquire semaphore again. Below is reproducible example:

```python
import asyncio


async def process(idx: int, semaphore: asyncio.Semaphore) -> None:
    while True:
        async with semaphore:
            print(f'ACQUIRE {idx}')
            await asyncio.sleep(1)


async def main() -> None:
    semaphore = asyncio.Semaphore(5)
    await asyncio.gather(*[process(idx, semaphore) for idx in range(20)])

asyncio.run(main())
```

In console:
```
/home/y.hyzyla/Work/asynciosemaphorebug/venv/bin/python /home/y.hyzyla/Work/asynciosemaphorebug/main.py
ACQUIRE 0
ACQUIRE 1
ACQUIRE 2
ACQUIRE 3
ACQUIRE 4
ACQUIRE 0
ACQUIRE 1
ACQUIRE 2
ACQUIRE 3
ACQUIRE 4
ACQUIRE 0
ACQUIRE 1
ACQUIRE 2
ACQUIRE 3
ACQUIRE 4
....
```

Ugly fix, is to add asyncio.sleep right before semaphore.
```python
    while True:
        await asyncio.sleep(0)
        async with semaphore:
            ...
```

Also, I found a comment on Stack Overflow about race condition in Semaphore implementation, but I don't know about the quality of that comment:

https://stackoverflow.com/questions/55951233/does-pythons-asyncio-lock-acquire-maintain-order#comment112978366_55951304

----------
components: asyncio
messages: 407809
nosy: asvetlov, hyzyla, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.Semaphore waiters deqeueu doesn't work
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45997>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:12:13 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Mon, 06 Dec 2021 14:12:13 +0000
Subject: [issue45620] A misleading url in 'Floating Point Arithmetic' page
In-Reply-To: <1635313160.15.0.740336077946.issue45620@roundup.psfhosted.org>
Message-ID: <1638799933.37.0.926069428197.issue45620@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
resolution: works for me -> 
stage: resolved -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45620>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:13:37 2021
From: report at bugs.python.org (Ken Jin)
Date: Mon, 06 Dec 2021 14:13:37 +0000
Subject: [issue43153] tempfile seems to treat a file as a directory when
 processing an exception in the onerror()
In-Reply-To: <1612691564.38.0.627288937354.issue43153@roundup.psfhosted.org>
Message-ID: <1638800017.49.0.454915973977.issue43153@roundup.psfhosted.org>


Change by Ken Jin <kenjin4096 at gmail.com>:


----------
keywords: +patch
pull_requests: +28165
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29940

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43153>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:18:04 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Mon, 06 Dec 2021 14:18:04 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638800284.34.0.567121552468.issue45995@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

It was decided long ago that % formatting would not be enhanced with new features. I think that it is supposed to match the standard C formatting codes, and nothing else.

So this is unlikely to be approved for % formatting.

It *might* be approved for the format method and f-strings. (I suspect that unless you get immediate and uncontroversial agreement from multiple core developers, you may need to take it for further discussion and perhaps even a PEP.)

What you call a "distraction" I consider to be critical part of the display. The numbers you are displaying actually are negative, and rounding them for display does not change that. So they ought to show the minus sign. So I'm not really very sympathetic to this feature request.

----------
nosy: +steven.daprano
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:18:22 2021
From: report at bugs.python.org (Thomas Grainger)
Date: Mon, 06 Dec 2021 14:18:22 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1638800302.87.0.584847308846.issue45996@roundup.psfhosted.org>


Thomas Grainger <tagrain at gmail.com> added the comment:

I think `AttributeError: args` is the desired/expected behaviour

consider the sync version:

```
import logging
from asyncio import sleep, gather, run
from contextlib import asynccontextmanager, contextmanager

@contextmanager
def foo():
    yield


def test():
    f = foo()
    f.__enter__()
    f.__enter__()

test()
```

```
Traceback (most recent call last):
  File "/home/graingert/projects/example/sync.py", line 15, in <module>
    test()
  File "/home/graingert/projects/example/sync.py", line 13, in test
    f.__enter__()
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    del self.args, self.kwds, self.func
AttributeError: args
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:19:07 2021
From: report at bugs.python.org (Thomas Grainger)
Date: Mon, 06 Dec 2021 14:19:07 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1638800347.68.0.701716090778.issue45996@roundup.psfhosted.org>


Thomas Grainger <tagrain at gmail.com> added the comment:

or consider the trio version:

```
import logging
import trio
from contextlib import asynccontextmanager

@asynccontextmanager
async def foo():
    await trio.sleep(1)
    yield


async def test():
    async with trio.open_nursery() as n:
        f = foo()
        n.start_soon(f.__aenter__)
        n.start_soon(f.__aenter__)

trio.run(test)
```

```
Traceback (most recent call last):
  File "/home/graingert/projects/examples/bar.py", line 17, in <module>
    trio.run(test)
  File "/home/graingert/.virtualenvs/testing39/lib/python3.9/site-packages/trio/_core/_run.py", line 1932, in run
    raise runner.main_task_outcome.error
  File "/home/graingert/projects/examples/bar.py", line 15, in test
    n.start_soon(f.__aenter__)
  File "/home/graingert/.virtualenvs/testing39/lib/python3.9/site-packages/trio/_core/_run.py", line 815, in __aexit__
    raise combined_error_from_nursery
  File "/usr/lib/python3.9/contextlib.py", line 179, in __aenter__
    del self.args, self.kwds, self.func
AttributeError: args
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:23:32 2021
From: report at bugs.python.org (neonene)
Date: Mon, 06 Dec 2021 14:23:32 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638800612.38.0.0240387885528.issue45582@roundup.psfhosted.org>


Change by neonene <nicesalmon at gmail.com>:


----------
pull_requests: +28166
pull_request: https://github.com/python/cpython/pull/29941

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:25:35 2021
From: report at bugs.python.org (Thomas Grainger)
Date: Mon, 06 Dec 2021 14:25:35 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1638800735.76.0.0761079484011.issue45996@roundup.psfhosted.org>


Thomas Grainger <tagrain at gmail.com> added the comment:

ah I can repeat this on python3.8.10 trio but not python3.9.9 trio:

```
import logging
import trio
from contextlib import asynccontextmanager

@asynccontextmanager
async def foo():
    await trio.sleep(1)
    yield


async def test():
    async with trio.open_nursery() as n:
        f = foo()
        n.start_soon(f.__aenter__)
        n.start_soon(f.__aenter__)

trio.run(test)

```

```
Traceback (most recent call last):
  File "bar.py", line 17, in <module>
    trio.run(test)
  File "/home/graingert/.virtualenvs/osirium-main/lib/python3.8/site-packages/trio/_core/_run.py", line 1932, in run
    raise runner.main_task_outcome.error
  File "bar.py", line 15, in test
    n.start_soon(f.__aenter__)
  File "/home/graingert/.virtualenvs/osirium-main/lib/python3.8/site-packages/trio/_core/_run.py", line 815, in __aexit__
    raise combined_error_from_nursery
  File "/usr/lib/python3.8/contextlib.py", line 171, in __aenter__
    return await self.gen.__anext__()
RuntimeError: anext(): asynchronous generator is already running
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:30:12 2021
From: report at bugs.python.org (Thomas Grainger)
Date: Mon, 06 Dec 2021 14:30:12 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1638801012.53.0.636678863989.issue45996@roundup.psfhosted.org>


Thomas Grainger <tagrain at gmail.com> added the comment:

I see the change here: https://github.com/python/cpython/commit/1c5c9c89ffc36875afaf4c3cc6a716d4bd089bbf#diff-e00601a380ba6c916ba4333277fe6ea43d2477804002ab1ae64480f80fec8e3aR177-R179

this is intentionally implementing https://bugs.python.org/issue30306 for asynccontextmanagers that was initially missing

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:31:40 2021
From: report at bugs.python.org (E. Paine)
Date: Mon, 06 Dec 2021 14:31:40 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638801100.16.0.876457384477.issue45957@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

I cannot reproduce on Ubuntu 21.10 (Tk 8.6.11), so I believe we can close this issue.

----------
type: behavior -> crash

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:33:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 14:33:45 +0000
Subject: [issue7325] tempfile.mkdtemp() does not return absolute pathname when
 relative dir is specified
In-Reply-To: <1258226856.45.0.72736645389.issue7325@psf.upfronthosting.co.za>
Message-ID: <1638801225.02.0.507407018694.issue7325@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

It's still the same in 3.11. I don't know whether this is something to fix in the code or in the docs.

>> import tempfile
>>> tempfile.mkdtemp(dir='.')
'./tmplvkt14za'
>>> tempfile.mkstemp(dir='.')
(3, '/Users/iritkatriel/src/cpython/tmp86ljh34k')

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue7325>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:34:48 2021
From: report at bugs.python.org (Thomas Grainger)
Date: Mon, 06 Dec 2021 14:34:48 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1638801288.26.0.325599068166.issue45996@roundup.psfhosted.org>


Thomas Grainger <tagrain at gmail.com> added the comment:

you can see the analogous sync contextmanager issue on python3.6 with:

```
import logging
from contextlib import contextmanager

@contextmanager
def foo():
    yield


def test():
    f = foo()
    f.__enter__()
    f.__enter__()

test()
```

on python3.7+ you get the bpo-30306 behaviour

```
Traceback (most recent call last):
  File "sync.py", line 14, in <module>
    test()
  File "sync.py", line 12, in test
    f.__enter__()
  File "/usr/lib/python3.8/contextlib.py", line 111, in __enter__
    del self.args, self.kwds, self.func
AttributeError: args
```

and python3.6 you get the same sort of error you see now for asynccontextmanagers:

```
Traceback (most recent call last):
  File "sync.py", line 14, in <module>
    test()
  File "sync.py", line 12, in test
    f.__enter__()
  File "/usr/lib/python3.6/contextlib.py", line 83, in __enter__
    raise RuntimeError("generator didn't yield") from None
RuntimeError: generator didn't yield
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:38:05 2021
From: report at bugs.python.org (Mark Shannon)
Date: Mon, 06 Dec 2021 14:38:05 +0000
Subject: [issue44525] Implement CALL_FUNCTION adaptive interpreter
 optimizations
In-Reply-To: <1624890138.2.0.824780513801.issue44525@roundup.psfhosted.org>
Message-ID: <1638801485.92.0.082353739699.issue44525@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
pull_requests: +28167
pull_request: https://github.com/python/cpython/pull/29942

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44525>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:40:30 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 14:40:30 +0000
Subject: [issue15013] [doc] smtplib: add low-level APIs to doc?
In-Reply-To: <1338968663.18.0.754320203153.issue15013@psf.upfronthosting.co.za>
Message-ID: <1638801630.55.0.156792184212.issue15013@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
title: smtplib: add low-level APIs to doc? -> [doc] smtplib: add low-level APIs to doc?
type:  -> enhancement
versions: +Python 3.11 -Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15013>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:42:27 2021
From: report at bugs.python.org (E. Paine)
Date: Mon, 06 Dec 2021 14:42:27 +0000
Subject: [issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11
In-Reply-To: <1633984027.59.0.32532195896.issue45436@roundup.psfhosted.org>
Message-ID: <1638801747.96.0.0806771041793.issue45436@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

> Any word on the tk Menu type parameter change?

I'll admit to having completely forgot about this issue and not raising it with the Tk team. Manually trying this case on Tk 8.6.12 segfaults, so I really need to raise it. To reproduce the segfault, simply run the top command in Python, or the bottom command in Wish:

tk.Menu(type="")
menu .m -type {}

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45436>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:47:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 14:47:45 +0000
Subject: [issue29309] Interpreter hang when interrupting a
 loop.run_in_executor() future
In-Reply-To: <1484751513.93.0.173979168861.issue29309@psf.upfronthosting.co.za>
Message-ID: <1638802065.66.0.423594408078.issue29309@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

@asyncio.coroutine was removed in 3.10, and the run_in_executor.py doesn't run with async def because that does not allow yield.

I'll close this as out of date, please create a new issue if you are still having a related problem with async def.

----------
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29309>
_______________________________________

From report at bugs.python.org  Mon Dec  6 09:52:27 2021
From: report at bugs.python.org (Ken Jin)
Date: Mon, 06 Dec 2021 14:52:27 +0000
Subject: [issue36392] IPv4Interface Object has no attributte prefixlen
In-Reply-To: <1553197512.13.0.766410741462.issue36392@roundup.psfhosted.org>
Message-ID: <1638802347.5.0.269136609425.issue36392@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:

The link to what Andrei is referring to:
https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network.prefixlen

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36392>
_______________________________________

From report at bugs.python.org  Mon Dec  6 10:00:33 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Mon, 06 Dec 2021 15:00:33 +0000
Subject: [issue45998] Document best practice for including and linking python
 framework
Message-ID: <1638802833.35.0.414122287903.issue45998@roundup.psfhosted.org>


New submission from Ronald Oussoren <ronaldoussoren at mac.com>:

There are two ways to develop against a Python.framework on MacOS:

1. Use the regular Unix pattern with "#include "Python.h", using compiler flags to select the right headers and libraries.

2. Using the native framework pattern with "#import <Python/Python.h>" and "-framework Python"

Both works, but the latter has the disadvantage of loosing control over which version of Python is used when multiple versions are installed.  The version is selected by the "Current" link in the framework, which is overwritten to point to whatever version was last installed or updated.

IMHO we should document this pitfall in the C API documentation.

----------
assignee: docs at python
components: Documentation, macOS
messages: 407821
nosy: docs at python, ned.deily, ronaldoussoren
priority: normal
severity: normal
stage: needs patch
status: open
title: Document best practice for including and linking python framework
type: enhancement
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45998>
_______________________________________

From report at bugs.python.org  Mon Dec  6 10:10:31 2021
From: report at bugs.python.org (John Belmonte)
Date: Mon, 06 Dec 2021 15:10:31 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638803431.49.0.901747070116.issue45995@roundup.psfhosted.org>


John Belmonte <john at neggie.net> added the comment:

Here is the same proposal made for C++ `std::format`:

  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1496r2.pdf

It makes fair arguments for the feature's use, and explains why the problem is hard to work around.

It was withdrawn by the author for C++20, but a consensus proposal is promised for C++23.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Mon Dec  6 10:12:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 15:12:48 +0000
Subject: [issue13548] line number when tracing an implicit return
In-Reply-To: <1323275290.33.0.837630531134.issue13548@psf.upfronthosting.co.za>
Message-ID: <1638803568.8.0.880361161839.issue13548@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11. 


An implicit return doesn't have a line, so it's not clear what should happen. Assigning the next line to it wouldn't be correct either (it could be the first line of the next function). 

We could say that in this case there is no line event, just a return event (unless that messes up the tracer somehow).

If you add a return statement it makes sense:

/Users/iritkatriel/src/cpython/mm.py 7 call
/Users/iritkatriel/src/cpython/mm.py 8 line
/Users/iritkatriel/src/cpython/mm.py 10 line
/Users/iritkatriel/src/cpython/mm.py 11 line
/Users/iritkatriel/src/cpython/mm.py 14 line
/Users/iritkatriel/src/cpython/mm.py 14 return

(line 13 does not appear because that's the else, the return is assigned line 14 which is where it really is).

----------
nosy: +iritkatriel
title: Invalid 'line' tracer event on pass within else clause -> line number when tracing an implicit return
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13548>
_______________________________________

From report at bugs.python.org  Mon Dec  6 10:31:35 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 06 Dec 2021 15:31:35 +0000
Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work
In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org>
Message-ID: <1638804695.04.0.338083162417.issue45997@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
title: asyncio.Semaphore waiters deqeueu doesn't work -> asyncio.Semaphore waiters deque doesn't work

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45997>
_______________________________________

From report at bugs.python.org  Mon Dec  6 10:31:52 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 06 Dec 2021 15:31:52 +0000
Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work
In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org>
Message-ID: <1638804712.92.0.787054400205.issue45997@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45997>
_______________________________________

From report at bugs.python.org  Mon Dec  6 10:55:03 2021
From: report at bugs.python.org (Douglas Wright)
Date: Mon, 06 Dec 2021 15:55:03 +0000
Subject: [issue45999] Links to packaging broken
Message-ID: <1638806103.81.0.408526409699.issue45999@roundup.psfhosted.org>


New submission from Douglas Wright <douglas277 at gmail.com>:

Links in this section from the docs from 3.9 and newer are currently broken.

https://docs.python.org/3.9/distributing/index.html#reading-the-python-packaging-user-guide

They are currently leading to a "page not found" error.

----------
assignee: docs at python
components: Documentation
messages: 407824
nosy: docs at python, douglas277
priority: normal
severity: normal
status: open
title: Links to packaging broken
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45999>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:11:52 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Mon, 06 Dec 2021 16:11:52 +0000
Subject: [issue46000] NetBSD curses compatibility
Message-ID: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>


New submission from Thomas Klausner <tk at giga.or.at>:

The code in Modules/_cursesmodule.c has an assumption on ncurses.
The attached simple patch fixes this and works with both NetBSD curses and ncurses.

----------
components: Extension Modules
files: patch-Modules___cursesmodule.c
messages: 407825
nosy: wiz
priority: normal
severity: normal
status: open
title: NetBSD curses compatibility
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50480/patch-Modules___cursesmodule.c

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:12:57 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 16:12:57 +0000
Subject: [issue12413] make faulthandler dump traceback of child processes
In-Reply-To: <1309046011.52.0.650507172396.issue12413@psf.upfronthosting.co.za>
Message-ID: <1638807177.51.0.73856206709.issue12413@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

There is not activity for 10 years. I consider that this feature is not really needed. I reject this feature request.

----------
resolution:  -> rejected
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12413>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:14:03 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 16:14:03 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638807243.48.0.304603204717.issue45950@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 612e59b53f0c730ce1b881f7c08dc6d49f02c123 by Christian Heimes in branch 'main':
bpo-45950: Fix macOS framework builds of _bootstrap_python (GH-29936)
https://github.com/python/cpython/commit/612e59b53f0c730ce1b881f7c08dc6d49f02c123


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:16:53 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 16:16:53 +0000
Subject: [issue44016] Enum related deprecation warnings in test_httpservers
 and test_faulthandler
In-Reply-To: <1620029095.2.0.0849109876545.issue44016@roundup.psfhosted.org>
Message-ID: <1638807413.83.0.103716200401.issue44016@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

test_httpservers warnings have been fixed.

I cannot reproduce test_faulthandler warnings. I close the issue. If someone still gets warnnings in test_faulthandler, please provide the full command line to reproduce them.


commit d3b9134ebb40bdb01ff52a37515c7c96970c9a0b
Author: Shreyan Avigyan <shreyan.avigyan at gmail.com>
Date:   Tue May 4 00:57:47 2021 +0530

    Remove Enum warnings from test_httpservers (GH-25844)

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44016>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:21:43 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 16:21:43 +0000
Subject: [issue21952] fnmatch.py can appear in tracemalloc diffs
In-Reply-To: <1405020967.14.0.385293193823.issue21952@psf.upfronthosting.co.za>
Message-ID: <1638807703.54.0.987482040922.issue21952@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Exposing internal caches in tracemalloc is not a bug but a deliberate choice. It's easy to write your own filters to ignore selected files (or even specific functions if you can locate them by line nubmers).

----------
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21952>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:22:11 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 16:22:11 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638807731.51.0.0741500433358.issue45950@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Ned, I have implemented a fix for _bootstrap_python for framework builds and re-enabled --with-build-python for all builds. Previously I disabled the option for standard builds, because --with-build-python can cause build issues when a user runs ./configure --with-build-python with an older 3.11 alpha build.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:22:13 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 16:22:13 +0000
Subject: [issue31139] Improve tracemalloc demo code in docs
In-Reply-To: <1502159168.93.0.181996633352.issue31139@psf.upfronthosting.co.za>
Message-ID: <1638807733.45.0.758292497146.issue31139@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

https://github.com/python/cpython/pull/3020 is closed, I close this issue as well.

----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31139>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:26:06 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 16:26:06 +0000
Subject: [issue45973] Not possible to clear PyImport_Inittab after
 PyImport_AppendInittab
In-Reply-To: <1638540674.64.0.96956184479.issue45973@roundup.psfhosted.org>
Message-ID: <1638807966.62.0.215753366128.issue45973@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Currently, the global variable PyImport_Inittab is used. It should be made per-interpreter and I suggest to add something like PyConfig_AppendInittab() to the PyConfig API, so the configuration change would only impact a single interpreter. It would be possible to run two interpreters with two different inittab configuration.

----------
nosy: +vstinner
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45973>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:27:50 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 16:27:50 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1638808070.46.0.43699610501.issue22815@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I think this has been fixed:

% cat mm.py 
import unittest

class TestStringMethods(unittest.TestCase):

    @unittest.expectedFailure
    def test_upper(self):
        self.assertEqual(2, 2)

if __name__ == '__main__':
    unittest.main()




% ./python.exe mm.py 
x
----------------------------------------------------------------------
Ran 1 test in 0.001s

OK (expected failures=1)
iritkatriel at Irits-MBP cpython % vi mm.py          
iritkatriel at Irits-MBP cpython % ./python.exe mm.py
u
----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (unexpected successes=1)

----------
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:28:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 16:28:45 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1638808125.61.0.0396409302192.issue22815@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Or do you mean that there should be more output?

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:30:09 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 16:30:09 +0000
Subject: [issue45973] Not possible to clear PyImport_Inittab after
 PyImport_AppendInittab
In-Reply-To: <1638540674.64.0.96956184479.issue45973@roundup.psfhosted.org>
Message-ID: <1638808209.18.0.500827537443.issue45973@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

See also bpo-44441 (fixed).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45973>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:43:29 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Mon, 06 Dec 2021 16:43:29 +0000
Subject: [issue45997] asyncio.Semaphore waiters deqeueu doesn't work
In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org>
Message-ID: <1638809009.26.0.994587911759.issue45997@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

Good point.
Currently, asyncio lock objects don't provide a strong FIFO guarantee.

In a tight loop, a task can re-acquire the lock just after releasing even if there are pending waiters that were scheduled earlier. It's true also for Lock, Conditional, Event, etc.

The solution requires *async* release method. Since the change is not backward compatible, a new method should be added, e.g. `await sem.release_and_wait()` for endorsing the context switch if there are pending waiters.

async context manager can be modified for using the new method without backward compatibility problems easily.

A hero who can help is welcome!

----------
assignee:  -> asvetlov
title: asyncio.Semaphore waiters deque doesn't work -> asyncio.Semaphore waiters deqeueu doesn't work
type: behavior -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45997>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:45:46 2021
From: report at bugs.python.org (James Gerity)
Date: Mon, 06 Dec 2021 16:45:46 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
Message-ID: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>


New submission from James Gerity <snoop.jedi at gmail.com>:

The docstrings for `json.JSONEncoder, json.dump(), json.dumps()` all refer to `OverflowError` when describing the behavior of the `check_circular` parameter, but the module's test of this parameter catches a `RecursionError` and the documentation does make reference to recursion.

Since the fix for bpo-43225 (7b78d43) the string-escaping machinery in `_json.c` is capable of raising OverflowError, but the reference in the documentation predates this addition by quite a long time.

----------
assignee: docs at python
components: Documentation
messages: 407837
nosy: SnoopJeDi, docs at python
priority: normal
severity: normal
status: open
title: JSON module documentation mentions OverflowError for case that raises RecursionError
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:45:57 2021
From: report at bugs.python.org (Ken Jin)
Date: Mon, 06 Dec 2021 16:45:57 +0000
Subject: [issue45755] Specialized generic class does not return class
 attributes in dir
In-Reply-To: <1636399849.8.0.841580145929.issue45755@roundup.psfhosted.org>
Message-ID: <1638809157.51.0.931703893001.issue45755@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:

Not exactly sure if this is a bug, but the reason is that Foo[int] used to be a class, now it's a plain object. It's a change brought in 3.7 by PEP 560.

3.6:
>>> isinstance(Foo[int], type)
True
>>> Foo[int].__dir__
<method '__dir__' of 'object' objects
>>> type(Foo[int].__dir__)
<class 'method_descriptor'>

main:
>>> isinstance(Foo[int], type)
False
>>> Foo[int].__dir__
<built-in method __dir__ of _GenericAlias object at 0x000001B44DF0A850>
>>> type(Foo[int].__dir__)
<class 'method_descriptor'>

The fix is just a 2-line change in either _GenericAlias or _BaseGenericAlias:
+    def __dir__(self):
+        return dir(self.__origin__)

Should we go ahead with this?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45755>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:51:58 2021
From: report at bugs.python.org (Taiga Katarao)
Date: Mon, 06 Dec 2021 16:51:58 +0000
Subject: [issue45994] Add simple usage to email module
In-Reply-To: <1638797453.53.0.368114444849.issue45994@roundup.psfhosted.org>
Message-ID: <1638809518.8.0.370862003574.issue45994@roundup.psfhosted.org>


Taiga Katarao <taiga4562 at gmail.com> added the comment:

There are the simplest example to send text email and a little bit complicated example to an email with some files.

However, beginners like me want simple example to create an email composed of the combination of multipart/alternative and multipart/mixed.

There are many web sites to explain sending an email composed of multipart/alternative and multipart/mixed, but all of them use MIMEText and MIMEMultipart, which can be replaced and simplified with EmailMessage like below.

```
import smtplib
from email.message import EmailMessage

msg = EmailMessage()
msg['From'] = 'from at example.com'
msg['To'] = 'to at example.com'
msg['Subject'] = 'Subject'

msg.add_alternative('Hello, world.', subtype='text')
msg.add_alternative('<h1>Helo, world.</h1>', subtype='html')
with open('example.pdf', 'rb') as f:
    msg.add_attachment(
        f.read(),
        maintype='application',
        subtype='pdf',
        filename='example.pdf'
    )

with smtplib.SMTP('SMTP_HOST', 'SMTP_PORT') as smtp:
    smtp.starttls()
    smtp.login('USER', 'PASSWORD')
    smtp.send_message(msg)
```

Of cause I know we can obtain the code above from the combination of existing example codes, but it's a little bit difficult.

I guess the reason why they cannot find simple way partially because the official documentation does not provide example.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45994>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:54:40 2021
From: report at bugs.python.org (James Gerity)
Date: Mon, 06 Dec 2021 16:54:40 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
In-Reply-To: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>
Message-ID: <1638809680.9.0.876587649893.issue46001@roundup.psfhosted.org>


Change by James Gerity <snoop.jedi at gmail.com>:


----------
keywords: +patch
pull_requests: +28168
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29943

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:56:27 2021
From: report at bugs.python.org (Tze Chian Kam)
Date: Mon, 06 Dec 2021 16:56:27 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
Message-ID: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>


New submission from Tze Chian Kam <tze.chian.kam at gmail.com>:

Using "pyenv" for python installations. "py" launcher detects all installed python versions from "pyenv". When using the shebang feature, if the following shebang is specified, "#!/usr/bin/env python -V", it will detect python version of "3.9.9" from MSYS2 (where the latest version is "3.9.9"). But MSYS2 python is not in registered in registry so it should not be detecting it.

----------
components: Windows
messages: 407840
nosy: Zernoxi, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: py Launcher for Windows with MSYS2
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 11:57:06 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Mon, 06 Dec 2021 16:57:06 +0000
Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work
In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org>
Message-ID: <1638809826.96.0.955832539408.issue45997@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

Or, maybe, there is a way to do everything without changing public API.

The idea is: _wake_up_next can create a future which is set by *waked up task* on its acquiring. acquire method should wait for this future first before entering in `while self._value < 0:` loop.

If the future is cancelled, `_wake_up_next` should be called again and waiting for the next future acquiring to be performed.

If there is no *acquire waiting* future exists -- do everything as usual.

All other lock objects should be modified also.

----------
title: asyncio.Semaphore waiters deqeueu doesn't work -> asyncio.Semaphore waiters deque doesn't work
type:  -> behavior
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45997>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:10:31 2021
From: report at bugs.python.org (Tze Chian Kam)
Date: Mon, 06 Dec 2021 17:10:31 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638810631.97.0.496470973015.issue46002@roundup.psfhosted.org>


Tze Chian Kam <tze.chian.kam at gmail.com> added the comment:

This is not in a a virtual environment by the way.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:14:55 2021
From: report at bugs.python.org (Yevhenii Hyzyla)
Date: Mon, 06 Dec 2021 17:14:55 +0000
Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work
In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org>
Message-ID: <1638810895.14.0.0149011746274.issue45997@roundup.psfhosted.org>


Yevhenii Hyzyla <hyzyla at gmail.com> added the comment:

Thanks for response!

> A hero who can help is welcome!

I will try to make PR :raising_hand

----------
type: behavior -> 
versions: +Python 3.8 -Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45997>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:15:50 2021
From: report at bugs.python.org (Julius Hamilton)
Date: Mon, 06 Dec 2021 17:15:50 +0000
Subject: [issue45934] python curses newterm implementation
In-Reply-To: <CAP7+vJJ3F3ywP2kHgVS5=Ec7g+vPBaLSh1SHjmMDHRCuZ3epfg@mail.gmail.com>
Message-ID: <1638810950.48.0.690735496187.issue45934@roundup.psfhosted.org>


Julius Hamilton <juliushamilton100 at gmail.com> added the comment:

I?m currently planning on studying the C code for initscr and newterm so I can really understand how they work.

I?ll post any updates about this soon.

Thanks.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45934>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:20:47 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 06 Dec 2021 17:20:47 +0000
Subject: [issue31879] Launcher fails on custom command starting with "python"
In-Reply-To: <1509037268.43.0.213398074469.issue31879@psf.upfronthosting.co.za>
Message-ID: <1638811247.94.0.408525801621.issue31879@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

Not sure if Mark and Martin are part of an expert group, but neither are active in this area these days.

For the original question, I have no idea why the command can't use a builtin name, so hard to say whether we'd change it. A summary of why it's broken and what the fix would be is needed before we can say whether the change would be accepted or not.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31879>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:25:33 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 06 Dec 2021 17:25:33 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638811533.58.0.433597525303.issue45582@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset af1db4eb555e02d2bff3476f99f7a653764203b0 by neonene in branch 'main':
bpo-45582: Fix getpath_isxfile() and test_embed on Windows (GH-29930)
https://github.com/python/cpython/commit/af1db4eb555e02d2bff3476f99f7a653764203b0


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:30:40 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 06 Dec 2021 17:30:40 +0000
Subject: [issue45992] distutils paths are scattered between PythonXY and
 PythonXY-32 on WoW64
In-Reply-To: <1638774011.75.0.410629931242.issue45992@roundup.psfhosted.org>
Message-ID: <1638811840.27.0.88384836332.issue45992@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

They should all be under "-32" when in roaming appdata, because otherwise having 32-bit and 64-bit installs side-by-side will conflict.

If these fields were newly added to distutils then should probably fix them to match sysconfig. If they're old and wrong, I'd just ignore them.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45992>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:38:56 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 06 Dec 2021 17:38:56 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638812336.33.0.66327432764.issue46002@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

Are you launching "py" from inside MSYS2? Or a regular prompt?

What does the output of "py -0p" show? (It should list all the discovered installs)

We might need someone who understands how MSYS2 works here, because I don't.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:44:27 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 17:44:27 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638812667.28.0.366991391699.issue45582@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28170
pull_request: https://github.com/python/cpython/pull/29944

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:46:15 2021
From: report at bugs.python.org (James Gerity)
Date: Mon, 06 Dec 2021 17:46:15 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
In-Reply-To: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>
Message-ID: <1638812775.09.0.351711860257.issue46001@roundup.psfhosted.org>


James Gerity <snoop.jedi at gmail.com> added the comment:

Correction: the bug whose resolution adds the OverflowError mentioned above is bpo-24522, not bpo-43255

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:49:32 2021
From: report at bugs.python.org (Tzu-ping Chung)
Date: Mon, 06 Dec 2021 17:49:32 +0000
Subject: [issue45992] distutils paths are scattered between PythonXY and
 PythonXY-32 on WoW64
In-Reply-To: <1638774011.75.0.410629931242.issue45992@roundup.psfhosted.org>
Message-ID: <1638812972.8.0.429614756771.issue45992@roundup.psfhosted.org>


Tzu-ping Chung <uranusjr at gmail.com> added the comment:

They are old, but so are purelib and platlib, which were changed regardless. The problem is that distutils?s values are now half wrong and half right, neither matching pre-3.10 behaviour, nor matching post-3.10 sysconfig behaviour.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45992>
_______________________________________

From report at bugs.python.org  Mon Dec  6 12:59:09 2021
From: report at bugs.python.org (Zernoxi)
Date: Mon, 06 Dec 2021 17:59:09 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638813549.07.0.14915047721.issue46002@roundup.psfhosted.org>


Zernoxi <tze.chian.kam at gmail.com> added the comment:

I am launching "py" from a regular prompt ("powershell"). I should only have 2 registered python versions in the registry. "py -0p" shows the correct information.

One thing to note is that if I "#!/usr/bin/env python3 -V", it will show the correct default python3 version and is consistence when in a virtual environment.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 13:13:21 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 18:13:21 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638814401.97.0.290403711453.issue45582@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset f16f93e5279f957ca25dd8b91233a44833167a8a by Christian Heimes in branch 'main':
bpo-45582: framework build: modPath must not be const (GH-29944)
https://github.com/python/cpython/commit/f16f93e5279f957ca25dd8b91233a44833167a8a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Mon Dec  6 13:16:16 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Mon, 06 Dec 2021 18:16:16 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638814576.58.0.767608361085.issue45995@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Mon Dec  6 13:18:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 18:18:28 +0000
Subject: [issue27016] BlockingIOError not raised inside function.
In-Reply-To: <1463191419.08.0.084074707962.issue27016@psf.upfronthosting.co.za>
Message-ID: <1638814708.04.0.129611394474.issue27016@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

On a Mac I get the "BlockingIOError: [Errno 35] Resource temporarily unavailable" with both version (with and without the function).

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27016>
_______________________________________

From report at bugs.python.org  Mon Dec  6 13:25:56 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 18:25:56 +0000
Subject: [issue41062] Advanced Debugger Support C-API is useless without
 HEAD_LOCK()/HEAD_UNLOCK()
In-Reply-To: <1592729628.06.0.446212297946.issue41062@roundup.psfhosted.org>
Message-ID: <1638815156.51.0.751876203118.issue41062@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41062>
_______________________________________

From report at bugs.python.org  Mon Dec  6 13:36:08 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 18:36:08 +0000
Subject: [issue8161] inconsistency behavior in ctypes.c_char_p dereferencing
In-Reply-To: <1268816987.2.0.0650705594073.issue8161@psf.upfronthosting.co.za>
Message-ID: <1638815768.15.0.571876600403.issue8161@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

On 3.11 I'm not getting str for the second expression, I get an empty bytes object:


>>> import ctypes
>>> class T(ctypes.Structure):
...     _fields_ = (
...             ('member', ctypes.c_char * 16),
...     )
... 
>>> print('%r'%((ctypes.c_char * 16)()[:]))
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>>> print('%r'%(T().member[:]))
b''

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue8161>
_______________________________________

From report at bugs.python.org  Mon Dec  6 13:43:18 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 18:43:18 +0000
Subject: [issue19864] [doc] multiprocessing Proxy docs need locking semantics
 explained
In-Reply-To: <1386010854.42.0.669130689835.issue19864@psf.upfronthosting.co.za>
Message-ID: <1638816198.1.0.388218660449.issue19864@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: multiprocessing Proxy docs need locking semantics explained -> [doc] multiprocessing Proxy docs need locking semantics explained
type:  -> enhancement
versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19864>
_______________________________________

From report at bugs.python.org  Mon Dec  6 13:53:40 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 06 Dec 2021 18:53:40 +0000
Subject: [issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11
In-Reply-To: <1633984027.59.0.32532195896.issue45436@roundup.psfhosted.org>
Message-ID: <1638816820.22.0.226320198219.issue45436@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

import tkinter as tk
tk.Menu(type='')

crashes on current Windows 3.9-11 with 8.6.12

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45436>
_______________________________________

From report at bugs.python.org  Mon Dec  6 14:03:35 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Mon, 06 Dec 2021 19:03:35 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638817415.88.0.383066016743.issue45995@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

I'd support having this functionality available for `format` and for f-strings. (As Steven says, changing %-formatting doesn't seem viable.) It really _is_ awkward to do this in any other way, and I'm reliably informed that normal people don't expect to see negative zeros in formatted numeric output.

It did take me a few minutes to get my head around the idea that `f"{-0.01:+.1f}"` would return `"+0.0"` rather than `"-0.0"` or `" 0.0"` or just plain `"0.0"` under this proposal, but I agree that it seems like the only thing that can be consistent and make sense.

I'm not 100% convinced by the particular spelling proposed, but I don't have anything better to suggest. If C++ might be going with a "z", would it make sense to do the same for Python?

I don't forsee any implementation difficulties for float and complex types. For Decimal, we'd need to "own" the string formatting, taking that responsibility away from mpdecimal, but there are already other reasons to do that. Once we've done that, again the implementation doesn't seem onerous.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Mon Dec  6 14:03:30 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 06 Dec 2021 19:03:30 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638817410.75.0.534476593804.issue46002@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

So if I've understood you, there are three Python installs on your machine. Two of them are Windows builds, which are listed in the registry and discovered by py.exe -0p. The third is the MSYS2 build, which is *not* listed in the registry and is *not* discovered by py.exe -0p.

However, when you specify the shebang line "/usr/bin/env python" in a file and launch it as "py.exe myfile.py" from a non-MSYS2 prompt, it launches the MSYS2 Python.

Is that correct?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 14:16:24 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 19:16:24 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638818184.61.0.154579422728.issue45847@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28171
pull_request: https://github.com/python/cpython/pull/29946

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Mon Dec  6 14:35:23 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 06 Dec 2021 19:35:23 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638819323.99.0.708108704338.issue46002@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

("2" and "3" are just arbitrary numbers... substitute however many Python runtimes you actually have, or "N" and "N+1" if you prefer.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 14:44:44 2021
From: report at bugs.python.org (Ali Amin-Nejad)
Date: Mon, 06 Dec 2021 19:44:44 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638819884.28.0.231167584001.issue45957@roundup.psfhosted.org>


Ali Amin-Nejad <aanejad at hotmail.co.uk> added the comment:

It seems like it must be a mac-specific issue just on 8.6.11 then if ned couldn't reproduce on 8.6.12. How does one go about upgrading their tkinter version? Thanks

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Mon Dec  6 15:13:33 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 20:13:33 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638821613.65.0.164609636447.issue45957@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

> How does one go about upgrading their tkinter version?

Since, based on your path names, you appear to be using a Python from miniconda, you should check with that project. Perhaps they have a newer version available. Good luck!

----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Mon Dec  6 15:33:30 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 20:33:30 +0000
Subject: [issue38523] ignore_dangling_symlinks in shutil.copytree does not
 apply recursively
In-Reply-To: <1571437755.03.0.462874003253.issue38523@roundup.psfhosted.org>
Message-ID: <1638822810.95.0.354172254625.issue38523@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38523>
_______________________________________

From report at bugs.python.org  Mon Dec  6 15:43:53 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 20:43:53 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638823433.22.0.579437292679.issue45847@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset fc012d801202a9ea139df143b934778060d51a60 by Christian Heimes in branch 'main':
bpo-45847: Fix uuid detection on macOS (GH-29946)
https://github.com/python/cpython/commit/fc012d801202a9ea139df143b934778060d51a60


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Mon Dec  6 15:53:26 2021
From: report at bugs.python.org (Eryk Sun)
Date: Mon, 06 Dec 2021 20:53:26 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638824006.12.0.284984416583.issue46002@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

The shebang "#!/usr/bin/env python" searches PATH for 
"python" plus the PATHEXT file extensions.

The shebang "#!/usr/bin/env python3" uses the highest version of Python 3 from the registry. It doesn't search PATH because Python installations do not necessarily include "python3.exe" or "python3.x.exe" binaries. Alternatives that also search PATH for this case have been discussed in prior issues.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 16:17:04 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 06 Dec 2021 21:17:04 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1638825424.91.0.081806044929.issue46000@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Could you please open a pull request on GitHub? A PR will run our CI and our bots will verify that your changeset follows our guidelines.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Mon Dec  6 16:20:05 2021
From: report at bugs.python.org (nobody)
Date: Mon, 06 Dec 2021 21:20:05 +0000
Subject: [issue46003] os.replace is not cross-platform: at least improve
 documentation
Message-ID: <1638825605.8.0.77974659196.issue46003@roundup.psfhosted.org>


New submission from nobody <peterpm at xs4all.nl>:

When using threads, os.replace gives no errors on Linux. On Windows however you get PermissionErrors like: '[WinError 5] Access is denied' for os.replace and '[Errno 13] Permission denied' when reading the os.replace file.
The only way I could get this to work was to add retries with delay.
At least the documentation should be improved.

----------
messages: 407864
nosy: hancos
priority: normal
severity: normal
status: open
title: os.replace is not cross-platform: at least improve documentation
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46003>
_______________________________________

From report at bugs.python.org  Mon Dec  6 16:24:09 2021
From: report at bugs.python.org (Roundup Robot)
Date: Mon, 06 Dec 2021 21:24:09 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1638825849.12.0.315794257629.issue46000@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +28172
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29947

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Mon Dec  6 16:24:30 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Mon, 06 Dec 2021 21:24:30 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1638825870.08.0.993120569954.issue46000@roundup.psfhosted.org>


Thomas Klausner <tk at giga.or.at> added the comment:

Done: https://github.com/python/cpython/pull/29947

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Mon Dec  6 16:37:42 2021
From: report at bugs.python.org (Brett Cannon)
Date: Mon, 06 Dec 2021 21:37:42 +0000
Subject: [issue21761] [doc] language reference describes the role of
 module.__file__ inaccurately
In-Reply-To: <1402778004.82.0.418404996295.issue21761@psf.upfronthosting.co.za>
Message-ID: <1638826662.74.0.56897051489.issue21761@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:

> "Ultimately, the loader set the values of __file__ and/or __cached__"

Change it to "sets" and +1 from me!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21761>
_______________________________________

From report at bugs.python.org  Mon Dec  6 16:41:29 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Mon, 06 Dec 2021 21:41:29 +0000
Subject: [issue44077] IP_RECVTOS option is missing from socket module
In-Reply-To: <1620485869.86.0.948839095965.issue44077@roundup.psfhosted.org>
Message-ID: <1638826889.53.0.787293340905.issue44077@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44077>
_______________________________________

From report at bugs.python.org  Mon Dec  6 16:57:49 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Mon, 06 Dec 2021 21:57:49 +0000
Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but
 undocumented behavior
In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za>
Message-ID: <1638827869.43.0.0882162560546.issue28516@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

It's a bit more readable to start by stating what a function does rather than what it doesn't do. I also wouldn't worry about possible future minor optimizations that might be added, because if that happens, a simple ".. aside from internal optimizations, ... " would suffice.

Something like this should work:

The __enter__ method returns the ExitStack instance, and performs no additional operations.

 OR

 ... and does not perform any additional operations.

----------
nosy: +andrei.avk

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28516>
_______________________________________

From report at bugs.python.org  Mon Dec  6 17:01:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 22:01:31 +0000
Subject: [issue21761] [doc] language reference describes the role of
 module.__file__ inaccurately
In-Reply-To: <1402778004.82.0.418404996295.issue21761@psf.upfronthosting.co.za>
Message-ID: <1638828091.88.0.562789076099.issue21761@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21761>
_______________________________________

From report at bugs.python.org  Mon Dec  6 17:07:52 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 22:07:52 +0000
Subject: [issue41174] asyncio.coroutine decorator returns a non-generator
 function when using PYTHONASYNCIODEBUG
In-Reply-To: <1593537261.43.0.523552907091.issue41174@roundup.psfhosted.org>
Message-ID: <1638828472.92.0.0971181222669.issue41174@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

asyncio.coroutine was removed in 3.11, and I don't think this will be changed in stable versions. I will close this issue unless I am corrected.

----------
nosy: +iritkatriel
resolution:  -> wont fix
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41174>
_______________________________________

From report at bugs.python.org  Mon Dec  6 17:12:04 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 06 Dec 2021 22:12:04 +0000
Subject: [issue13548] line number when tracing an implicit return
In-Reply-To: <1323275290.33.0.837630531134.issue13548@psf.upfronthosting.co.za>
Message-ID: <1638828724.69.0.803215387192.issue13548@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

This seems to be fixed.  On 3.11.0a2 installed on Windows and fresh build of .0a2+, I see return on line 11, which is correct.

f:\dev\3x>python ../tem/tem.py
Running Debug|x64 interpreter...
f:\dev\tem\tem.py 7 call
f:\dev\tem\tem.py 8 line
f:\dev\tem\tem.py 10 line
f:\dev\tem\tem.py 11 line
f:\dev\tem\tem.py 11 return

Irit, please confirm (or not) on your *nix system.

----------
nosy: +Mark.Shannon

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13548>
_______________________________________

From report at bugs.python.org  Mon Dec  6 17:13:50 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 06 Dec 2021 22:13:50 +0000
Subject: [issue45957] _tkinter.TclError: expected boolean value but got ""
In-Reply-To: <1638395678.26.0.142189706167.issue45957@roundup.psfhosted.org>
Message-ID: <1638828830.66.0.775477870197.issue45957@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Or use python.org installer ;-).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45957>
_______________________________________

From report at bugs.python.org  Mon Dec  6 17:13:52 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 22:13:52 +0000
Subject: [issue13548] line number when tracing an implicit return
In-Reply-To: <1323275290.33.0.837630531134.issue13548@psf.upfronthosting.co.za>
Message-ID: <1638828832.67.0.815200158169.issue13548@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Terry, I'm pretty sure I saw the problem on the mac earlier. Can you paste the contents of tem.py?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13548>
_______________________________________

From report at bugs.python.org  Mon Dec  6 17:20:56 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 22:20:56 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638829256.09.0.517533279079.issue45476@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> In the PyPI top 5000, I found two projects using PyDescr_TYPE() and PyDescr_NAME() as l-value: M2Crypto and mecab-python3. In both cases, it was code generated by SWIG

I proposed a first PR for Py_TYPE():
https://github.com/swig/swig/pull/2116

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Mon Dec  6 17:38:24 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 06 Dec 2021 22:38:24 +0000
Subject: [issue13548] line number when tracing an implicit return
In-Reply-To: <1323275290.33.0.837630531134.issue13548@psf.upfronthosting.co.za>
Message-ID: <1638830304.92.0.58694552072.issue13548@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

The attached badlineevent.py with print updated.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13548>
_______________________________________

From report at bugs.python.org  Mon Dec  6 17:46:24 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 06 Dec 2021 22:46:24 +0000
Subject: [issue45798] Move _decimal build setup into configure
In-Reply-To: <1636794919.07.0.823304462548.issue45798@roundup.psfhosted.org>
Message-ID: <1638830784.43.0.543913161422.issue45798@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

It looks like this change broke macOS universal2 builds of libmpdec. I'm looking at it now but wanted to flag it as a "release blocker" for tagging 3.11.0a3.

----------
nosy: +ned.deily
priority: normal -> release blocker
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45798>
_______________________________________

From report at bugs.python.org  Mon Dec  6 17:48:04 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 06 Dec 2021 22:48:04 +0000
Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value
In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org>
Message-ID: <1638830884.0.0.658397765541.issue45476@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> python-snappy-0.6.0: maybe_resize() in snappy/snappymodule.cc

I proposed a fix: https://github.com/andrix/python-snappy/pull/114

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45476>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:14:51 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Mon, 06 Dec 2021 23:14:51 +0000
Subject: [issue46003] os.replace is not cross-platform: at least improve
 documentation
In-Reply-To: <1638825605.8.0.77974659196.issue46003@roundup.psfhosted.org>
Message-ID: <1638832491.79.0.203237790623.issue46003@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

I suspect anti-virus software.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46003>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:16:40 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 23:16:40 +0000
Subject: [issue13548] line number when tracing an implicit return
In-Reply-To: <1323275290.33.0.837630531134.issue13548@psf.upfronthosting.co.za>
Message-ID: <1638832600.53.0.215160992905.issue13548@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Yes, you're right. I don't know what I thought I saw before. It works on the mac as well.

----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13548>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:19:35 2021
From: report at bugs.python.org (Eryk Sun)
Date: Mon, 06 Dec 2021 23:19:35 +0000
Subject: [issue8161] inconsistency behavior in ctypes.c_char_p dereferencing
In-Reply-To: <1268816987.2.0.0650705594073.issue8161@psf.upfronthosting.co.za>
Message-ID: <1638832775.88.0.740251230414.issue8161@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

This appears to be misreported. The implementation in 3.1.2rc1 looks correct to me [1]. Either way, it's out of date.

That said, the emulation of a simple type in an aggregate type is still incomplete nowadays. It's not implemented when a c_char or c_wchar array type is itself the type of an array. It's also inconsistent with simple types because the automatic get-set conversion isn't disabled for subclasses of c_char and c_wchar array types. For a subclass, one should have to use the `value` attribute.

---
[1] https://github.com/python/cpython/blob/v3.1.2rc1/Modules/_ctypes/cfield.c#L110-L137

----------
nosy: +eryksun
resolution:  -> out of date
stage: needs patch -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue8161>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:27:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 23:27:05 +0000
Subject: [issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not
 present in code
In-Reply-To: <1571436071.95.0.156296507321.issue38522@roundup.psfhosted.org>
Message-ID: <1638833225.16.0.7743115114.issue38522@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
versions: +Python 3.10, Python 3.11 -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38522>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:28:21 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 23:28:21 +0000
Subject: [issue36706] Python script on startup stucks at import
In-Reply-To: <1556024687.06.0.0109255005812.issue36706@roundup.psfhosted.org>
Message-ID: <1638833301.89.0.0449881352923.issue36706@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36706>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:29:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 23:29:28 +0000
Subject: [issue22684] message.as_bytes() produces recursion depth exceeded
In-Reply-To: <1413894566.0.0.84714989702.issue22684@psf.upfronthosting.co.za>
Message-ID: <1638833368.06.0.604461475178.issue22684@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> works for me
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22684>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:30:41 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 23:30:41 +0000
Subject: [issue18531] Undocumented different between METH_KEYWORDS and **kws
In-Reply-To: <1374519103.74.0.277776306074.issue18531@psf.upfronthosting.co.za>
Message-ID: <1638833441.94.0.953884456717.issue18531@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18531>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:31:14 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 23:31:14 +0000
Subject: [issue25633] The documentation for urllib.request should mention
 http.client.HTTPException
In-Reply-To: <1447663371.73.0.839165836135.issue25633@psf.upfronthosting.co.za>
Message-ID: <1638833474.49.0.123812312432.issue25633@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> out of date
stage: needs patch -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25633>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:40:06 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 23:40:06 +0000
Subject: [issue20459] [doc] No Argument Clinic documentation on how to specify
 a return converter
In-Reply-To: <1391185302.8.0.888255910236.issue20459@psf.upfronthosting.co.za>
Message-ID: <1638834006.0.0.464355935796.issue20459@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: No Argument Clinic documentation on how to specify a return converter -> [doc] No Argument Clinic documentation on how to specify a return converter
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20459>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:40:40 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Mon, 06 Dec 2021 23:40:40 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1638834040.18.0.459550846648.issue23819@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset 265918bb1d782ab85c7dbc835eb62d6cfc2145b7 by Kumar Aditya in branch 'main':
bpo-23819: asyncio: Replace AssertionError with TypeError where it makes sense (GH-29894)
https://github.com/python/cpython/commit/265918bb1d782ab85c7dbc835eb62d6cfc2145b7


----------
nosy: +asvetlov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:43:09 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 06 Dec 2021 23:43:09 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638834189.53.0.122920969683.issue45582@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
pull_requests: +28173
pull_request: https://github.com/python/cpython/pull/29948

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:44:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 23:44:20 +0000
Subject: [issue21731] Calendar Problem with Windows (XP)
In-Reply-To: <1402573101.18.0.674315484569.issue21731@psf.upfronthosting.co.za>
Message-ID: <1638834260.01.0.522024561419.issue21731@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> locale.py resetlocale throws exception on Windows (getdefaultlocale returns value not usable in setlocale)

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21731>
_______________________________________

From report at bugs.python.org  Mon Dec  6 18:50:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 06 Dec 2021 23:50:48 +0000
Subject: [issue20936] test_strftime: enormous allocation,
 fails under Clang sanitizer
In-Reply-To: <1394901902.95.0.363100076763.issue20936@psf.upfronthosting.co.za>
Message-ID: <1638834648.91.0.403140519226.issue20936@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

3.5 is no longer maintained. Please create a new issue if you see this on a current version (>= 3.().

----------
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20936>
_______________________________________

From report at bugs.python.org  Mon Dec  6 19:07:45 2021
From: report at bugs.python.org (Steve Dower)
Date: Tue, 07 Dec 2021 00:07:45 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638835665.26.0.1134099455.issue45582@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset b7ef27bc084665ce58d89fc69530c6f9d2d37754 by Steve Dower in branch 'main':
bpo-45582: Ensure PYTHONHOME still overrides detected build prefixes (GH-29948)
https://github.com/python/cpython/commit/b7ef27bc084665ce58d89fc69530c6f9d2d37754


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Mon Dec  6 19:10:56 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 00:10:56 +0000
Subject: [issue28953] Use `raise from` when raising new IncompleteRead
In-Reply-To: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za>
Message-ID: <1638835856.31.0.289750625982.issue28953@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset c5c365220ed2c867fe81078f70b827de22db2ee6 by 180909 in branch 'main':
bpo-28953: Use `raise from` when raising new IncompleteRead (GH-29861)
https://github.com/python/cpython/commit/c5c365220ed2c867fe81078f70b827de22db2ee6


----------
nosy: +miss-islington

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28953>
_______________________________________

From report at bugs.python.org  Mon Dec  6 19:13:07 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Tue, 07 Dec 2021 00:13:07 +0000
Subject: [issue28953] Use `raise from` when raising new IncompleteRead
In-Reply-To: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za>
Message-ID: <1638835987.61.0.378967625704.issue28953@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28953>
_______________________________________

From report at bugs.python.org  Mon Dec  6 19:14:25 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Tue, 07 Dec 2021 00:14:25 +0000
Subject: [issue45620] A misleading url in 'Floating Point Arithmetic' page
In-Reply-To: <1635313160.15.0.740336077946.issue45620@roundup.psfhosted.org>
Message-ID: <1638836065.58.0.222835795555.issue45620@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

I notified lahey.com, and it looks like the behavior is now normal (at least, it looks okay by testing with the curl commands). Could someone who say this problem in a browser please double-check?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45620>
_______________________________________

From report at bugs.python.org  Mon Dec  6 19:47:39 2021
From: report at bugs.python.org (Eryk Sun)
Date: Tue, 07 Dec 2021 00:47:39 +0000
Subject: [issue46003] os.replace is not cross-platform: at least improve
 documentation
In-Reply-To: <1638825605.8.0.77974659196.issue46003@roundup.psfhosted.org>
Message-ID: <1638838059.86.0.101565464072.issue46003@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

The os module tries to avoid documenting low-level OS behaviors. It would be unreliable and difficult to maintain. 

In the case of os.replace(), in Windows it calls MoveFileExW() with the flag MOVEFILE_REPLACE_EXISTING [1]. The source and destination paths must be on the same volume. The caller must have permission to delete the source path and, if it already exists, the destination path. The caller must have permission to add a file or directory to the destination directory. Existing opens of the source path must share delete access. If the source path is a directory, none of the files and directories in its tree is allowed to be open. If the destination path already exists, it cannot be a directory, a readonly file, or mapped as a process image (i.e. a data mapping is allowed, but an executing EXE or DLL is disallowed). Currently, existing opens of the destination path are not allowed, even if they share delete access. 

In Windows 10+, there's new support at the NT system call level (i.e. the layer beneath the Windows API) to support replacing a file that has existing opens, if the file system supports it (e.g. NTFS, ReFS). Delete access is still required, so the opens must share delete access. MoveFileExW() has not been updated yet to use this new capability. If and when it's supported, the requirement for existing opens to share delete access means it won't help in general. Most Windows programs, including Python, do not share delete access on open files. To share delete access in Python, one can use a custom opener function that calls CreateFileW() and wraps the OS handle in an fd via msvcrt.open_osfhandle().

---
[1] https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexw

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46003>
_______________________________________

From report at bugs.python.org  Mon Dec  6 19:49:59 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 07 Dec 2021 00:49:59 +0000
Subject: [issue21761] [doc] language reference describes the role of
 module.__file__ inaccurately
In-Reply-To: <1402778004.82.0.418404996295.issue21761@psf.upfronthosting.co.za>
Message-ID: <1638838199.42.0.482004254962.issue21761@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

The key point is that loaders should be using the spec, not any of the module attrs (like `__file__` and `__cached__`), nor setting them.

For the specific paragraph I referenced, it would look more like:

  It is also appropriate to set __cached__ when __file__ is not set.
  However, that scenario is quite atypical.  Ultimately, __file__ and
  __cached__ are set by the import system from the module spec provided
  by the finder.  The spec instructs the loader.  If a loader can load
  from a cached module but otherwise does not load from a file, that
  atypical scenario may be appropriate.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21761>
_______________________________________

From report at bugs.python.org  Mon Dec  6 20:38:30 2021
From: report at bugs.python.org (Zernoxi)
Date: Tue, 07 Dec 2021 01:38:30 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638841110.22.0.84845219665.issue46002@roundup.psfhosted.org>


Zernoxi <tze.chian.kam at gmail.com> added the comment:

I did some more testing more testing some more testing and saw that eryksun pointed out that the PATH environment variable is also being checked. I thought that it only checked for registered pythons but anyway. If I remove the "bin" folder to MSYS2 then the issue goes away.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 20:56:41 2021
From: report at bugs.python.org (Zernoxi)
Date: Tue, 07 Dec 2021 01:56:41 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638842201.23.0.664434410283.issue46002@roundup.psfhosted.org>


Zernoxi <tze.chian.kam at gmail.com> added the comment:

Is there a way to "ignore" MSYS2 "bin" folder? Because "pyenv" is a wrapper for python versions and its python.exe is not explicitly in the PATH environment variable.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 21:05:01 2021
From: report at bugs.python.org (Zernoxi)
Date: Tue, 07 Dec 2021 02:05:01 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638842701.84.0.107140014873.issue46002@roundup.psfhosted.org>


Zernoxi <tze.chian.kam at gmail.com> added the comment:

My bad, I guess its not a bug. Didn't read the documents correctly.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Mon Dec  6 21:07:31 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 07 Dec 2021 02:07:31 +0000
Subject: [issue45798] Move _decimal build setup into configure
In-Reply-To: <1636794919.07.0.823304462548.issue45798@roundup.psfhosted.org>
Message-ID: <1638842851.94.0.756185027992.issue45798@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
pull_requests: +28174
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29949

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45798>
_______________________________________

From report at bugs.python.org  Mon Dec  6 21:25:38 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 07 Dec 2021 02:25:38 +0000
Subject: [issue45950] Reintroduce bootstrap_python for freezing
In-Reply-To: <1638375997.48.0.12074215987.issue45950@roundup.psfhosted.org>
Message-ID: <1638843938.57.0.264401801623.issue45950@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

I've now verified that the _bootstrap_python fix for framework builds works - removing "release blocker" status. Thanks, Christian!

----------
priority: release blocker -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45950>
_______________________________________

From report at bugs.python.org  Mon Dec  6 21:35:54 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 07 Dec 2021 02:35:54 +0000
Subject: [issue45798] Move _decimal build setup into configure
In-Reply-To: <1636794919.07.0.823304462548.issue45798@roundup.psfhosted.org>
Message-ID: <1638844554.8.0.50575576403.issue45798@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:


New changeset ddbab69b6d44085564a9b5022b96b002a52b2f2b by Ned Deily in branch 'main':
bpo-45798: Let libmpdec decide which archs to build on macOS as done previously. (GH-29949)
https://github.com/python/cpython/commit/ddbab69b6d44085564a9b5022b96b002a52b2f2b


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45798>
_______________________________________

From report at bugs.python.org  Mon Dec  6 21:43:44 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 07 Dec 2021 02:43:44 +0000
Subject: [issue45798] Move _decimal build setup into configure
In-Reply-To: <1636794919.07.0.823304462548.issue45798@roundup.psfhosted.org>
Message-ID: <1638845024.51.0.56896290649.issue45798@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

The issue here turned out to be that the architecture selection code for libmpdec builds on macOS had been scrambled a bit on the move from setup.py to configure. To support universal builds correctly, libmpdec has code to decide itself which arch(s) to build with on macOS. PR 29949 restores that behavior and macOS universal2 builds (builds which have both native arm64 and x86_64 binaries in each executable or library file) now work again for 3.11.

----------
priority: release blocker -> 
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45798>
_______________________________________

From report at bugs.python.org  Mon Dec  6 22:30:19 2021
From: report at bugs.python.org (Ma Lin)
Date: Tue, 07 Dec 2021 03:30:19 +0000
Subject: [issue44092] [sqlite3] Remove special rollback handling
In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org>
Message-ID: <1638847819.4.0.446564936467.issue44092@roundup.psfhosted.org>


Ma Lin <malincns at 163.com> added the comment:

If the special rollback handling is removed, the behavior of Connection.rollback() and 'ON CONFLICT ROLLBACK' clause will be consistent.
See attached file on_conflict_rollback.py.

----------
Added file: https://bugs.python.org/file50481/on_conflict_rollback.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44092>
_______________________________________

From report at bugs.python.org  Mon Dec  6 23:11:18 2021
From: report at bugs.python.org (Eryk Sun)
Date: Tue, 07 Dec 2021 04:11:18 +0000
Subject: [issue31879] Launcher fails on custom command starting with "python"
In-Reply-To: <1509037268.43.0.213398074469.issue31879@psf.upfronthosting.co.za>
Message-ID: <1638850278.72.0.620590602995.issue31879@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

Whether it should be this way or not, here's how it currently works. 

The builtin virtual paths all end with "python":

    static SHEBANG builtin_virtual_paths [] = {
        { L"/usr/bin/env python", TRUE },
        { L"/usr/bin/python", FALSE },
        { L"/usr/local/bin/python", FALSE },
        { L"python", FALSE },
        { NULL, FALSE },
    };

parse_shebang() loops over this list, simply matching up to the length of each virtual path. Thus "/usr/bin/env python-xyz" is matched as a virtual path. 

Supporting user configured "python*" commands would require more sophisticated matching. A virtual command has to consume a suffix that looks like a version string in the form "[x[.y]][-32|-64]", as determined by validate_version(). But otherwise configured "python*" commands don't have to be matched as virtual commands.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31879>
_______________________________________

From report at bugs.python.org  Mon Dec  6 23:20:42 2021
From: report at bugs.python.org (Markus Kitsinger (he/him/his))
Date: Tue, 07 Dec 2021 04:20:42 +0000
Subject: [issue14965] super() and property inheritance behavior
In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za>
Message-ID: <1638850842.03.0.617890706615.issue14965@roundup.psfhosted.org>


Change by Markus Kitsinger (he/him/his) <root at swooshalicio.us>:


----------
nosy: +SwooshyCueb
nosy_count: 23.0 -> 24.0
pull_requests: +28175
pull_request: https://github.com/python/cpython/pull/29950

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14965>
_______________________________________

From report at bugs.python.org  Tue Dec  7 01:11:16 2021
From: report at bugs.python.org (Andre Roberge)
Date: Tue, 07 Dec 2021 06:11:16 +0000
Subject: [issue46004] Incorrect bad token identified in 3.10.1
Message-ID: <1638857476.78.0.83967741356.issue46004@roundup.psfhosted.org>


New submission from Andre Roberge <andre.roberge at gmail.com>:

In Python 3.10.1, a change occurred compared with 3.10.0 so that an incorrect token is flagged for a SyntaxError.  Also, in 3.11.0a2, the suggestion made about having forgotten a comma is incorrect.


Python 3.10.1
    for x range(4):
                  ^
SyntaxError: invalid syntax

(I no longer have 3.10.0 available but I know from my tests that it was identifying correctly the wrong token.)


Python 3.11.0a2
    for x range(4):
        ^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Python 3.9.5
    for x range(4):
          ^
SyntaxError: invalid syntax

Python 3.8.10
    for x range(4):
          ^
SyntaxError: invalid syntax

Python 3.7.8
    for x range(4):
              ^
SyntaxError: invalid syntax

Python 3.6.8
    for x range(4):
              ^
SyntaxError: invalid syntax

----------
components: Parser
messages: 407894
nosy: aroberge, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Incorrect bad token identified in 3.10.1
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________

From report at bugs.python.org  Tue Dec  7 01:16:04 2021
From: report at bugs.python.org (Andre Roberge)
Date: Tue, 07 Dec 2021 06:16:04 +0000
Subject: [issue46004] Incorrect bad token identified in 3.10.1
In-Reply-To: <1638857476.78.0.83967741356.issue46004@roundup.psfhosted.org>
Message-ID: <1638857764.69.0.409354069448.issue46004@roundup.psfhosted.org>


Andre Roberge <andre.roberge at gmail.com> added the comment:

>From (https://friendly-traceback.github.io/docs/syntax_tracebacks_en_3.10.html#for-loop-missing-in-operator), this is what was shown for Python 3.10.0

    for x range(4):
        ^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Same as Python 3.11.0a2.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________

From report at bugs.python.org  Tue Dec  7 03:08:57 2021
From: report at bugs.python.org (Elmir)
Date: Tue, 07 Dec 2021 08:08:57 +0000
Subject: [issue46005] [doc] replace 'distutils' examples with 'setuptools'
Message-ID: <1638864537.57.0.967787312853.issue46005@roundup.psfhosted.org>


New submission from Elmir <elmir.jagudin at maxiv.lu.se>:

As the distutils have been deprecated, the documentation on building C/C++ extension modules should be updated to use more future proof tool.

I guess the section:

'Building C and C++ Extensions with distutils'

should be replaced with:

'Building C and C++ Extensions with setuptools'

Here is link to the section that needs to be updated/replaced:

https://docs.python.org/3/extending/building.html#building-c-and-c-extensions-with-distutils

----------
assignee: docs at python
components: Documentation
messages: 407896
nosy: docs at python, elmjag
priority: normal
severity: normal
status: open
title: [doc] replace 'distutils' examples with 'setuptools'
type: enhancement
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46005>
_______________________________________

From report at bugs.python.org  Tue Dec  7 03:12:16 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 08:12:16 +0000
Subject: [issue28533] Remove asyncore, asynchat and smtpd modules
In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za>
Message-ID: <1638864736.44.0.912122873217.issue28533@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
pull_requests: +28176
pull_request: https://github.com/python/cpython/pull/29951

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28533>
_______________________________________

From report at bugs.python.org  Tue Dec  7 03:13:45 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 08:13:45 +0000
Subject: [issue28533] Remove asyncore, asynchat and smtpd modules
In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za>
Message-ID: <1638864825.89.0.0511227314321.issue28533@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

I reopen the issue: the Steering Council asked to revert the change removing the 3 modules, since the DeprecationWarning was only emitted in a single Python release (Python 3.10) and so the PEP 387 process was not respected.

I created the PR 29951 to add again the 3 modules to Python 3.11.

----------
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28533>
_______________________________________

From report at bugs.python.org  Tue Dec  7 03:17:48 2021
From: report at bugs.python.org (Alex Waygood)
Date: Tue, 07 Dec 2021 08:17:48 +0000
Subject: [issue45929] extend json.tool --json-lines to ignore empty rows
In-Reply-To: <1638200958.63.0.173460715414.issue45929@roundup.psfhosted.org>
Message-ID: <1638865068.91.0.63328107804.issue45929@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

I am changing the "version" field to 3.11, as enhancement proposals are generally only considered for unreleased versions of Python.

----------
nosy: +AlexWaygood, bob.ippolito, ezio.melotti, rhettinger
versions: +Python 3.11 -Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45929>
_______________________________________

From report at bugs.python.org  Tue Dec  7 03:20:16 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Tue, 07 Dec 2021 08:20:16 +0000
Subject: [issue41174] asyncio.coroutine decorator returns a non-generator
 function when using PYTHONASYNCIODEBUG
In-Reply-To: <1593537261.43.0.523552907091.issue41174@roundup.psfhosted.org>
Message-ID: <1638865216.05.0.291682887182.issue41174@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

Agree, thanks!

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41174>
_______________________________________

From report at bugs.python.org  Tue Dec  7 03:20:21 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 08:20:21 +0000
Subject: [issue28533] Remove asyncore, asynchat and smtpd modules
In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za>
Message-ID: <1638865221.86.0.147368209966.issue28533@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

https://github.com/python/steering-council/issues/86

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28533>
_______________________________________

From report at bugs.python.org  Tue Dec  7 03:27:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 08:27:33 +0000
Subject: [issue41174] asyncio.coroutine decorator returns a non-generator
 function when using PYTHONASYNCIODEBUG
In-Reply-To: <1593537261.43.0.523552907091.issue41174@roundup.psfhosted.org>
Message-ID: <1638865653.98.0.295261099427.issue41174@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41174>
_______________________________________

From report at bugs.python.org  Tue Dec  7 03:45:13 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 08:45:13 +0000
Subject: [issue27016] BlockingIOError not raised inside function.
In-Reply-To: <1463191419.08.0.084074707962.issue27016@psf.upfronthosting.co.za>
Message-ID: <1638866713.34.0.00584919934706.issue27016@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> works for me
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27016>
_______________________________________

From report at bugs.python.org  Tue Dec  7 03:56:53 2021
From: report at bugs.python.org (Julien Castiaux)
Date: Tue, 07 Dec 2021 08:56:53 +0000
Subject: [issue44637] Quoting issue on header Reply-To and other address
 headers
In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org>
Message-ID: <1638867413.19.0.784304613559.issue44637@roundup.psfhosted.org>


Julien Castiaux <julien.castiaux at gmail.com> added the comment:

Hello there,

There is a pull-request on github, had to modify `_refold_parse_tree` but I could keep the diff quite small. It is properly tested and it is waiting a review :)

We have a patch at work so it is *absolutely not* urgent, feel free to review it *anytime*. Since we are using the Ubuntu LTS version of python, we might be interested by a backport till 3.7, quite honestly I'm happy it was flag as a security issue :D

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44637>
_______________________________________

From report at bugs.python.org  Tue Dec  7 04:19:25 2021
From: report at bugs.python.org (bendupndo)
Date: Tue, 07 Dec 2021 09:19:25 +0000
Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with
 FORMAT_RAW
In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org>
Message-ID: <1638868765.2.0.912310914437.issue41210@roundup.psfhosted.org>


bendupndo <apksunny.com at gmail.com> added the comment:

Candy Crush Saga MOD APK

If you have not yet played the legendary Candy Crush Saga, you should definitely try its MOD APK version. This cheat is a third party application that lets you have unlimited lives, moves, and collect stuff. It also allows you to purchase extra moves and boosters in the game. The main benefit of the MOD APK is that you can play the game without any limitations. So, how does it work? Well, it works just like the official version of the game.

Link download: https://apksunny.com/candy-crush-saga/

In Candy Crush Saga MOD APK, you will get unlimited elixir, gold, and gems. This means that you can purchase as many boosters as you want. With this cheat, you can also have access to VIP GUI, which will give you unlimited power-ups. It's the perfect way to play without paying for anything. In addition, it will also let you play the game with an unlimited amount of time and without worrying about running out of elixir.

Using the Candy Crush Saga MOD APK is simple. It will give you unlimited lives, unlimited moves, and infinite boosters. You just need to close the message asking you to buy a booster and choose one. You'll also have unlimited lollypop and hand switch boosters, plus endless owl candies. You can also use the MOD APK to get more levels and unlock extra special candies.

You can also use this Candy Crush Saga MOD APK to get unlimited boosts. To buy the boosters, you simply need to click the 'buy' button in the pop-up message and then select the 'booster' you want. After this, you'll be able to have infinite lollypops, hand switches, and unlimited owl candies. You can also get endless owl candies. The MOD APK is not available in all versions of the game, but it's worth a try.

In Candy Crush Saga MOD APK, you can save your progress to cloud services. This is a great feature for people who don't want to risk losing their progress. The MOD APK is free, safe, and very easy to install. It's recommended that you uninstall the PlayStore version of the game if you're using a different version of the game. Once you've uninstalled the PlayStore version of the app, simply download the MOD version of the game and restart the game.

The Candy Crush Saga MOD APK gives you unlimited lives and is similar to the PlayStore version. It has the same features as the PlayStore version, but with a few exceptions. For example, you'll get a daily booster wheel and time-limited challenges. You'll have more lives than you need to complete the levels. The Bomb Counter will be set to 99 double all the time.

----------
nosy: +sakaranata

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41210>
_______________________________________

From report at bugs.python.org  Tue Dec  7 04:33:47 2021
From: report at bugs.python.org (Akuli)
Date: Tue, 07 Dec 2021 09:33:47 +0000
Subject: [issue45620] A misleading url in 'Floating Point Arithmetic' page
In-Reply-To: <1635313160.15.0.740336077946.issue45620@roundup.psfhosted.org>
Message-ID: <1638869627.92.0.735331629133.issue45620@roundup.psfhosted.org>


Akuli <akuviljanen17 at gmail.com> added the comment:

Thanks! Works for me in browser now.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45620>
_______________________________________

From report at bugs.python.org  Tue Dec  7 04:40:01 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 07 Dec 2021 09:40:01 +0000
Subject: [issue45929] extend json.tool --json-lines to ignore empty rows
In-Reply-To: <1638200958.63.0.173460715414.issue45929@roundup.psfhosted.org>
Message-ID: <1638870001.42.0.626821635805.issue45929@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Both JSON Lines (https://jsonlines.org/) and Newline Delimited JSON (http://ndjson.org/) formats require that Each Line is a Valid JSON Value.

If you want to ignore empty lines you can filter them out with `sed /^$/d`.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45929>
_______________________________________

From report at bugs.python.org  Tue Dec  7 04:43:55 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 07 Dec 2021 09:43:55 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1638870235.41.0.478525547895.issue46000@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Tue Dec  7 04:54:42 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 07 Dec 2021 09:54:42 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638870882.74.0.271280110061.issue45995@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Well, it makes sense for negative zero produced by rounding.

But if we add a special support for this case, it would be useful to have some control on the type of rounding. Currently floats are rounded to the nearest decimal number, but in some cases it would be better to round up, down, toward zero or infinity (seed for example issue44884).

You can round explicitly before formatting, but this solution is also applicable for this issue:

>>> '%5.1f' % (round(-.00001, 1) + 0.0)
'  0.0'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Tue Dec  7 04:58:56 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 07 Dec 2021 09:58:56 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
In-Reply-To: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>
Message-ID: <1638871136.17.0.443611281435.issue46001@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 8db06528cacc94e67eb1fb2e4c2acc061a515671 by James Gerity in branch 'main':
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943)
https://github.com/python/cpython/commit/8db06528cacc94e67eb1fb2e4c2acc061a515671


----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Tue Dec  7 04:59:02 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 09:59:02 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
In-Reply-To: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>
Message-ID: <1638871142.72.0.564018787768.issue46001@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28177
pull_request: https://github.com/python/cpython/pull/29952

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Tue Dec  7 04:59:07 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 09:59:07 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
In-Reply-To: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>
Message-ID: <1638871147.66.0.89237540445.issue46001@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28178
pull_request: https://github.com/python/cpython/pull/29953

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Tue Dec  7 04:59:55 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 07 Dec 2021 09:59:55 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
In-Reply-To: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>
Message-ID: <1638871195.6.0.434697361883.issue46001@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Thank you for your contribution James!

----------
versions: +Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Tue Dec  7 05:20:20 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 10:20:20 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
In-Reply-To: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>
Message-ID: <1638872420.22.0.453230767773.issue46001@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 15da2a2723245710f1bd2c7cbd5b450532ae7728 by Miss Islington (bot) in branch '3.10':
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943)
https://github.com/python/cpython/commit/15da2a2723245710f1bd2c7cbd5b450532ae7728


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Tue Dec  7 05:25:07 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 10:25:07 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
In-Reply-To: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>
Message-ID: <1638872707.15.0.287717121284.issue46001@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 2e360832d7ed2697d715e93cb9f859a52264d60b by Miss Islington (bot) in branch '3.9':
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943)
https://github.com/python/cpython/commit/2e360832d7ed2697d715e93cb9f859a52264d60b


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Tue Dec  7 05:32:55 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 07 Dec 2021 10:32:55 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638873175.79.0.717386877183.issue45582@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28179
pull_request: https://github.com/python/cpython/pull/29954

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Tue Dec  7 05:41:54 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 10:41:54 +0000
Subject: [issue45963] Embed interpreter frame in generator.
In-Reply-To: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org>
Message-ID: <1638873714.29.0.382994208208.issue45963@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Unfortunately, all refleak buildbots are failing after 299483c95d601ddcfdce2f96418b6499c1fc7b9f was merged. I bisected the problem to it:

299483c95d601ddcfdce2f96418b6499c1fc7b9f is the first bad commit
commit 299483c95d601ddcfdce2f96418b6499c1fc7b9f
Author: Mark Shannon <mark at hotpy.org>
Date:   Mon Dec 6 10:13:49 2021 +0000

    bpo-45963: Make space for the InterpreterFrame of a generator in that generator. (GH-29891)

    * Make generator, coroutine and async gen structs all the same size.

    * Store interpreter frame in generator (and coroutine). Reduces the number of allocations neeeded for a generator from two to one.

 Include/cpython/genobject.h     |  23 ++---
 Include/internal/pycore_ceval.h |   2 +-
 Include/internal/pycore_frame.h |   2 +-
 Lib/test/test_sys.py            |   2 +-
 Objects/genobject.c             | 183 ++++++++++++++++++++++------------------
 Python/ceval.c                  |  41 +++------
 Python/frame.c                  |  18 ++--
 7 files changed, 127 insertions(+), 144 deletions(-)

Following out buildbot policy, the change will need to be reverted if is not fixed in 24 hours.

----------
nosy: +pablogsal

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45963>
_______________________________________

From report at bugs.python.org  Tue Dec  7 05:43:25 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 10:43:25 +0000
Subject: [issue45963] Embed interpreter frame in generator.
In-Reply-To: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org>
Message-ID: <1638873805.22.0.518619953277.issue45963@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

This is also unfortunately blocking the 3.11.a3 release :(

----------
priority: normal -> release blocker

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45963>
_______________________________________

From report at bugs.python.org  Tue Dec  7 05:50:32 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 07 Dec 2021 10:50:32 +0000
Subject: [issue46001] JSON module documentation mentions OverflowError for
 case that raises RecursionError
In-Reply-To: <1638809146.18.0.0478648187504.issue46001@roundup.psfhosted.org>
Message-ID: <1638874232.24.0.212055529765.issue46001@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46001>
_______________________________________

From report at bugs.python.org  Tue Dec  7 05:50:51 2021
From: report at bugs.python.org (Mark Shannon)
Date: Tue, 07 Dec 2021 10:50:51 +0000
Subject: [issue45890] Add tests for tracing try-except-finally blocks
Message-ID: <1638874251.29.0.95185574141.issue45890@roundup.psfhosted.org>


New submission from Mark Shannon <mark at hotpy.org>:


New changeset a310fd83a014484b8c680de83540c4908b344c6c by Irit Katriel in branch 'main':
bpo-45890: Add tests for tracing try-except-finally blocks (GH-29746)
https://github.com/python/cpython/commit/a310fd83a014484b8c680de83540c4908b344c6c


----------
nosy: +Mark.Shannon

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45890>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:04:33 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Tue, 07 Dec 2021 11:04:33 +0000
Subject: [issue45620] A misleading url in 'Floating Point Arithmetic' page
In-Reply-To: <1635313160.15.0.740336077946.issue45620@roundup.psfhosted.org>
Message-ID: <1638875073.08.0.599936590153.issue45620@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

@Akuli: thanks for checking. And thanks so much for the awesome debugging with curl: that was the key to solving the problem.

I didn't hear back from lahey.com what the problem was, but I'd sure be curious to know!

----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45620>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:07:06 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Tue, 07 Dec 2021 11:07:06 +0000
Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI
In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org>
Message-ID: <1638875226.9.0.144205976663.issue43795@roundup.psfhosted.org>


Change by Petr Viktorin <encukou at gmail.com>:


----------
pull_requests: +28180
pull_request: https://github.com/python/cpython/pull/29956

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43795>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:15:57 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 11:15:57 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638875757.37.0.942670034842.issue35821@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28181
pull_request: https://github.com/python/cpython/pull/29957

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:16:02 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 11:16:02 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638875762.13.0.352751454527.issue35821@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28182
pull_request: https://github.com/python/cpython/pull/29958

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:15:53 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 07 Dec 2021 11:15:53 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638875753.76.0.758295411045.issue35821@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset 2bf551757e0a7e3cc6ce2ebed2178b82438ac6b5 by Vinay Sajip in branch 'main':
bpo-35821: Add an example to Logger.propagate documentation. (GH-29841)
https://github.com/python/cpython/commit/2bf551757e0a7e3cc6ce2ebed2178b82438ac6b5


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:23:49 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 11:23:49 +0000
Subject: [issue45890] Add tests for tracing try-except-finally blocks
In-Reply-To: <1638874251.29.0.95185574141.issue45890@roundup.psfhosted.org>
Message-ID: <1638876229.04.0.114479502965.issue45890@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45890>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:25:20 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 11:25:20 +0000
Subject: [issue46004] Incorrect bad token identified in 3.10.1
In-Reply-To: <1638857476.78.0.83967741356.issue46004@roundup.psfhosted.org>
Message-ID: <1638876320.88.0.599737252621.issue46004@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
keywords: +patch
pull_requests: +28183
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29959

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:25:25 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 11:25:25 +0000
Subject: [issue46004] Incorrect bad token identified in 3.10.1
In-Reply-To: <1638857476.78.0.83967741356.issue46004@roundup.psfhosted.org>
Message-ID: <1638876325.23.0.18339001047.issue46004@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
keywords: +patch, patch
pull_requests: +28183, 28184
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29959

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:31:12 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 11:31:12 +0000
Subject: [issue28533] Remove asyncore, asynchat and smtpd modules
In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za>
Message-ID: <1638876672.15.0.418242768281.issue28533@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:


New changeset cf7eaa4617295747ee5646c4e2b7e7a16d7c64ab by Victor Stinner in branch 'main':
Revert "bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)" (GH-29951)
https://github.com/python/cpython/commit/cf7eaa4617295747ee5646c4e2b7e7a16d7c64ab


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28533>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:31:13 2021
From: report at bugs.python.org (Athanasius)
Date: Tue, 07 Dec 2021 11:31:13 +0000
Subject: [issue45986] 3.10.0 ships with older tcl/tk DLLs than 3.9.9 causing
 Windows Installer problems
In-Reply-To: <1638706009.9.0.557448740254.issue45986@roundup.psfhosted.org>
Message-ID: <1638876673.04.0.653197055572.issue45986@roundup.psfhosted.org>


Athanasius <github at miggy.org> added the comment:

I can confirm that things are now working properly for us with Python 3.10.1.

This can be closed with regards to the immediate issue, but perhaps the release team might want to implement some checks/policy to avoid such an issue in future ?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45986>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:38:28 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 07 Dec 2021 11:38:28 +0000
Subject: [issue33080] regen-importlib is causing build races against other
 regen-all targets in Makefile.pre.in
In-Reply-To: <1521132370.51.0.467229070634.issue33080@psf.upfronthosting.co.za>
Message-ID: <1638877108.84.0.781174450394.issue33080@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

May I ask why you are running the regen-all target at all? A normal end-user build of CPython does not need make regen-all. It's only used for CI and internal development.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33080>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:44:05 2021
From: report at bugs.python.org (Alexander Kanavin)
Date: Tue, 07 Dec 2021 11:44:05 +0000
Subject: [issue33080] regen-importlib is causing build races against other
 regen-all targets in Makefile.pre.in
In-Reply-To: <1521132370.51.0.467229070634.issue33080@psf.upfronthosting.co.za>
Message-ID: <1638877445.06.0.253827125634.issue33080@roundup.psfhosted.org>


Alexander Kanavin <alex.kanavin at gmail.com> added the comment:

We have long ago updated to a much newer python and removed the workaround, so the whatever the issue was, it is completely obsolete. Thanks!

----------
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33080>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:45:22 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 07 Dec 2021 11:45:22 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638877522.03.0.509869765052.issue35821@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset f78c229b4ec8621a9b15c6396b6c91518e8975d6 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-35821: Add an example to Logger.propagate documentation. (GH-29841) (GH-29957)
https://github.com/python/cpython/commit/f78c229b4ec8621a9b15c6396b6c91518e8975d6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:45:57 2021
From: report at bugs.python.org (Alexander Kanavin)
Date: Tue, 07 Dec 2021 11:45:57 +0000
Subject: [issue33080] regen-importlib is causing build races against other
 regen-all targets in Makefile.pre.in
In-Reply-To: <1521132370.51.0.467229070634.issue33080@psf.upfronthosting.co.za>
Message-ID: <1638877557.84.0.275829897953.issue33080@roundup.psfhosted.org>


Alexander Kanavin <alex.kanavin at gmail.com> added the comment:

(removed both the workaround, and regen-all itself)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33080>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:45:52 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 07 Dec 2021 11:45:52 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638877552.97.0.56450422184.issue35821@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset e688568cdfe758a2316ecaf0c8df868d5dde0d83 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-35821: Add an example to Logger.propagate documentation. (GH-29841) (GH-29958)
https://github.com/python/cpython/commit/e688568cdfe758a2316ecaf0c8df868d5dde0d83


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:46:07 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 07 Dec 2021 11:46:07 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638877567.12.0.135642619162.issue35821@roundup.psfhosted.org>


Change by Vinay Sajip <vinay_sajip at yahoo.co.uk>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:48:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 11:48:48 +0000
Subject: [issue26120] pydoc: move __future__ imports out of the DATA block
In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za>
Message-ID: <1638877728.84.0.980275361154.issue26120@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
type:  -> enhancement
versions: +Python 3.11 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26120>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:51:03 2021
From: report at bugs.python.org (Mark Shannon)
Date: Tue, 07 Dec 2021 11:51:03 +0000
Subject: [issue45963] Embed interpreter frame in generator.
In-Reply-To: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org>
Message-ID: <1638877863.72.0.858989133113.issue45963@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:

I'll look into it now, and fix or revert it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45963>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:51:40 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 11:51:40 +0000
Subject: [issue24253] pydoc for namespace packages indicates FILE as built-in
In-Reply-To: <1432183058.22.0.402547757332.issue24253@psf.upfronthosting.co.za>
Message-ID: <1638877900.47.0.257893115515.issue24253@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduce on 3.11.

----------
nosy: +iritkatriel
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24253>
_______________________________________

From report at bugs.python.org  Tue Dec  7 06:56:49 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 07 Dec 2021 11:56:49 +0000
Subject: [issue33080] regen-importlib is causing build races against other
 regen-all targets in Makefile.pre.in
In-Reply-To: <1521132370.51.0.467229070634.issue33080@psf.upfronthosting.co.za>
Message-ID: <1638878209.3.0.36707164864.issue33080@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Fantasic!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33080>
_______________________________________

From report at bugs.python.org  Tue Dec  7 07:00:11 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 07 Dec 2021 12:00:11 +0000
Subject: [issue45664] resolve_bases() and new_class() do not work with type
 alias of a built-in type
In-Reply-To: <1635453507.8.0.842225708276.issue45664@roundup.psfhosted.org>
Message-ID: <1638878411.29.0.0163067063383.issue45664@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset bffce2cbb5543bc63a67e33ad599328a12f2b00a by Miss Islington (bot) in branch '3.9':
bpo-45664: Fix resolve_bases() and new_class() for GenericAlias instance as a base (GH-29298) (GH-29928)
https://github.com/python/cpython/commit/bffce2cbb5543bc63a67e33ad599328a12f2b00a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45664>
_______________________________________

From report at bugs.python.org  Tue Dec  7 07:00:37 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 07 Dec 2021 12:00:37 +0000
Subject: [issue45664] resolve_bases() and new_class() do not work with type
 alias of a built-in type
In-Reply-To: <1635453507.8.0.842225708276.issue45664@roundup.psfhosted.org>
Message-ID: <1638878437.24.0.190198660693.issue45664@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45664>
_______________________________________

From report at bugs.python.org  Tue Dec  7 07:01:12 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 07 Dec 2021 12:01:12 +0000
Subject: [issue45663] is_dataclass() does not work for dataclasses which are
 subclasses of types.GenericAlias
In-Reply-To: <1635451831.16.0.493312475993.issue45663@roundup.psfhosted.org>
Message-ID: <1638878472.41.0.20244829155.issue45663@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45663>
_______________________________________

From report at bugs.python.org  Tue Dec  7 07:10:42 2021
From: report at bugs.python.org (E. Paine)
Date: Tue, 07 Dec 2021 12:10:42 +0000
Subject: [issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11
In-Reply-To: <1633984027.59.0.32532195896.issue45436@roundup.psfhosted.org>
Message-ID: <1638879042.59.0.683403537635.issue45436@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

Fix merged upstream: https://core.tcl-lang.org/tk/tktview/be8f5b9f
Can issue be closed now?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45436>
_______________________________________

From report at bugs.python.org  Tue Dec  7 07:22:14 2021
From: report at bugs.python.org (John Belmonte)
Date: Tue, 07 Dec 2021 12:22:14 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638879734.81.0.73384551894.issue45995@roundup.psfhosted.org>


John Belmonte <john at neggie.net> added the comment:

> changing %-formatting doesn't seem viable

I'm concerned about treating %-formatting specially.  As far as float/complex, the logical and efficient place to put this change seems to be PyOS_double_to_string(), which affects all three formatting options.

For example, the dtoa case is as simple as this change to format_float_short():

    /* coerce negative zero to positive */
    if (sign == 1 && ((digits_len == 0 && decpt == -1) ||
                      (digits_len == 1 && digits[0] == '0'))) {
        sign = 0;
    }

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Tue Dec  7 07:53:02 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Tue, 07 Dec 2021 12:53:02 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638879734.81.0.73384551894.issue45995@roundup.psfhosted.org>
Message-ID: <20211207125036.GC21647@ando.pearwood.info>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

Sorry John, I don't understand your comment about "treating %-formatting 
specifically". Isn't the point here not to change %-formatting at all?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Tue Dec  7 07:55:35 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Tue, 07 Dec 2021 12:55:35 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638881735.77.0.498802347903.issue45995@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

%-formatting already doesn't support some formats that float.__format__ does, for example ','.

So I agree we shouldn't modify %-formatting. I don't have much of an opinion on whether changing __format__ is a good idea or not.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Tue Dec  7 07:57:17 2021
From: report at bugs.python.org (Mark Shannon)
Date: Tue, 07 Dec 2021 12:57:17 +0000
Subject: [issue45963] Embed interpreter frame in generator.
In-Reply-To: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org>
Message-ID: <1638881837.59.0.928635935933.issue45963@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
pull_requests: +28185
pull_request: https://github.com/python/cpython/pull/29960

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45963>
_______________________________________

From report at bugs.python.org  Tue Dec  7 07:58:40 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 12:58:40 +0000
Subject: [issue28141] shutil.copystat utime lookup fails on certain Android
 file systems
In-Reply-To: <1473833050.26.0.837055301848.issue28141@psf.upfronthosting.co.za>
Message-ID: <1638881920.97.0.24303334101.issue28141@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Jerry, is this still a problem with current python versions? (2.7/3.5 are no longer being maintained).

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28141>
_______________________________________

From report at bugs.python.org  Tue Dec  7 08:01:07 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 13:01:07 +0000
Subject: [issue38579] 'u' formatted arrays mostly prevent appends of 4 byte
 characters
In-Reply-To: <1571913084.38.0.724512448926.issue38579@roundup.psfhosted.org>
Message-ID: <1638882067.93.0.264366185879.issue38579@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Can you include a code snippet to demonstrate the problem?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38579>
_______________________________________

From report at bugs.python.org  Tue Dec  7 08:02:33 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 13:02:33 +0000
Subject: [issue46004] Incorrect bad token identified in 3.10.1
In-Reply-To: <1638857476.78.0.83967741356.issue46004@roundup.psfhosted.org>
Message-ID: <1638882153.34.0.107145985304.issue46004@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset 1c7a1c3be08ee911d347fffd2716f3911ba751f9 by Pablo Galindo Salgado in branch 'main':
bpo-46004: Fix error location for loops with invalid targets (GH-29959)
https://github.com/python/cpython/commit/1c7a1c3be08ee911d347fffd2716f3911ba751f9


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________

From report at bugs.python.org  Tue Dec  7 08:05:45 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 13:05:45 +0000
Subject: [issue46004] Incorrect bad token identified in 3.10.1
In-Reply-To: <1638857476.78.0.83967741356.issue46004@roundup.psfhosted.org>
Message-ID: <1638882345.1.0.873204495048.issue46004@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
pull_requests: +28186
pull_request: https://github.com/python/cpython/pull/29961

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________

From report at bugs.python.org  Tue Dec  7 08:14:12 2021
From: report at bugs.python.org (John Belmonte)
Date: Tue, 07 Dec 2021 13:14:12 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638882852.7.0.90956080774.issue45995@roundup.psfhosted.org>


John Belmonte <john at neggie.net> added the comment:

I see now.  PyOS_double_to_string() could gain the extra flag to coerce negative zero but, out of the three formatting methods, only format() and f-string would use the flag.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Tue Dec  7 08:28:04 2021
From: report at bugs.python.org (Antony Lee)
Date: Tue, 07 Dec 2021 13:28:04 +0000
Subject: [issue24253] pydoc for namespace packages indicates FILE as built-in
In-Reply-To: <1432183058.22.0.402547757332.issue24253@psf.upfronthosting.co.za>
Message-ID: <1638883684.98.0.487146000248.issue24253@roundup.psfhosted.org>


Change by Antony Lee <anntzer.lee at gmail.com>:


----------
nosy:  -Antony.Lee

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24253>
_______________________________________

From report at bugs.python.org  Tue Dec  7 08:28:12 2021
From: report at bugs.python.org (Antony Lee)
Date: Tue, 07 Dec 2021 13:28:12 +0000
Subject: [issue26120] pydoc: move __future__ imports out of the DATA block
In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za>
Message-ID: <1638883692.37.0.0374791176771.issue26120@roundup.psfhosted.org>


Change by Antony Lee <anntzer.lee at gmail.com>:


----------
nosy:  -Antony.Lee

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26120>
_______________________________________

From report at bugs.python.org  Tue Dec  7 08:57:10 2021
From: report at bugs.python.org (Ken Jin)
Date: Tue, 07 Dec 2021 13:57:10 +0000
Subject: [issue45755] Specialized generic class does not return class
 attributes in dir
In-Reply-To: <1636399849.8.0.841580145929.issue45755@roundup.psfhosted.org>
Message-ID: <1638885430.15.0.242263841294.issue45755@roundup.psfhosted.org>


Change by Ken Jin <kenjin4096 at gmail.com>:


----------
keywords: +patch
pull_requests: +28187
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29962

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45755>
_______________________________________

From report at bugs.python.org  Tue Dec  7 09:03:42 2021
From: report at bugs.python.org (Ken Jin)
Date: Tue, 07 Dec 2021 14:03:42 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638885822.41.0.945049520345.issue35821@roundup.psfhosted.org>


Change by Ken Jin <kenjin4096 at gmail.com>:


----------
nosy: +kj
nosy_count: 5.0 -> 6.0
pull_requests: +28188
pull_request: https://github.com/python/cpython/pull/29963

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 09:07:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 14:07:20 +0000
Subject: [issue36850] shutil.copy2 fails with even with source network
 filesystem not supporting extended attributes
In-Reply-To: <1557301411.76.0.646767757374.issue36850@roundup.psfhosted.org>
Message-ID: <1638886040.33.0.655873659602.issue36850@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This seems fixed, can it be closed?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36850>
_______________________________________

From report at bugs.python.org  Tue Dec  7 09:45:21 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 14:45:21 +0000
Subject: [issue45703] importlib.invalidate_caches() does not invalidate
 _NamespacePath's _last_parent_path-based cache
In-Reply-To: <1635938516.86.0.42328943914.issue45703@roundup.psfhosted.org>
Message-ID: <1638888321.23.0.000299202374596.issue45703@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28189
pull_request: https://github.com/python/cpython/pull/29964

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45703>
_______________________________________

From report at bugs.python.org  Tue Dec  7 09:59:00 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Tue, 07 Dec 2021 14:59:00 +0000
Subject: [issue45703] importlib.invalidate_caches() does not invalidate
 _NamespacePath's _last_parent_path-based cache
In-Reply-To: <1635938516.86.0.42328943914.issue45703@roundup.psfhosted.org>
Message-ID: <1638889140.5.0.889537780933.issue45703@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

Sadly, the backport is non-trivial. I'm putting on my TODO list, but I doubt I'll get to it soon :(

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45703>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:09:27 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 15:09:27 +0000
Subject: [issue22910] test_pydoc test_synopsis_sourceless is a flaky test
In-Reply-To: <1416553421.91.0.74824945431.issue22910@psf.upfronthosting.co.za>
Message-ID: <1638889767.05.0.449773949665.issue22910@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Shall we close this? It's pretty old and if the test is still flaky it will let us know.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22910>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:11:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 15:11:45 +0000
Subject: [issue23469] Delete Misc/*.wpr files
In-Reply-To: <1424048342.99.0.00819785192711.issue23469@psf.upfronthosting.co.za>
Message-ID: <1638889905.27.0.89809305343.issue23469@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Closing as this seems abandoned. Feel free to reopen if not.

----------
nosy: +iritkatriel
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23469>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:15:32 2021
From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=)
Date: Tue, 07 Dec 2021 15:15:32 +0000
Subject: [issue26120] pydoc: move __future__ imports out of the DATA block
In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za>
Message-ID: <1638890132.27.0.400734633698.issue26120@roundup.psfhosted.org>


Vedran ?a?i? <vedgar at gmail.com> added the comment:

I thought that _Feature starts with an underscore precisely to evade such listings. Do other "private" module data also get listed?

----------
nosy: +veky

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26120>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:20:50 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 15:20:50 +0000
Subject: [issue24393] Test urllib2_localnet fails depending on host proxy
 configuration
In-Reply-To: <1433594936.74.0.27552580361.issue24393@psf.upfronthosting.co.za>
Message-ID: <1638890450.28.0.778563610012.issue24393@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I'm closing this as there was no activity for 6 years and 3.5 is no longer maintained. Furthermore, it's not clear what problem the patch trying to solve. If this problem still exists on current versions (>= 3.9), please create a new issue and explain in more detail the scenario in which you had a problem with this test.

----------
nosy: +iritkatriel
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24393>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:23:41 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 15:23:41 +0000
Subject: [issue46004] Incorrect bad token identified in 3.10.1
In-Reply-To: <1638857476.78.0.83967741356.issue46004@roundup.psfhosted.org>
Message-ID: <1638890621.82.0.448046333864.issue46004@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset c52141200364898818956a73b955f7c04f634dc8 by Pablo Galindo Salgado in branch '3.10':
[3.10] bpo-46004: Fix error location for loops with invalid targets (GH-29959). (GH-29961)
https://github.com/python/cpython/commit/c52141200364898818956a73b955f7c04f634dc8


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:23:40 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 15:23:40 +0000
Subject: [issue46004] Incorrect bad token identified in 3.10.1
In-Reply-To: <1638857476.78.0.83967741356.issue46004@roundup.psfhosted.org>
Message-ID: <1638890620.14.0.24135418222.issue46004@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:24:54 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 15:24:54 +0000
Subject: [issue46004] Incorrect bad token identified in 3.10.1
In-Reply-To: <1638857476.78.0.83967741356.issue46004@roundup.psfhosted.org>
Message-ID: <1638890694.56.0.444722131366.issue46004@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

>    From (https://friendly-traceback.github.io/docs/syntax_tracebacks_en_3.10.html#for-loop-missing-in-operator), this is what was shown for Python 3.10.0

Yeah, we are not showing that anymore as we only trigger the error when it happens inside collections to avoid many of the false positives we were seeing.

This PR fixes the problem to point to the correct token, but still show "syntax error"

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:25:21 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 15:25:21 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638890721.94.0.0220129121355.issue35821@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28190
pull_request: https://github.com/python/cpython/pull/29965

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:25:26 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 15:25:26 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638890726.48.0.653271640861.issue35821@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28191
pull_request: https://github.com/python/cpython/pull/29966

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:25:22 2021
From: report at bugs.python.org (Ken Jin)
Date: Tue, 07 Dec 2021 15:25:22 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638890722.54.0.734700528383.issue35821@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset c7e7a4b969b5728d4b4f3c59bf98e1e830d5c6d6 by Ken Jin in branch 'main':
bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963)
https://github.com/python/cpython/commit/c7e7a4b969b5728d4b4f3c59bf98e1e830d5c6d6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:35:18 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 15:35:18 +0000
Subject: [issue25726] [doc] sys.setprofile / sys.getprofile asymetry
In-Reply-To: <1448406267.14.0.484592445826.issue25726@psf.upfronthosting.co.za>
Message-ID: <1638891318.41.0.0040905761014.issue25726@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
title: sys.setprofile / sys.getprofile asymetry -> [doc] sys.setprofile / sys.getprofile asymetry
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25726>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:47:42 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 15:47:42 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638892062.28.0.123528584392.issue35821@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 14f03ce6e8a33cc8b45f11c4d428193fc7c4a145 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963) (GH-29965)
https://github.com/python/cpython/commit/14f03ce6e8a33cc8b45f11c4d428193fc7c4a145


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 10:48:42 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 15:48:42 +0000
Subject: [issue35821] Clarify when logging events are propagated when
 propagate is true
In-Reply-To: <1548360439.22.0.955979079327.issue35821@roundup.psfhosted.org>
Message-ID: <1638892122.06.0.662543543748.issue35821@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset db42809d299d1bc3a07b29fabe8f74fa02a7e59e by Miss Islington (bot) in branch '3.9':
bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963)
https://github.com/python/cpython/commit/db42809d299d1bc3a07b29fabe8f74fa02a7e59e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________

From report at bugs.python.org  Tue Dec  7 11:03:03 2021
From: report at bugs.python.org (Mark Shannon)
Date: Tue, 07 Dec 2021 16:03:03 +0000
Subject: [issue45947] Place dict (and values) pointers at a fixed (negative)
 offset from the base of the object.
In-Reply-To: <1638365448.99.0.213832334161.issue45947@roundup.psfhosted.org>
Message-ID: <1638892983.71.0.455831250223.issue45947@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 8319114feedd2a5b77378bba24eb9fb2689c5033 by Mark Shannon in branch 'main':
bpo-45947: Place dict and values pointer at fixed (negative) offset just before GC header. (GH-29879)
https://github.com/python/cpython/commit/8319114feedd2a5b77378bba24eb9fb2689c5033


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45947>
_______________________________________

From report at bugs.python.org  Tue Dec  7 11:07:12 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 16:07:12 +0000
Subject: [issue23947] Add mechanism to import stdlib package bypassing user
 packages
In-Reply-To: <1429022719.25.0.0685276960077.issue23947@psf.upfronthosting.co.za>
Message-ID: <1638893232.16.0.917300284596.issue23947@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
type:  -> enhancement
versions: +Python 3.11 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23947>
_______________________________________

From report at bugs.python.org  Tue Dec  7 11:17:30 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 16:17:30 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1638893850.09.0.737691392061.issue45635@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset d596acbd3b4f6716ed98895eb0b48e9830e0b320 by Irit Katriel in branch 'main':
bpo-45635: standardize error handling in traceback.c (GH-29905)
https://github.com/python/cpython/commit/d596acbd3b4f6716ed98895eb0b48e9830e0b320


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Tue Dec  7 11:25:34 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 16:25:34 +0000
Subject: [issue19745] TEST_DATA_DIR for out-of-tree builds
In-Reply-To: <1385260850.2.0.647023626646.issue19745@psf.upfronthosting.co.za>
Message-ID: <1638894334.1.0.905736364316.issue19745@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

It does seem to be used here: 

https://github.com/python/cpython/blob/a6c3b0faa1d55e36539caf19bd3bcf1dea12df84/Lib/test/support/__init__.py#L553

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19745>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:00:56 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 07 Dec 2021 17:00:56 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638896456.67.0.0521678555664.issue45847@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

I just noticed that the PKG_CHECK_MODULES() fallbacks override the PKG_CONFIG environment variables. We should do something like

   ZLIB_CFLAGS=${ZLIB_CFLAGS:-""}
   ZLIB_LIBS=${ZLIB_LIBS:-"-lz"}

for all env vars. I prefer the syntax over ${ZLIB_CFLAGS:=""} because it is more obvious what is happening.

Env vars:

  LIBUUID_CFLAGS
              C compiler flags for LIBUUID, overriding pkg-config
  LIBUUID_LIBS
              linker flags for LIBUUID, overriding pkg-config
  LIBFFI_CFLAGS
              C compiler flags for LIBFFI, overriding pkg-config
  LIBFFI_LIBS linker flags for LIBFFI, overriding pkg-config
  LIBNSL_CFLAGS
              C compiler flags for LIBNSL, overriding pkg-config
  LIBNSL_LIBS linker flags for LIBNSL, overriding pkg-config
  LIBSQLITE3_CFLAGS
              C compiler flags for LIBSQLITE3, overriding pkg-config
  LIBSQLITE3_LIBS
              linker flags for LIBSQLITE3, overriding pkg-config
  GDBM_CFLAGS C compiler flags for gdbm
  GDBM_LIBS   additional linker flags for gdbm
  ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config
  ZLIB_LIBS   linker flags for ZLIB, overriding pkg-config
  BZIP2_CFLAGS
              C compiler flags for BZIP2, overriding pkg-config
  BZIP2_LIBS  linker flags for BZIP2, overriding pkg-config
  LIBLZMA_CFLAGS
              C compiler flags for LIBLZMA, overriding pkg-config
  LIBLZMA_LIBS
              linker flags for LIBLZMA, overriding pkg-config
  LIBCRYPT_CFLAGS
              C compiler flags for LIBCRYPT, overriding pkg-config
  LIBCRYPT_LIBS
              linker flags for LIBCRYPT, overriding pkg-config

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:12:26 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 17:12:26 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
Message-ID: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>


New submission from STINNER Victor <vstinner at python.org>:

_PyUnicode_EqualToASCIIId() seems to be incompatible with subinterpreter: it makes the assumption that if direct pointer comparison fails and the string is interned, the two strings are not equal.

--

super_init_without_args() of Objects/typeobject.c calls _PyUnicode_EqualToASCIIId(name, &PyId___class__) to test if the Unicode string 'name' is equal to "__class__".

int
_PyUnicode_EqualToASCIIId(PyObject *left, _Py_Identifier *right)
{
    right_uni = _PyUnicode_FromId(right);
    ...
    if (left == right_uni)
        return 1;
    if (PyUnicode_CHECK_INTERNED(left))
        return 0;
    ...
    return unicode_compare_eq(left, right_uni);
}

_PyUnicode_EqualToASCIIId() makes the assumption that left and right are not equal if left and _PyUnicode_FromId(right) pointers are not equal and left is an interned string.

In the reproducer, left object is abc.ABCMeta.__new__.__code__.co_freevars[0].

Depending on how the stdlib abc.py file was loaded (in the main interpreter and in the subinterpreter), __code__.co_freevars[0] may or may not be an interned string.

If __code__.co_freevars[0] is an interned string, _PyUnicode_EqualToASCIIId() fails in a subinterpreter if the direct pointer comparison fails (if left and right_uni pointers are not equal).

--

Reproducer from: https://github.com/ninia/jep/issues/358#issuecomment-988090696

* Build Python 3.10 with "./configure --enable-shared --prefix /opt/py310" and install it.
* Download attached reproducer.c.
* Build the reproducer with: 
  gcc -o reproducer reproducer.c $(/opt/py310/bin/python3.10-config --embed --cflags --ldflags)
* Remove all stdlib .pyc files:
  find /opt/py310 -type d -name __pycache__|xargs rm -rf
* Run the reproducer with:
  LD_LIBRARY_PATH=/opt/py310/lib ./reproducer

Output:
---
Before creating sub interpreter
Traceback (most recent call last):
  File "/opt/py310/lib/python3.10/io.py", line 52, in <module>
  File "/opt/py310/lib/python3.10/abc.py", line 184, in <module>
  File "/opt/py310/lib/python3.10/abc.py", line 106, in __new__
RuntimeError: super(): __class__ cell not found
Fatal Python error: _PyThreadState_Delete: tstate 0x7f9f2001c710 is still current
Python runtime state: initialized

Current thread 0x00007f9f27c99640 (most recent call first):
  <no Python frame>
Abandon (core dumped)
---

py-bt command in gdb:
---
(gdb) py-bt
Traceback (most recent call first):
  File "/opt/py310/lib/python3.10/abc.py", line 106, in __new__
    cls = super().__new__(mcls, name, bases, namespace, **kwargs)
  <built-in method __build_class__ of module object at remote 0x7fffea0b4cc0>
  File "/opt/py310/lib/python3.10/abc.py", line 184, in <module>
    class ABC(metaclass=ABCMeta):
  <built-in method exec of module object at remote 0x7fffea0b4cc0>
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "/opt/py310/lib/python3.10/io.py", line 52, in <module>
    import abc
  <built-in method exec of module object at remote 0x7fffea0b4cc0>
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  <built-in method __import__ of module object at remote 0x7fffea0b4cc0>
---

----------
components: C API, Subinterpreters
files: reproducer.c
messages: 407950
nosy: corona10, erlendaasland, vstinner
priority: normal
severity: normal
status: open
title: [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters
versions: Python 3.10, Python 3.11
Added file: https://bugs.python.org/file50482/reproducer.c

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:19:22 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 17:19:22 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1638897562.95.0.75287594113.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

In Python 3.9, the code works because the _Py_IDENTIFIER() API shares Python Unicode objects between all interpreters.

_PyUnicode_FromId() was modified to be per-interpreter in bpo-39465 by:

New changeset ba3d67c2fb04a7842741b1b6da5d67f22c579f33 by Victor Stinner in branch 'master':
bpo-39465: Fix _PyUnicode_FromId() for subinterpreters (GH-20058)
https://github.com/python/cpython/commit/ba3d67c2fb04a7842741b1b6da5d67f22c579f33

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:21:43 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 17:21:43 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1638897703.15.0.976654131705.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Serhiy: Do you recall the idea of the PyUnicode_CHECK_INTERNED() optimization?

The PyUnicode_CHECK_INTERNED() test is as old as the _PyUnicode_EqualToASCIIId() function.

commit f5894dd646f5e39918377b37b8c8694cebdca103
Author: Serhiy Storchaka <storchaka at gmail.com>
Date:   Wed Nov 16 15:40:39 2016 +0200

    Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.
    
    The latter function is more readable, faster and doesn't raise exceptions.
    
    Based on patch by Xiang Zhang.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:27:51 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 17:27:51 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1638898071.09.0.351396020287.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> Depending on how the stdlib abc.py file was loaded (in the main interpreter and in the subinterpreter), __code__.co_freevars[0] may or may not be an interned string.

When the bug occurs, I see that the Python stdlib abc.py file is loaded twice: the main interpreter builds a code object, and then subinterpreter builds its own code object: same content, but different Python object (at different memory addresses so inequal pointers!).

I modified reproducer.c to add "Py_VerboseFlag = 1;" before the Py_Initialize() call. Truncated output:
---
...
# code object from /opt/py310/lib/python3.10/abc.py
...
# code object from /opt/py310/lib/python3.10/abc.py
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
...
RuntimeError: super(): __class__ cell not found
...
---

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:28:23 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 17:28:23 +0000
Subject: [issue39465] [subinterpreters] Design a subinterpreter friendly
 alternative to _Py_IDENTIFIER
In-Reply-To: <1580135310.72.0.978238650594.issue39465@roundup.psfhosted.org>
Message-ID: <1638898103.32.0.457510140302.issue39465@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

This change introduced a subtle regression: bpo-46006 "[subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39465>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:34:25 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 17:34:25 +0000
Subject: [issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the
 limited C API
Message-ID: <1638898465.89.0.178243976292.issue46007@roundup.psfhosted.org>


New submission from STINNER Victor <vstinner at python.org>:

The PyUnicode_CHECK_INTERNED() macro uses the PyASCIIObject structure which is *excluded* from the limited C API:

/* Use only if you know it's a string */
#define PyUnicode_CHECK_INTERNED(op) \
    (((PyASCIIObject *)(op))->state.interned)

Using this macro in the limited C API doesn't work.

I propose to remove it from the limited C API.

IMO it's not a good idea to fix the function in the limited C API by converting it to a regular function hiding the implementation details and so working at the ABI level. We should not expose such "implementation detail" (if a string is "interned or not") in the *limited* C API.

----------
components: C API
messages: 407955
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46007>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:34:31 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 17:34:31 +0000
Subject: [issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the
 limited C API
In-Reply-To: <1638898465.89.0.178243976292.issue46007@roundup.psfhosted.org>
Message-ID: <1638898471.88.0.237655533596.issue46007@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
nosy: +petr.viktorin

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46007>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:35:35 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 17:35:35 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1638898535.15.0.367121333811.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

There are around 27 _PyUnicode_EqualToASCIIId() calls in the Python code base. I don't think that avoiding _PyUnicode_EqualToASCIIId() is a good solution :-)

Fixing _PyUnicode_EqualToASCIIId() to make it compatible with subinterpreters sound more reasonable: remove the PyUnicode_CHECK_INTERNED() test optimization.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:36:56 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 17:36:56 +0000
Subject: [issue17780] the test suite should use a TEMPDIR in the build
 directory, not the source directory
In-Reply-To: <1366223766.74.0.431919060709.issue17780@psf.upfronthosting.co.za>
Message-ID: <1638898616.27.0.547178824675.issue17780@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> TEST_DATA_DIR for out-of-tree builds

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17780>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:38:53 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 07 Dec 2021 17:38:53 +0000
Subject: [issue45999] Links to packaging broken
In-Reply-To: <1638806103.81.0.408526409699.issue45999@roundup.psfhosted.org>
Message-ID: <1638898733.1.0.378101464593.issue45999@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

Perhaps I'm misunderstanding to which links you are referring but I am not seeing any broken links in that section at the moment. Could you retry and, if so, list exactly which links do not work for you?

----------
nosy: +ned.deily
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45999>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:44:35 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 07 Dec 2021 17:44:35 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638899075.86.0.785722578076.issue45847@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28192
pull_request: https://github.com/python/cpython/pull/29967

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:47:35 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 17:47:35 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1638899255.2.0.06968040471.issue45711@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28193
pull_request: https://github.com/python/cpython/pull/29968

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:49:31 2021
From: report at bugs.python.org (Berker Peksag)
Date: Tue, 07 Dec 2021 17:49:31 +0000
Subject: [issue23469] Delete Misc/*.wpr files
In-Reply-To: <1424048342.99.0.00819785192711.issue23469@psf.upfronthosting.co.za>
Message-ID: <1638899371.52.0.931985529087.issue23469@roundup.psfhosted.org>


Change by Berker Peksag <berker.peksag at gmail.com>:


----------
stage: resolved -> 
status: closed -> open
versions: +Python 3.11 -Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23469>
_______________________________________

From report at bugs.python.org  Tue Dec  7 12:51:37 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 07 Dec 2021 17:51:37 +0000
Subject: [issue45986] 3.10.0 ships with older tcl/tk DLLs than 3.9.9 causing
 Windows Installer problems
In-Reply-To: <1638706009.9.0.557448740254.issue45986@roundup.psfhosted.org>
Message-ID: <1638899497.92.0.925456468711.issue45986@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45986>
_______________________________________

From report at bugs.python.org  Tue Dec  7 13:02:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 18:02:20 +0000
Subject: [issue27062] `inspect` doesn't have `__all__`
In-Reply-To: <1463689783.23.0.292900715898.issue27062@psf.upfronthosting.co.za>
Message-ID: <1638900140.63.0.951999533292.issue27062@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27062>
_______________________________________

From report at bugs.python.org  Tue Dec  7 13:02:31 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Tue, 07 Dec 2021 18:02:31 +0000
Subject: [issue22910] test_pydoc test_synopsis_sourceless is a flaky test
In-Reply-To: <1416553421.91.0.74824945431.issue22910@psf.upfronthosting.co.za>
Message-ID: <1638900151.08.0.478900813276.issue22910@roundup.psfhosted.org>


Change by Gregory P. Smith <greg at krypto.org>:


----------
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22910>
_______________________________________

From report at bugs.python.org  Tue Dec  7 13:04:24 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 18:04:24 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638900264.94.0.928407825157.issue45847@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

After PR29747, some buildbots are failing:

https://buildbot.python.org/all/#/builders/58/builds/1217

for example:

```
0:35:41 load avg: 3.70 Re-running failed tests in verbose mode
0:35:41 load avg: 3.70 Re-running test_code in verbose mode
test_bad_index (test.test_code.CoExtra) ... ok
test_free_called (test.test_code.CoExtra) ... Fatal Python error: Illegal instruction
Current thread 0xb7bd4700 (most recent call first):
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_code.py", line 575 in test_free_called
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py", line 547 in _callTestMethod
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py", line 591 in run
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py", line 646 in __call__
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", line 122 in run
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", line 84 in __call__
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", line 122 in run
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", line 84 in __call__
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", line 122 in run
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", line 84 in __call__
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/runner.py", line 197 in run
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/support/__init__.py", line 1009 in _run_suite
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/support/__init__.py", line 1135 in run_unittest
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py", line 273 in _test_module
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py", line 309 in _runtest_inner2
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py", line 352 in _runtest_inner
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py", line 227 in _runtest
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py", line 257 in runtest
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py", line 337 in rerun_failed_tests
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py", line 715 in _main
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py", line 658 in main
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py", line 736 in main
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/__main__.py", line 2 in <module>
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/runpy.py", line 86 in _run_code
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/runpy.py", line 196 in _run_module_as_main
```

unfortunately, this is blocking the release of Python 3.11 :(

----------
nosy: +pablogsal
priority: normal -> release blocker

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Tue Dec  7 13:04:52 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 18:04:52 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638900292.11.0.93984858505.issue45847@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I may need to revert this commit to unblock the release if no one can take a look today

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Tue Dec  7 13:10:05 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Tue, 07 Dec 2021 18:10:05 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638900605.51.0.529928080876.issue45582@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 06c4ae8b1380eec1c5f3cd8faa21102d1c940bab by Christian Heimes in branch 'main':
bpo-45582: Fix framework path and bootstrap build (GH-29954)
https://github.com/python/cpython/commit/06c4ae8b1380eec1c5f3cd8faa21102d1c940bab


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Tue Dec  7 13:39:05 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 07 Dec 2021 18:39:05 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638902345.69.0.785094323689.issue45847@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28194
pull_request: https://github.com/python/cpython/pull/29969

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Tue Dec  7 13:46:12 2021
From: report at bugs.python.org (nobody)
Date: Tue, 07 Dec 2021 18:46:12 +0000
Subject: [issue46003] os.replace is not cross-platform: at least improve
 documentation
In-Reply-To: <1638825605.8.0.77974659196.issue46003@roundup.psfhosted.org>
Message-ID: <1638902772.0.0.267522977964.issue46003@roundup.psfhosted.org>


nobody <peterpm at xs4all.nl> added the comment:

Thank you for your replies. I have been reading more and conclude that I/O programming on Windows and Linux are two different things.

Python is not cross-platform in the sense that a Python program always works on different operating systems but that you can make it work on different operating systems (most of the time).

My application uses the PyPi package cachelib. The file system interface is implemented in this file:

https://github.com/pallets/cachelib/blob/main/src/cachelib/file.py

This package uses os.replace and other file I/O methods. 

>From what I understand is that this package must be modified to also handle WinError 5 and Errno 13 if you want to use it on Windows,
meaning more specific exception handling and adding retries and a delay for every I/O related function accessing the os.replace file.

Please correct me if I am wrong.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46003>
_______________________________________

From report at bugs.python.org  Tue Dec  7 14:56:55 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 07 Dec 2021 19:56:55 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638907015.2.0.0180599932822.issue45847@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 91b59a3fcdcb93d74bb89cce536f11d2990f655d by Christian Heimes in branch 'main':
bpo-45847: Revert Port _ctypes partly to PY_STDLIB_MOD (GH-29747) (GH-29969)
https://github.com/python/cpython/commit/91b59a3fcdcb93d74bb89cce536f11d2990f655d


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Tue Dec  7 15:24:16 2021
From: report at bugs.python.org (Eryk Sun)
Date: Tue, 07 Dec 2021 20:24:16 +0000
Subject: [issue36850] shutil.copy2 fails with even with source network
 filesystem not supporting extended attributes
In-Reply-To: <1557301411.76.0.646767757374.issue36850@roundup.psfhosted.org>
Message-ID: <1638908656.23.0.692847278117.issue36850@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36850>
_______________________________________

From report at bugs.python.org  Tue Dec  7 15:24:26 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 07 Dec 2021 20:24:26 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
Message-ID: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>


New submission from Eric Snow <ericsnowcurrently at gmail.com>:

There are a few things in `_PyRuntimeState`, `PyInterpreterState`, `PyThreadState`, and there initialization (Python/pystate.c & Python/pylifecycle.c) that would benefit from some minor cleanup.  Normally I wouldn't bother (due to the cost of churn), but such cleanup would help with other changes I'm working on.

The cleanup includes:

* move thread related interpreter state to `PyInterpreterState.threads`
* return void from `_PyEval_InitState()`
* separate Py*State initialization from creation
* distinguish between initialized-to-safe-state and ready-to-use
* separate init for global types/objects into phases: object state vs. global objects vs. global types

----------
assignee: eric.snow
components: Interpreter Core
messages: 407963
nosy: eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: Prepare runtime/interp/thread state and init for upcoming changes.
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 15:29:33 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 07 Dec 2021 20:29:33 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638908973.49.0.74629255789.issue46008@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
keywords: +patch
pull_requests: +28195
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29970

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 15:29:37 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 07 Dec 2021 20:29:37 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638908977.65.0.685810325481.issue46008@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
pull_requests: +28196
pull_request: https://github.com/python/cpython/pull/29971

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 15:47:38 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 07 Dec 2021 20:47:38 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638910058.89.0.389944458906.issue46008@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
pull_requests: +28197
pull_request: https://github.com/python/cpython/pull/29972

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 15:49:03 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 20:49:03 +0000
Subject: [issue33411] All console message are in the error output in bash
 interpretor
In-Reply-To: <1525271049.22.0.682650639539.issue33411@psf.upfronthosting.co.za>
Message-ID: <1638910143.83.0.086791853259.issue33411@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I think the question here is why this went to stderr rather than stdout:

Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33411>
_______________________________________

From report at bugs.python.org  Tue Dec  7 15:55:49 2021
From: report at bugs.python.org (Jan Kaliszewski)
Date: Tue, 07 Dec 2021 20:55:49 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638910549.1.0.676419673361.issue20751@roundup.psfhosted.org>


Jan Kaliszewski <zuo at kaliszewski.net> added the comment:

So the current (after the aforementioned commit) form of the description is:

   A dotted lookup such as ``super(A, a).x`` searches
   ``obj.__class__.__mro__`` for a base class ``B`` following ``A`` and then
   returns ``B.__dict__['x'].__get__(a, A)``.  If not a descriptor, ``x`` is
   returned unchanged.

I guess here ``obj`` was supposed to be ``a``.

But is the description correct when it comes to what class is used where?
I.e., shouldn't it be rather something along the lines of the following:

   A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an
   instance of ``A`` of some other subclass of ``A``) searches
   ``A.__mro__`` for a base class ``B`` whose `__dict__` contains name
   ``"x"`` and then returns ``B.__dict__['x'].__get__(obj, type(obj))``.
   If ``B.__dict__['x']`` is not a descriptor, it is returned unchanged.

***

Ad my comment #2 -- yes, it became groundless with time... Minor explanation: when I reported this issue in 2015, the signature of `object.__get__` was documented just as "__get__(self, instance, owner)" (see: https://docs.python.org/3.5/reference/datamodel.html#implementing-descriptors); that's why I wrote about an inconsistency.

----------
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:00:39 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 07 Dec 2021 21:00:39 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638910839.02.0.967633539129.issue46008@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
pull_requests: +28198
pull_request: https://github.com/python/cpython/pull/29973

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:01:55 2021
From: report at bugs.python.org (Jan Kaliszewski)
Date: Tue, 07 Dec 2021 21:01:55 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638910915.38.0.0704495349639.issue20751@roundup.psfhosted.org>


Jan Kaliszewski <zuo at kaliszewski.net> added the comment:

Sorry, a few mistakes distorted my proposal. It should be:

   A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an
   instance of ``A`` or of a subclass of ``A``) searches ``A.__mro__``
   for a base class whose `__dict__` contains name ``"x"``, and
   then returns ``B.__dict__['x'].__get__(obj, type(obj))`` (where
   ``B`` is that base class).  If ``B.__dict__['x']`` is not a
   descriptor, it is returned unchanged.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:02:35 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 07 Dec 2021 21:02:35 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638910955.36.0.365885224231.issue46008@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:


New changeset 8262c96bcc1841188866c1b022d9087e89639d98 by Eric Snow in branch 'main':
bpo-46008: Return void from _PyEval_InitState(). (gh-29970)
https://github.com/python/cpython/commit/8262c96bcc1841188866c1b022d9087e89639d98


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:02:46 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 21:02:46 +0000
Subject: [issue17975] altinstall should not install libpython3.so (conflict
 between multiple $VERSIONs)
In-Reply-To: <1368542639.2.0.817126483539.issue17975@psf.upfronthosting.co.za>
Message-ID: <1638910966.75.0.333606153133.issue17975@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The discussion here seems to have been abandoned 7 years ago after Martin asked Patrick to clarify the issue. I will close this soon if nobody will explain what is left to be done.

----------
nosy: +iritkatriel
resolution:  -> wont fix
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17975>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:03:58 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 07 Dec 2021 21:03:58 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638911038.99.0.013019790309.issue46008@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:


New changeset 313f92a57bc3887026ec16adb536bb2b7580ce47 by Eric Snow in branch 'main':
bpo-46008: Move thread-related interpreter state into a sub-struct. (gh-29971)
https://github.com/python/cpython/commit/313f92a57bc3887026ec16adb536bb2b7580ce47


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:10:56 2021
From: report at bugs.python.org (Jan Kaliszewski)
Date: Tue, 07 Dec 2021 21:10:56 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638911456.51.0.784585467628.issue20751@roundup.psfhosted.org>


Jan Kaliszewski <zuo at kaliszewski.net> added the comment:

I am very sorry, I just noticed another mistake.

It should be:

   A dotted lookup such as ``super(A, obj).x`` (where ``obj``
   is an instance of ``A`` or of a subclass of ``A``) searches
   ``type(obj).__mro__`` for such a base class ``B`` that follows
   ``A`` and whose :attr:`__dict__` contains the name ``"x"``;
   then ``B.__dict__['x'].__get__(obj, type(obj))`` is returned.
   If not a descriptor, ``B.__dict__['x']`` is returned unchanged.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:18:14 2021
From: report at bugs.python.org (Val Shkolnikov)
Date: Tue, 07 Dec 2021 21:18:14 +0000
Subject: [issue43098] tarfile list() method does not show file type
In-Reply-To: <1612240547.16.0.611621491067.issue43098@roundup.psfhosted.org>
Message-ID: <1638911894.35.0.96385374982.issue43098@roundup.psfhosted.org>


Val Shkolnikov <val at nvsoft.net> added the comment:

> contributions are only now accepted in form of github PRs
Done

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43098>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:38:01 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 07 Dec 2021 21:38:01 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638913081.67.0.94656689206.issue46008@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 9b577cd01f66512b503115c0fdbf0734edfd5f8a by Eric Snow in branch 'main':
bpo-46008: Use PyMem_RawCalloc() to allocate PyThreadState. (GH-29972)
https://github.com/python/cpython/commit/9b577cd01f66512b503115c0fdbf0734edfd5f8a


----------
nosy: +miss-islington

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:42:45 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 07 Dec 2021 21:42:45 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638913365.11.0.112795816106.issue45582@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
nosy:  -vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:48:16 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Tue, 07 Dec 2021 21:48:16 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638913696.88.0.201725595785.issue45995@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

PyOS_double_to_string is part of the stable ABI. I don't recall if we're allowed to add new bitfield flags to a stable ABI function. We'd use a new Py_DTSF_NORMALIZE_NEGATIVE_0 flag for this feature.

I suspect we can't add a flag, due to comparability reasons (new code setting the flag being used in old versions of python without it), but we'd need to research. I saw a similar discussion within the last few years, but of course now I can't find it. Maybe old versions would correctly ignore the new bit being set.

This proposal becomes less interesting if we'd need to add a new function to support it. Although I guess we could do something that's internal-only.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:50:34 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 21:50:34 +0000
Subject: [issue40222] "Zero cost" exception handling
In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org>
Message-ID: <1638913834.79.0.769200324433.issue40222@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +iritkatriel, iritkatriel
nosy_count: 16.0 -> 17.0
pull_requests: +28199, 28200
pull_request: https://github.com/python/cpython/pull/29975

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40222>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:50:29 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 21:50:29 +0000
Subject: [issue40222] "Zero cost" exception handling
In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org>
Message-ID: <1638913829.64.0.736620540557.issue40222@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +iritkatriel
nosy_count: 16.0 -> 17.0
pull_requests: +28199
pull_request: https://github.com/python/cpython/pull/29975

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40222>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:51:42 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Tue, 07 Dec 2021 21:51:42 +0000
Subject: [issue46003] os.replace is not cross-platform: at least improve
 documentation
In-Reply-To: <1638825605.8.0.77974659196.issue46003@roundup.psfhosted.org>
Message-ID: <1638913902.9.0.700381526584.issue46003@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

As they say, there's no such thing as "portable software", only "software that has been ported". Especially in an area like file I/O: once you move beyond simple "one process opens, writes, and closes; and another process then opens, reads, and closes", there are a lot of platform-specific issues. Python does not try to abstract away all possible file I/O issues.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46003>
_______________________________________

From report at bugs.python.org  Tue Dec  7 16:53:29 2021
From: report at bugs.python.org (Stanislav Syekirin)
Date: Tue, 07 Dec 2021 21:53:29 +0000
Subject: [issue46009] sending non-None values makes generator raise
 StopIteration on next access
Message-ID: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org>


New submission from Stanislav Syekirin <syekirin at gmail.com>:

Tested with Python 3.10.1 on Linux and Python 3.10.0 on Windows.

The following code prints None in 3.9 and raises StopIteration without any additional information in 3.10:

    def f():
        yield
    
    x = f()
    
    try:
        x.send(0)
    except TypeError as e:
        print(e) # can't send non-None value to a just-started generator
    
    print(next(x))

----------
messages: 407975
nosy: Zabolekar
priority: normal
severity: normal
status: open
title: sending non-None values makes generator raise StopIteration on next access
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46009>
_______________________________________

From report at bugs.python.org  Tue Dec  7 17:09:40 2021
From: report at bugs.python.org (David Halter)
Date: Tue, 07 Dec 2021 22:09:40 +0000
Subject: [issue31184] Fix data descriptor detection in inspect.getattr_static
In-Reply-To: <1502468531.27.0.204472955702.issue31184@psf.upfronthosting.co.za>
Message-ID: <1638914980.91.0.237466883149.issue31184@roundup.psfhosted.org>


David Halter <davidhalter88 at gmail.com> added the comment:

This is not a duplicate. It is related to https://bugs.python.org/issue26103, because __get__ is not required anymore for an object to be a data descriptor. The current code on master (of inspect.getattr_static) still thinks a descriptor has both __get__ and __set__ set.

Since issue #26103 has been fixed, it's now clear that my patch is slightly wrong, but I'm happy to fix that if someone is actually going to review it.

----------
resolution: duplicate -> 
status: closed -> open
versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31184>
_______________________________________

From report at bugs.python.org  Tue Dec  7 17:17:00 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 07 Dec 2021 22:17:00 +0000
Subject: [issue1653457] Python misbehaves when installed in / (patch attached)
Message-ID: <1638915420.92.0.372145270649.issue1653457@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

getpath.c has been rewritten (see Issue45582).  reduce is no longer there.

----------
nosy: +iritkatriel
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1653457>
_______________________________________

From report at bugs.python.org  Tue Dec  7 17:26:42 2021
From: report at bugs.python.org (Eryk Sun)
Date: Tue, 07 Dec 2021 22:26:42 +0000
Subject: [issue33411] All console message are in the error output in bash
 interpretor
In-Reply-To: <1525271049.22.0.682650639539.issue33411@psf.upfronthosting.co.za>
Message-ID: <1638916002.01.0.0853059424045.issue33411@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

PyOS_Readline() calls PyOS_StdioReadline() if sys_stdin or sys_stdout isn't a tty file. This function always writes the prompt to stderr, as follows:

    if (prompt) {
        fprintf(stderr, "%s", prompt);
    }
    fflush(stderr);

Maybe this matched the behavior of the readline module and/or GNU Readline in the past. It's definitely *not* the case in Linux with Python 2.x or 3.x with readline linked to "libreadline.so.8". In this case, the prompt gets written to stdout. For example:

    $ python -q 2>err.txt
    >>> import a
    >>> $ 
    $ cat err.txt
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'a'

In Windows, OTOH, the readline module isn't available in the standard library, in which case PyOS_StdioReadline() is called. For the io._WindowsConsoleIO update in 3.6, this function was modified to use ReadConsoleW() and WriteConsoleW() instead of my_fgets(). But I think modifying PyOS_StdioReadline() was a mistake. The changes should have been implemented as a new hook for PyOS_ReadlineFunctionPointer. This should have used stdout for the prompt instead of stderr, normalizing the behavior with interactive readline on other platforms. Whether or not stderr is redirected to a file or pipe should make no difference on the behavior.

----------
nosy: +eryksun
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 <report at bugs.python.org>
<https://bugs.python.org/issue33411>
_______________________________________

From report at bugs.python.org  Tue Dec  7 17:36:16 2021
From: report at bugs.python.org (Chris Webb)
Date: Tue, 07 Dec 2021 22:36:16 +0000
Subject: [issue1653457] Python misbehaves when installed in / (patch attached)
In-Reply-To: <1638915420.92.0.372145270649.issue1653457@roundup.psfhosted.org>
Message-ID: <6CDD6671-AEB7-49D0-A990-732E7BBD07BB@arachsys.com>


Chris Webb <chris at arachsys.com> added the comment:

Irit Katriel <iritkatriel at gmail.com> added the comment:

> getpath.c has been rewritten (see Issue45582).  reduce is no longer there.

Gosh, this is one I originally reported back in the late 1990s and then  
again mid-2000s! I've carried a patch in my distribution to make python  
work in /bin and /lib/python for over 25 years - it'll feel like end of an  
era to finally be able to drop that local patch. Thanks!

(Presumably this will land in Python 11 rather than get backported?)

Best wishes,
Chris.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1653457>
_______________________________________

From report at bugs.python.org  Tue Dec  7 17:44:55 2021
From: report at bugs.python.org (Francisco Orozco)
Date: Tue, 07 Dec 2021 22:44:55 +0000
Subject: [issue46010] Cookie cutter templates to allow variable fields and
 data transfer proposal before system merge
Message-ID: <1638917095.16.0.187106370804.issue46010@roundup.psfhosted.org>


New submission from Francisco Orozco <forozco at email.com>:

Not featuring templates to allow variable fields and data record creation when converting projects to new platform projects for purpose to confirm, verify record creation, might be helpful, in addition of only viewing/editing project development and structure.

For purpose of data analysis, future data merging, data financial reservations or data eligibility or feasibility or recalls.

----------
components: Build
messages: 407980
nosy: Francisco
priority: normal
severity: normal
status: open
title: Cookie cutter templates to allow variable fields and data transfer proposal before system merge
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46010>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:03:29 2021
From: report at bugs.python.org (Caleb Donovick)
Date: Tue, 07 Dec 2021 23:03:29 +0000
Subject: [issue29944] Argumentless super() fails in classes constructed with
 type()
In-Reply-To: <1490855809.89.0.267666010996.issue29944@psf.upfronthosting.co.za>
Message-ID: <1638918209.17.0.3002646647.issue29944@roundup.psfhosted.org>


Change by Caleb Donovick <donovick at cs.stanford.edu>:


----------
nosy: +donovick

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29944>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:05:24 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Tue, 07 Dec 2021 23:05:24 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638918324.89.0.801032815948.issue45847@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

Quoting msg407949:
> [...] We should do something like
>
>   ZLIB_CFLAGS=${ZLIB_CFLAGS:-""}
>   ZLIB_LIBS=${ZLIB_LIBS:-"-lz"}
>
> for all env vars.

I think we should use ${VAR-default} instead of ${VAR:-default}; we only want to override if the variable is _not_ set:

    $ TEST=
    $ echo ${TEST-default}
    
    $ echo ${TEST:-default}
    default
    $ unset TEST
    $ echo ${TEST-default} 
    default
    $ echo ${TEST:-default}
    default


> I prefer the syntax over ${ZLIB_CFLAGS:=""} because it is more obvious what
> is happening.

I agree. I also prefer `TEST=${TEST-""}` to `TEST=${TEST-}` for empty strings.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:22:54 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:22:54 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638919374.17.0.290524223601.issue45847@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
priority: release blocker -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:23:10 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:23:10 +0000
Subject: [issue45963] Embed interpreter frame in generator.
In-Reply-To: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org>
Message-ID: <1638919390.78.0.165384837545.issue45963@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
priority: release blocker -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45963>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:23:17 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:23:17 +0000
Subject: [issue45963] Embed interpreter frame in generator.
In-Reply-To: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org>
Message-ID: <1638919397.83.0.875095052352.issue45963@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45963>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:23:25 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:23:25 +0000
Subject: [issue45813] Importing asyncio after deleting a coroutine object and
 before cleaning it up leads to crashing on Python3.11
In-Reply-To: <1637052252.29.0.850993765277.issue45813@roundup.psfhosted.org>
Message-ID: <1638919405.93.0.453569535168.issue45813@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45813>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:24:34 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:24:34 +0000
Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1
In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org>
Message-ID: <1638919474.46.0.773161362328.issue45618@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45618>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:25:23 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:25:23 +0000
Subject: [issue43137] webbrowser to support "gio open <URL>"
In-Reply-To: <1612527994.14.0.364284995735.issue43137@roundup.psfhosted.org>
Message-ID: <1638919523.79.0.571391986073.issue43137@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Christian, this is going into 3.11.0a3 unfortunately. I will make this a blocker for future alphas, so please, take any action that you think is required.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43137>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:26:09 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:26:09 +0000
Subject: [issue43683] Handle generator (and coroutine) state in the bytecode.
In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org>
Message-ID: <1638919569.99.0.713543155914.issue43683@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Mark, is something left in this issue?

----------
nosy: +pablogsal

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43683>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:26:56 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:26:56 +0000
Subject: [issue45415] Assert oparg < INSTR_OFFSET()
In-Reply-To: <1633721594.06.0.212064470222.issue45415@roundup.psfhosted.org>
Message-ID: <1638919616.22.0.931146384683.issue45415@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Ping. This issue is marked as release blocker, is something left here?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45415>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:32:58 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Tue, 07 Dec 2021 23:32:58 +0000
Subject: [issue31184] Fix data descriptor detection in inspect.getattr_static
In-Reply-To: <1502468531.27.0.204472955702.issue31184@psf.upfronthosting.co.za>
Message-ID: <1638919978.51.0.103034919629.issue31184@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Can you give an example of where getattr_static() is not doing what you expect?

----------
assignee:  -> rhettinger
components: +Library (Lib)
nosy: +rhettinger
type:  -> behavior
versions:  -Python 3.10, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31184>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:33:56 2021
From: report at bugs.python.org (Steve Dower)
Date: Tue, 07 Dec 2021 23:33:56 +0000
Subject: [issue45415] Assert oparg < INSTR_OFFSET()
In-Reply-To: <1633721594.06.0.212064470222.issue45415@roundup.psfhosted.org>
Message-ID: <1638920036.63.0.189913233225.issue45415@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

Yes, it's been fixed.

The debate about whether to test in CI with C assertions enabled or not can continue somewhere else.

----------
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45415>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:43:39 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Tue, 07 Dec 2021 23:43:39 +0000
Subject: [issue43683] Handle generator (and coroutine) state in the bytecode.
In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org>
Message-ID: <1638920619.23.0.950608863057.issue43683@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

bpo-46009 about the same behavior change

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43683>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:44:29 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:44:29 +0000
Subject: [issue46009] sending non-None values makes generator raise
 StopIteration on next access
In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org>
Message-ID: <1638920669.21.0.361313188999.issue46009@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
nosy: +Mark.Shannon

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46009>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:45:13 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:45:13 +0000
Subject: [issue46009] sending non-None values makes generator raise
 StopIteration on next access
In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org>
Message-ID: <1638920713.64.0.301674705348.issue46009@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
nosy: +pablogsal
priority: normal -> release blocker

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46009>
_______________________________________

From report at bugs.python.org  Tue Dec  7 18:48:41 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Tue, 07 Dec 2021 23:48:41 +0000
Subject: [issue43683] Handle generator (and coroutine) state in the bytecode.
In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org>
Message-ID: <1638920921.91.0.410364405857.issue43683@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Unfortunately, this has not been fixed into 3.10.1 and 3.11.0a3 as this hasn't version information and therefore has missed our automatic checks for blockers.

I have marked https://bugs.python.org/issue46009? as release blocker, as well as this issue and I have marked the versions.

Please, ensure this is fixed ASAP so it doesn't go into the next bugfix release or alpha release.

----------
versions: +Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43683>
_______________________________________

From report at bugs.python.org  Tue Dec  7 19:20:01 2021
From: report at bugs.python.org (Louis Sautier)
Date: Wed, 08 Dec 2021 00:20:01 +0000
Subject: [issue34434] Removal of kwargs for built-in types not covered with
 "changed in Python" note in documentation
In-Reply-To: <1534685830.81.0.56676864532.issue34434@psf.upfronthosting.co.za>
Message-ID: <1638922801.25.0.428781441788.issue34434@roundup.psfhosted.org>


Change by Louis Sautier <sautier.louis at gmail.com>:


----------
nosy: +sbraz
nosy_count: 7.0 -> 8.0
pull_requests: +28201
pull_request: https://github.com/python/cpython/pull/29976

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34434>
_______________________________________

From report at bugs.python.org  Tue Dec  7 19:20:40 2021
From: report at bugs.python.org (Louis Sautier)
Date: Wed, 08 Dec 2021 00:20:40 +0000
Subject: [issue42114] Documentation of ctypes.CDLL does not correspond to code
In-Reply-To: <1603317735.12.0.0166150677555.issue42114@roundup.psfhosted.org>
Message-ID: <1638922840.26.0.653690234336.issue42114@roundup.psfhosted.org>


Change by Louis Sautier <sautier.louis at gmail.com>:


----------
keywords: +patch
nosy: +sbraz
nosy_count: 1.0 -> 2.0
pull_requests: +28202
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29976

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42114>
_______________________________________

From report at bugs.python.org  Tue Dec  7 19:26:39 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 08 Dec 2021 00:26:39 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638923199.23.0.963823002345.issue46008@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:


New changeset 1f384e318481532323bb9076f4447bc02da07209 by Eric Snow in branch 'main':
bpo-46008: Stop calling _PyThreadState_Init() in new_threadstate(). (gh-29973)
https://github.com/python/cpython/commit/1f384e318481532323bb9076f4447bc02da07209


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 19:36:15 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 08 Dec 2021 00:36:15 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638923775.84.0.894977637484.issue46008@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
pull_requests: +28203
pull_request: https://github.com/python/cpython/pull/29977

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 20:14:46 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 08 Dec 2021 01:14:46 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638926086.41.0.927730815173.issue46008@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
pull_requests: +28204
pull_request: https://github.com/python/cpython/pull/29978

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 20:38:10 2021
From: report at bugs.python.org (Steve Dower)
Date: Wed, 08 Dec 2021 01:38:10 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638927490.24.0.386338534962.issue45582@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
pull_requests: +28205
pull_request: https://github.com/python/cpython/pull/29979

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Tue Dec  7 20:49:49 2021
From: report at bugs.python.org (Brett Cannon)
Date: Wed, 08 Dec 2021 01:49:49 +0000
Subject: [issue21762] update the import machinery to only use __spec__
In-Reply-To: <1402781631.86.0.838758150876.issue21762@psf.upfronthosting.co.za>
Message-ID: <1638928189.91.0.367370160961.issue21762@roundup.psfhosted.org>


Change by Brett Cannon <brett at python.org>:


----------
assignee:  -> brett.cannon

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21762>
_______________________________________

From report at bugs.python.org  Tue Dec  7 20:51:58 2021
From: report at bugs.python.org (John Belmonte)
Date: Wed, 08 Dec 2021 01:51:58 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1638928318.97.0.611568298172.issue45995@roundup.psfhosted.org>


John Belmonte <john at neggie.net> added the comment:

I'll share a draft PR soon (excluding Decimal), so far it's still looking straightforward.

> Maybe old versions would correctly ignore the new bit being set.

That's one of the benefits of using bit flags in an ABI: backward-compatible extensibility.  (An implementation can defeat it by intentionally failing if unknown bits are encountered, but the code in question doesn't appear to be doing this.)

> You can round explicitly before formatting
>
>    >>> '%5.1f' % (round(-.00001, 1) + 0.0)

Yes, I have experience with it.

  1. even as a one-off, it's questionable.  If someone accidentally changes the precision in only one of the spec string or round call, that's a bug.
  2. since applications and libraries may pass around format specs, and because of (1), you'll try to make a programmatic solution.  Now you're parsing format spec strings.
  3. while a programmatic solution can be done for a function API like format() that takes a separate spec and value, there is no sane way to wrap f-strings

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Tue Dec  7 20:56:14 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 08 Dec 2021 01:56:14 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638928574.53.0.487002705583.issue46008@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:


New changeset 758b74e71eb22e1e83a9eb937d1c015e461745a1 by Eric Snow in branch 'main':
bpo-46008: Add _PyInterpreterState_Main(). (gh-29978)
https://github.com/python/cpython/commit/758b74e71eb22e1e83a9eb937d1c015e461745a1


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 20:59:55 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 08 Dec 2021 01:59:55 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638928795.69.0.562188157146.issue46008@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:


New changeset 32a67246b0d1e08cd50fc3bfa58052cfeb515b2e by Eric Snow in branch 'main':
bpo-46008: Move Py*State init into distinct functions. (gh-29977)
https://github.com/python/cpython/commit/32a67246b0d1e08cd50fc3bfa58052cfeb515b2e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 21:01:39 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 08 Dec 2021 02:01:39 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1638928899.56.0.823044440262.issue46008@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

At this point all the changes I was considering have been made, except for splitting type/object init into logical phases.  That may or may not happen.  Regardless, it can be done in a new issue.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Tue Dec  7 21:18:30 2021
From: report at bugs.python.org (Steve Dower)
Date: Wed, 08 Dec 2021 02:18:30 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1638929910.93.0.209209846401.issue45582@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset b0b30862796e97b3f0ee358bcc61d21f0cc98441 by Steve Dower in branch 'main':
bpo-45582: Write empty pybuilddir.txt on Windows to allow relocatable build directories (GH-29979)
https://github.com/python/cpython/commit/b0b30862796e97b3f0ee358bcc61d21f0cc98441


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Tue Dec  7 22:18:11 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 08 Dec 2021 03:18:11 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638933491.9.0.0842112487414.issue20751@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
pull_requests: +28206
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/29980

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Tue Dec  7 22:38:39 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 08 Dec 2021 03:38:39 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638934719.18.0.698580470997.issue20751@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:


New changeset 4ccccb1cfc1f30327e76a2d845cc274be56b34b1 by Raymond Hettinger in branch 'main':
bpo-20751: Match variable name to the example. (GH-29980)
https://github.com/python/cpython/commit/4ccccb1cfc1f30327e76a2d845cc274be56b34b1


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Tue Dec  7 22:44:47 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 08 Dec 2021 03:44:47 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1638935086.99.0.932311982682.issue20751@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> I guess here ``obj`` was supposed to be ``a``.

Okay, I updated the variable name to match the rest of the example.

> But is the description correct when it comes to what class is used where?

It looks fine to me.  It is harmonious with the other three entries in the section and every part of the wording is verified in the test code.

> It should be:

Sorry, I disagree with the wordsmithing.  IMO, the additional proposed wording mostly makes it harder to read.  Also, this section is already a bit long. The details on super() are in the main docs for super().  Here we just want to show that super() is one of the four ways to invoke a descriptor.

----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Tue Dec  7 23:22:58 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 08 Dec 2021 04:22:58 +0000
Subject: [issue31184] Fix data descriptor detection in inspect.getattr_static
In-Reply-To: <1502468531.27.0.204472955702.issue31184@psf.upfronthosting.co.za>
Message-ID: <1638937378.24.0.76727335667.issue31184@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
assignee: rhettinger -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31184>
_______________________________________

From report at bugs.python.org  Tue Dec  7 23:32:57 2021
From: report at bugs.python.org (Mark Sapiro)
Date: Wed, 08 Dec 2021 04:32:57 +0000
Subject: [issue46011] Python 3.10 email returns invalid Date: header unchanged.
Message-ID: <1638937977.72.0.569168452456.issue46011@roundup.psfhosted.org>


New submission from Mark Sapiro <mark at msapiro.net>:

Here is an interactive Python session
```
Python 3.10.1 (main, Dec  7 2021, 15:44:39) [GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from email import message_from_bytes, policy
>>> msg_raw = b"""Return-Path: <owner-mailman-users at python.org>
... Delivered-To: mailman-users at dinsdale.python.org
... From: user at example.com
... Message-Id: <msg1>
... Date: Tue, 30 Nov 1999 23:56:33 -3000 (CST)
... To: mailman-users at python.org
... 
... msg1
... """
>>> message = message_from_bytes(msg_raw, policy=policy.default)
>>> message.get('date')
'Tue, 30 Nov 1999 23:56:33 -3000 (CST)'
>>> message.defects
[]
>>> 
```
The same session in Python 3.9 throws ValueError: offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24), not datetime.timedelta(days=-2, seconds=64800).

At first I thought this was related to https://bugs.python.org/issue30681 but that seems to not be the case as utils.parsedate_to_datetime('Tue, 30 Nov 1999 23:56:33 -3000 (CST)') throws the same exception In Python 3.10.1.

I think getting the Date: header which has an invalid timezone should either throw the exception as before or return None, but not return the invalid date header.

----------
components: email
keywords: 3.10regression
messages: 407997
nosy: barry, msapiro, r.david.murray
priority: normal
severity: normal
status: open
title: Python 3.10 email returns invalid Date: header unchanged.
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46011>
_______________________________________

From report at bugs.python.org  Wed Dec  8 00:25:28 2021
From: report at bugs.python.org (Zernoxi)
Date: Wed, 08 Dec 2021 05:25:28 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638941128.8.0.857012787141.issue46002@roundup.psfhosted.org>


Zernoxi <tze.chian.kam at gmail.com> added the comment:

Is there a way to not parse certain paths in the PATH environment variable for the shebang: "#!/usr/bin/env python". I get that it is trying to mimic Unix "env" function but is it not conflicting if there is a python install but it is not registered in registry?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Wed Dec  8 01:31:44 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 08 Dec 2021 06:31:44 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1638945104.29.0.169412364138.issue46002@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

You can use "#!python", or "#!/usr/bin/python", or "#!/usr/local/bin/python". They're all equivalent, and they do not search PATH. Since no wanted version is specified, the launcher will look for a version to run in the following order: an active virtual environment, a configured PY_PYTHON version, the highest registered version of 2.x, and the highest registered version of 3.x.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Wed Dec  8 01:52:00 2021
From: report at bugs.python.org (David Shiko)
Date: Wed, 08 Dec 2021 06:52:00 +0000
Subject: [issue46012] unittest AsyncConnection not described
Message-ID: <1638946320.75.0.503190940676.issue46012@roundup.psfhosted.org>


New submission from David Shiko <dsb321mp at gmail.com>:

AsyncConnection mentioned only one at this docs but not imported or presented somehow else.
https://docs.python.org/3/library/unittest.html.

----------
components: Tests
messages: 408000
nosy: dsb321mp
priority: normal
severity: normal
status: open
title: unittest AsyncConnection not described
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46012>
_______________________________________

From report at bugs.python.org  Wed Dec  8 03:01:17 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 08 Dec 2021 08:01:17 +0000
Subject: [issue46012] unittest AsyncConnection not described
In-Reply-To: <1638946320.75.0.503190940676.issue46012@roundup.psfhosted.org>
Message-ID: <1638950477.32.0.0637217104695.issue46012@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

There is no AsyncConnection in unittest nor anywhere in the stdlib. It is just an example illustrating the order of calling setup and teardown methods and cleanup callbacks.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46012>
_______________________________________

From report at bugs.python.org  Wed Dec  8 04:02:42 2021
From: report at bugs.python.org (Inada Naoki)
Date: Wed, 08 Dec 2021 09:02:42 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1638954162.88.0.0470165477283.issue46006@roundup.psfhosted.org>


Inada Naoki <songofacandy at gmail.com> added the comment:

Should `_PyUnicode_EqualToASCIIId()` support comparing two unicode from different interpreter??

----------
nosy: +methane

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec  8 04:08:26 2021
From: report at bugs.python.org (nobody)
Date: Wed, 08 Dec 2021 09:08:26 +0000
Subject: [issue46003] os.replace is not cross-platform: at least improve
 documentation
In-Reply-To: <1638825605.8.0.77974659196.issue46003@roundup.psfhosted.org>
Message-ID: <1638954506.1.0.5578008357.issue46003@roundup.psfhosted.org>


nobody <peterpm at xs4all.nl> added the comment:

Thank you again, closing this issue.

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46003>
_______________________________________

From report at bugs.python.org  Wed Dec  8 04:41:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 09:41:45 +0000
Subject: [issue40222] "Zero cost" exception handling
In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org>
Message-ID: <1638956505.37.0.855965863762.issue40222@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 7989e9dff68fd681657aa9f93ac6e8fa12c534e4 by Irit Katriel in branch 'main':
bpo-40222: update doc entry with respect to the change in WITH_EXCEPT_START (GH-29975)
https://github.com/python/cpython/commit/7989e9dff68fd681657aa9f93ac6e8fa12c534e4


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40222>
_______________________________________

From report at bugs.python.org  Wed Dec  8 04:44:53 2021
From: report at bugs.python.org (Vito De Tullio)
Date: Wed, 08 Dec 2021 09:44:53 +0000
Subject: [issue45929] extend json.tool --json-lines to ignore empty rows
In-Reply-To: <1638200958.63.0.173460715414.issue45929@roundup.psfhosted.org>
Message-ID: <1638956693.62.0.833450393481.issue45929@roundup.psfhosted.org>


Vito De Tullio <vito.detullio at gmail.com> added the comment:

My final goal is to preserve the empty lines - I think I can do some bash magic, but maybe something more complex that a simple sed call.

FWIW on https://jsonlines.org/#line-separator-is-n I see "The last character in the file may be a line separator, and it will be treated the same as if there was no line separator present.".
And on https://github.com/ndjson/ndjson-spec#32-parsing I see "The parser MAY silently ignore empty lines, e.g. \n\n. This behavior MUST be documented and SHOULD be configurable by the user of the parser.".

While I get this choice can be "on a grey area", I think this is a known "dialect" of the jsonl specs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45929>
_______________________________________

From report at bugs.python.org  Wed Dec  8 04:46:58 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Wed, 08 Dec 2021 09:46:58 +0000
Subject: [issue46003] os.replace is not cross-platform: at least improve
 documentation
In-Reply-To: <1638825605.8.0.77974659196.issue46003@roundup.psfhosted.org>
Message-ID: <1638956818.41.0.54437289429.issue46003@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
resolution:  -> not a bug

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46003>
_______________________________________

From report at bugs.python.org  Wed Dec  8 04:51:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 09:51:45 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1638957105.96.0.212388258484.issue45635@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28207
pull_request: https://github.com/python/cpython/pull/29981

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Wed Dec  8 04:54:22 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 08 Dec 2021 09:54:22 +0000
Subject: [issue45929] extend json.tool --json-lines to ignore empty rows
In-Reply-To: <1638200958.63.0.173460715414.issue45929@roundup.psfhosted.org>
Message-ID: <1638957262.4.0.399046027237.issue45929@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy:  -AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45929>
_______________________________________

From report at bugs.python.org  Wed Dec  8 05:19:38 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 08 Dec 2021 10:19:38 +0000
Subject: [issue43683] Handle generator (and coroutine) state in the bytecode.
In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org>
Message-ID: <1638958778.31.0.0458846978274.issue43683@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:

Sorry about the delay; this dropped off my list. I'll fix it shortly.

This is quite an obscure bug, so I'm not sure that it is worth blocking the release for. But I'm not the release manager :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43683>
_______________________________________

From report at bugs.python.org  Wed Dec  8 05:41:28 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Wed, 08 Dec 2021 10:41:28 +0000
Subject: [issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the
 limited C API
In-Reply-To: <1638898465.89.0.178243976292.issue46007@roundup.psfhosted.org>
Message-ID: <1638960088.07.0.857707703249.issue46007@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

+1, PyUnicodeObject/PyASCIIObject is excluded from the limited API since Python 3.2, so it wasn't possible to use this macro.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46007>
_______________________________________

From report at bugs.python.org  Wed Dec  8 05:52:29 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 08 Dec 2021 10:52:29 +0000
Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()
In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org>
Message-ID: <1638960749.59.0.575786167314.issue45847@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 0461c68cdff1392a5299ebd8c37ddce0b60dd6cc by Christian Heimes in branch 'main':
bpo-45847: Don't override user overrides for CFLAGS/LIBS (GH-29967)
https://github.com/python/cpython/commit/0461c68cdff1392a5299ebd8c37ddce0b60dd6cc


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45847>
_______________________________________

From report at bugs.python.org  Wed Dec  8 05:53:01 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 08 Dec 2021 10:53:01 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1638960781.87.0.212982015909.issue40280@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28208
pull_request: https://github.com/python/cpython/pull/29984

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Wed Dec  8 06:01:20 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 08 Dec 2021 11:01:20 +0000
Subject: [issue46009] sending non-None values makes generator raise
 StopIteration on next access
In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org>
Message-ID: <1638961280.59.0.796497308197.issue46009@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
keywords: +patch
pull_requests: +28209
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29986

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46009>
_______________________________________

From report at bugs.python.org  Wed Dec  8 06:04:03 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Wed, 08 Dec 2021 11:04:03 +0000
Subject: [issue43683] Handle generator (and coroutine) state in the bytecode.
In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org>
Message-ID: <1638961443.11.0.00396680878855.issue43683@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

> This is quite an obscure bug, so I'm not sure that it is worth blocking the release for. But I'm not the release manager :)

Well, it certainly didn't block 3.10.1 or 3.11.0a3 ;)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43683>
_______________________________________

From report at bugs.python.org  Wed Dec  8 06:18:31 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 08 Dec 2021 11:18:31 +0000
Subject: [issue45855] PyCapsule_Import still using PyImport_ImportModuleNoBlock
In-Reply-To: <1637425638.46.0.745441938277.issue45855@roundup.psfhosted.org>
Message-ID: <1638962310.99.0.261731735871.issue45855@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

The main branch has a dozen PyImport_ImportModuleNoBlock() usages.

Would you replace them also?

----------
nosy: +asvetlov
versions: +Python 3.11 -Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45855>
_______________________________________

From report at bugs.python.org  Wed Dec  8 06:28:35 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 08 Dec 2021 11:28:35 +0000
Subject: [issue41692] Deprecate immortal interned strings:
 PyUnicode_InternImmortal()
In-Reply-To: <1599055165.93.0.874786911809.issue41692@roundup.psfhosted.org>
Message-ID: <1638962915.31.0.256830927564.issue41692@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

I cannot find "PyUnicode_InternImmortal" pattern in the source code of the PyPI top 5000 projects (December 1, 2021).

I only found a false positive in frozendict-2.1.1:

frozendict/src/3_10/cpython_src/Include/unicodeobject.h: // PyUnicode_InternImmortal() is deprecated since Python 3.10
frozendict/src/3_10/cpython_src/Include/unicodeobject.h: Py_DEPRECATED(3.10) PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
frozendict/src/3_6/cpython_src/Include/unicodeobject.h: PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
frozendict/src/3_7/cpython_src/Include/unicodeobject.h: PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
frozendict/src/3_8/cpython_src/Include/unicodeobject.h: PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
frozendict/src/3_9/cpython_src/Include/unicodeobject.h: PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);

These are copies of the Python unicodeobject.h header files, but the PyUnicode_InternImmortal() function is not called by frozendict.

I used my download_pypi_top.py and search_pypi_top.py tools which can be found at:
https://github.com/vstinner/misc/tree/main/cpython

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41692>
_______________________________________

From report at bugs.python.org  Wed Dec  8 06:36:17 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 08 Dec 2021 11:36:17 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1638963377.09.0.36333009744.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> Should `_PyUnicode_EqualToASCIIId()` support comparing two unicode from different interpreter?

Right now, there still many cases where objects are still shared between two interpreters:

* None, True, False singletons
* strings from code objects (according to what I saw when I reproduced the issue)
* objects from static types: type name (str), subtypes (tuple), MRO (tuple), etc.
* etc.

More details in the following issues:

* bpo-40533: [subinterpreters] Don't share Python objects between interpreters
* bpo-40512: [subinterpreters] Meta issue: per-interpreter GIL

----------
nosy: +eric.snow

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec  8 06:44:02 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 08 Dec 2021 11:44:02 +0000
Subject: [issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the
 limited C API
In-Reply-To: <1638898465.89.0.178243976292.issue46007@roundup.psfhosted.org>
Message-ID: <1638963842.33.0.125128234013.issue46007@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
keywords: +patch
pull_requests: +28210
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29987

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46007>
_______________________________________

From report at bugs.python.org  Wed Dec  8 07:09:46 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 08 Dec 2021 12:09:46 +0000
Subject: [issue46009] sending non-None values makes generator raise
 StopIteration on next access
In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org>
Message-ID: <1638965386.15.0.152488725787.issue46009@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 69806b9516dbe092381f3ef884c7c64bb9b8414a by Mark Shannon in branch 'main':
bpo-46009: Do not exhaust generator when send() method raises (GH-29986)
https://github.com/python/cpython/commit/69806b9516dbe092381f3ef884c7c64bb9b8414a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46009>
_______________________________________

From report at bugs.python.org  Wed Dec  8 07:14:59 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 08 Dec 2021 12:14:59 +0000
Subject: [issue46009] sending non-None values makes generator raise
 StopIteration on next access
In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org>
Message-ID: <1638965699.98.0.320229643123.issue46009@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
pull_requests: +28211
pull_request: https://github.com/python/cpython/pull/29988

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46009>
_______________________________________

From report at bugs.python.org  Wed Dec  8 07:34:49 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 08 Dec 2021 12:34:49 +0000
Subject: [issue46012] unittest AsyncConnection not described
In-Reply-To: <1638946320.75.0.503190940676.issue46012@roundup.psfhosted.org>
Message-ID: <1638966889.3.0.6121709058.issue46012@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46012>
_______________________________________

From report at bugs.python.org  Wed Dec  8 07:37:28 2021
From: report at bugs.python.org (JMcB)
Date: Wed, 08 Dec 2021 12:37:28 +0000
Subject: [issue46013] Confusing period in object.__hash__ doc
Message-ID: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org>


New submission from JMcB <joel.mcbride1 at live.com>:

At https://docs.python.org/3/reference/datamodel.html#object.__hash__
It says:
Called by built-in function hash() and for operations on members of hashed collections including set, frozenset, and dict. __hash__() should return an integer.

How it's rendered there, the kerning made it confusing to me on a first read because dict. [new sentence]__hash__() looked like dict.__hash__().

I think a line break should be added, which I'll open a pr to do.

----------
assignee: docs at python
components: Documentation
messages: 408014
nosy: JMcB17, docs at python
priority: normal
severity: normal
status: open
title: Confusing period in object.__hash__ doc
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46013>
_______________________________________

From report at bugs.python.org  Wed Dec  8 07:40:31 2021
From: report at bugs.python.org (JMcB)
Date: Wed, 08 Dec 2021 12:40:31 +0000
Subject: [issue46013] Confusing period in object.__hash__ doc
In-Reply-To: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org>
Message-ID: <1638967231.7.0.197433605425.issue46013@roundup.psfhosted.org>


Change by JMcB <joel.mcbride1 at live.com>:


----------
keywords: +patch
pull_requests: +28212
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29989

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46013>
_______________________________________

From report at bugs.python.org  Wed Dec  8 07:52:02 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 12:52:02 +0000
Subject: [issue1653457] Python misbehaves when installed in / (patch attached)
Message-ID: <1638967922.95.0.262695559323.issue1653457@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

> (Presumably this will land in Python 11 rather than get backported?)

I believe so.

> it'll feel like end of an era to finally be able to drop that local patch.

You should mark the occasion somehow, it's not everyday you say goodbye to a 25 year old patch!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1653457>
_______________________________________

From report at bugs.python.org  Wed Dec  8 07:55:58 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Wed, 08 Dec 2021 12:55:58 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1638968158.82.0.0633798369674.issue45459@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

Antoine has a good point. We can freeze the Py_buffer struct. If it needs to be extended in the future, it'll need a new set of functions and names -- and perhaps a versioning scheme. We'll know more about the problem when/if it comes up.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Wed Dec  8 08:27:31 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 08 Dec 2021 13:27:31 +0000
Subject: [issue45813] Importing asyncio after deleting a coroutine object and
 before cleaning it up leads to crashing on Python3.11
In-Reply-To: <1637052252.29.0.850993765277.issue45813@roundup.psfhosted.org>
Message-ID: <1638970051.37.0.895644660887.issue45813@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
pull_requests: +28213
pull_request: https://github.com/python/cpython/pull/29990

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45813>
_______________________________________

From report at bugs.python.org  Wed Dec  8 08:29:35 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 08 Dec 2021 13:29:35 +0000
Subject: [issue45813] Importing asyncio after deleting a coroutine object and
 before cleaning it up leads to crashing on Python3.11
In-Reply-To: <1637052252.29.0.850993765277.issue45813@roundup.psfhosted.org>
Message-ID: <1638970175.94.0.140290587051.issue45813@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

Pablo, I think https://github.com/python/cpython/pull/29990 should be merged as well before the issue closing.

It covers another execution branch.

----------
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45813>
_______________________________________

From report at bugs.python.org  Wed Dec  8 08:34:12 2021
From: report at bugs.python.org (Dave Evans)
Date: Wed, 08 Dec 2021 13:34:12 +0000
Subject: [issue46014] functools.singledispatch does not support Union types
Message-ID: <1638970452.65.0.012237534186.issue46014@roundup.psfhosted.org>


New submission from Dave Evans <dave at evans.io>:

It's not currently possible to use `singledispatch` with a function annotated with a Union type, although the desired behaviour is clear.

Example:
```
    from functools import singledispatch
    from typing import Union

    @singledispatch
    def test(arg):
        raise ValueError(arg)

    @test.register
    def _(arg: Union[int, float]):
        print(f"{arg} is a number")

    test(1)
```

This dies with:

    TypeError: Invalid annotation for 'arg'. typing.Union[int, float] is not a class.

I've implemented a workaround which digs the types out of the union and registers them one-by-one:
```
    from functools import singledispatch
    from typing import Union, get_type_hints

    def register_for_union_type(target_fn):
        def decorator(fn):
            arg_type = list(get_type_hints(fn).values())[0]
            assert arg_type.__origin__ is Union
            for type_ in arg_type.__args__:
                fn = target_fn.register(type_)(fn)
            return fn

        return decorator

    @singledispatch
    def test(arg):
        raise ValueError(arg)

    @register_for_union_type(test)
    def _(arg: Union[int, float]):
        print(f"{arg} is a number")

    test(1)

```

Looking at the source for `singledispatch` is doesn't look like it would *too* difficult to add support for something like this, though of course there may be subtleties I've missed. Would you be open to a patch?

The only other mentions I've found of this online are:
https://mail.python.org/archives/list/python-ideas at python.org/thread/HF5HDXQ2SXZHO3TWODIRQATTE4TCAWPL/
https://stackoverflow.com/questions/61721761/type-hints-and-singledispatch-how-do-i-include-union-in-an-extensible-w

----------
components: Library (Lib)
messages: 408018
nosy: evansd
priority: normal
severity: normal
status: open
title: functools.singledispatch does not support Union types
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46014>
_______________________________________

From report at bugs.python.org  Wed Dec  8 08:47:08 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 08 Dec 2021 13:47:08 +0000
Subject: [issue46014] functools.singledispatch does not support Union types
In-Reply-To: <1638970452.65.0.012237534186.issue46014@roundup.psfhosted.org>
Message-ID: <1638971228.61.0.568239725073.issue46014@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +AlexWaygood, lukasz.langa, rhettinger
versions:  -Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46014>
_______________________________________

From report at bugs.python.org  Wed Dec  8 08:47:39 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 08 Dec 2021 13:47:39 +0000
Subject: [issue45840] Improve cross-references in the data model documentation
In-Reply-To: <1637287286.96.0.846227383123.issue45840@roundup.psfhosted.org>
Message-ID: <1638971259.73.0.157619485423.issue45840@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
stage: patch review -> backport needed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45840>
_______________________________________

From report at bugs.python.org  Wed Dec  8 09:02:15 2021
From: report at bugs.python.org (wyz23x2)
Date: Wed, 08 Dec 2021 14:02:15 +0000
Subject: [issue45420] Python 3.10 final installation failure
In-Reply-To: <1633828108.74.0.92443333438.issue45420@roundup.psfhosted.org>
Message-ID: <1638972135.13.0.382409009618.issue45420@roundup.psfhosted.org>


wyz23x2 <wyz23x2 at 163.com> added the comment:

Problem solved by installing 3.10.1. (Why?) Thanks!

----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45420>
_______________________________________

From report at bugs.python.org  Wed Dec  8 09:13:00 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 08 Dec 2021 14:13:00 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1638972780.72.0.311217610653.issue45459@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28214
pull_request: https://github.com/python/cpython/pull/29991

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Wed Dec  8 09:33:31 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 08 Dec 2021 14:33:31 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1638974011.9.0.431176885511.issue45459@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

After some consideration I also agree with Antoine. The Py_buffer API has been around for a long time without any changes to the Py_buffer struct. It is unlikely that the struct will ever change.

I have created a new PR that exposes Py_buffer struct, PyBuffer_*() API functions, PyBUF_* constants, Py_bf_* type slots, and PyMemoryView_FromBuffer(). We could consider to export PyPickleBuffer*() API, too.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Wed Dec  8 09:46:40 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Wed, 08 Dec 2021 14:46:40 +0000
Subject: [issue46009] sending non-None values makes generator raise
 StopIteration on next access
In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org>
Message-ID: <1638974800.77.0.906991943497.issue46009@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset 99c72326d245fb604609a87a51ef1ad0845467b7 by Mark Shannon in branch '3.10':
[3.10] bpo-46009: Do not exhaust generator when send() method raises (GH-29986). (GH-29988)
https://github.com/python/cpython/commit/99c72326d245fb604609a87a51ef1ad0845467b7


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46009>
_______________________________________

From report at bugs.python.org  Wed Dec  8 09:47:37 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 14:47:37 +0000
Subject: [issue11385] [doc] TextTestRunner documentation improvements
In-Reply-To: <1299176734.52.0.359265322214.issue11385@psf.upfronthosting.co.za>
Message-ID: <1638974857.12.0.197393971921.issue11385@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The run method is documented now, but most of the above points are still true.

----------
assignee: michael.foord -> 
keywords: +easy
nosy: +iritkatriel
title: TextTestRunner methods are not documented -> [doc] TextTestRunner documentation improvements
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue11385>
_______________________________________

From report at bugs.python.org  Wed Dec  8 09:50:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 14:50:05 +0000
Subject: [issue10608] [doc] Add a section to Windows FAQ explaining os.symlink
In-Reply-To: <1291315333.59.0.493313738075.issue10608@psf.upfronthosting.co.za>
Message-ID: <1638975005.77.0.171352074155.issue10608@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
title: Add a section to Windows FAQ explaining os.symlink -> [doc] Add a section to Windows FAQ explaining os.symlink
type: behavior -> enhancement
versions: +Python 3.11 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10608>
_______________________________________

From report at bugs.python.org  Wed Dec  8 09:53:31 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Wed, 08 Dec 2021 14:53:31 +0000
Subject: [issue46009] sending non-None values makes generator raise
 StopIteration on next access
In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org>
Message-ID: <1638975211.27.0.0754035186021.issue46009@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46009>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:08:10 2021
From: report at bugs.python.org (Chris Webb)
Date: Wed, 08 Dec 2021 15:08:10 +0000
Subject: [issue1653457] Python misbehaves when installed in / (patch attached)
Message-ID: <1638976090.75.0.375010887848.issue1653457@roundup.psfhosted.org>


Change by Chris Webb <chris at arachsys.com>:


Removed file: https://bugs.python.org/file17945/paths.patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1653457>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:20:10 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 08 Dec 2021 15:20:10 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1638976810.81.0.785869827937.issue45459@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Would it make sense to add a "version" member to the structure?

It would allow to support an old stable structure for the stable ABI and a new structure with other changes. The problem is how to initalize the version member. On Windows, many structures have a member which is the size of the structure.

I tried to implement such ABI compatibility for PEP 587 PyConfig structure, but the idea was rejected (there was no need for a stable ABI when Python is embedded in an application):
https://mail.python.org/archives/list/python-dev at python.org/thread/C7Z2NA2DTM3DLOZCFQAK5A2WFYO3PHHX/

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:22:50 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 15:22:50 +0000
Subject: [issue15735] PEP 3121, 384 Refactoring applied to ossaudio module
In-Reply-To: <1345456522.27.0.354179103538.issue15735@psf.upfronthosting.co.za>
Message-ID: <1638976970.99.0.272201398058.issue15735@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The patch needs to be converted to a github PR.

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15735>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:25:16 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 15:25:16 +0000
Subject: [issue15651] PEP 3121, 384 refactoring applied to elementtree module
In-Reply-To: <1344968721.44.0.689766020196.issue15651@psf.upfronthosting.co.za>
Message-ID: <1638977116.72.0.729110534679.issue15651@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> duplicate
status: open -> closed
superseder:  -> PEP 3121, 384 refactoring applied to elementtree module

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15651>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:27:50 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 15:27:50 +0000
Subject: [issue15390] PEP 3121, 384 refactoring applied to _datetime module
In-Reply-To: <1342647232.82.0.0763290244077.issue15390@psf.upfronthosting.co.za>
Message-ID: <1638977270.72.0.710895458299.issue15390@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The patch needs to be converted to a github PR.

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15390>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:29:56 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 15:29:56 +0000
Subject: [issue15389] PEP 3121, 384 refactoring applied to curses module
In-Reply-To: <1342647007.31.0.0527373490627.issue15389@psf.upfronthosting.co.za>
Message-ID: <1638977396.17.0.696050396524.issue15389@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The patch needs to be converted to a github PR.

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15389>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:31:40 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 15:31:40 +0000
Subject: [issue15673] PEP 3121, 384 Refactoring applied to testcapi module
In-Reply-To: <1345042709.67.0.745658134358.issue15673@psf.upfronthosting.co.za>
Message-ID: <1638977500.69.0.879439488574.issue15673@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The patch needs to be converted to a github PR.

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15673>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:32:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 15:32:48 +0000
Subject: [issue15708] PEP 3121, 384 Refactoring applied to socket module
In-Reply-To: <1345152388.23.0.37223742756.issue15708@psf.upfronthosting.co.za>
Message-ID: <1638977568.44.0.857107045589.issue15708@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The patch needs to be converted to a github PR.

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15708>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:57:27 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 15:57:27 +0000
Subject: [issue19888] Three argument type() super call sets __name__ but not
 __qualname__
In-Reply-To: <1386194767.46.0.367836396475.issue19888@psf.upfronthosting.co.za>
Message-ID: <1638979047.64.0.619726605958.issue19888@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This is about documenting a difference between 3.2 and 3.3, so I'm assuming it's no longer relevant.

----------
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19888>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:59:07 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 08 Dec 2021 15:59:07 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1638979147.02.0.151936511514.issue45459@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

I thought of a version field, too. In the end it is going to cause more work and trouble than it would benefit us.

Stack-allocated Py_buffer's are typically initialized with

   Py_buffer data = {NULL, NULL};

. The code initializes Py_buffer.buf and Py_buffer.obj as NULL. The remaining fields are whatever random values happens to be on the C stack. If we would append a version field to the struct, than every project would have to initialize the field properly.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Wed Dec  8 10:59:37 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 08 Dec 2021 15:59:37 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1638979177.85.0.804877701758.issue45459@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

In Python 3.5, I decided to rename the public "PyMemAllocator" structure to PyMemAllocatorEx when I added a new "calloc" member. C extensions using "PyMemAllocator" fail to build to force developers to set the calloc member.

IMO it's unfortunate to have to rename a structure to force developers to update their C code :-(

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:05:12 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 08 Dec 2021 16:05:12 +0000
Subject: [issue45813] Importing asyncio after deleting a coroutine object and
 before cleaning it up leads to crashing on Python3.11
In-Reply-To: <1637052252.29.0.850993765277.issue45813@roundup.psfhosted.org>
Message-ID: <1638979512.28.0.608672772143.issue45813@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset d4363d214097b3fca8b7910c2e0e91c8b0873fb2 by Andrew Svetlov in branch 'main':
bpo-45813: Drop redundant assertion from frame.clear() (GH-29990)
https://github.com/python/cpython/commit/d4363d214097b3fca8b7910c2e0e91c8b0873fb2


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45813>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:08:25 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 08 Dec 2021 16:08:25 +0000
Subject: [issue45813] Importing asyncio after deleting a coroutine object and
 before cleaning it up leads to crashing on Python3.11
In-Reply-To: <1637052252.29.0.850993765277.issue45813@roundup.psfhosted.org>
Message-ID: <1638979705.06.0.855949471545.issue45813@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
resolution:  -> fixed
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45813>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:18:46 2021
From: report at bugs.python.org (Steve Dower)
Date: Wed, 08 Dec 2021 16:18:46 +0000
Subject: [issue46015] Windows venvs do not include DLLs directory
Message-ID: <1638980326.73.0.477270049092.issue46015@roundup.psfhosted.org>


New submission from Steve Dower <steve.dower at python.org>:

Before, a venv would include the DLLs directory in sys.path. Since issue45582, it does not, and so anything that relies on a standard library native module cannot run.

----------
assignee: steve.dower
components: Windows
messages: 408033
nosy: paul.moore, steve.dower, tim.golden, vinay.sajip, zach.ware
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Windows venvs do not include DLLs directory
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46015>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:18:56 2021
From: report at bugs.python.org (Steve Dower)
Date: Wed, 08 Dec 2021 16:18:56 +0000
Subject: [issue46015] Windows venvs do not include DLLs directory
In-Reply-To: <1638980326.73.0.477270049092.issue46015@roundup.psfhosted.org>
Message-ID: <1638980336.43.0.969028059249.issue46015@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

+RM

----------
nosy: +pablogsal

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46015>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:21:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 16:21:05 +0000
Subject: [issue29590] Incorrect stack traces when re-entering a
 generator/coroutine stack via .throw()
In-Reply-To: <1487341428.62.0.272190755105.issue29590@psf.upfronthosting.co.za>
Message-ID: <1638980465.71.0.375374670298.issue29590@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29590>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:28:24 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 08 Dec 2021 16:28:24 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1638980904.62.0.528853414416.issue45459@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

The Py_buffer struct has stayed the same for over a decade and since Python 2.6.0 and 3.0.0. It is unlikely that it has to be changed in the near future.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:31:10 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 08 Dec 2021 16:31:10 +0000
Subject: [issue46013] Confusing period in object.__hash__ doc
In-Reply-To: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org>
Message-ID: <1638981070.58.0.801646332708.issue46013@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

A line break would look weird.  Let's add plain English instead.

-   including set, frozenset, and dict. __hash__() should return an integer.
+   including set, frozenset, and dict. The __hash__() method should return an integer.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46013>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:34:30 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Wed, 08 Dec 2021 16:34:30 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1638981270.39.0.118529650717.issue45459@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

The current struct is also likely to continue covering most future uses.
If we decide to add PyBufferEx functions but continue providing the current ones (with the current struct), most users won't be affected. (But it'll be a bit more work for us than throwing the old API out entirely.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:36:57 2021
From: report at bugs.python.org (Steve Dower)
Date: Wed, 08 Dec 2021 16:36:57 +0000
Subject: [issue46015] Windows venvs do not include DLLs directory
In-Reply-To: <1638980326.73.0.477270049092.issue46015@roundup.psfhosted.org>
Message-ID: <1638981417.91.0.192626653149.issue46015@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
keywords: +patch
pull_requests: +28215
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29992

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46015>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:39:39 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 16:39:39 +0000
Subject: [issue16223] [doc] untokenize returns a string if no encoding token
 is recognized
In-Reply-To: <1350193751.15.0.784217855065.issue16223@psf.upfronthosting.co.za>
Message-ID: <1638981579.74.0.0669291826006.issue16223@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The doc has been updated by now:

"It returns bytes, encoded using the ENCODING token, which is the first token sequence output by tokenize(). If there is no encoding token in the input, it returns a str instead."

https://docs.python.org/3/library/tokenize.html#tokenize.untokenize


The docstring doesn't say this though.

----------
components: +Documentation
nosy: +iritkatriel
title: untokenize returns a string if no encoding token is recognized -> [doc] untokenize returns a string if no encoding token is recognized
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16223>
_______________________________________

From report at bugs.python.org  Wed Dec  8 11:50:48 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 08 Dec 2021 16:50:48 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1638982248.54.0.895344411975.issue45459@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> Py_buffer data = {NULL, NULL};
> The code initializes Py_buffer.buf and Py_buffer.obj as NULL. The remaining fields are whatever random values happens to be on the C stack.

The C language sets other members to 0/NULL with this syntax, no?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Wed Dec  8 13:47:35 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 18:47:35 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1638989255.8.0.0553858661552.issue45635@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset f893bb2e01307c92ca19597f44874ecaffe7f06f by Irit Katriel in branch 'main':
bpo-45635: refactor print_exception() into smaller functions (GH-29981)
https://github.com/python/cpython/commit/f893bb2e01307c92ca19597f44874ecaffe7f06f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Wed Dec  8 13:53:08 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 08 Dec 2021 18:53:08 +0000
Subject: [issue45359] TopologicalSorter is not Generic at runtime (but is in
 typeshed)
In-Reply-To: <1633299530.43.0.181161136207.issue45359@roundup.psfhosted.org>
Message-ID: <1638989588.93.0.479730588374.issue45359@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset 3cb9731b7e59b0df9a7a9ab6b7746a669958b693 by Jacob Hayes in branch 'main':
bpo-45359: Support TopologicalSorter type subscript (GH-28714)
https://github.com/python/cpython/commit/3cb9731b7e59b0df9a7a9ab6b7746a669958b693


----------
nosy: +asvetlov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45359>
_______________________________________

From report at bugs.python.org  Wed Dec  8 14:13:05 2021
From: report at bugs.python.org (David CARLIER)
Date: Wed, 08 Dec 2021 19:13:05 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
Message-ID: <1638990785.71.0.738290193352.issue46016@roundup.psfhosted.org>


Change by David CARLIER <devnexen at gmail.com>:


----------
components: FreeBSD
nosy: devnexen, koobs
priority: normal
pull_requests: 28216
severity: normal
status: open
title: fcntl module add F_DUP2FD_CLOEXEC
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Wed Dec  8 14:26:07 2021
From: report at bugs.python.org (Steve Dower)
Date: Wed, 08 Dec 2021 19:26:07 +0000
Subject: [issue46015] Windows venvs do not include DLLs directory
In-Reply-To: <1638980326.73.0.477270049092.issue46015@roundup.psfhosted.org>
Message-ID: <1638991567.81.0.765770232606.issue46015@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset 7778116c2f573edf320bd55301137a968e4339d8 by Steve Dower in branch 'main':
bpo-46015: Fixes calculation of sys.path in a venv on Windows (GH-29992)
https://github.com/python/cpython/commit/7778116c2f573edf320bd55301137a968e4339d8


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46015>
_______________________________________

From report at bugs.python.org  Wed Dec  8 14:36:23 2021
From: report at bugs.python.org (Steve Dower)
Date: Wed, 08 Dec 2021 19:36:23 +0000
Subject: [issue46015] Windows venvs do not include DLLs directory
In-Reply-To: <1638980326.73.0.477270049092.issue46015@roundup.psfhosted.org>
Message-ID: <1638992183.96.0.955610259051.issue46015@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46015>
_______________________________________

From report at bugs.python.org  Wed Dec  8 15:08:11 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 20:08:11 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1638994091.54.0.412741803039.issue45711@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 2109f7880b65755329a877da3a7f8a362de07350 by Irit Katriel in branch 'main':
bpo-45711: Remove unnecessary normalization of exc_info (GH-29922)
https://github.com/python/cpython/commit/2109f7880b65755329a877da3a7f8a362de07350


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Wed Dec  8 16:01:12 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Wed, 08 Dec 2021 21:01:12 +0000
Subject: [issue44377] Truncated error message of original function while
 multiprocessing or multithreading
In-Reply-To: <1623328035.9.0.197827548789.issue44377@roundup.psfhosted.org>
Message-ID: <1638997272.84.0.119011337402.issue44377@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Prasanth: can you provide a bit more details, are you saying that this line:
https://github.com/python/cpython/blob/2109f7880b65755329a877da3a7f8a362de07350/Lib/multiprocessing/pool.py#L86

.. truncates the exception msg? What is the exact exception type that got truncated?

Can you post the exact error output you got here?

----------
assignee:  -> andrei.avk
nosy: +andrei.avk

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44377>
_______________________________________

From report at bugs.python.org  Wed Dec  8 16:02:12 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 08 Dec 2021 21:02:12 +0000
Subject: [issue10608] [doc] Add a section to Windows FAQ explaining os.symlink
In-Reply-To: <1291315333.59.0.493313738075.issue10608@psf.upfronthosting.co.za>
Message-ID: <1638997332.19.0.160002361396.issue10608@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

Ingrid's patch misses the requirement to log off after adding a privilege to the current account. A new access token is required, from a fresh logon. 

Privileges can also be added to groups, not just to individual user accounts. Thus the symlink privilege can be granted to a standard group or well-known group, such as "Users" or "Authenticated Users".

Python 3.8+ supports the system's developer mode, which allows unprivileged symlink creation. This is just for developer tools, such as Git. Developer mode should not be relied on for regular scripts and applications. 

In POSIX, symlinks are widely used to reduce the burden of software maintenance. In Windows, however, symlinks are not reliably available, due to limited file system support (primarily NTFS, ReFs) and the requirement for a privilege that standard users lack by default. Another significant problem in Windows is the behavior of the shell API (shell32.dll), which eagerly resolves a symlink to its target and thus breaks many use cases for symlinks (e.g. virtual environments). Given these problems, using symlinks may actually increase the maintenance burden in Windows. Applications have to support a fallback path for Windows -- such as hard linking, copying, or launchers -- when symlinks either aren't available or for use cases that are unreliable (e.g. due to the way symlinks are accessed in the GUI shell).

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10608>
_______________________________________

From report at bugs.python.org  Wed Dec  8 16:03:19 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Wed, 08 Dec 2021 21:03:19 +0000
Subject: [issue44377] Truncated error message of original function while
 multiprocessing or multithreading
In-Reply-To: <1623328035.9.0.197827548789.issue44377@roundup.psfhosted.org>
Message-ID: <1638997399.41.0.203475400356.issue44377@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44377>
_______________________________________

From report at bugs.python.org  Wed Dec  8 16:14:38 2021
From: report at bugs.python.org (David CARLIER)
Date: Wed, 08 Dec 2021 21:14:38 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
Message-ID: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>


New submission from David CARLIER <devnexen at gmail.com>:

Exposing these specific freebsd constants to the module.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Wed Dec  8 16:25:06 2021
From: report at bugs.python.org (Nathan Jensen)
Date: Wed, 08 Dec 2021 21:25:06 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1638998706.75.0.59262115492.issue46006@roundup.psfhosted.org>


Change by Nathan Jensen <ndjensen at gmail.com>:


----------
nosy: +ndjensen

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec  8 16:26:34 2021
From: report at bugs.python.org (Nathan Jensen)
Date: Wed, 08 Dec 2021 21:26:34 +0000
Subject: [issue22213] Make pyvenv style virtual environments easier to
 configure when embedding Python
In-Reply-To: <1408275761.36.0.915361061447.issue22213@psf.upfronthosting.co.za>
Message-ID: <1638998794.72.0.50300008824.issue22213@roundup.psfhosted.org>


Change by Nathan Jensen <ndjensen at gmail.com>:


----------
nosy: +ndjensen

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22213>
_______________________________________

From report at bugs.python.org  Wed Dec  8 16:27:46 2021
From: report at bugs.python.org (Nathan Jensen)
Date: Wed, 08 Dec 2021 21:27:46 +0000
Subject: [issue40512] [subinterpreters] Meta issue: per-interpreter GIL
In-Reply-To: <1588683075.13.0.0239787407564.issue40512@roundup.psfhosted.org>
Message-ID: <1638998866.6.0.438256272129.issue40512@roundup.psfhosted.org>


Change by Nathan Jensen <ndjensen at gmail.com>:


----------
nosy: +ndjensen

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40512>
_______________________________________

From report at bugs.python.org  Wed Dec  8 17:06:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 22:06:20 +0000
Subject: [issue39694] Incorrect dictionary unpacking when calling str.format
In-Reply-To: <1582193003.32.0.513659901276.issue39694@roundup.psfhosted.org>
Message-ID: <1639001180.35.0.141892714159.issue39694@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

>>> x = {None: ''}
>>> ''.format(**x)
''
>>> '{x}'.format(**x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'x'

----------
components: +Library (Lib)
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39694>
_______________________________________

From report at bugs.python.org  Wed Dec  8 17:14:39 2021
From: report at bugs.python.org (Mark Sapiro)
Date: Wed, 08 Dec 2021 22:14:39 +0000
Subject: [issue46011] Python 3.10 email returns invalid Date: header unchanged.
In-Reply-To: <1638937977.72.0.569168452456.issue46011@roundup.psfhosted.org>
Message-ID: <1639001679.71.0.923641486035.issue46011@roundup.psfhosted.org>


Mark Sapiro <mark at msapiro.net> added the comment:

Upon further research I realized this is related to https://bugs.python.org/issue30681 and that while there are no message.defects the Date: header does have the InvalidDateDefect and its datetime attribute is None so I consider this resolved.

----------
stage:  -> resolved

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46011>
_______________________________________

From report at bugs.python.org  Wed Dec  8 17:23:06 2021
From: report at bugs.python.org (Ben Ricketts)
Date: Wed, 08 Dec 2021 22:23:06 +0000
Subject: [issue46017] Tutorial incorrectly refers to skits rather than
 sketches.
Message-ID: <1639002186.7.0.719126864665.issue46017@roundup.psfhosted.org>


New submission from Ben Ricketts <benricketts77 at gmail.com>:

https://docs.python.org/3/tutorial/appetite.html

4th paragraph from bottom refers to "skits" where as Monty Python in fact perform sketch comedy.It is a minor but important differentiation.

----------
assignee: docs at python
components: Documentation
messages: 408049
nosy: benricketts77, docs at python
priority: normal
severity: normal
status: open
title: Tutorial incorrectly refers to skits rather than sketches.
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46017>
_______________________________________

From report at bugs.python.org  Wed Dec  8 17:28:55 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 08 Dec 2021 22:28:55 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
In-Reply-To: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>
Message-ID: <1639002535.87.0.457690184891.issue46016@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:


New changeset 267539bff700c2493778c07eeb1642b9584c4826 by David CARLIER in branch 'main':
bpo-46016: fcntl module add FreeBSD's F_DUP2FD_CLOEXEC flag support (GH-29993)
https://github.com/python/cpython/commit/267539bff700c2493778c07eeb1642b9584c4826


----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Wed Dec  8 17:29:11 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 08 Dec 2021 22:29:11 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
In-Reply-To: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>
Message-ID: <1639002551.06.0.341016276753.issue46016@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Wed Dec  8 17:31:08 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 22:31:08 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1639002668.69.0.73607243815.issue45711@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28217
pull_request: https://github.com/python/cpython/pull/29994

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Wed Dec  8 17:31:14 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Wed, 08 Dec 2021 22:31:14 +0000
Subject: [issue38884] __import__ is not thread-safe on Python 3
In-Reply-To: <1574363514.58.0.324753075286.issue38884@roundup.psfhosted.org>
Message-ID: <1639002674.64.0.659743464854.issue38884@roundup.psfhosted.org>


Change by Gregory P. Smith <greg at krypto.org>:


----------
nosy: +gregory.p.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38884>
_______________________________________

From report at bugs.python.org  Wed Dec  8 17:43:29 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 08 Dec 2021 22:43:29 +0000
Subject: [issue39694] Incorrect dictionary unpacking when calling str.format
In-Reply-To: <1582193003.32.0.513659901276.issue39694@roundup.psfhosted.org>
Message-ID: <1639003409.01.0.532126904896.issue39694@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

In most cases the test is cheap even for large dict (it has constant complexity if the dict never contained non-string keys).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39694>
_______________________________________

From report at bugs.python.org  Wed Dec  8 17:53:27 2021
From: report at bugs.python.org (Valentyn Tymofieiev)
Date: Wed, 08 Dec 2021 22:53:27 +0000
Subject: [issue38884] __import__ is not thread-safe on Python 3
In-Reply-To: <1574363514.58.0.324753075286.issue38884@roundup.psfhosted.org>
Message-ID: <1639004007.71.0.53458482303.issue38884@roundup.psfhosted.org>


Valentyn Tymofieiev <valentyn at google.com> added the comment:

Given that the behavior changes between Python 3.2 (no deadlock) and Python 3.3 (deadlock), this should be easily bisectable if someone has the right setup to build and run Python versions from sources in that range.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38884>
_______________________________________

From report at bugs.python.org  Wed Dec  8 18:02:01 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Wed, 08 Dec 2021 23:02:01 +0000
Subject: [issue46017] Tutorial incorrectly refers to skits rather than
 sketches.
In-Reply-To: <1639002186.7.0.719126864665.issue46017@roundup.psfhosted.org>
Message-ID: <1639004521.06.0.702766785428.issue46017@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

What difference do you believe there is between skits and sketches?

Definition 1 of skit: "A short comic performance."

https://en.wiktionary.org/wiki/skit#English

Definition 4 of sketch: "A brief, light, or unfinished dramatic, musical, or literary work or idea; especially a short, often humorous or satirical scene or play, frequently as part of a revue or variety show. Synonym: skit"

https://en.wiktionary.org/wiki/sketch#English


The Pythons themselves sometimes describe their work as "skits" and sometimes as "sketches". E.g. quote: "Included are transcripts of Hollywood Bowl Skits..."

http://www.montypython.com/book_Monty%20Python%20Live!/24

while of course it is always "the Dead Parrot sketch".

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46017>
_______________________________________

From report at bugs.python.org  Wed Dec  8 18:21:54 2021
From: report at bugs.python.org (Oleg Iarygin)
Date: Wed, 08 Dec 2021 23:21:54 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639005714.0.0.742366428429.issue36048@roundup.psfhosted.org>


Oleg Iarygin <oleg at arhadthedev.net> added the comment:

Here is a report that this change breaks PyQt5 on Fedora:

<https://github.com/python/cpython/pull/11952#issuecomment-989298404>

> [...]
>
> Why do I care? This breaks tons of existing PyQt5 code out there, for example. I wasn't aware of this change to the language until Fedora shipped Python 3.10 and everything broke. So much stuff that uses PyQt5 is broken now. Good job guys!!
>
> [...]

Even though the rest of comment is emotional, we need to check if the problem really has place and the PR needs to be retracted until PyQt5 is ported to newer Python C API.

----------
nosy: +arhadthedev

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Wed Dec  8 18:44:46 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 08 Dec 2021 23:44:46 +0000
Subject: [issue34111] python-config breaks when symlinked to another location
In-Reply-To: <1531567311.02.0.56676864532.issue34111@psf.upfronthosting.co.za>
Message-ID: <1639007086.59.0.605830201765.issue34111@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

tobik, 3.4/3.5 are no longer maintained. Do you know whether this is impacting current versions (>= 3.9)?

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34111>
_______________________________________

From report at bugs.python.org  Wed Dec  8 19:01:49 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Thu, 09 Dec 2021 00:01:49 +0000
Subject: [issue45510] Specialize BINARY_SUBTRACT
In-Reply-To: <1634555657.96.0.480345209598.issue45510@roundup.psfhosted.org>
Message-ID: <1639008109.45.0.20044112864.issue45510@roundup.psfhosted.org>


Change by Brandt Bucher <brandtbucher at gmail.com>:


----------
pull_requests: +28218
pull_request: https://github.com/python/cpython/pull/29995

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45510>
_______________________________________

From report at bugs.python.org  Wed Dec  8 19:15:16 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 00:15:16 +0000
Subject: [issue20899] Nested namespace imports do not work inside zip archives
In-Reply-To: <1394656225.26.0.176386437395.issue20899@psf.upfronthosting.co.za>
Message-ID: <1639008916.86.0.538586245776.issue20899@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I got the same results as Jonathan.

----------
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20899>
_______________________________________

From report at bugs.python.org  Wed Dec  8 19:20:27 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 00:20:27 +0000
Subject: [issue29899] zlib missing when --enable--optimizations option appended
In-Reply-To: <1490419181.2.0.645690574744.issue29899@psf.upfronthosting.co.za>
Message-ID: <1639009227.37.0.824475708494.issue29899@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Version 3.3 is no longer supported, and it doesn't look like there is enough information here for core devs to understand what happened.

I'll close this, but please create a new issue if you are still having this problem with a current version (>= 3.9).

----------
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29899>
_______________________________________

From report at bugs.python.org  Wed Dec  8 19:24:12 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 00:24:12 +0000
Subject: [issue22282] ipaddress module accepts octal formatted IPv4 addresses
 in IPv6 addresses
In-Reply-To: <1409132006.4.0.222962839937.issue22282@psf.upfronthosting.co.za>
Message-ID: <1639009452.85.0.341327781501.issue22282@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This is what I get now on 3.11:


>>> ipaddress.ip_address("::1.0.0.00")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\User\src\cpython\Lib\ipaddress.py", line 54, in ip_address
    raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: '::1.0.0.00' does not appear to be an IPv4 or IPv6 address

----------
nosy: +iritkatriel
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22282>
_______________________________________

From report at bugs.python.org  Wed Dec  8 19:27:54 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 00:27:54 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1639009674.13.0.376409409415.issue45635@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28219
pull_request: https://github.com/python/cpython/pull/29996

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Wed Dec  8 19:43:56 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 09 Dec 2021 00:43:56 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
Message-ID: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>


New submission from Steve Dower <steve.dower at python.org>:

If a C runtime's math functions set errno to ERANGE, we assume it is a valid underflow if fabs(result) < 1.0.

However, because expm1 includes a -1.0, it underflows towards -1.0. This fails the above check, and so if a runtime's expm1() sets ERANGE we will raise a spurious OverflowError.

----------
assignee: steve.dower
components: Library (Lib)
messages: 408059
nosy: steve.dower
priority: normal
severity: normal
status: open
title: expm1 may incorrectly raise OverflowError on underflow
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Wed Dec  8 19:48:05 2021
From: report at bugs.python.org (Zernoxi)
Date: Thu, 09 Dec 2021 00:48:05 +0000
Subject: [issue46002] py Launcher for Windows with MSYS2
In-Reply-To: <1638809787.4.0.667501971988.issue46002@roundup.psfhosted.org>
Message-ID: <1639010885.17.0.0889294492079.issue46002@roundup.psfhosted.org>


Zernoxi <tze.chian.kam at gmail.com> added the comment:

True, that would work but it not ideal "Unix". I'll closed this since not unintended behavior.

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46002>
_______________________________________

From report at bugs.python.org  Wed Dec  8 19:51:00 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 09 Dec 2021 00:51:00 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639011060.04.0.414187877985.issue46018@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
keywords: +patch
pull_requests: +28220
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29997

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Wed Dec  8 20:05:34 2021
From: report at bugs.python.org (Eric Snow)
Date: Thu, 09 Dec 2021 01:05:34 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1639011934.45.0.0800891247154.issue46008@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
pull_requests: +28221
pull_request: https://github.com/python/cpython/pull/29998

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Wed Dec  8 20:17:24 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Thu, 09 Dec 2021 01:17:24 +0000
Subject: [issue45510] Specialize BINARY_SUBTRACT
In-Reply-To: <1634555657.96.0.480345209598.issue45510@roundup.psfhosted.org>
Message-ID: <1639012644.04.0.0508068701782.issue45510@roundup.psfhosted.org>


Dong-hee Na <donghee.na at python.org> added the comment:


New changeset 5de39f4b412ed5b0f3ed0140c83b2c1f8c707603 by Brandt Bucher in branch 'main':
bpo-45510: Check both types when specializing subtraction (GH-29995)
https://github.com/python/cpython/commit/5de39f4b412ed5b0f3ed0140c83b2c1f8c707603


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45510>
_______________________________________

From report at bugs.python.org  Wed Dec  8 20:23:31 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Thu, 09 Dec 2021 01:23:31 +0000
Subject: [issue44289] tarfile.is_tarfile() and tarfile.open() when used with
 file object may cause tarfile operations to fail
In-Reply-To: <1622646545.23.0.614350359918.issue44289@roundup.psfhosted.org>
Message-ID: <1639013011.76.0.0703908671036.issue44289@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

This affects more use cases than just is_tarfile() and getmembers() results.

is_tarfile() calls open() which is the root cause of the issue. Calling open() 2+ times will also cause the same issue.

In addition to getmembers(), extracting the tar will also silently fail. (and possibly other operations).

I've suggested a different fix in the comment on the PR:
https://github.com/python/cpython/pull/26488#issuecomment-989367707

----------
nosy: +andrei.avk
title: tarfile.is_tarfile() modifies file object's current position -> tarfile.is_tarfile() and tarfile.open() when used with file object may cause tarfile operations to fail

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44289>
_______________________________________

From report at bugs.python.org  Wed Dec  8 20:23:47 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Thu, 09 Dec 2021 01:23:47 +0000
Subject: [issue44289] tarfile.is_tarfile() and tarfile.open() when used with
 file object may cause tarfile operations to fail
In-Reply-To: <1622646545.23.0.614350359918.issue44289@roundup.psfhosted.org>
Message-ID: <1639013027.38.0.16519886838.issue44289@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
nosy: +kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44289>
_______________________________________

From report at bugs.python.org  Wed Dec  8 20:52:20 2021
From: report at bugs.python.org (Rahul Gupta)
Date: Thu, 09 Dec 2021 01:52:20 +0000
Subject: [issue46019] collections.Counter - Cast list of keys into set to
 remove iteration over duplicate elements for __le__, __ge__ and __eq__
Message-ID: <1639014740.35.0.724814360021.issue46019@roundup.psfhosted.org>


New submission from Rahul Gupta <rg119 at ic.ac.uk>:

On lines 725, 737 and 749 there is the following code:

'''for c in (self, other) for e in c''' which generates an iterable with all the keys in self and other - casting c to a set will remove duplicates and allow faster iteration - some minor benchmarks I ran seem to agree.

----------
components: Library (Lib)
messages: 408063
nosy: argoop1728
priority: normal
severity: normal
status: open
title: collections.Counter - Cast list of keys into set to remove iteration over duplicate elements for __le__,__ge__ and __eq__
type: performance
versions: Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46019>
_______________________________________

From report at bugs.python.org  Wed Dec  8 20:53:27 2021
From: report at bugs.python.org (Rahul Gupta)
Date: Thu, 09 Dec 2021 01:53:27 +0000
Subject: [issue46019] collections.Counter - Cast list of keys into set to
 remove iteration over duplicate elements for __le__, __ge__ and __eq__
In-Reply-To: <1639014740.35.0.724814360021.issue46019@roundup.psfhosted.org>
Message-ID: <1639014807.64.0.546245592722.issue46019@roundup.psfhosted.org>


Change by Rahul Gupta <rg119 at ic.ac.uk>:


----------
keywords: +patch
pull_requests: +28222
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29999

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46019>
_______________________________________

From report at bugs.python.org  Wed Dec  8 21:19:44 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 09 Dec 2021 02:19:44 +0000
Subject: [issue46019] collections.Counter - Cast list of keys into set to
 remove iteration over duplicate elements for __le__, __ge__ and __eq__
In-Reply-To: <1639014740.35.0.724814360021.issue46019@roundup.psfhosted.org>
Message-ID: <1639016384.51.0.538989482938.issue46019@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> casting c to a set will remove duplicates and allow faster iteration

Sorry, but this doesn't make any sense.  The *c* is either *self* or *other*, both of which are instances of Counter which is itself a subclass of dict.  So, the input cannot have duplicates keys.

> some minor benchmarks I ran seem to agree.

I'm dubious about the minor benchmarks.  If in fact the effect is real, it is merely exploiting an implementation quirk which is tenuous and subject to change (the premise would be that converting to a set and looping over a set is faster than the native dict iterator for a dict subclass).  Conceptually, it is always worse to spend the time and space for first converting to a set.

Besides a speed consideration, there is also a space consideration.  The existing code does not use any auxiliary memory.  The proposed code unnecessarily builds two new sets and then throws them away.

Thanks for the suggestion, but I am going to decline.  The timings seem dubious.  Conceptually, the PR makes the methods do more work.  To the extent some timing difference can be observed, it is likely an implementation quirk. The PR does not make the code cleaner or clearer, and it loops over a dict subclass in an unconventional way.  Also, the PR would have a negative impact on memory usage.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46019>
_______________________________________

From report at bugs.python.org  Wed Dec  8 21:20:27 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 09 Dec 2021 02:20:27 +0000
Subject: [issue46019] collections.Counter - Cast list of keys into set to
 remove iteration over duplicate elements for __le__, __ge__ and __eq__
In-Reply-To: <1639014740.35.0.724814360021.issue46019@roundup.psfhosted.org>
Message-ID: <1639016427.67.0.675076110234.issue46019@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46019>
_______________________________________

From report at bugs.python.org  Wed Dec  8 21:27:54 2021
From: report at bugs.python.org (Rahul Gupta)
Date: Thu, 09 Dec 2021 02:27:54 +0000
Subject: [issue46019] collections.Counter - Cast list of keys into set to
 remove iteration over duplicate elements for __le__, __ge__ and __eq__
In-Reply-To: <1639014740.35.0.724814360021.issue46019@roundup.psfhosted.org>
Message-ID: <1639016874.39.0.35429463995.issue46019@roundup.psfhosted.org>


Rahul Gupta <rg119 at ic.ac.uk> added the comment:

After looking at this again, I agree with you - the key duplication issue seems to have gone. Thank you for providing this feedback, it is very helpful.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46019>
_______________________________________

From report at bugs.python.org  Wed Dec  8 21:39:14 2021
From: report at bugs.python.org (tobik)
Date: Thu, 09 Dec 2021 02:39:14 +0000
Subject: [issue34111] python-config breaks when symlinked to another location
In-Reply-To: <1531567311.02.0.56676864532.issue34111@psf.upfronthosting.co.za>
Message-ID: <1639017554.34.0.96337005126.issue34111@roundup.psfhosted.org>


tobik <python at tobik.me> added the comment:

Yes, the bug still exists and all Python versions are affected.

We patch them all in FreeBSD Ports:
https://cgit.freebsd.org/ports/tree/lang/python36/files/patch-Misc__python-config.sh.in
https://cgit.freebsd.org/ports/tree/lang/python37/files/patch-Misc__python-config.sh.in
https://cgit.freebsd.org/ports/tree/lang/python38/files/patch-Misc__python-config.sh.in
https://cgit.freebsd.org/ports/tree/lang/python39/files/patch-Misc__python-config.sh.in
https://cgit.freebsd.org/ports/tree/lang/python310/files/patch-Misc__python-config.sh.in
https://cgit.freebsd.org/ports/tree/lang/python311/files/patch-Misc__python-config.sh.in

----------
status: pending -> open
versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34111>
_______________________________________

From report at bugs.python.org  Wed Dec  8 21:41:39 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 09 Dec 2021 02:41:39 +0000
Subject: [issue39694] Incorrect dictionary unpacking when calling str.format
In-Reply-To: <1582193003.32.0.513659901276.issue39694@roundup.psfhosted.org>
Message-ID: <1639017699.23.0.8568072489.issue39694@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

IMO, there is no actual problem being solved here.  Instead there is just a concern that something doesn't feel right.   Given that there is no problem in practice, I recommend closing this rather than cluttering docs, tests, or the C code for a non-issue.  

The format() method looksup keywords on demand and it can only lookup strings.  Anything not looked up is ignored.  We have a long history of that working out just fine:

     >>> 'The answer is %(answer)s.' % \
         {'answer': 'correct', 10: 'never used'}
     'The answer is correct.'

     >>> 'The answer is {answer}.'.format(
          **{'answer': 'correct', 10: 'never used'})
     'The answer is correct.'

     >>> 'The answer is {answer}.'.format_map(
         {'answer': 'correct', 10: 'never used'})
     'The answer is correct.

One could argue that making any of the above raise an error for a non-string in a dict is backwards incompatible and would only serve to break code that is already working fine.

I'm going to close this one.  If another core dev feels strongly that this is a problem in practice, go ahead and reopen it.  There was a similar change to SimpleNamespace but arguably that shouldn't have been done either, but at least it had much less risk of breaking existing code that has worked fine for over a decade.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39694>
_______________________________________

From report at bugs.python.org  Wed Dec  8 21:55:45 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Thu, 09 Dec 2021 02:55:45 +0000
Subject: [issue39694] Incorrect dictionary unpacking when calling str.format
In-Reply-To: <1582193003.32.0.513659901276.issue39694@roundup.psfhosted.org>
Message-ID: <1639018545.73.0.31356610814.issue39694@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

I concur with Raymond.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39694>
_______________________________________

From report at bugs.python.org  Wed Dec  8 21:59:23 2021
From: report at bugs.python.org (Inada Naoki)
Date: Thu, 09 Dec 2021 02:59:23 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639018763.49.0.992807413088.issue46006@roundup.psfhosted.org>


Inada Naoki <songofacandy at gmail.com> added the comment:

That's too bad.
We can not compare two Unicode by pointer even if both are interned anymore... It was a nice optimization.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec  8 22:06:20 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 09 Dec 2021 03:06:20 +0000
Subject: [issue14965] super() and property inheritance behavior
In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za>
Message-ID: <1639019180.25.0.938805759603.issue14965@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

-0 from me as well.  I don't think this is common or something that should be encouraged.  As Andrew points out, "del super().x" doesn't have an obvious meaning and it could be regarded as a code smell.

The OP's first example would be an unpleasant API to debug -- it exhibits tight coupling between the parent and child class, it has Liskov issues, and it has implicit forwarding and indirection through descriptors.  The tight coupling is especially problematic because Python's super() isn't guaranteed to call the parent class; rather, it can call a sibling class as determined by the MRO which cannot be known at the time the class is written.

Another thought is that super() is intentionally not a completely transparent proxy.  While an explicit call super().__getitem__(k) works, we've denied support for super()[k].  To me, "super().x = 10" and "del super().x" fall in the same category.

Looking at the OP's 

Fortunately, it doesn't seem to be a common need to use super() in a property setter or deleter to bypass the current class and call setter or deleter in a parent class property.  Arguably, this kind of tight coupling isn't good design.  The OP's first example would be an unpleasant API to debug.

FWIW,

----------
nosy: +rhettinger
versions:  -Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14965>
_______________________________________

From report at bugs.python.org  Wed Dec  8 22:08:37 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 09 Dec 2021 03:08:37 +0000
Subject: [issue14965] super() and property inheritance behavior
In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za>
Message-ID: <1639019317.69.0.0506859156333.issue14965@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Another thought:  Given that this tracker issue has been open for a decade without resolution, we have evidence that this isn't an important problem in practice.

Arguably, people have been better off being nudged in another direction toward better design or having been forced to be explicit about what method is called and when.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14965>
_______________________________________

From report at bugs.python.org  Wed Dec  8 22:10:46 2021
From: report at bugs.python.org (Aaron Gallagher)
Date: Thu, 09 Dec 2021 03:10:46 +0000
Subject: [issue14965] super() and property inheritance behavior
In-Reply-To: <1639019317.69.0.0506859156333.issue14965@roundup.psfhosted.org>
Message-ID: <CAGxfLhw-usKdzMj9XHA9eP3efOTcexFx+MdxF9sU5dxpupxWAQ@mail.gmail.com>


Aaron Gallagher <_ at habnab.it> added the comment:

I will note, Raymond, that I?ve wanted this for years before discovering
this bpo issue, and I found it because you linked it on Twitter. ;)

On Wed, Dec 8, 2021 at 19:08 Raymond Hettinger <report at bugs.python.org>
wrote:

>
> Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:
>
> Another thought:  Given that this tracker issue has been open for a decade
> without resolution, we have evidence that this isn't an important problem
> in practice.
>
> Arguably, people have been better off being nudged in another direction
> toward better design or having been forced to be explicit about what method
> is called and when.
>
> ----------
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue14965>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14965>
_______________________________________

From report at bugs.python.org  Thu Dec  9 00:40:50 2021
From: report at bugs.python.org (Eryk Sun)
Date: Thu, 09 Dec 2021 05:40:50 +0000
Subject: [issue44540] venv: activate.bat fails for venv with special
 characters in PATH
In-Reply-To: <1625057041.78.0.250792490415.issue44540@roundup.psfhosted.org>
Message-ID: <1639028450.69.0.263769048084.issue44540@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

There's no parsing problem with delayed expansion (e.g. "!VAR!" instead of %VAR%) and for loop variables (e.g. "%%a"). The solution is thus to execute in a local scope that enables delayed expansion and command extensions [1]. 

That's easy enough, but then there's the problem of how to evaluate the `set` commands in the global scope, without the help of delayed expansion to prevent parsing errors. I did some research, and apparently the common trick is to end the local scope inside of a `for /f` loop. Then subsequent `set "%%a"` statements in iterations of the loop execute in the global scope. 

The final problem is building the command to execute in the local scope, for which the `for /f` loop iterates the output lines. `set var` returns a line with "var=value", which can be passed back into `set "%%a"`. So I decided to build up a sequence of `&` concatenated `set var` and `echo var=` (clear) statements in an EXPORTS variable.

I added default values for PROMPT ($P$G) and PATH (%SystemRoot%;%SystemRoot%\System32), for when they're not defined. I made sure that deactivate.bat does not leave these defaults in place. The original values, whether defined or not, should be restored exactly as they were.

All of this adds to the length of the scripts. They're roughly doubled in size. But there should be no more problems with an odd number of quotes and/or special characters in any of the variables that get set.

---
[1] The activate.bat and deactivate.bat scripts have been naively relying 
    on the default enabled state of command extensions, e.g. `for /f`
    loops and `if defined` statements.

----------
nosy: +eryksun
Added file: https://bugs.python.org/file50483/activate.bat

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44540>
_______________________________________

From report at bugs.python.org  Thu Dec  9 00:41:07 2021
From: report at bugs.python.org (Eryk Sun)
Date: Thu, 09 Dec 2021 05:41:07 +0000
Subject: [issue44540] venv: activate.bat fails for venv with special
 characters in PATH
In-Reply-To: <1625057041.78.0.250792490415.issue44540@roundup.psfhosted.org>
Message-ID: <1639028467.97.0.669087010775.issue44540@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


Added file: https://bugs.python.org/file50484/deactivate.bat

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44540>
_______________________________________

From report at bugs.python.org  Thu Dec  9 01:19:17 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Thu, 09 Dec 2021 06:19:17 +0000
Subject: [issue44170] ShareableList cannot safely handle multibyte utf-8
 characters
In-Reply-To: <1621336329.38.0.49764469303.issue44170@roundup.psfhosted.org>
Message-ID: <1639030757.29.0.0760855136114.issue44170@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

We classify 'crash' type as seg faults etc, so changing this to 'behavior' type.

----------
nosy: +andrei.avk
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44170>
_______________________________________

From report at bugs.python.org  Thu Dec  9 01:21:18 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Thu, 09 Dec 2021 06:21:18 +0000
Subject: [issue44170] ShareableList cannot safely handle multibyte utf-8
 characters
In-Reply-To: <1621336329.38.0.49764469303.issue44170@roundup.psfhosted.org>
Message-ID: <1639030878.65.0.697225466923.issue44170@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

I've confirmed this issue is still present in 3.11.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44170>
_______________________________________

From report at bugs.python.org  Thu Dec  9 01:32:23 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 09 Dec 2021 06:32:23 +0000
Subject: [issue46020] Optimize long_pow for the common case
Message-ID: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org>


New submission from Raymond Hettinger <raymond.hettinger at gmail.com>:

The expression 'x * x' is faster than 'x ** 2'.

In Python3.10, the speed difference was enormous.  Due to ceval optimizations, the difference in Python3.11 is tighter; however, there is still room for improvement.

The code for long_pow() doesn't currently have a fast path for squaring which is by far the most important case.

$ python3.10 -m timeit -r 11 -s 'x = 10' 'x ** 2'
1000000 loops, best of 11: 201 nsec per loop
$ python3.10 -m timeit -r 11 -s 'x = 10' 'x * x'
10000000 loops, best of 11: 21.9 nsec per loop

$ python3.11 -m timeit -r 11 -s 'x = 10' 'x ** 2'
10000000 loops, best of 11: 32 nsec per loop
$ python3.11 -m timeit -r 11 -s 'x = 10' 'x * x'
20000000 loops, best of 11: 17.6 nsec per loop

----------
components: Interpreter Core
messages: 408076
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Optimize long_pow for the common case
type: performance

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46020>
_______________________________________

From report at bugs.python.org  Thu Dec  9 02:32:08 2021
From: report at bugs.python.org (Oleg Iarygin)
Date: Thu, 09 Dec 2021 07:32:08 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639035128.8.0.138839423689.issue36048@roundup.psfhosted.org>


Oleg Iarygin <oleg at arhadthedev.net> added the comment:

The reporter gave more details (<https://github.com/python/cpython/pull/11952#issuecomment-989430968>):

> Literally this is ok in C++ with Qt:
>
>     float x = 2.3, y = 1.1;
>     auto p = QPoint(x, y); // QPoint only takes 2 int params.. this works in C++; floats can be always be implicitly converted to int
>
> Same code, more or less, in Python3.10 is now broken:
>
>     x = 2.3
>     y = 1.1
>     p = QPoint(x, y)  # This fails, where previously it worked on every Python version since the age of the dinosaurs...
>
> Note that most of the API for PyQt5 is auto-generated from the function signatures of the C++. So in this case QPoint takes 2 ints for its c'tor (just like in C++).. and breaks on Python 3.10 if given floats, when previously it worked just fine with either ints or floats. This is just 1 example. But many codebases that use PyQt5 are hit by breakages like this one now.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:00:42 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 08:00:42 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1639036842.97.0.148279630291.issue45459@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

> The C language sets other members to 0/NULL with this syntax, no?

No, they are not set to 0/NULL. https://en.wikipedia.org/wiki/Uninitialized_variable

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:01:11 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Thu, 09 Dec 2021 08:01:11 +0000
Subject: [issue46020] Optimize long_pow for the common case
In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org>
Message-ID: <1639036871.98.0.42062015452.issue46020@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

I believe https://bugs.python.org/issue44376 added a special case for 2nd and 3rd powers, and that's the 3.10/3.11 difference in the speed of x**2, not ceval optimizations.

----------
nosy: +Dennis Sweeney

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46020>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:02:36 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 08:02:36 +0000
Subject: [issue34111] python-config breaks when symlinked to another location
In-Reply-To: <1531567311.02.0.56676864532.issue34111@psf.upfronthosting.co.za>
Message-ID: <1639036956.06.0.503010547345.issue34111@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Could you open a PR, please? The fix looks trivial.

----------
components: +Build
nosy: +christian.heimes
stage:  -> needs patch
versions:  -Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34111>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:03:33 2021
From: report at bugs.python.org (Bar Harel)
Date: Thu, 09 Dec 2021 08:03:33 +0000
Subject: [issue10850] inconsistent behavior concerning
 multiprocessing.manager.BaseManager._Server
In-Reply-To: <1294360374.53.0.588595674921.issue10850@psf.upfronthosting.co.za>
Message-ID: <1639037013.2.0.883731321627.issue10850@roundup.psfhosted.org>


Bar Harel <bzvi7919 at gmail.com> added the comment:

It's technically not a bug as it is not exposed externally, but I concur with the OP that it shouldn't happen. I'll send a fix either way, and from there we will continue asking if _Server should be exposed or not.

----------
nosy: +bar.harel
versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10850>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:06:03 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 09 Dec 2021 08:06:03 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639037163.14.0.61381076487.issue46018@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
nosy: +mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:12:33 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 09 Dec 2021 08:12:33 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639037553.87.0.862378591675.issue46018@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

It's a bit cheap and nasty, but I think we could simply replace the line:

    if (fabs(x) < 1.0)

in is_error with

    if (fabs(x) < 2.0)

perhaps with an explanatory comment. All we need to do is distinguish underflow from overflow, and 2.0 is still clearly a _long_ way away from any overflow boundary.

It would be good to have a test that would trigger the behaviour, too.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:19:39 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 09 Dec 2021 08:19:39 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639037979.32.0.705217888603.issue46018@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

I presume this is also worth an upstream report? Setting ERANGE on a result that's close to -1.0 is rather questionable.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:38:22 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 09 Dec 2021 08:38:22 +0000
Subject: [issue46020] Optimize long_pow for the common case
In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org>
Message-ID: <1639039102.68.0.47543465254.issue46020@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
nosy: +mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46020>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:46:22 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 09 Dec 2021 08:46:22 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1639039582.57.0.151188424716.issue45459@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Example:
---
struct Point { int x; int y; int z; };

int main()
{
    struct Point p = {1};
    return p.y;
}
---

gcc -O0 produces this machine code which sets p.y to 0 and p.z to 0:
---
Dump of assembler code for function main:
   0x0000000000401106 <+0>:	push   rbp
   0x0000000000401107 <+1>:	mov    rbp,rsp
   0x000000000040110a <+4>:	mov    QWORD PTR [rbp-0xc],0x0
   0x0000000000401112 <+12>:	mov    DWORD PTR [rbp-0x4],0x0
   0x0000000000401119 <+19>:	mov    DWORD PTR [rbp-0xc],0x1
   0x0000000000401120 <+26>:	mov    eax,DWORD PTR [rbp-0x8]
   0x0000000000401123 <+29>:	pop    rbp
   0x0000000000401124 <+30>:	ret    
---

gcc -O3 heavily optimize the code, it always return 0, it doesn't return a random value from the stack:
---
(gdb) disassemble main
Dump of assembler code for function main:
   0x0000000000401020 <+0>:	xor    eax,eax
   0x0000000000401022 <+2>:	ret    
---

The "C99 Standard 6.7.8.21" says:

    If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration.

The C99 standard says that p.y and p.z must be set to 0.

I'm talking about the specific C syntax of a structure static initialization: "struct MyStruct x = {...};".


If "Py_buffer data = {NULL, NULL};" is allocated on the stack, all "data" Py_buffer members are set to 0 or NULL:

typedef struct bufferinfo {
    void *buf;
    PyObject *obj;        /* owned reference */
    Py_ssize_t len;
    Py_ssize_t itemsize;  /* This is Py_ssize_t so it can be
                             pointed to by strides in simple case.*/
    int readonly;
    int ndim;
    char *format;
    Py_ssize_t *shape;
    Py_ssize_t *strides;
    Py_ssize_t *suboffsets;
    void *internal;
} Py_buffer;


If we want to add a version member to this structure, I would suggest to enforce the usage of a static initialization macro or an initialization function, like:
  "Py_buffer data; PyBuffer_Init(&data);"
or
  "Py_buffer data = PyBuffer_STATIC_INIT;"

The problem of the macro is that it is not usable on Python extensions was are not written in C or C++ (or more generally to extensions which cannot use macros).

--

A different approach is to use an API which allocates a Py_buffer on the heap memory, so if the structure becomes larger tomorrow, an old built C extensions continues to work:

Py_buffer *data = PyBuffer_New();
// ... use *data ...
PyBuffer_Free(data);

PyBuffer_New() can initialize the version member and allocates the proper memory block size.

The best is if the "... use *data ..." part is only done with function calls :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:57:57 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 09 Dec 2021 08:57:57 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639040277.01.0.293010260755.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> We can not compare two Unicode by pointer even if both are interned anymore... It was a nice optimization.

If two strings are interned and part of the same interpreter, the "ptr1 == ptr2" comparison continues to work.

What is not compatible with subinterpreters, which have other interned string objects, is the assumption that two interned strings are not equal if both strings are interned and pointeres are not equal.

_PyUnicode_EqualToASCIIId() is the only function making this assumption.

* dictkeys_stringlookup(): if pointers are not equal, compare the hash: if the two hashes are equal, compare the strings content with unicode_eq()

* PyUnicode_Compare(): if pointers are not equal, compare the strings content with unicode_compare()

* _PyUnicode_EQ(): always compare the strings content

* PyUnicode_RichCompare(): if pointers are not equal, compare the strings content

None of these functions have a fast path for interned strings. Well, _PyUnicode_EqualToASCIIId() is different since right is always an interned string.


Note: unicode_compare() is strange, it requires both strings to be equal, but it does not consider that two strings are not equal if their kinds are not equal. If both strings are ready and their kinds are not equal, the two strings cannot be equal... unicode_compare_eq() returns 0 if the two kinds are not equal.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Thu Dec  9 03:58:21 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 08:58:21 +0000
Subject: [issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the
 limited C API
In-Reply-To: <1638898465.89.0.178243976292.issue46007@roundup.psfhosted.org>
Message-ID: <1639040301.22.0.0477202540743.issue46007@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 73325bbe774b16891f999fb557177206470676b1 by Victor Stinner in branch 'main':
bpo-46007: Exclude PyUnicode_CHECK_INTERNED() from limited C API (GH-29987)
https://github.com/python/cpython/commit/73325bbe774b16891f999fb557177206470676b1


----------
nosy: +miss-islington

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46007>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:00:19 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 09 Dec 2021 09:00:19 +0000
Subject: [issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the
 limited C API
In-Reply-To: <1638898465.89.0.178243976292.issue46007@roundup.psfhosted.org>
Message-ID: <1639040419.23.0.113274665042.issue46007@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46007>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:06:53 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 09 Dec 2021 09:06:53 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639040813.31.0.906108105254.issue36048@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

@arhadthedev: Thanks for highlighting the issue.

> we need to check if the problem really has place and the PR needs to be retracted until PyQt5 is ported to newer Python C API

I'm not particularly impressed by the arguments from cculianu. This was the right change to make: this is very general machinery, and we've seen many real issues over the years resulting from implicit acceptance of floats or Decimal objects where an integer is expected. 

It may well be that for some *specific* libraries like PyQt5 it makes sense to make a different choice. And indeed, PySide6 has done exactly that:

Python 3.10.0 (default, Nov 12 2021, 12:32:57) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PySide6.QtCore import QPoint
>>> QPoint(2, 3)
PySide6.QtCore.QPoint(2, 3)
>>> QPoint(2.1, 3.3)
PySide6.QtCore.QPoint(2, 3)

So no, I don't believe this change should be reverted. At best, we could re-introduce the deprecation warnings and delay the full implementation of the change. But the deprecation warnings were present since Python 3.8, and so either the PyQt5 developers noticed them but didn't want to make the change, or didn't notice them. Either way, it's difficult to see what difference extending the deprecation warning period would make. Moreover, the new behaviour is already released, in Python 3.10.0 and 3.10.1, and the code churn would likely be more annoying than helpful.

I would suggest to cculianu that they take this up with the PyQt5 developers.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:11:35 2021
From: report at bugs.python.org (David CARLIER)
Date: Thu, 09 Dec 2021 09:11:35 +0000
Subject: [issue46021] fcntl module update supports FreeBSD F_KINFO flag
Message-ID: <1639041095.56.0.579209436021.issue46021@roundup.psfhosted.org>


New submission from David CARLIER <devnexen at gmail.com>:

- Enabling new F_KINFO flag.
- Returning a subset of practical data from it.

----------
components: FreeBSD
messages: 408088
nosy: devnexen, koobs
priority: normal
pull_requests: 28224
severity: normal
status: open
title: fcntl module update supports FreeBSD F_KINFO flag

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46021>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:14:00 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 09:14:00 +0000
Subject: [issue45459] Limited API support for Py_buffer
In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org>
Message-ID: <1639041240.21.0.742057147006.issue45459@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Thanks for the investigation. I didn't know about C99 Standard 6.7.8.21. That's a useful and sensible extension to the language.

In my opinion it is neither useful to extend the Py_buffer struct with a version tag nor to force users to allocate the struct on the heap. The current design has worked for over 13 years. Any deviation from the established design poses a risk to break 3rd party software.

I could be convinced to add PyBuffer_New() and PyBuffer_Free() as additional feature, but their use should be optional. The function were part of my first PR GH-29035.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:19:49 2021
From: report at bugs.python.org (Bar Harel)
Date: Thu, 09 Dec 2021 09:19:49 +0000
Subject: [issue46022] Multiprocessing.Server.serve_forever runs sys.exit()
Message-ID: <1639041589.61.0.824516720423.issue46022@roundup.psfhosted.org>


New submission from Bar Harel <bzvi7919 at gmail.com>:

The Python docs recommends using `.serve_forever()` for running a multiprocessing manager.

The problem is, that unlike any equivalent `.serve_forever()`, this specific one calls `sys.exit()` and exits the program. This in turn may cause issues if that's not the only use of the Python program, as seen here:
https://stackoverflow.com/questions/70284538/overriding-a-built-in-class-method-that-another-class-i-want-to-inherit-from-rel

3 possible solutions:

1. Remove `sys.exit()`: This will cause `shutdown()` to not actually shut down. The function counts on the `.accepter()` daemon thread to close, but if other code is preventing that process from closing, it will continue uninterrupted.

2. Remove `sys.exit()` and check the `stop_event` inside the `.accepter()` daemon thread: This will only partially shut down. The socket will still listen and will only close when the listener receives a command. An option to solve it would be to dispatch a shutdown command, or close the Listener forcibly using `.close()`. All in all, I believe this is the best option.

3. Discourage the use of `serve_forever()`: Right now the way it looks, server is not implemented too well. Its `serve_forever()` function is endorsed by the docs, but the class itself is completely undocumented, with no documentation on any of its functions, and it shuts down the process calling the function when it finishes which is dubious at best. There are plenty more issues scattered around the bug tracker, one of them about its finalization due to the use of daemon threads. Everything can be implemented using start() together with an event. The only reason I don't like this option, is because `serve_forever()` does seem convenient and can be fixed per option 2.

I'll start implementing option 2 in the background, together with adding documentation, but I would enjoy gathering more feedback.

----------
messages: 408090
nosy: bar.harel, davin, pitrou
priority: normal
severity: normal
status: open
title: Multiprocessing.Server.serve_forever runs sys.exit()
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46022>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:23:50 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 09:23:50 +0000
Subject: [issue46023] Modules/makesetup generated rules ignore *disabled*
Message-ID: <1639041830.9.0.701619101169.issue46023@roundup.psfhosted.org>


New submission from Christian Heimes <lists at cheimes.de>:

Modules/Setup can disable a module. However makesetup does not take *disabled* into account when it generated Makefile.

Example:

---Modules/Setup.local

*disabled*
pwd
---

makesetup generates a Makefile with "pwd" in MODDISABLED_NAMES and MODBUILT_NAMES. Because "pwd" is in MODBUILT_NAMES the module is built and included in python binary.

Expected result:
"pwd" module should not be built.

----------
components: Build
messages: 408091
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Modules/makesetup generated rules ignore *disabled*
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46023>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:27:32 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 09:27:32 +0000
Subject: [issue46023] Modules/makesetup generated rules ignore *disabled*
In-Reply-To: <1639041830.9.0.701619101169.issue46023@roundup.psfhosted.org>
Message-ID: <1639042052.11.0.579866742861.issue46023@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
keywords: +patch
pull_requests: +28225
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30001

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46023>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:33:37 2021
From: report at bugs.python.org (Bar Harel)
Date: Thu, 09 Dec 2021 09:33:37 +0000
Subject: [issue46022] Multiprocessing.Server.serve_forever runs sys.exit()
In-Reply-To: <1639041589.61.0.824516720423.issue46022@roundup.psfhosted.org>
Message-ID: <1639042417.76.0.187050348285.issue46022@roundup.psfhosted.org>


Bar Harel <bzvi7919 at gmail.com> added the comment:

Regarding backwards compatibility, the only issue that can arise from solutions 1 or 2, is if someone uses a bare `except` statement for finalization around `serve_forever` instead of using `finally`.

Keep in mind the function is not documented and there is no good solution for the breakage as you're generally not supposed to catch SystemExit either way. We can make a small search for open source usage of `serve_forever` and see if catching SystemExit is a common idiom. Even if it's common, I still believe this breakage is acceptable.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46022>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:36:25 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 09:36:25 +0000
Subject: [issue46021] fcntl module update supports FreeBSD F_KINFO flag
In-Reply-To: <1639041095.56.0.579209436021.issue46021@roundup.psfhosted.org>
Message-ID: <1639042585.47.0.917055909133.issue46021@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Please update the ticket with more information

- What does the flag F_KINFO do?
- Which platforms support the F_KINFO flag?
- link to a man page or platform documentation

A ticket should contain enough information so that a reviewer can understand the purpose of a feature request.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46021>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:37:00 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 09 Dec 2021 09:37:00 +0000
Subject: [issue46020] Optimize long_pow for the common case
In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org>
Message-ID: <1639042620.65.0.398711039534.issue46020@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Hmm, I had just looked at that code and it wasn't at all obvious that an optimization had been added.  I expected something like:

   if (exp==2) return PyNumber_Multiply(x, x);

I wonder where the extra clock cycles are going.  Looking at the ceval.c dispatch and the bodies of PyNumber_Multiply(), _PyNumber_PowerNoMod(), and PyNumber_Power(), it looks like the power dispatch code should be about the same as or slightly cheaper than the multiply dispatch.

I'm surprised there is still almost a two to one speed difference.   ISTM there is still too much overhead for squaring.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46020>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:39:01 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 09:39:01 +0000
Subject: [issue32917] ConfigParser writes a superfluous final blank line
In-Reply-To: <1519349390.35.0.467229070634.issue32917@psf.upfronthosting.co.za>
Message-ID: <1639042741.32.0.200173244033.issue32917@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: patch review -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32917>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:42:03 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 09 Dec 2021 09:42:03 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639042923.75.0.376820695366.issue36048@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

This issue was closed more than 2.5 years ago. The changes were made in 3.8, not in 3.10. BTW, 3.8 only accepts security fixes now. Please open a new issue for new discussion.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:42:35 2021
From: report at bugs.python.org (David CARLIER)
Date: Thu, 09 Dec 2021 09:42:35 +0000
Subject: [issue46021] fcntl module update supports FreeBSD F_KINFO flag
In-Reply-To: <1639041095.56.0.579209436021.issue46021@roundup.psfhosted.org>
Message-ID: <1639042955.82.0.711798605232.issue46021@roundup.psfhosted.org>


David CARLIER <devnexen at gmail.com> added the comment:

- The F_KINFO flag returns the related kinfo_file from the file descriptor.
- While F_KINFO is, at the moment, FreeBSD's specific however other BSD has kinfo_file data as well thus the possibility they support a similar feature (F_KINFO appears only around the 5th of December).
- Does not appear yet on the man page most likely due to its very recent appareance.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46021>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:44:03 2021
From: report at bugs.python.org (David CARLIER)
Date: Thu, 09 Dec 2021 09:44:03 +0000
Subject: [issue46021] fcntl module update supports FreeBSD F_KINFO flag
In-Reply-To: <1639041095.56.0.579209436021.issue46021@roundup.psfhosted.org>
Message-ID: <1639043043.35.0.399993424016.issue46021@roundup.psfhosted.org>


David CARLIER <devnexen at gmail.com> added the comment:

- Got clues mostly from source code and header https://github.com/freebsd/freebsd-src/blob/794d3e8e63f4a6ebc8926030b6c937109ddc5485/sys/sys/fcntl.h#L273

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46021>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:45:02 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 09:45:02 +0000
Subject: [issue38145] Fix short option 'd' in 'distutils' command 'bdist_dumb'
In-Reply-To: <1568313123.54.0.58284352566.issue38145@roundup.psfhosted.org>
Message-ID: <1639043102.82.0.0579856484142.issue38145@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38145>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:46:50 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 09 Dec 2021 09:46:50 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639043210.76.0.169342042747.issue36048@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

For the record, #37999 is the issue that turned the deprecation warnings into errors for Python 3.10. (But as Serhiy says, please open a new issue, or start a discussion on one of the mailing lists.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:48:06 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 09:48:06 +0000
Subject: [issue15082] [httplib] httplib.BadStatusLine on any HTTPS connection
 in certain unknown cases.
In-Reply-To: <1339811528.79.0.0690651710917.issue15082@psf.upfronthosting.co.za>
Message-ID: <1639043286.81.0.912414418882.issue15082@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: test needed -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15082>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:50:28 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 09 Dec 2021 09:50:28 +0000
Subject: [issue46020] Optimize long_pow for the common case
In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org>
Message-ID: <1639043428.06.0.0260325754136.issue46020@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

The situation for floats is also disappointing:

$ python3.11 -m timeit -s 'x=1.1' 'x ** 2'
5000000 loops, best of 5: 60.8 nsec per loop
$ python3.11 -m timeit -s 'x=1.1' 'x ** 2.0'
5000000 loops, best of 5: 51.5 nsec per loop
$ python3.11 -m timeit -s 'x=1.1' 'x * x'
20000000 loops, best of 5: 17.7 nsec per loop

Complex numbers are more balanced.  Surprisingly, some of the complex cases are faster than their float counterparts:

$ python3.11 -m timeit -s 'x=1.1+2.2j' 'x ** 2'
5000000 loops, best of 5: 42.4 nsec per loop
$ python3.11 -m timeit -s 'x=1.1+2.2j' 'x ** 2.0'
5000000 loops, best of 5: 43.3 nsec per loop
$ python3.11 -m timeit -s 'x=1.1+2.2j' 'x ** 2.0j'
2000000 loops, best of 5: 107 nsec per loop
$ python3.11 -m timeit -s 'x=1.1+2.2j' 'x * x'
10000000 loops, best of 5: 30.6 nsec per loop

Decimal still shows a large difference:

$ python3.11 -m timeit -s 'from decimal import Decimal' -s 'x=Decimal("1.1")' 'x ** 2'
1000000 loops, best of 5: 206 nsec per loop
$ python3.11 -m timeit -s 'from decimal import Decimal' -s 'x=Decimal("1.1")' 'x ** Decimal(2)'
1000000 loops, best of 5: 281 nsec per loop
$ python3.11 -m timeit -s 'from decimal import Decimal' -s 'x=Decimal("1.1")' 'x * x'
5000000 loops, best of 5: 60.9 nsec per loop

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46020>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:55:02 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 09:55:02 +0000
Subject: [issue10336] test_xmlrpc fails if gzip is not supported by client
In-Reply-To: <1289041038.52.0.266218953067.issue10336@psf.upfronthosting.co.za>
Message-ID: <1639043702.23.0.567184105372.issue10336@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: test needed -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10336>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:56:20 2021
From: report at bugs.python.org (Bar Harel)
Date: Thu, 09 Dec 2021 09:56:20 +0000
Subject: [issue46022] Multiprocessing.Server.serve_forever runs sys.exit()
In-Reply-To: <1639041589.61.0.824516720423.issue46022@roundup.psfhosted.org>
Message-ID: <1639043780.69.0.138453341623.issue46022@roundup.psfhosted.org>


Change by Bar Harel <bzvi7919 at gmail.com>:


----------
components: +Library (Lib)
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46022>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:56:52 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 09:56:52 +0000
Subject: [issue46021] fcntl module update supports FreeBSD F_KINFO flag
In-Reply-To: <1639041095.56.0.579209436021.issue46021@roundup.psfhosted.org>
Message-ID: <1639043812.5.0.340774831011.issue46021@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

I still have no clue what the flag is doing. Could you please describe the purpose and meaning of kinfo_file so that somebody without FreeBSD Kernel insight can understand it? Much appreciated.

The feature is not available in FreeBSD 13.0. Is it scheduled for 14.0? We typically do not wrap new Kernel or OS features until they are available in stable OS releases.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46021>
_______________________________________

From report at bugs.python.org  Thu Dec  9 04:59:08 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 09:59:08 +0000
Subject: [issue1295179] termios.c in qnx4.25
Message-ID: <1639043948.53.0.0865891453943.issue1295179@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: test needed -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1295179>
_______________________________________

From report at bugs.python.org  Thu Dec  9 05:07:38 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 09 Dec 2021 10:07:38 +0000
Subject: [issue39694] Incorrect dictionary unpacking when calling str.format
In-Reply-To: <1582193003.32.0.513659901276.issue39694@roundup.psfhosted.org>
Message-ID: <1639044458.06.0.786683878784.issue39694@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I disagree, but does not insists if other core developers have other opinion.

This is a special case which breaks the rules. The Python language specification does not support non-string keywords. You cannot implement this "feature" in Python. And it is not compatible with other implementations (PyPy):

>>>> ''.format(**{1:2})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: format() keywords must be strings, not 'int'

It would be understandable to not enforce this limitation if it has significant costs. But in this case it costs almost nothing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39694>
_______________________________________

From report at bugs.python.org  Thu Dec  9 05:07:58 2021
From: report at bugs.python.org (David CARLIER)
Date: Thu, 09 Dec 2021 10:07:58 +0000
Subject: [issue46021] fcntl module update supports FreeBSD F_KINFO flag
In-Reply-To: <1639041095.56.0.579209436021.issue46021@roundup.psfhosted.org>
Message-ID: <1639044478.29.0.632494906167.issue46021@roundup.psfhosted.org>


David CARLIER <devnexen at gmail.com> added the comment:

Ah right then no point then if there is no support for upcoming feature, indeed it s only FreeBSD 14 scheduled next year :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46021>
_______________________________________

From report at bugs.python.org  Thu Dec  9 05:14:42 2021
From: report at bugs.python.org (David CARLIER)
Date: Thu, 09 Dec 2021 10:14:42 +0000
Subject: [issue46021] fcntl module update supports FreeBSD F_KINFO flag
In-Reply-To: <1639041095.56.0.579209436021.issue46021@roundup.psfhosted.org>
Message-ID: <1639044882.77.0.376260160784.issue46021@roundup.psfhosted.org>


David CARLIER <devnexen at gmail.com> added the comment:

- A kinfo_file data holds file information from the kernel's perspective  (like the path or the current offset), more info here https://github.com/freebsd/freebsd-src/blob/main/sys/sys/user.h#L342

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46021>
_______________________________________

From report at bugs.python.org  Thu Dec  9 05:19:15 2021
From: report at bugs.python.org (flvn.dev)
Date: Thu, 09 Dec 2021 10:19:15 +0000
Subject: [issue46024] Different behaviour with zipfile
Message-ID: <1639045155.54.0.671926991121.issue46024@roundup.psfhosted.org>


New submission from flvn.dev <flvn.dev at protonmail.com>:

Given the this directory structure:

```
logs
??? 2020
?  ??? 2020101.zip
|  ??? ...
??? 2021
?  ??? 2021101.zip
|  ??? ...
```

The following piece of code:

```python
from pathlib import Path
from zipfile import Path as ZipPath

for item in Path("logs").iterdir():
    if item.is_dir():
        path = next(item.iterdir())
        print(ZipPath(path).name)

```

gives different results between Python 3.9.7 (empty strings) and 3.10.0 (the zip files name)

----------
messages: 408104
nosy: flvn.dev
priority: normal
severity: normal
status: open
title: Different behaviour with zipfile
type: behavior
versions: Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46024>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:06:51 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 11:06:51 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
In-Reply-To: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>
Message-ID: <1639048011.44.0.395163358159.issue46016@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

GH-29993 broke docs:

python tools/rstlint.py -i tools -i ./venv -i README.rst
[2] whatsnew/3.11.rst:335: default role used
1 problem with severity 2 found.
make: *** [Makefile:216: check] Error 1

----------
nosy: +christian.heimes
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:14:04 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 11:14:04 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
In-Reply-To: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>
Message-ID: <1639048444.1.0.965581641614.issue46016@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
assignee:  -> vstinner
priority: normal -> release blocker

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:17:27 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 11:17:27 +0000
Subject: [issue10048] urllib.request documentation confusing
In-Reply-To: <1286535990.46.0.129844190964.issue10048@psf.upfronthosting.co.za>
Message-ID: <1639048647.21.0.936925869627.issue10048@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: needs patch -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:20:52 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 09 Dec 2021 11:20:52 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
Message-ID: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>


New submission from Pablo Galindo Salgado <pablogsal at gmail.com>:

Issue found by Matt Wozniski:

Running this with python3.10 -X dev segfaults:

import atexit
def func():
    atexit.unregister(func)
    1/0
atexit.register(func)

----------
keywords: 3.10regression, 3.11regression
messages: 408106
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Raising in an atexit function in dev mode crashes
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:22:12 2021
From: report at bugs.python.org (Zac Hatfield-Dodds)
Date: Thu, 09 Dec 2021 11:22:12 +0000
Subject: [issue46026] importlib.resources.read_text() raises FileNotFound
Message-ID: <1639048932.34.0.580414106772.issue46026@roundup.psfhosted.org>


New submission from Zac Hatfield-Dodds <zac.hatfield.dodds at gmail.com>:

Testing Hypothesis with Python 3.11.0a3, I've triggered a frustrating regression in importlib.resources:


# Both work in Python 3.9 and 3.10, but both fail in 3.11.0a3
from importlib.resources import files, read_text
read_text("hypothesis.vendor", "tlds-alpha-by-domain.txt")
files("hypothesis.vendor").joinpath("tlds-alpha-by-domain.txt").read_text()


Traceback (most recent call last):
  ...
  File "example.py", line 4, in <module>
    read_text("hypothesis.vendor", "tlds-alpha-by-domain.txt")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "python3.11/importlib/_legacy.py", line 25, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "python3.11/importlib/_legacy.py", line 67, in read_text
    with open_text(package, resource, encoding, errors) as fp:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "python3.11/importlib/_legacy.py", line 25, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "python3.11/importlib/_legacy.py", line 50, in open_text
    return (_common.files(package) / _common.normalize_path(resource)).open(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "python3.11/importlib/_adapters.py", line 141, in open
    raise FileNotFoundError("Can't open orphan path")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Can't open orphan path


At first I thought this was just a problem with the _legacy shims, but since it also affects the new files() API it might be more serious.

----------
components: Library (Lib)
messages: 408107
nosy: Zac Hatfield-Dodds, barry
priority: normal
severity: normal
status: open
title: importlib.resources.read_text() raises FileNotFound
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46026>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:22:57 2021
From: report at bugs.python.org (Zac Hatfield-Dodds)
Date: Thu, 09 Dec 2021 11:22:57 +0000
Subject: [issue46026] importlib.resources.read_text() raises FileNotFound
In-Reply-To: <1639048932.34.0.580414106772.issue46026@roundup.psfhosted.org>
Message-ID: <1639048977.86.0.23498520067.issue46026@roundup.psfhosted.org>


Change by Zac Hatfield-Dodds <zac.hatfield.dodds at gmail.com>:


----------
nosy: +brett.cannon, jaraco

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46026>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:23:27 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 09 Dec 2021 11:23:27 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
In-Reply-To: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>
Message-ID: <1639049007.16.0.604697021033.issue46025@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:23:59 2021
From: report at bugs.python.org (Zac Hatfield-Dodds)
Date: Thu, 09 Dec 2021 11:23:59 +0000
Subject: [issue46026] importlib.resources.read_text() raises FileNotFound
In-Reply-To: <1639048932.34.0.580414106772.issue46026@roundup.psfhosted.org>
Message-ID: <1639049039.7.0.274950796025.issue46026@roundup.psfhosted.org>


Zac Hatfield-Dodds <zac.hatfield.dodds at gmail.com> added the comment:

This may have appeared in the wild, via the backport, in

https://github.com/Nuitka/Nuitka/issues/1274 and
https://github.com/Nuitka/Nuitka/commit/ffe861cfe972c6bf19f9eea1ff95e35d0e4240b4

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46026>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:36:14 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Thu, 09 Dec 2021 11:36:14 +0000
Subject: [issue45359] TopologicalSorter is not Generic at runtime (but is in
 typeshed)
In-Reply-To: <1633299530.43.0.181161136207.issue45359@roundup.psfhosted.org>
Message-ID: <1639049774.34.0.0412569776741.issue45359@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

The new feature is applied to Python 3.11 only

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45359>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:42:59 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 09 Dec 2021 11:42:59 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
In-Reply-To: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>
Message-ID: <1639050179.12.0.0626085128968.issue46025@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
keywords: +patch
pull_requests: +28226
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30002

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:49:09 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 09 Dec 2021 11:49:09 +0000
Subject: [issue27062] `inspect` doesn't have `__all__`
In-Reply-To: <1463689783.23.0.292900715898.issue27062@psf.upfronthosting.co.za>
Message-ID: <1639050549.04.0.835224887286.issue27062@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 2.0 -> 3.0
pull_requests: +28227
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30003

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27062>
_______________________________________

From report at bugs.python.org  Thu Dec  9 06:53:54 2021
From: report at bugs.python.org (Jacob Hayes)
Date: Thu, 09 Dec 2021 11:53:54 +0000
Subject: [issue45359] TopologicalSorter is not Generic at runtime (but is in
 typeshed)
In-Reply-To: <1633299530.43.0.181161136207.issue45359@roundup.psfhosted.org>
Message-ID: <1639050834.3.0.598214317029.issue45359@roundup.psfhosted.org>


Jacob Hayes <jacob.r.hayes at gmail.com> added the comment:

Thanks for merging!

Should typeshed be updated for <3.11 in the meantime or do you suggest `if TYPE_CHECKING` blocks on user side? Perhaps it's a non-issue if no one else has noticed this. :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45359>
_______________________________________

From report at bugs.python.org  Thu Dec  9 07:17:03 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 12:17:03 +0000
Subject: [issue12142] Reference cycle when importing ctypes
In-Reply-To: <1306017588.73.0.650837416325.issue12142@psf.upfronthosting.co.za>
Message-ID: <1639052223.69.0.309717341157.issue12142@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Looks like the long double issue is still there in 3.11

>>> import gc
>>> gc.set_debug(gc.DEBUG_LEAK)
>>> import ctypes
gc: collectable <function 0x0000026417BBE200>
gc: collectable <tuple 0x0000026417BE0040>
gc: collectable <dict 0x0000026417BC56C0>
gc: collectable <type 0x0000026417AD9840>
gc: collectable <tuple 0x0000026417BD6540>
gc: collectable <getset_descriptor 0x0000026417BD6580>
gc: collectable <getset_descriptor 0x0000026417BD65C0>
gc: collectable <tuple 0x0000026417BE05E0>
gc: collectable <_ctypes.PyCSimpleType 0x0000026417AE4E10>
gc: collectable <tuple 0x0000026417BD96C0>
gc: collectable <getset_descriptor 0x0000026417BE9080>
gc: collectable <getset_descriptor 0x0000026417BE90C0>
gc: collectable <StgDict 0x00000264178A5490>
>>> gc.garbage
[<function _C._m at 0x0000026417BBE200>, (<class 'object'>,), {'__module__': 'types', '_m': <function _C._m at 0x0000026417BBE200>, '__dict__': <attribute '__dict__' of '_C' objects>, '__weakref__': <attribute '__weakref__' of '_C' objects>, '__doc__': None}, <class 'types._C'>, (<class 'types._C'>, <class 'object'>), <attribute '__dict__' of '_C' objects>, <attribute '__weakref__' of '_C' objects>, (<class '_ctypes._SimpleCData'>,), <class 'ctypes.c_longdouble'>, (<class 'ctypes.c_longdouble'>, <class '_ctypes._SimpleCData'>, <class '_ctypes._CData'>, <class 'object'>), <attribute '__dict__' of 'c_longdouble' objects>, <attribute '__weakref__' of 'c_longdouble' objects>, {'__module__': 'ctypes', '_type_': 'g', '__dict__': <attribute '__dict__' of 'c_longdouble' objects>, '__weakref__': <attribute '__weakref__' of 'c_longdouble' objects>, '__doc__': None}]

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12142>
_______________________________________

From report at bugs.python.org  Thu Dec  9 07:20:07 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 12:20:07 +0000
Subject: [issue23104] [Windows x86-64] ctypes: Incorrect function call
In-Reply-To: <1419334423.22.0.551057120801.issue23104@psf.upfronthosting.co.za>
Message-ID: <1639052407.79.0.431009903194.issue23104@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I'm closing as there was no reply to Victor's suggestion and this is 7 years old. Please create a new issue if you are still having a problem with this in a supported python version (>= 3.9).

----------
nosy: +iritkatriel
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23104>
_______________________________________

From report at bugs.python.org  Thu Dec  9 07:43:39 2021
From: report at bugs.python.org (Eryk Sun)
Date: Thu, 09 Dec 2021 12:43:39 +0000
Subject: [issue23104] [Windows x86-64] ctypes: Incorrect function call
In-Reply-To: <1419334423.22.0.551057120801.issue23104@psf.upfronthosting.co.za>
Message-ID: <1639053819.5.0.0997641055691.issue23104@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

Victor's comment wasn't relevant. objid() stays referenced during the call.  Anyway, I just built testlib.c and verified that this ctypes example works correctly in both 64-bit 3.4.4 and 3.10, so the issue is out of date.

----------
nosy: +eryksun
resolution:  -> out of date

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23104>
_______________________________________

From report at bugs.python.org  Thu Dec  9 07:44:09 2021
From: report at bugs.python.org (Eryk Sun)
Date: Thu, 09 Dec 2021 12:44:09 +0000
Subject: [issue23104] [Windows x86-64] ctypes: Incorrect function call
In-Reply-To: <1419334423.22.0.551057120801.issue23104@psf.upfronthosting.co.za>
Message-ID: <1639053849.21.0.113701478404.issue23104@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


----------
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23104>
_______________________________________

From report at bugs.python.org  Thu Dec  9 07:44:06 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Thu, 09 Dec 2021 12:44:06 +0000
Subject: [issue15673] PEP 3121, 384 Refactoring applied to testcapi module
In-Reply-To: <1345042709.67.0.745658134358.issue15673@psf.upfronthosting.co.za>
Message-ID: <1639053846.57.0.34529141758.issue15673@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

The _testcapi modules should stay as it is, ref. msg384272 on bpo-40077:

    Yes, please keep _testcapimodule.c as it is. Static types are still supported and need to be tested.

----------
nosy: +erlendaasland
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15673>
_______________________________________

From report at bugs.python.org  Thu Dec  9 07:56:24 2021
From: report at bugs.python.org (Ken Jin)
Date: Thu, 09 Dec 2021 12:56:24 +0000
Subject: [issue45391] 3.10 objects.inv classifies UnionType as data
In-Reply-To: <1633522850.1.0.516575372895.issue45391@roundup.psfhosted.org>
Message-ID: <1639054584.53.0.540182873993.issue45391@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset e2cfc89e099b8fad5d8d5bd7f59dadffb6078778 by Bern?t G?bor in branch 'main':
bpo-45391: mark UnionType as a class in documentation (GH-28757)
https://github.com/python/cpython/commit/e2cfc89e099b8fad5d8d5bd7f59dadffb6078778


----------
nosy: +kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45391>
_______________________________________

From report at bugs.python.org  Thu Dec  9 07:56:40 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 12:56:40 +0000
Subject: [issue45391] 3.10 objects.inv classifies UnionType as data
In-Reply-To: <1633522850.1.0.516575372895.issue45391@roundup.psfhosted.org>
Message-ID: <1639054600.29.0.475676248005.issue45391@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +28228
pull_request: https://github.com/python/cpython/pull/30004

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45391>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:12:12 2021
From: report at bugs.python.org (Ken Jin)
Date: Thu, 09 Dec 2021 13:12:12 +0000
Subject: [issue46020] Optimize long_pow for the common case
In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org>
Message-ID: <1639055532.68.0.336433919684.issue46020@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:

I'm not sure about the original 10:1 difference in 3.10, but in 3.11, the 2:1 difference might be due to the PEP 659 machinery optimizing for int * int, and float * float cases (see BINARY_OP_MULTIPLY_INT and BINARY_OP_MULTIPLY_FLOAT in ceval).

Last I recall, these were slightly faster than their unspecialized counterparts as they have less overhead in C function calls. Meanwhile, none of the power operations are optimized via PEP 659 machinery at the moment.

----------
nosy: +kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46020>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:14:49 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Thu, 09 Dec 2021 13:14:49 +0000
Subject: [issue45359] TopologicalSorter is not Generic at runtime (but is in
 typeshed)
In-Reply-To: <1633299530.43.0.181161136207.issue45359@roundup.psfhosted.org>
Message-ID: <1639055689.16.0.0964611538744.issue45359@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

`if TYPE_CHECKING:` is a good choice, it works fine just now.
`from __future__ import annotations` is another alternative.

I don't see a reason for REMOVING already existing and correct annotations from typeshed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45359>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:16:49 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 09 Dec 2021 13:16:49 +0000
Subject: [issue25066] Better repr for multiprocessing.synchronize objects
In-Reply-To: <1441945512.28.0.268911334925.issue25066@psf.upfronthosting.co.za>
Message-ID: <1639055809.68.0.611096907817.issue25066@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset af6b4068859a5d0c8afd696f3c0c0155660211a4 by Kumar Aditya in branch 'main':
bpo-25066: Added repr for multiprocessing.Event (GH-29749)
https://github.com/python/cpython/commit/af6b4068859a5d0c8afd696f3c0c0155660211a4


----------
nosy: +pablogsal

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25066>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:17:44 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 13:17:44 +0000
Subject: [issue45391] 3.10 objects.inv classifies UnionType as data
In-Reply-To: <1633522850.1.0.516575372895.issue45391@roundup.psfhosted.org>
Message-ID: <1639055864.58.0.972354321711.issue45391@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 2c2ee83c4db4dbd54017dc364bbefc70fa75ea5d by Miss Islington (bot) in branch '3.10':
bpo-45391: mark UnionType as a class in documentation (GH-28757)
https://github.com/python/cpython/commit/2c2ee83c4db4dbd54017dc364bbefc70fa75ea5d


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45391>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:22:02 2021
From: report at bugs.python.org (Ken Jin)
Date: Thu, 09 Dec 2021 13:22:02 +0000
Subject: [issue45391] 3.10 objects.inv classifies many types as data
In-Reply-To: <1633522850.1.0.516575372895.issue45391@roundup.psfhosted.org>
Message-ID: <1639056122.38.0.879488842102.issue45391@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:

As a start, I merged the types.UnionType fix because it's straightforward, but the rest are a little dubious so I'll leave this issue open for now.

----------
title: 3.10 objects.inv classifies UnionType as data -> 3.10 objects.inv classifies many types as data

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45391>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:37:57 2021
From: report at bugs.python.org (Eryk Sun)
Date: Thu, 09 Dec 2021 13:37:57 +0000
Subject: [issue12142] Reference cycle when importing ctypes
In-Reply-To: <1306017588.73.0.650837416325.issue12142@psf.upfronthosting.co.za>
Message-ID: <1639057077.71.0.934547041652.issue12142@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

The _ctypes extension module could have a dict that maps each format code to its (size, alignment), based on `formattable`. Then direct size comparisons wouldn't be limited to types defined by the struct module, and it wouldn't be necessary to create c_longdouble just to check its size and throw it away.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12142>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:38:48 2021
From: report at bugs.python.org (Gabriele N Tornetta)
Date: Thu, 09 Dec 2021 13:38:48 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639057128.52.0.964175073948.issue32683@roundup.psfhosted.org>


Gabriele N Tornetta <phoenix1987 at gmail.com> added the comment:

The following example shows isinstance causing a side effect


class Side:

    class Effect(Exception):
        pass

    def __getattribute__(self, name):
        raise Side.Effect()


isinstance(Side(), str)


I'd be inclined to see this as a bug as I wouldn't expect isinstance to cause any side effects.

----------
nosy: +Gabriele Tornetta

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:53:54 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 09 Dec 2021 13:53:54 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
In-Reply-To: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>
Message-ID: <1639058034.9.0.435977363525.issue46025@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset f0d290d25cad66e615ada68ba190b8a23ac1deaa by Pablo Galindo Salgado in branch 'main':
bpo-46025: Fix a crash in the atexit module for auto-unregistering functions (GH-30002)
https://github.com/python/cpython/commit/f0d290d25cad66e615ada68ba190b8a23ac1deaa


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:53:57 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 13:53:57 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
In-Reply-To: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>
Message-ID: <1639058037.53.0.090857058078.issue46025@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +28229
pull_request: https://github.com/python/cpython/pull/30005

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 08:54:47 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 13:54:47 +0000
Subject: [issue28276] test_loading.py - false positive result for "def
 test_find" when find_library() is not functional or the (shared) library does
 not exist
In-Reply-To: <1474887883.6.0.275550575314.issue28276@psf.upfronthosting.co.za>
Message-ID: <1639058087.46.0.778823790732.issue28276@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28276>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:04:11 2021
From: report at bugs.python.org (Douglas Wright)
Date: Thu, 09 Dec 2021 14:04:11 +0000
Subject: [issue45999] Links to packaging broken
In-Reply-To: <1638806103.81.0.408526409699.issue45999@roundup.psfhosted.org>
Message-ID: <1639058651.35.0.972833160294.issue45999@roundup.psfhosted.org>


Douglas Wright <douglas277 at gmail.com> added the comment:

The links are working now.

I recall that all of the links in that section pointed to different URLs on 3.9 and newer than they did on 3.8.  On 3.9 and newer, you would land on "page not found" on readthedocs.org.

They all seem to match up now though.

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45999>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:04:59 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Thu, 09 Dec 2021 14:04:59 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639058699.07.0.804214455151.issue46006@roundup.psfhosted.org>


Dong-hee Na <donghee.na at python.org> added the comment:

> If two strings are interned and part of the same interpreter, the "ptr1 == ptr2" comparison continues to work.

Yeah, AFAIK Comparing two interned strings from different interpreters are not the available use-case.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:19:35 2021
From: report at bugs.python.org (Ned Deily)
Date: Thu, 09 Dec 2021 14:19:35 +0000
Subject: [issue45999] Links to packaging broken
In-Reply-To: <1638806103.81.0.408526409699.issue45999@roundup.psfhosted.org>
Message-ID: <1639059575.08.0.160184952422.issue45999@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45999>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:23:17 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 09 Dec 2021 14:23:17 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
In-Reply-To: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>
Message-ID: <1639059797.94.0.234374320414.issue46016@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 4.0 -> 5.0
pull_requests: +28230
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30006

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:24:42 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 14:24:42 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
In-Reply-To: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>
Message-ID: <1639059882.53.0.536524738413.issue46016@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset b123ad8030a4ad15c8dbb7cb3638caf625943878 by Kumar Aditya in branch 'main':
bpo-46016: Fix rest syntax of GH-29993 (GH-30006)
https://github.com/python/cpython/commit/b123ad8030a4ad15c8dbb7cb3638caf625943878


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:27:19 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 14:27:19 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
In-Reply-To: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>
Message-ID: <1639060039.88.0.454821370295.issue46016@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
priority: release blocker -> normal
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:33:36 2021
From: report at bugs.python.org (Charles Coulombe)
Date: Thu, 09 Dec 2021 14:33:36 +0000
Subject: [issue21042] ctypes.util.find_library() should return full pathname
 instead of filename in linux
In-Reply-To: <1395614835.79.0.900137034576.issue21042@psf.upfronthosting.co.za>
Message-ID: <1639060416.74.0.233595551518.issue21042@roundup.psfhosted.org>


Charles Coulombe <charles.coulombe at calculquebec.ca> added the comment:

Any update on this issue? 

This would be helpful to HPC systems that don't have libraries installed in standard place, and to standardize find_library as well!

----------
nosy: +Charles Coulombe
versions:  -Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21042>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:34:26 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Thu, 09 Dec 2021 14:34:26 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639060466.06.0.0890010719351.issue32683@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

I'd be inclined to see this as a bug in your code, if you are causing side-effects from `__getattribute__`. If you don't want attribute access to cause side-effects, then don't put code in `__getattribute__` that causes side-effects :-)

isinstance has to check the object's `__class__`, if it has one. To do that it has to look at obj.__class__, which your class intercepts using `__getattribute__` and causes a side-effect.

Overloading `__getattribute__` is perilous, because it intercepts *all* instance attribute lookups. In my opinion, one should (almost?) never overload the `__getattribute__` method, it is safer to overload `__getattr__`.

In any case, I don't think there is anything to fix here. Dan has not responded since his initial bug report nearly four years ago, so I'm inclined to close this as "Not A Bug". Unless somebody gives a more convincing reason why the current behaviour is wrong, I think we should close it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:38:09 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 14:38:09 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1639060689.42.0.681577114427.issue45635@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset dc4a212bd305831cb4b187a2e0cc82666fcb15ca by Irit Katriel in branch 'main':
bpo-45635: continue refactor of print_exception() to standardize error handling (GH-29996)
https://github.com/python/cpython/commit/dc4a212bd305831cb4b187a2e0cc82666fcb15ca


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Thu Dec  9 09:58:06 2021
From: report at bugs.python.org (R. David Murray)
Date: Thu, 09 Dec 2021 14:58:06 +0000
Subject: [issue46011] Python 3.10 email returns invalid Date: header unchanged.
In-Reply-To: <1638937977.72.0.569168452456.issue46011@roundup.psfhosted.org>
Message-ID: <1639061886.63.0.383883808421.issue46011@roundup.psfhosted.org>


R. David Murray <rdmurray at bitdance.com> added the comment:

Yeah, I think there may be a general issue with getting header defects reflected somehow in message.defects, but that's a separate issue :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46011>
_______________________________________

From report at bugs.python.org  Thu Dec  9 10:02:37 2021
From: report at bugs.python.org (Gabriele N Tornetta)
Date: Thu, 09 Dec 2021 15:02:37 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639062157.18.0.257697415684.issue32683@roundup.psfhosted.org>


Gabriele N Tornetta <phoenix1987 at gmail.com> added the comment:

I think the issue on display here is that isinstance could cause a side effect, which I dare say it's unexpected (and not documented AFAIK). Are there any reasons why __class__ cannot be retrieved with object.__getattribute__ instead? In fact, considering that __getattribute__ could be overridden, this would be the right thing to do imho, else isinstance would break spectacularly, like in my previous example.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 10:08:54 2021
From: report at bugs.python.org (Dave Shawley)
Date: Thu, 09 Dec 2021 15:08:54 +0000
Subject: [issue43112] SOABI on Linux does not distinguish between GNU libc and
 musl libc
In-Reply-To: <1612344373.45.0.663786135841.issue43112@roundup.psfhosted.org>
Message-ID: <1639062534.72.0.0694456095835.issue43112@roundup.psfhosted.org>


Change by Dave Shawley <daveshawley at gmail.com>:


----------
nosy: +dave-shawley

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43112>
_______________________________________

From report at bugs.python.org  Thu Dec  9 10:14:16 2021
From: report at bugs.python.org (hongweipeng)
Date: Thu, 09 Dec 2021 15:14:16 +0000
Subject: [issue42943] singledispatchmethod should expose registry of all known
 overloads
In-Reply-To: <1610833579.12.0.993134178442.issue42943@roundup.psfhosted.org>
Message-ID: <1639062856.58.0.0686319669469.issue42943@roundup.psfhosted.org>


Change by hongweipeng <hongweichen8888 at sina.com>:


----------
keywords: +patch
nosy: +hongweipeng
nosy_count: 5.0 -> 6.0
pull_requests: +28231
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30007

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42943>
_______________________________________

From report at bugs.python.org  Thu Dec  9 10:15:34 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 09 Dec 2021 15:15:34 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
In-Reply-To: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>
Message-ID: <1639062934.31.0.624050364088.issue46025@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 10:16:19 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 09 Dec 2021 15:16:19 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
In-Reply-To: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>
Message-ID: <1639062979.89.0.688884102344.issue46025@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset 934a24c641da5bc4bdb724e901adc20f9a5dff40 by Miss Islington (bot) in branch '3.10':
bpo-46025: Fix a crash in the atexit module for auto-unregistering functions (GH-30002) (GH-30005)
https://github.com/python/cpython/commit/934a24c641da5bc4bdb724e901adc20f9a5dff40


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 10:34:56 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Thu, 09 Dec 2021 15:34:56 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1639062157.18.0.257697415684.issue32683@roundup.psfhosted.org>
Message-ID: <20211209153221.GP21647@ando.pearwood.info>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

If you don't want to customise attribute access, don't overload 
`__getattribute__`. The documentation for `__getattribute__` is clear 
about what it does:

"Called unconditionally to implement attribute accesses for instances of 
the class."

https://docs.python.org/3/reference/datamodel.html#object.__getattribute__

That includes lookups for `__class__`, regardless of whether the 
function doing the lookup is isinstance or some other function.

You ask:

"Are there any reasons why __class__ cannot be retrieved with
object.__getattribute__ instead?"

Yes, that would ignore overloaded attribute access, which would be a 
bug in my opinion.

Being able to dynamically generate computed attributes by overloading 
`__getattr__` and `__getattribute__` is not a bug. It is part of 
Python's data model. See the documentation above.

And that includes `__class__`.

I don't believe that it is an accident or a bug that isinstance uses 
ordinary attribute lookup, which goes through the standard mechanism 
including the class' own `__getattribute__` method. But I will ask on 
the Python-Dev mailing list in case Guido or other core developers think 
that it is wrong to do so.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 10:45:22 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 09 Dec 2021 15:45:22 +0000
Subject: [issue45949] Provide pure-Python implementation of
 Programs/_freeze_module for cross building
In-Reply-To: <1638372868.47.0.982140813893.issue45949@roundup.psfhosted.org>
Message-ID: <1639064722.09.0.631962181063.issue45949@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Eric, could you review my PR, please? It simplifies cross building to other platforms.

I took a look at Tools/freeze/freeze.py. The freeze tool creates different output than Program/_freeze_module.c.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________

From report at bugs.python.org  Thu Dec  9 10:59:22 2021
From: report at bugs.python.org (Paul Moore)
Date: Thu, 09 Dec 2021 15:59:22 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639065562.72.0.786888947874.issue32683@roundup.psfhosted.org>


Paul Moore <p.f.moore at gmail.com> added the comment:

I tend to agree with Steven and David here. You define __getattribute__ and so that's the behaviour you get when an attribute of the class is requested (whether by the system or by your code). The documentation (here: https://docs.python.org/3/reference/datamodel.html#object.__getattribute__) seems to support this view as well.

Do you have a real-world example of code that is broken by this behaviour, or is this just a theoretical problem? Is it particularly hard to make the code work the way you want it to with the current behaviour? For example,

    # Don't intercept __class__
    if attr == "__class__":
        return object.__getattribute__(self, attr)

----------
nosy: +paul.moore

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 11:18:41 2021
From: report at bugs.python.org (Gabriele N Tornetta)
Date: Thu, 09 Dec 2021 16:18:41 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639066721.22.0.721643276169.issue32683@roundup.psfhosted.org>


Gabriele N Tornetta <phoenix1987 at gmail.com> added the comment:

> I tend to agree with Steven and David here. You define __getattribute__ and so that's the behaviour you get when an attribute of the class is requested (whether by the system or by your code).

I would agree if it was obvious or explicitly stated that isinstance looks up __class__ using the object's __getattribute__, and thus prone to cause side-effects. It wasn't obvious to me that isinstance would access any attributes from the object, but that it would rather get the object's type in a more direct way (at the C level for CPython).

> Do you have a real-world example of code that is broken by this behaviour, or is this just a theoretical problem?

I was looking at some profiling data for a real-life project (observability) that I'm working on. I was using a simple Django application as a target and noticed calls to a __getattribute__ (implemented by a Django class) that I wasn't expecting. All my code was doing was to check that a certain object was not of "callable" type using isinstance. Whilst I believe no side effects were caused by this particular instance of __getattribute__, it should be noted that "Django" is a variable here: any other target framework or library might have caused side effects in theory. The code that I want to execute must have guarantees of being side-effects-free, so using isinstance does not give me that. Currently, I have worked around this by using a custom, pure Python implementation of isinstance that gets __mro__  (via object.__getattribute__) and checks that type(obj) is an element of it (plus caching, for performance reasons).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 11:28:06 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 09 Dec 2021 16:28:06 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
In-Reply-To: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>
Message-ID: <1639067286.3.0.0209864866784.issue46016@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
pull_requests: +28232
pull_request: https://github.com/python/cpython/pull/30009

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Thu Dec  9 11:37:56 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 09 Dec 2021 16:37:56 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639067876.07.0.133539744076.issue46018@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

I considered just switching to <2.0, but wasn't sure if I would be breaking some other unspoken behaviour there. But you're right, it's really just detecting underflow vs. overflow, so that's a much simpler way to check.

I've filed the upstream report. I suspect the errno is coming from the exp() call within the expm1() implementation, so it's underflowing towards 0.0 and then subtracting 1.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 11:41:28 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Thu, 09 Dec 2021 16:41:28 +0000
Subject: [issue46024] Different behaviour with zipfile
In-Reply-To: <1639045155.54.0.671926991121.issue46024@roundup.psfhosted.org>
Message-ID: <1639068088.94.0.0268671939783.issue46024@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

What does "path" (the input to ZipPath) look like?

Please change your print statement to:
print(repr(path), ZipPath(path).name)

Then send us the output from each version of python.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46024>
_______________________________________

From report at bugs.python.org  Thu Dec  9 11:46:38 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 09 Dec 2021 16:46:38 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639068398.59.0.412321002255.issue46018@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

I've also got no idea how to write a test for this, given that it's a very thin wrapper around a platform's C runtime library. Our existing test discovered when the library changed behaviour to start setting errno, which is probably the best we can do.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 11:51:17 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Thu, 09 Dec 2021 16:51:17 +0000
Subject: [issue45654] Freeze the runpy module.
In-Reply-To: <1635444830.43.0.574749380857.issue45654@roundup.psfhosted.org>
Message-ID: <1639068677.2.0.854807237051.issue45654@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:


New changeset 44b0e76f2a80c9a78242b7542b8b1218d244af07 by Kumar Aditya in branch 'main':
bpo-45654: Freeze the runpy module and stuff it imports (GH-29903)
https://github.com/python/cpython/commit/44b0e76f2a80c9a78242b7542b8b1218d244af07


----------
nosy: +gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45654>
_______________________________________

From report at bugs.python.org  Thu Dec  9 11:52:22 2021
From: report at bugs.python.org (Ethan Furman)
Date: Thu, 09 Dec 2021 16:52:22 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639068742.13.0.876096878607.issue32683@roundup.psfhosted.org>


Ethan Furman <ethan at stoneleaf.us> added the comment:

$ python3
Python 3.8.10 (default, Sep 28 2021, 16:10:42) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> object
<class 'object'>

>>> import builtins
>>> builtins.object
<class 'object'>

>>> builtins.object = int
>>> object
<class 'int'>


Python is very much a language about responsibility.  If Django is overriding `__getattribute__` then it is their responsibility to ensure that everything still works properly.  If something doesn't, we file a bug report and/or implement a work-around.

As for side-effect free -- I'm not sure than anything in Python is guaranteed to be side-effect free, except maybe `is`.

There is no bug here, everything is working as intended.

----------
nosy: +ethan.furman

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 11:55:11 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Thu, 09 Dec 2021 16:55:11 +0000
Subject: [issue45654] Freeze the runpy module.
In-Reply-To: <1635444830.43.0.574749380857.issue45654@roundup.psfhosted.org>
Message-ID: <1639068911.81.0.915492633117.issue45654@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Thanks Kumar!

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45654>
_______________________________________

From report at bugs.python.org  Thu Dec  9 12:01:17 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 09 Dec 2021 17:01:17 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
In-Reply-To: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>
Message-ID: <1639069277.52.0.013002144372.issue46025@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Interesting bug report! Thanks for the fix ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 12:03:09 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 09 Dec 2021 17:03:09 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
In-Reply-To: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>
Message-ID: <1639069389.08.0.94374009748.issue46025@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

For me, the question is why would anyone call atexit.unregister() inside an atexit callback. Is it useful?

atexit._run_exitfuncs() removes all registered callbacks.

Py_Finalize() calls _PyAtExit_Call() which also removes all registered callbacks.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 12:04:32 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 09 Dec 2021 17:04:32 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639069472.52.0.822458782345.issue46018@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> I've also got no idea how to write a test for this

Yep, that's fine. All I want is that at least one particular value that caused the spurious OverflowError is in the test suite somewhere, but it sounds as though that's already the case. I'd imagine that one of these two testcases should be enough to trigger it:

https://github.com/python/cpython/blob/44b0e76f2a80c9a78242b7542b8b1218d244af07/Lib/test/math_testcases.txt#L495-L496

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 12:05:26 2021
From: report at bugs.python.org (Calin Culianu)
Date: Thu, 09 Dec 2021 17:05:26 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639069526.13.0.173222082528.issue36048@roundup.psfhosted.org>


Calin Culianu <calin.culianu at gmail.com> added the comment:

Hi, I'm cculianu, the reporting user.

May I get a link or some background for the motivation for this change? It seems to me that there are vague allusions to "Decimal -> int cause problems in past", or some such, and I'd like to read the arguments presented as to what problems in particular, and how this change fixes those problems.

Mathematically, and by convention in computer science, conversions from float-like types -> int are always well defined.  It seems strangely un-Pythonic to restrict things in such a way.  I am very surprised by this change, quite frankly.  It's the wrong direction to go in, for this language, is my intuitive feeling.

Anyway, very curious about what the rationale was for this. Thanks.

----------
nosy: +calin.culianu

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 12:06:29 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 09 Dec 2021 17:06:29 +0000
Subject: [issue46025] Raising in an atexit function in dev mode crashes
In-Reply-To: <1639048852.81.0.201272717703.issue46025@roundup.psfhosted.org>
Message-ID: <1639069589.89.0.313013608679.issue46025@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

>For me, the question is why would anyone call atexit.unregister() inside an atexit callback. Is it useful?

Is not useful, is just an edge case

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46025>
_______________________________________

From report at bugs.python.org  Thu Dec  9 12:14:04 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 09 Dec 2021 17:14:04 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639070044.2.0.319680616642.issue46018@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

Lines 500-504 are the ones that trigger it. Apparently there are no tests in that file for straight exp(), but the equivalent tests for those would return 0.0 and suppress ERANGE too.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:12:26 2021
From: report at bugs.python.org (Fred Drake)
Date: Thu, 09 Dec 2021 18:12:26 +0000
Subject: [issue46027] email.utils.parsedate_to_datetime() handling of -0000
 offset
Message-ID: <1639073545.99.0.633545342091.issue46027@roundup.psfhosted.org>


New submission from Fred Drake <fdrake at gmail.com>:

A local time offset of '-0000' is not handled the same way as an offset of '+0000', but I'd expect it would be:

>>> import email.utils
>>> 
>>> email.utils.parsedate_to_datetime('9 Dec 2021 08:52:04 -0000')
datetime.datetime(2021, 12, 9, 8, 52, 4)
>>> email.utils.parsedate_to_datetime('9 Dec 2021 08:52:04 +0000')
datetime.datetime(2021, 12, 9, 8, 52, 4, tzinfo=datetime.timezone.utc)

I observe the same behavior on Python 3.9.9 and 3.10.1.

----------
components: email
messages: 408149
nosy: barry, fdrake, r.david.murray
priority: normal
severity: normal
status: open
title: email.utils.parsedate_to_datetime() handling of -0000 offset
type: behavior
versions: Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46027>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:21:24 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 09 Dec 2021 18:21:24 +0000
Subject: [issue44525] Implement CALL_FUNCTION adaptive interpreter
 optimizations
In-Reply-To: <1624890138.2.0.824780513801.issue44525@roundup.psfhosted.org>
Message-ID: <1639074083.99.0.414134956107.issue44525@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
pull_requests: +28233
pull_request: https://github.com/python/cpython/pull/30011

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44525>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:25:58 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 09 Dec 2021 18:25:58 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639074358.36.0.652397068377.issue36048@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

See issue660144 which made float values be rejected in most cases where an integer is expected rather of silently truncating them. It was at 2003. Guido mentioned that is an age-old problem, so perhaps you can find older discussions on the tracker or mailing lists.

It was a partial solution. It caught unexpected floats, but not other non-integer numbers. Later, the __index__ special method was introduced specially to distinguish objects which can be implicitly converted to integer from these which can be explicitly converted to integer. And finally we fixed that age-old problem.

If you have other questions, please ask them on mailing lists, forums or other resources.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:30:35 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 09 Dec 2021 18:30:35 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639074635.57.0.923215939158.issue46018@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Lines 500-504 are the ones that trigger it.

Ah, right. Thanks.

> Apparently there are no tests in that file for straight exp()

Yes - that file was mostly written to give good coverage for places where we'd written our own implementations rather than simply wrapping an existing libm function, though I think we've now reverted to using the libm expm1 in all cases.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:32:08 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 18:32:08 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639074728.67.0.245753213926.issue46018@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +28234
pull_request: https://github.com/python/cpython/pull/30012

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:32:13 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 18:32:13 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639074733.32.0.973487115158.issue46018@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington, miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +28234, 28235
pull_request: https://github.com/python/cpython/pull/30012

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:32:13 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 18:32:13 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639074733.49.0.664986034226.issue46018@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington, miss-islington, miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +28234, 28235, 28236
pull_request: https://github.com/python/cpython/pull/30012

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:32:15 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 18:32:15 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639074735.71.0.191018516375.issue46018@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28237
pull_request: https://github.com/python/cpython/pull/30013

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:32:03 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 09 Dec 2021 18:32:03 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639074723.49.0.757389726626.issue46018@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset 3363e1cb05d0d19ed172ea63606d8cb6268747fc by Steve Dower in branch 'main':
bpo-46018: Ensure that math.expm1 does not raise on underflow (GH-29997)
https://github.com/python/cpython/commit/3363e1cb05d0d19ed172ea63606d8cb6268747fc


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:32:24 2021
From: report at bugs.python.org (neonene)
Date: Thu, 09 Dec 2021 18:32:24 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1639074744.71.0.407609710739.issue45582@roundup.psfhosted.org>


Change by neonene <nicesalmon at gmail.com>:


----------
pull_requests: +28238
pull_request: https://github.com/python/cpython/pull/30014

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:45:23 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 18:45:23 +0000
Subject: [issue27315] pydoc: prefer the pager command in favor of the specifc
 less command
In-Reply-To: <1465885673.67.0.270326980861.issue27315@psf.upfronthosting.co.za>
Message-ID: <1639075523.52.0.31239980776.issue27315@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
type:  -> enhancement
versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27315>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:48:37 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 18:48:37 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1639075717.91.0.874293879172.issue45635@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28239
pull_request: https://github.com/python/cpython/pull/30015

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:51:59 2021
From: report at bugs.python.org (Calin Culianu)
Date: Thu, 09 Dec 2021 18:51:59 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639075919.64.0.665666609967.issue36048@roundup.psfhosted.org>


Calin Culianu <calin.culianu at gmail.com> added the comment:

Ok, well I found this in that issue you linked to:

This is the original "problem":

```
type __mul__ is wierd:

>> 'a'.__mul__(3.4)
'aaa'
>>> [1].__mul__(3.4)
[1, 1, 1]
```

And this is Guido's response:

> The problem is that on the one hand you want "i" to accept
other int-ish types that have an __int__ method. But on the
other hand you don't want it to accept float, which also has
an __int__ method. Or other float-ish types.

--- 

You have to understand -- I don't see a problem here!

Not once is there any discussion as to *why* this is really a problem. So what? Your float gets truncated and treated as an int.  So?

If you are calling into a C api -- why is this a problem exactly when **in the C Language itself** by convention and by compiler rules anyway -- this is **perfectly ok**.

Restricting Python in this way -- why? What is the benefit? What problem is being solved? I did all the digging in the world here and cannot at all discern what, exactly, is being solved at all.  It seems like some bizarre aesthetic thing, at best.  Sorry.. maybe I am wrong.  Please point me to where the real problem is... 

Again, I reiterate **mathematically**, by convention in computer science, the conversion from float -> int is well defined.  Moreover, you have the legacy __int__ method already that *can define it* for specific types. And Python has worked this way since the age of the dinosaurs (2002!!).

So.. in python this conversion is well defined. And has always been, by __int__.

I think the introduction of __index__ versus __int__ may be a mistake, especially if it is designed to "solve" just this problem -- which as yet, has to be clearly argued for as to **why** it's a problem!

This boggles my mind, guys. I.. am speechless.  Please tell me I'm wrong. To me it seems you guys imagined a problem that doesn't exist, then "solved" it with extra API stuff, and the actual end result was -- real-world problems created ex-nihilo for real-world programs, manifesting themselves finally in 2021.

You have to understand that .. to me as a C++ programmer.. I see no problem. I just see Python all of a sudden becoming less nice.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 13:56:04 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 18:56:04 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639076164.03.0.811573716755.issue46018@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 5ae4265b8c8042c496e569b6dbf9ef107e1d5b31 by Miss Islington (bot) in branch '3.9':
bpo-46018: Ensure that math.expm1 does not raise on underflow (GH-29997)
https://github.com/python/cpython/commit/5ae4265b8c8042c496e569b6dbf9ef107e1d5b31


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 14:16:56 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 09 Dec 2021 19:16:56 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639077416.1.0.888163430848.issue46018@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 14:32:05 2021
From: report at bugs.python.org (Ronny Pfannschmidt)
Date: Thu, 09 Dec 2021 19:32:05 +0000
Subject: [issue14965] super() and property inheritance behavior
In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za>
Message-ID: <1639078325.46.0.527941669106.issue14965@roundup.psfhosted.org>


Ronny Pfannschmidt <bugs.python.org at ronnypfannschmidt.de> added the comment:

im on the noisy list because i  faced this first in 2012

a key problem where i ran into this was mixins, - depending on whether a mixin was added or not one would get errors or not

from  my pov a super object should look like the "next class"

so properties of the next base should behave as such, special methods as well

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14965>
_______________________________________

From report at bugs.python.org  Thu Dec  9 14:34:00 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Thu, 09 Dec 2021 19:34:00 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639078440.55.0.0321461653557.issue36048@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Claim, you need to tone down the rhetoric. Python is not C++ and user expectations are different. You are the one who is fighting windmills here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 14:37:18 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 09 Dec 2021 19:37:18 +0000
Subject: [issue46018] expm1 may incorrectly raise OverflowError on underflow
In-Reply-To: <1639010636.16.0.465988709351.issue46018@roundup.psfhosted.org>
Message-ID: <1639078638.08.0.424113888794.issue46018@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset ca08655b808aed2e3abeb64cb67d98a79a661dda by Miss Islington (bot) in branch '3.10':
bpo-46018: Ensure that math.expm1 does not raise on underflow (GH-29997)
https://github.com/python/cpython/commit/ca08655b808aed2e3abeb64cb67d98a79a661dda


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46018>
_______________________________________

From report at bugs.python.org  Thu Dec  9 14:59:37 2021
From: report at bugs.python.org (Eric Snow)
Date: Thu, 09 Dec 2021 19:59:37 +0000
Subject: [issue46008] Prepare runtime/interp/thread state and init for
 upcoming changes.
In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org>
Message-ID: <1639079977.48.0.917639733985.issue46008@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:


New changeset c8749b578324ad4089c8d014d9136bc42b065343 by Eric Snow in branch 'main':
bpo-46008: Make runtime-global object/type lifecycle functions and state consistent. (gh-29998)
https://github.com/python/cpython/commit/c8749b578324ad4089c8d014d9136bc42b065343


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46008>
_______________________________________

From report at bugs.python.org  Thu Dec  9 15:32:01 2021
From: report at bugs.python.org (Calin Culianu)
Date: Thu, 09 Dec 2021 20:32:01 +0000
Subject: [issue36048] Deprecate implicit truncating when convert Python
 numbers to C integers: use __index__, not __int__
In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org>
Message-ID: <1639081921.24.0.900912154216.issue36048@roundup.psfhosted.org>


Calin Culianu <calin.culianu at gmail.com> added the comment:

Ok, Guido, thanks. Fair enough.

So regardless: what is the problem exactly if a C function expects an int but gets given a float? Why does such strictness matter, in that it required a whole other set of __index__ etc to be added?  I am having trouble seeing the actual problem, which was taken as a given in all the archaeology I have done on this ancient "issue" -- but is it a given?  There is no problem... only the one created by this change, really.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36048>
_______________________________________

From report at bugs.python.org  Thu Dec  9 16:45:16 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 21:45:16 +0000
Subject: [issue12038] assertEqual doesn't display newline differences quite
 well
In-Reply-To: <1304959012.21.0.957539258305.issue12038@psf.upfronthosting.co.za>
Message-ID: <1639086316.1.0.589229532189.issue12038@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12038>
_______________________________________

From report at bugs.python.org  Thu Dec  9 17:10:24 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 22:10:24 +0000
Subject: [issue20420] BufferedIncrementalEncoder violates IncrementalEncoder
 interface
In-Reply-To: <1390926885.67.0.351173619746.issue20420@psf.upfronthosting.co.za>
Message-ID: <1639087824.94.0.717581862241.issue20420@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
components: +Library (Lib)
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20420>
_______________________________________

From report at bugs.python.org  Thu Dec  9 17:33:03 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Thu, 09 Dec 2021 22:33:03 +0000
Subject: [issue45774] Detect SQLite in configure.ac
In-Reply-To: <1636496806.29.0.76332999648.issue45774@roundup.psfhosted.org>
Message-ID: <1639089183.3.0.361287910414.issue45774@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

Reopening: the current detection is a little bit weak; many SQLite API's may be disabled at SQLite compile time using SQLITE_OMIT_* defines. We must make sure we've got all vital functions in place before marking the sqlite3 module as present and usable.

The following API's can be omitted using compile time defines:

- sqlite3_column_decltype (SQLITE_OMIT_DECLTYPE)
- sqlite3_complete (SQLITE_OMIT_COMPLETE)
- sqlite3_enable_shared_cache (SQLITE_OMIT_SHARED_CACHE)
- sqlite3_progress_handler (SQLITE_OMIT_PROGRESS_CALLBACK)
- sqlite3_set_authorizer (SQLITE_OMIT_AUTHORIZATION)
- sqlite3_trace_v2 (SQLITE_OMIT_TRACE)
- sqlite3_trace (SQLITE_OMIT_TRACE, SQLITE_OMIT_DEPRECATED)


The following API's _may_ be disabled in the future using SQLITE_OMIT_FLOATING_POINT:

- sqlite3_bind_double
- sqlite3_column_double
- sqlite3_result_double
- sqlite3_value_double

----------
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45774>
_______________________________________

From report at bugs.python.org  Thu Dec  9 17:36:18 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 22:36:18 +0000
Subject: [issue26159] Unsafe to BaseEventLoop.set_debug(False) when
 PYTHONASYNCIODEBUG=1
In-Reply-To: <1453220098.77.0.244617474798.issue26159@psf.upfronthosting.co.za>
Message-ID: <1639089378.58.0.667009867184.issue26159@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

asyncio.coroutine was removed in 3.10, so this is no longer relevant.

----------
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26159>
_______________________________________

From report at bugs.python.org  Thu Dec  9 17:37:37 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Thu, 09 Dec 2021 22:37:37 +0000
Subject: [issue45774] Detect SQLite in configure.ac
In-Reply-To: <1636496806.29.0.76332999648.issue45774@roundup.psfhosted.org>
Message-ID: <1639089457.65.0.0315654185899.issue45774@roundup.psfhosted.org>


Change by Erlend E. Aasland <erlend.aasland at innova.no>:


----------
pull_requests: +28240
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/30016

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45774>
_______________________________________

From report at bugs.python.org  Thu Dec  9 17:58:38 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 22:58:38 +0000
Subject: [issue7262] [doc] codecs.open() + eol (windows)
In-Reply-To: <1257344010.52.0.739143662559.issue7262@psf.upfronthosting.co.za>
Message-ID: <1639090718.4.0.658065741664.issue7262@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

That paragraph was edited here:

https://github.com/python/cpython/commit/b9fdb7a452c2b6f7a628118b5f695bd061b62cc8


but this point was not added.

----------
nosy: +iritkatriel
title: codecs.open() + eol (windows) -> [doc] codecs.open() + eol (windows)
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue7262>
_______________________________________

From report at bugs.python.org  Thu Dec  9 18:02:30 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 09 Dec 2021 23:02:30 +0000
Subject: [issue46016] fcntl module add F_DUP2FD_CLOEXEC
In-Reply-To: <1638998078.36.0.0492190037093.issue46016@roundup.psfhosted.org>
Message-ID: <1639090950.71.0.376319666929.issue46016@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:


New changeset da3cf4304f6dd530533bbd2c0913b674cd803744 by Victor Stinner in branch 'main':
bpo-46016: GHA Doc job now also runs "make check" (GH-30009)
https://github.com/python/cpython/commit/da3cf4304f6dd530533bbd2c0913b674cd803744


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46016>
_______________________________________

From report at bugs.python.org  Thu Dec  9 18:09:23 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 23:09:23 +0000
Subject: [issue17108] [doc] import silently prefers package over module when
 both available
In-Reply-To: <1359844868.64.0.586214844711.issue17108@psf.upfronthosting.co.za>
Message-ID: <1639091363.12.0.873347972028.issue17108@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: import silently prefers package over module when both available -> [doc] import silently prefers package over module when both available
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17108>
_______________________________________

From report at bugs.python.org  Thu Dec  9 18:26:15 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 23:26:15 +0000
Subject: [issue20823] [doc] Clarify copyreg.pickle() documentation
In-Reply-To: <1393749966.08.0.529137298895.issue20823@psf.upfronthosting.co.za>
Message-ID: <1639092375.4.0.0195433464333.issue20823@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy -patch
title: Clarify copyreg.pickle() documentation -> [doc] Clarify copyreg.pickle() documentation
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20823>
_______________________________________

From report at bugs.python.org  Thu Dec  9 18:38:35 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 09 Dec 2021 23:38:35 +0000
Subject: [issue27583] [doc ] configparser: modifying default_section at runtime
In-Reply-To: <1469105653.63.0.572086425799.issue27583@psf.upfronthosting.co.za>
Message-ID: <1639093115.14.0.170935913673.issue27583@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: configparser: modifying default_section at runtime -> [doc ] configparser: modifying default_section at runtime
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27583>
_______________________________________

From report at bugs.python.org  Thu Dec  9 19:03:15 2021
From: report at bugs.python.org (Gabriele N Tornetta)
Date: Fri, 10 Dec 2021 00:03:15 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639094595.1.0.361239052716.issue32683@roundup.psfhosted.org>


Gabriele N Tornetta <phoenix1987 at gmail.com> added the comment:

> Python is very much a language about responsibility.  If Django is overriding `__getattribute__` then it is their responsibility to ensure that everything still works properly.

Perhaps I didn't stress observability enough. A tool like a tracer or a profiler, in the ideal world, is not supposed to perturb the tracee in any way. The current implementation of isinstance, when used by an observability tool, may cause side effects as well as overheads, so it is not safe to use in such tools. Working around it may solve the side-effects issue, but leaves the problem of overheads. Changing the way isinstance works internally might prove beneficial for such tools.

En passant,  I think it should be noted that the built-in "type" doesn't suffer from the same problem, i.e.

~~~
class Side(object):
    def __getattribute__(self, name):
        ValueError(name)


type(Side())
~~~

works as expected.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 19:24:21 2021
From: report at bugs.python.org (Ned Batchelder)
Date: Fri, 10 Dec 2021 00:24:21 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
Message-ID: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>


New submission from Ned Batchelder <ned at nedbatchelder.com>:

Under tox, sys._base_executable is not an actual file for 3.11.0a3.  It was fine in 3.11.0a2.

To reproduce:

--- 8< --------------------
# tox.ini
[tox]
envlist = py{310,311a2,311}
skipsdist = True

[testenv]
commands =
    python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))"

[testenv:py311a2]
# This is the path to 3.11.0a2 if you have it.
basepython = /usr/local/pyenv/pyenv/versions/3.11.0a2/bin/python3
----------------------------

Create a new Python 3.8 virtualenv, and install latest tox (3.24.4 for me).

Then run "tox".  I see:

--------------------------------------------------------------------------------
py310 create: /Users/nedbatchelder/coverage/lab/fix-3.11a3/.tox/py310
py310 run-test-pre: PYTHONHASHSEED='534434199'
py310 run-test: commands[0] | python -c 'import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))'
/Users/nedbatchelder/coverage/lab/fix-3.11a3/.tox/py310/bin/python
True
py311a2 create: /Users/nedbatchelder/coverage/lab/fix-3.11a3/.tox/py311a2
py311a2 run-test-pre: PYTHONHASHSEED='534434199'
py311a2 run-test: commands[0] | python -c 'import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))'
/Users/nedbatchelder/coverage/lab/fix-3.11a3/.tox/py311a2/bin/python
True
py311 create: /Users/nedbatchelder/coverage/lab/fix-3.11a3/.tox/py311
py311 run-test-pre: PYTHONHASHSEED='534434199'
py311 run-test: commands[0] | python -c 'import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))'
/usr/local/pyenv/pyenv/versions/3.11.0a3/python
False
_________________________________________________________ summary _________________________________________________________
  py310: commands succeeded
  py311a2: commands succeeded
  py311: commands succeeded
  congratulations :)
--------------------------------------------------------------------------------

This came to my attention because the coverage.py test suite uses "python -m venv" to create environments. They worked under 3.11.0a2, but failed under a3.  I tracked it down to a difference in sys._base_executable.

I couldn't see a difference in those values without tox, but I'm not sure why it changes the results.

----------
keywords: 3.11regression
messages: 408166
nosy: nedbat, pablogsal
priority: normal
severity: normal
status: open
title: 3.11.0a3: under tox, sys._base_executable is wrong
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Thu Dec  9 20:16:22 2021
From: report at bugs.python.org (Yurii Karabas)
Date: Fri, 10 Dec 2021 01:16:22 +0000
Subject: [issue46014] functools.singledispatch does not support Union types
In-Reply-To: <1638970452.65.0.012237534186.issue46014@roundup.psfhosted.org>
Message-ID: <1639098982.26.0.795612078932.issue46014@roundup.psfhosted.org>


Change by Yurii Karabas <1998uriyyo at gmail.com>:


----------
keywords: +patch
nosy: +uriyyo
nosy_count: 4.0 -> 5.0
pull_requests: +28241
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30017

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46014>
_______________________________________

From report at bugs.python.org  Thu Dec  9 20:18:18 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 10 Dec 2021 01:18:18 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639099098.14.0.210331162788.issue46028@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Steve, could this be related to the changes in getpath?

----------
nosy: +steve.dower

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Thu Dec  9 20:19:03 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 10 Dec 2021 01:19:03 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639099143.26.0.701486523932.issue46028@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
priority: normal -> release blocker

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Thu Dec  9 20:22:36 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 10 Dec 2021 01:22:36 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639099356.68.0.452926635393.issue46028@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Ned, are you able to bisect this or provide a simpler reproducer that doesn't involve tox?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Thu Dec  9 20:52:19 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 01:52:19 +0000
Subject: [issue43931] Add the Python version to the API data.
In-Reply-To: <1619275074.12.0.00901483534926.issue43931@roundup.psfhosted.org>
Message-ID: <1639101139.94.0.225315616112.issue43931@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 50669083fe16a42cba90b5dd8c1a017751f69fd8 by Gabriele N. Tornetta in branch 'main':
bpo-43931: Export Python version as API data (GH-25577)
https://github.com/python/cpython/commit/50669083fe16a42cba90b5dd8c1a017751f69fd8


----------
nosy: +miss-islington

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43931>
_______________________________________

From report at bugs.python.org  Thu Dec  9 21:22:42 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 10 Dec 2021 02:22:42 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639102962.67.0.342389862191.issue32683@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> Changing the way isinstance works internally might prove
> beneficial for such tools.

ISTM you're advocating a design change rather than discussing a bug report.  The python-ideas mail list would be a better forum than the tracker.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 21:30:22 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Fri, 10 Dec 2021 02:30:22 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1639066721.22.0.721643276169.issue32683@roundup.psfhosted.org>
Message-ID: <20211210022746.GV21647@ando.pearwood.info>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

I agree that the rules regarding type and `__class__` and isinstance are 
not clear or well documented.

We have:

https://docs.python.org/3/library/stdtypes.html#instance.__class__

https://docs.python.org/3/library/functions.html#isinstance

but neither discuss the interaction between a class' "real" type and 
it's "fake" type.

To be honest, I'm not even sure I fully understand the interaction 
myself, or how they combine with virtual subclasses. A lot of my 
information comes from this Stackoverflow post:

https://stackoverflow.com/questions/1060499/difference-between-typeobj-and-obj-class

and in particular this comment:

"Some code does this deliberately to lie about the type of objects, such 
as weakref.proxy. Some people think obj.__class__ should be preferred, 
because it believes the lie, while some people think type(obj) should be 
preferred because it ignores the lie. isinstance will return true if an 
object's real class or its lie class is an instance of the second 
argument."

So I think that the behaviour here is correct, but it is not documented 
well and we should fix that.

What I think happens:

* type(obj) always and only returns the actual internal (C-level) type 
  of the object, guaranteed to be a type object.

* isinstance(obj, classinfo) returns True if any of the following hold:

  - the type() of object is a subclass of any of the classes in the
    classinfo object (a class, a Union of classes, or a tuple of 
    classes);

  - obj.__class__ is a subclass of any of the classes in classinfo;

  - or obj is registered as a virtual subclass of any of the classes
    in classinfo, by calling type(ob).__subclasshook__;

* obj.__class__ is determined using the normal attribute lookup 
  mechanism, which means it does not have to be a static attribute
  but can be dynamically generated using properties, __getattr__,
  __getattribute__ or any other similar mechanism.

And for the avoidance of doubt, a class is always considered a subclass 
of itself.

I'm really not sure about the interaction with virtual subclasses, I 
probably have that bit wrong. And it is not clear to me what happens if 
__class__ is a non-type object. It seems to be permitted.

Improving the documentation would be excellent.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 21:36:15 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Fri, 10 Dec 2021 02:36:15 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1639094595.1.0.361239052716.issue32683@roundup.psfhosted.org>
Message-ID: <20211210023339.GW21647@ando.pearwood.info>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

On Fri, Dec 10, 2021 at 12:03:15AM +0000, Gabriele N Tornetta wrote:

> class Side(object):
>     def __getattribute__(self, name):
>         ValueError(name)

You forgot to actually *raise* the exception. That will just instantiate
the ValueError instance, and then immediately garbage collect it.

In any case, type() and isinstance() do not work the same way. type()
does not inspect the `__class__` attribute.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Thu Dec  9 21:42:16 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 10 Dec 2021 02:42:16 +0000
Subject: [issue43931] Add the Python version to the API data.
In-Reply-To: <1619275074.12.0.00901483534926.issue43931@roundup.psfhosted.org>
Message-ID: <1639104136.64.0.406301351929.issue43931@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43931>
_______________________________________

From report at bugs.python.org  Thu Dec  9 22:01:19 2021
From: report at bugs.python.org (oittaa)
Date: Fri, 10 Dec 2021 03:01:19 +0000
Subject: [issue46029] "ValueError: Invalid isoformat string" from a valid
 string
Message-ID: <1639105279.05.0.259148747281.issue46029@roundup.psfhosted.org>


New submission from oittaa <oittaa at oittaa.com>:

Test case:

>>> import datetime
>>> datetime.datetime.fromisoformat('2021-12-10T01:00:00Z')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid isoformat string: '2021-12-10T01:00:00Z'


Basically every other programming language I tested correctly accepted this ISO/RFC3339 string as a date.

----------
messages: 408173
nosy: oittaa
priority: normal
severity: normal
status: open
title: "ValueError: Invalid isoformat string" from a valid string
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46029>
_______________________________________

From report at bugs.python.org  Fri Dec 10 00:02:34 2021
From: report at bugs.python.org (Lasse Kantola)
Date: Fri, 10 Dec 2021 05:02:34 +0000
Subject: [issue39327] shutil.rmtree using vagrant synched folder fails
In-Reply-To: <1578995152.92.0.0617677010821.issue39327@roundup.psfhosted.org>
Message-ID: <1639112554.64.0.557800103408.issue39327@roundup.psfhosted.org>


Lasse Kantola <lasse.kantola at iki.fi> added the comment:

I have encountered the same problem with vboxsf mounted folders when using Debian guest on VirtualBox 6.1 hosted by Windows 10.

The general VirtualBox issue of vboxsf not supporting rmdir when there are open file descriptors is difficult to solve, and out of scope for Python.

However, it looks like the shutil.rmtree implementation can be easily modified to change the order of operations so that the rmdir is performed after the directory file descriptor is closed, which makes shutil.rmtree work under vboxsf shared folders.

Example of the change against Python 3.7 is inlined below. The changed order matches the behavior of "rm -r" and to my understanding should not change the security implications of the code, but as the code is related to the prevention of a symlink attack https://bugs.python.org/issue4489 careful review would be needed.


--- /usr/lib/python3.7/shutil.py--orig  2021-01-23 05:04:44.000000000 +0900
+++ /usr/lib/python3.7/shutil.py        2021-12-09 20:42:36.795338346 +0900
@@ -427,10 +427,6 @@
                 try:
                     if os.path.samestat(orig_st, os.fstat(dirfd)):
                         _rmtree_safe_fd(dirfd, fullname, onerror)
-                        try:
-                            os.rmdir(entry.name, dir_fd=topfd)
-                        except OSError:
-                            onerror(os.rmdir, fullname, sys.exc_info())
                     else:
                         try:
                             # This can only happen if someone replaces
@@ -442,6 +438,10 @@
                             onerror(os.path.islink, fullname, sys.exc_info())
                 finally:
                     os.close(dirfd)
+                try:
+                    os.rmdir(entry.name, dir_fd=topfd)
+                except OSError:
+                    onerror(os.rmdir, fullname, sys.exc_info())
         else:
             try:
                 os.unlink(entry.name, dir_fd=topfd)
@@ -489,10 +489,6 @@
         try:
             if os.path.samestat(orig_st, os.fstat(fd)):
                 _rmtree_safe_fd(fd, path, onerror)
-                try:
-                    os.rmdir(path)
-                except OSError:
-                    onerror(os.rmdir, path, sys.exc_info())
             else:
                 try:
                     # symlinks to directories are forbidden, see bug #1669
@@ -501,6 +497,10 @@
                     onerror(os.path.islink, path, sys.exc_info())
         finally:
             os.close(fd)
+        try:
+            os.rmdir(path)
+        except OSError:
+            onerror(os.rmdir, path, sys.exc_info())
     else:
         try:
             if os.path.islink(path):

----------
nosy: +lkantola

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39327>
_______________________________________

From report at bugs.python.org  Fri Dec 10 02:06:11 2021
From: report at bugs.python.org (David Carlier)
Date: Fri, 10 Dec 2021 07:06:11 +0000
Subject: [issue46030] socket module add couple of FreeBSD constants
Message-ID: <1639119971.08.0.15845075802.issue46030@roundup.psfhosted.org>


New submission from David Carlier <dcarlier at deviceatlas.com>:

- adding LOCAL_CREDS then LOCAL_CREDS_PERSISTENT and SCM_CREDS2 which would be used as msg type for the latter.

----------
components: FreeBSD
messages: 408175
nosy: dcarlier, koobs
priority: normal
pull_requests: 28242
severity: normal
status: open
title: socket module add couple of FreeBSD constants
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46030>
_______________________________________

From report at bugs.python.org  Fri Dec 10 02:29:40 2021
From: report at bugs.python.org (penguin_wwy)
Date: Fri, 10 Dec 2021 07:29:40 +0000
Subject: [issue45630] Dump CodeObject API for debugging
In-Reply-To: <1635349665.14.0.891838928636.issue45630@roundup.psfhosted.org>
Message-ID: <1639121380.78.0.970725716982.issue45630@roundup.psfhosted.org>


penguin_wwy <940375606 at qq.com> added the comment:

Recently, we have used this function to troubleshoot problems with online applications.
We have implemented the PEP659(Specializing) to the 3.6 version which is used by online services, and this function allows us to dump the current function's code in the case of an unhandled exception to determine if the problem was caused by an optimization.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45630>
_______________________________________

From report at bugs.python.org  Fri Dec 10 03:54:02 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 10 Dec 2021 08:54:02 +0000
Subject: [issue45359] TopologicalSorter is not Generic at runtime (but is in
 typeshed)
In-Reply-To: <1633299530.43.0.181161136207.issue45359@roundup.psfhosted.org>
Message-ID: <1639126442.18.0.994276022795.issue45359@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Another option for code using Python <3.11, that will work without the `from __future__ import annotations` import, is to do something like this:

```
from graphlib import TopologicalSorter
x: 'TopologicalSorter[str]' = TopologicalSorter({"a": {}, "b": {"a"}})
```

By using a string as the annotation, we give mypy the specificity it needs, but the expression will never need to be resolved at runtime.

----------
nosy: +AlexWaygood
type: behavior -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45359>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:02:08 2021
From: report at bugs.python.org (penguin_wwy)
Date: Fri, 10 Dec 2021 09:02:08 +0000
Subject: [issue46031] add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE
Message-ID: <1639126928.63.0.63808958692.issue46031@roundup.psfhosted.org>


New submission from penguin_wwy <940375606 at qq.com>:

https://github.com/faster-cpython/ideas/discussions/154

----------
components: Interpreter Core
messages: 408178
nosy: penguin_wwy
priority: normal
severity: normal
status: open
title: add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46031>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:04:09 2021
From: report at bugs.python.org (penguin_wwy)
Date: Fri, 10 Dec 2021 09:04:09 +0000
Subject: [issue46031] add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE
In-Reply-To: <1639126928.63.0.63808958692.issue46031@roundup.psfhosted.org>
Message-ID: <1639127049.0.0.732608089309.issue46031@roundup.psfhosted.org>


Change by penguin_wwy <940375606 at qq.com>:


----------
keywords: +patch
pull_requests: +28243
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30019

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46031>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:04:56 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Fri, 10 Dec 2021 09:04:56 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
Message-ID: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>


New submission from Kumar Aditya <rahuladitya303 at gmail.com>:

functools' singledispatch does not support GenericAlias

```py
from functools import singledispatch

@singledispatch
def func(x):
    print("any")

@func.register
def _(x: list[str]):
    print("list[str]")


func(["a", "b"])

```

----------
components: Library (Lib)
messages: 408179
nosy: kumaraditya303, rhettinger
priority: normal
severity: normal
status: open
title: functools' singledispatch does not support GenericAlias
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:14:08 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 10 Dec 2021 09:14:08 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639127648.86.0.525828877082.issue46028@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Commit 9f2f7e42269db74a89fc8cd74d82a875787f01d7 has correct _base_executable

$ venv/bin/python
Python 3.11.0a2+ (heads/bpo-45847-simple-115-g9f2f7e42269:9f2f7e42269, Dec 10 2021, 10:09:54) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._base_executable
'/home/heimes/dev/python/cpython/venv/bin/python'

_base_executable in commit 99fcf1505218464c489d419d4500f126b6d6dc28 is wrong

$ venv/bin/python
Python 3.11.0a2+ (heads/bpo-45847-simple-116-g99fcf150521:99fcf150521, Dec 10 2021, 10:12:35) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._base_executable
'/home/heimes/dev/python/cpython/python'

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:21:40 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 10 Dec 2021 09:21:40 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1639128100.59.0.73198755555.issue46032@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

My opinion is that supporting `GenericAlias` here would be a bad idea. Associating an implementation of the function with the argument type `list[str]` is ambiguous. Would this implementation be called if any argument of type `list` was supplied, or would it only be called if all elements in the list were of type `str`?

The first option would be efficient, simple, and similar to the way singledispatch treats most other argument-types. However, it would be unintuitive.

The second option would be more intuitive, but could be extremely inefficient if a very long list was passed in. It would also make the code more complicated.

----------
nosy: +AlexWaygood, lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:39:14 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 09:39:14 +0000
Subject: [issue45773] Compiler hangs during jump elimination
In-Reply-To: <1636487782.5.0.379047434297.issue45773@roundup.psfhosted.org>
Message-ID: <1639129154.59.0.663262272677.issue45773@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45773>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:40:14 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 10 Dec 2021 09:40:14 +0000
Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods
In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org>
Message-ID: <1639129214.57.0.986685441804.issue42182@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 8c74713d0e349c27518080945d5f040dfd52a56e by andrei kulakov in branch 'main':
bpo-42182: stdtypes doc - update and fix links to several dunder methods  (GH-27384)
https://github.com/python/cpython/commit/8c74713d0e349c27518080945d5f040dfd52a56e


----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42182>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:40:25 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 09:40:25 +0000
Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods
In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org>
Message-ID: <1639129224.99.0.629226899469.issue42182@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28244
pull_request: https://github.com/python/cpython/pull/30020

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42182>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:40:28 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 09:40:28 +0000
Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods
In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org>
Message-ID: <1639129228.61.0.428937239161.issue42182@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28245
pull_request: https://github.com/python/cpython/pull/30021

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42182>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:41:02 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 09:41:02 +0000
Subject: [issue45779] multiprocessing initializer error with CPython 3.9.6 on
 Apple Silicon
In-Reply-To: <1636562874.34.0.208720566335.issue45779@roundup.psfhosted.org>
Message-ID: <1639129262.06.0.4393403892.issue45779@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45779>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:41:52 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 10 Dec 2021 09:41:52 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1639129312.64.0.0651810230707.issue46000@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 2fb797e93c6bbd44dfcbe23f63acfa240a87e48a by Thomas Klausner in branch 'main':
bpo-46000: Improve NetBSD curses compatibility (GH-29947)
https://github.com/python/cpython/commit/2fb797e93c6bbd44dfcbe23f63acfa240a87e48a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:41:55 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 09:41:55 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1639129315.21.0.162927877137.issue46000@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28246
pull_request: https://github.com/python/cpython/pull/30022

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:41:59 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 09:41:59 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1639129319.0.0.736935359406.issue46000@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28247
pull_request: https://github.com/python/cpython/pull/30023

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:42:24 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 09:42:24 +0000
Subject: [issue15757] ./configure --with-pydebug on FreeBSD results in -O2
 -pipe eventually ending up in CFLAGS.
In-Reply-To: <1345584581.07.0.102502771699.issue15757@psf.upfronthosting.co.za>
Message-ID: <1639129344.49.0.867088089884.issue15757@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15757>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:42:52 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 10 Dec 2021 09:42:52 +0000
Subject: [issue45662] Incorrect repr of InitVar of a type alias
In-Reply-To: <1635450363.22.0.969198768309.issue45662@roundup.psfhosted.org>
Message-ID: <1639129372.92.0.80378721221.issue45662@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset fb8aad16401e081a6a9059c7b428f7e8aae85d58 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-45662: Fix the repr of InitVar with a type alias to the built-in class (GH-29291) (GH-29924)
https://github.com/python/cpython/commit/fb8aad16401e081a6a9059c7b428f7e8aae85d58


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45662>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:43:47 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 09:43:47 +0000
Subject: [issue13473] Add tests for files byte-compiled by distutils
In-Reply-To: <1322145911.61.0.528651769931.issue13473@psf.upfronthosting.co.za>
Message-ID: <1639129427.21.0.753983850256.issue13473@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13473>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:47:23 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 10 Dec 2021 09:47:23 +0000
Subject: [issue45662] Incorrect repr of InitVar of a type alias
In-Reply-To: <1635450363.22.0.969198768309.issue45662@roundup.psfhosted.org>
Message-ID: <1639129643.66.0.934810225346.issue45662@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45662>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:48:17 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 09:48:17 +0000
Subject: [issue14336] Difference between pickle implementations for function
 objects
In-Reply-To: <1331924619.34.0.890923032137.issue14336@psf.upfronthosting.co.za>
Message-ID: <1639129697.8.0.980042445187.issue14336@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> wont fix
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14336>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:50:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 09:50:22 +0000
Subject: [issue28559] Unclear error message when raising wrong type of
 exceptions
In-Reply-To: <1477764991.61.0.67228056749.issue28559@psf.upfronthosting.co.za>
Message-ID: <1639129822.7.0.296874862806.issue28559@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> rejected
stage: patch review -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28559>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:51:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 09:51:57 +0000
Subject: [issue41702] Inconsistent behaviour in strftime
In-Reply-To: <1599133552.94.0.223502406334.issue41702@roundup.psfhosted.org>
Message-ID: <1639129917.0.0.781704724277.issue41702@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41702>
_______________________________________

From report at bugs.python.org  Fri Dec 10 04:53:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 09:53:20 +0000
Subject: [issue22293] unittest.mock: use slots in MagicMock to reduce memory
 footprint
In-Reply-To: <1409223925.36.0.353064472257.issue22293@psf.upfronthosting.co.za>
Message-ID: <1639130000.93.0.148002627508.issue22293@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: needs patch -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22293>
_______________________________________

From report at bugs.python.org  Fri Dec 10 05:02:19 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 10:02:19 +0000
Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods
In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org>
Message-ID: <1639130539.35.0.506618568859.issue42182@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 64c2788f42c49c7094d3b6e5404fe8386a2b4779 by Miss Islington (bot) in branch '3.10':
bpo-42182: stdtypes doc - update and fix links to several dunder methods  (GH-27384)
https://github.com/python/cpython/commit/64c2788f42c49c7094d3b6e5404fe8386a2b4779


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42182>
_______________________________________

From report at bugs.python.org  Fri Dec 10 05:04:58 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 10:04:58 +0000
Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods
In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org>
Message-ID: <1639130698.86.0.347225268278.issue42182@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 40d765260ae08d152ee89ed9c1c621f4a0024fa6 by Miss Islington (bot) in branch '3.9':
bpo-42182: stdtypes doc - update and fix links to several dunder methods  (GH-27384)
https://github.com/python/cpython/commit/40d765260ae08d152ee89ed9c1c621f4a0024fa6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42182>
_______________________________________

From report at bugs.python.org  Fri Dec 10 05:29:30 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 10:29:30 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1639132170.34.0.642305627076.issue46000@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset bb76410824e526ee075eac22812a577cca7583cf by Miss Islington (bot) in branch '3.10':
bpo-46000: Improve NetBSD curses compatibility (GH-29947)
https://github.com/python/cpython/commit/bb76410824e526ee075eac22812a577cca7583cf


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Fri Dec 10 05:33:02 2021
From: report at bugs.python.org (Gabriele N Tornetta)
Date: Fri, 10 Dec 2021 10:33:02 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639132382.38.0.663406039855.issue32683@roundup.psfhosted.org>


Gabriele N Tornetta <phoenix1987 at gmail.com> added the comment:

@rhettinger
Apologies. You're totally right but I wasn't expecting this to become a lengthy conversation.

So, to get closer to the initial issue, I believe that this ticket could be closed provided that the documentation is improved by making developers aware of the potential side effects of isinstance. I was doing some more experiments and it looks like

def _isinstance(obj, classinfo):
    return issubclass(type(obj), classinfo)

might be considered a "side-effects-free" version of isinstance. So perhaps one thing to mention in the documentation is that `isinstance(obj, classinfo) != issubclass(type(obj), classinfo)` in general.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Fri Dec 10 05:42:42 2021
From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBE?=)
Date: Fri, 10 Dec 2021 10:42:42 +0000
Subject: [issue46033] Duplicated sentence in for statement documentation
Message-ID: <1639132962.13.0.2847255275.issue46033@roundup.psfhosted.org>


New submission from Micha? D <michcio1234 at gmail.com>:

In for statement description, there seem to be two sentences meant to mean the same:

> The suite is then executed once for each item provided by the iterator, in the order returned by the iterator. Each item in turn is assigned to the target list using the standard rules for assignments (see Assignment statements), and then the suite is executed.

(from https://docs.python.org/3/reference/compound_stmts.html#the-for-statement)

I believe only one of these sentences should be kept (probably the second one).

If I am wrong, and the current version is actually correct, then it is unclear - to me it sounds like the iterator is iterated through twice, and suite is executed twice for each item.

----------
assignee: docs at python
components: Documentation
messages: 408189
nosy: docs at python, michcio1234
priority: normal
severity: normal
status: open
title: Duplicated sentence in for statement documentation
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46033>
_______________________________________

From report at bugs.python.org  Fri Dec 10 05:59:42 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Fri, 10 Dec 2021 10:59:42 +0000
Subject: [issue45723] Improve and simplify configure.ac checks
In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org>
Message-ID: <1639133982.86.0.110741785002.issue45723@roundup.psfhosted.org>


Change by Erlend E. Aasland <erlend.aasland at innova.no>:


----------
pull_requests: +28248
pull_request: https://github.com/python/cpython/pull/30024

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45723>
_______________________________________

From report at bugs.python.org  Fri Dec 10 06:05:16 2021
From: report at bugs.python.org (Roundup Robot)
Date: Fri, 10 Dec 2021 11:05:16 +0000
Subject: [issue46033] Duplicated sentence in for statement documentation
In-Reply-To: <1639132962.13.0.2847255275.issue46033@roundup.psfhosted.org>
Message-ID: <1639134316.66.0.336949094663.issue46033@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +28249
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30025

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46033>
_______________________________________

From report at bugs.python.org  Fri Dec 10 06:18:26 2021
From: report at bugs.python.org (David CARLIER)
Date: Fri, 10 Dec 2021 11:18:26 +0000
Subject: [issue46030] socket module add couple of FreeBSD constants
In-Reply-To: <1639119971.08.0.15845075802.issue46030@roundup.psfhosted.org>
Message-ID: <1639135106.44.0.981449145847.issue46030@roundup.psfhosted.org>


Change by David CARLIER <devnexen at gmail.com>:


----------
nosy: +devnexen -dcarlier

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46030>
_______________________________________

From report at bugs.python.org  Fri Dec 10 06:21:24 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 10 Dec 2021 11:21:24 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1639135284.07.0.563869488555.issue46000@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 040f9f9c48f4e74e851d850275aa9e050a04d0c6 by Miss Islington (bot) in branch '3.9':
bpo-46000: Improve NetBSD curses compatibility (GH-29947) (GH-30023)
https://github.com/python/cpython/commit/040f9f9c48f4e74e851d850275aa9e050a04d0c6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Fri Dec 10 06:27:43 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 10 Dec 2021 11:27:43 +0000
Subject: [issue45723] Improve and simplify configure.ac checks
In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org>
Message-ID: <1639135663.17.0.620886877528.issue45723@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 74b23c97cd5e178970a199066795cf0561f46b72 by Erlend Egeberg Aasland in branch 'main':
bpo-45723: Normalise configure user communication (GH-30024)
https://github.com/python/cpython/commit/74b23c97cd5e178970a199066795cf0561f46b72


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45723>
_______________________________________

From report at bugs.python.org  Fri Dec 10 06:41:23 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Fri, 10 Dec 2021 11:41:23 +0000
Subject: [issue32683] isinstance is calling ob.__getattribute__ as a fallback
 instead of object.__class__.__get__
In-Reply-To: <1517001040.56.0.467229070634.issue32683@psf.upfronthosting.co.za>
Message-ID: <1639136483.47.0.941159479942.issue32683@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

The plot thickens.

I was wrong to say that type() always and only looks at the "real" underlying type of the instance. type() does look at __class__ as well. But only sometimes.

>>> class A:
...     __class__ = int
... 
>>> type(A())
<class '__main__.A'>
>>> a = A()
>>> a.__class__ = int
>>> type(a)
<class '__main__.A'>

So from A, we might think that type() ignores __class__

>>> class B:
...     pass
... 
>>> type(B())  # no __class__ to inspect
<class '__main__.B'>
>>> b = B()
>>> b.__class__ = int
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __class__ assignment only supported for mutable types or ModuleType subclasses

How very odd. But okay, let's try something else:

>>> b.__class__ = A  # lie that this is an A not a B
>>> type(b)
<class '__main__.A'>

So now type() *does* inspect __class__, and believes it.

If we generate the __class__ attribute dynamically with __getattr__, the method doesn't even get called. But if we use __getattribute__:

>>> class C:
...     def __getattribute__(self, name):
...             print('C getattribute:', name)
...             if name == '__class__':
...                     return int
...             raise AttributeError
... 
>>> C().__class__
C getattribute: __class__
<class 'int'>
>>> type(C())
<class '__main__.C'>

type() ignores the dynamically generated __class__. But isinstance does not:

>>> isinstance(C(), int)
C getattribute: __class__
True


The same applies if we use property:

>>> class D:
...     @property
...     def __class__(self):
...             return int
... 
>>> type(D())
<class '__main__.D'>
>>> isinstance(D(), int)
True


So the rules appear to be:

- you can set __class__, but only sometimes;
- type() will believe __class__, but only sometimes;
- you can generate __class__ dynamically, but not with __getattr__;
- isinstance() will believe __class__ (always?);
- and there is no indication of how much of this is deliberate language feature and how much is an accident of implementation.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32683>
_______________________________________

From report at bugs.python.org  Fri Dec 10 06:44:18 2021
From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=)
Date: Fri, 10 Dec 2021 11:44:18 +0000
Subject: [issue46033] Duplicated sentence in for statement documentation
In-Reply-To: <1639132962.13.0.2847255275.issue46033@roundup.psfhosted.org>
Message-ID: <1639136658.64.0.0224808395551.issue46033@roundup.psfhosted.org>


Vedran ?a?i? <vedgar at gmail.com> added the comment:

How about adding the words "More precisely," at the beginning of the second sentence?

----------
nosy: +veky

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46033>
_______________________________________

From report at bugs.python.org  Fri Dec 10 06:46:01 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 10 Dec 2021 11:46:01 +0000
Subject: [issue46000] NetBSD curses compatibility
In-Reply-To: <1638807112.42.0.171377770564.issue46000@roundup.psfhosted.org>
Message-ID: <1639136761.03.0.17279189694.issue46000@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Thank you Thomas for your contribution.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46000>
_______________________________________

From report at bugs.python.org  Fri Dec 10 06:51:25 2021
From: report at bugs.python.org (Ned Batchelder)
Date: Fri, 10 Dec 2021 11:51:25 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639137085.69.0.0691354628939.issue46028@roundup.psfhosted.org>


Ned Batchelder <ned at nedbatchelder.com> added the comment:

git bisect also identifies that commit as the first bad:


99fcf1505218464c489d419d4500f126b6d6dc28 is the first bad commit
commit 99fcf1505218464c489d419d4500f126b6d6dc28
Author: Steve Dower <steve.dower at python.org>
Date:   Fri Dec 3 00:08:42 2021 +0000

    bpo-45582: Port getpath[p].c to Python (GH-29041)

    The getpath.py file is frozen at build time and executed as code over a namespace. It is never imported, nor is it meant to be importable or reusable. However, it should be easier to read, modify, and patch than the previous code.

    This commit attempts to preserve every previously tested quirk, but these may be changed in the future to better align platforms.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Fri Dec 10 06:54:44 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 11:54:44 +0000
Subject: [issue40821] os.getlogin() not working
In-Reply-To: <1590784290.42.0.113469889536.issue40821@roundup.psfhosted.org>
Message-ID: <1639137284.25.0.687709615264.issue40821@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40821>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:01:00 2021
From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=)
Date: Fri, 10 Dec 2021 12:01:00 +0000
Subject: [issue46034] Patch-adding __init__ in a class takes no effect when
 called from a subinterpreter
Message-ID: <1639137660.32.0.636703165427.issue46034@roundup.psfhosted.org>


New submission from Miro Hron?ok <miro at hroncok.cz>:

Hello,

based on some bug reports reported in:

- https://github.com/GrahamDumpleton/mod_wsgi/issues/729
- https://github.com/poljar/weechat-matrix/issues/293
- https://bugzilla.redhat.com/show_bug.cgi?id=2030621

I have isolated the following reproducer that shows a regression in Python 3.10+. It happens at least with 3.10.0, 3.10.1 and 3.11.0a2. It works as expected in Python 3.9.

The following code is valid and works on 3.9, 3.10, 3.11:

=========================================
class Greeting():
    pass

def new_init(inst, name):
    inst.text = f"Hello, {name}\n"

Greeting.__init__ = new_init

Greeting("Miro")
=========================================


But if we run it via a subinterpreter, it breaks on 3.10+:

=========================================
import _testcapi

code = r"""class Greeting():
    pass

def new_init(inst, name):
    inst.text = f"Hello, {name}\n"

Greeting.__init__ = new_init

Greeting("Miro")"""

_testcapi.run_in_subinterp(code)
=========================================


$ python3.9 reproducer.py
(exits cleanly)

$ python3.10 reproducer.py 
Traceback (most recent call last):
  File "<string>", line 9, in <module>
TypeError: Greeting() takes no arguments

$ python3.11 reproducer.py 
Traceback (most recent call last):
  File "<string>", line 9, in <module>
TypeError: Greeting() takes no arguments


My observation also shows that if the Greeting class already had (any) __init__:

=========================================
class Greeting():
    __init__ = ...
=========================================

It works as expected on 3.9, 3.10, 3.11.



In reality, this is most likely to affect classes with decorators, like:

=========================================
import attr

@attr.s
class TestClass:
    foo = attr.ib()

TestClass("Miro")
=========================================

This works standalone, but fails in a subinterpreter:

$ python3.10 reproducer.py 
Traceback (most recent call last):
  File "<string>", line 7, in <module>
TypeError: TestClass() takes no arguments

----------
components: Subinterpreters
messages: 408196
nosy: eric.snow, hroncok, vstinner
priority: normal
severity: normal
status: open
title: Patch-adding __init__ in a class takes no effect when called from a subinterpreter
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46034>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:10:59 2021
From: report at bugs.python.org (milahu)
Date: Fri, 10 Dec 2021 12:10:59 +0000
Subject: [issue46035] mimetypes.guess_type returns deprecated mimetype
 application/x-javascript
Message-ID: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org>


New submission from milahu <milahu at gmail.com>:

deprecated mimetype?
per rfc4329, the technical term is "unregistered media type"

https://datatracker.ietf.org/doc/html/rfc4329#section-3

related

https://stackoverflow.com/a/9664327/10440128

https://github.com/danny0838/PyWebScrapBook/issues/53

quick fix

```py
# python/Lib/mimetypes.py

class MimeTypes:
# ...
    def guess_type(self, url, strict=True):
# ...

        if ext in _types_map_default:
            # prefer the python-internal values over /etc/mime.types
            return _types_map_default[ext], encoding

        if ext in types_map:
            return types_map[ext], encoding
```

why is `application/x-javascript` returned?

on linux, mimetypes.init() loads /etc/mime.types
source:
https://mirrors.kernel.org/gentoo/distfiles/mime-types-9.tar.bz2

/etc/mime.types is sorted by alphabet, so

```
cat /etc/mime.types | grep javascript
application/javascript										js
application/x-javascript									js
```

apparently, the last entry application/x-javascript
will overwrite the previous entry application/javascript

----------
components: Library (Lib)
messages: 408197
nosy: milahu
priority: normal
severity: normal
status: open
title: mimetypes.guess_type returns deprecated mimetype application/x-javascript
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46035>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:16:07 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Fri, 10 Dec 2021 12:16:07 +0000
Subject: [issue45723] Improve and simplify configure.ac checks
In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org>
Message-ID: <1639138567.22.0.126204122271.issue45723@roundup.psfhosted.org>


Change by Erlend E. Aasland <erlend.aasland at innova.no>:


----------
pull_requests: +28251
pull_request: https://github.com/python/cpython/pull/30026

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45723>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:20:41 2021
From: report at bugs.python.org (milahu)
Date: Fri, 10 Dec 2021 12:20:41 +0000
Subject: [issue46035] mimetypes.guess_type returns deprecated mimetype
 application/x-javascript
In-Reply-To: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org>
Message-ID: <1639138841.5.0.112482668838.issue46035@roundup.psfhosted.org>


milahu <milahu at gmail.com> added the comment:

patch

https://github.com/milahu/cpython/commit/8a50633bb1b0c3e39fbe2cd467bb34a839ad068f

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46035>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:22:25 2021
From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=)
Date: Fri, 10 Dec 2021 12:22:25 +0000
Subject: [issue46034] Patch-adding __init__ in a class takes no effect when
 called from a subinterpreter
In-Reply-To: <1639137660.32.0.636703165427.issue46034@roundup.psfhosted.org>
Message-ID: <1639138945.91.0.929329507417.issue46034@roundup.psfhosted.org>


Miro Hron?ok <miro at hroncok.cz> added the comment:

git bisect gives:

https://github.com/python/cpython/commit/ea251806b8dffff11b30d2182af1e589caf88acf

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46034>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:29:40 2021
From: report at bugs.python.org (STINNER Victor)
Date: Fri, 10 Dec 2021 12:29:40 +0000
Subject: [issue46034] Patch-adding __init__ in a class takes no effect when
 called from a subinterpreter
In-Reply-To: <1639137660.32.0.636703165427.issue46034@roundup.psfhosted.org>
Message-ID: <1639139380.64.0.193707484212.issue46034@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

I mark this issue as a duplicate of bpo-46006. It's not exactly the same issue, but the root cause is the same: in some functions, Python use fast pointer comparisons when two strings are interned, but this now fails if two interned strings belong to two different interpreters.

----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46034>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:32:58 2021
From: report at bugs.python.org (STINNER Victor)
Date: Fri, 10 Dec 2021 12:32:58 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639139578.68.0.798803058491.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

I marked bpo-46034 as a duplicate: setting a class "__init__" attribute doesn't update properly its tp_init slot. update_slot() of Objects/typeobject.c only uses a fast pointer comparison since both strings are interned, but the test fails if the two strings are part of two different Python interpreters.

In bpo-46034 case, the problem is that the "slotdefs" array uses interned strings created in the main interpreter, whereas the update_slot() name parameter (Python string) was created in a sub-interpreter.

Reproducer:
=========================================
import _testcapi

code = r"""class Greeting():
    pass

def new_init(inst, name):
    inst.text = f"Hello, {name}\n"

Greeting.__init__ = new_init

Greeting("Miro")"""

_testcapi.run_in_subinterp(code)
=========================================

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:35:11 2021
From: report at bugs.python.org (STINNER Victor)
Date: Fri, 10 Dec 2021 12:35:11 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639139711.37.0.407629406007.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Attachd cmp_interned_strings.patch fix _PyUnicode_EqualToASCIIId() and update_slot() for subinterpreters. I will create a PR once we agree if it's required to support subinterpreters there, and if there is no better (faster) option.

For update_slot(), one option to avoid adding a "slow" _PyUnicode_EQ() call would be to have per-interpreter interned strings for the slotdefs array.

----------
keywords: +patch
Added file: https://bugs.python.org/file50485/cmp_interned_strings.patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:35:44 2021
From: report at bugs.python.org (Carl Friedrich Bolz-Tereick)
Date: Fri, 10 Dec 2021 12:35:44 +0000
Subject: [issue37971] Wrong trace with multiple decorators (linenumber wrong
 in frame)
In-Reply-To: <1567017172.25.0.486267767179.issue37971@roundup.psfhosted.org>
Message-ID: <1639139744.07.0.708052578993.issue37971@roundup.psfhosted.org>


Carl Friedrich Bolz-Tereick <cfbolz at gmx.de> added the comment:

I ran into this problem in PyPy today, preparing a patch for CPython too (without looking at the old one).

----------
nosy: +Carl.Friedrich.Bolz

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37971>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:38:43 2021
From: report at bugs.python.org (Carl Friedrich Bolz-Tereick)
Date: Fri, 10 Dec 2021 12:38:43 +0000
Subject: [issue37971] Wrong trace with multiple decorators (linenumber wrong
 in frame)
In-Reply-To: <1567017172.25.0.486267767179.issue37971@roundup.psfhosted.org>
Message-ID: <1639139923.28.0.967513619602.issue37971@roundup.psfhosted.org>


Change by Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>:


----------
pull_requests: +28252
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30027

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37971>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:44:06 2021
From: report at bugs.python.org (STINNER Victor)
Date: Fri, 10 Dec 2021 12:44:06 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639140246.06.0.660831815967.issue46006@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
keywords: +3.10regression
nosy: +pablogsal
priority: normal -> release blocker

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Fri Dec 10 07:58:17 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 10 Dec 2021 12:58:17 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1639141097.7.0.713117836142.issue46032@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

It would be well worth it to improve the error message, however:

```
>>> from functools import singledispatch
>>> @singledispatch
... def func(arg):
...     raise NotImplementedError
... 
>>> @func.register
... def _(arg: list[str]):
...     print('Got a list of strings')
... 
>>> func(1)
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/functools.py", line 830, in dispatch
    impl = dispatch_cache[cls]
  File "/usr/local/lib/python3.9/weakref.py", line 405, in __getitem__
    return self.data[ref(key)]
KeyError: <weakref at 0x7f2a0d9141d0; to 'type' at 0x7f2a0e08b200 (int)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/functools.py", line 833, in dispatch
    impl = registry[cls]
KeyError: <class 'int'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/functools.py", line 877, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
    return dispatch(args[0].__class__)(*args, **kw)
  File "/usr/local/lib/python3.9/functools.py", line 835, in dispatch
    impl = _find_impl(cls, registry)
  File "/usr/local/lib/python3.9/functools.py", line 782, in _find_impl
    mro = _compose_mro(cls, registry.keys())
  File "/usr/local/lib/python3.9/functools.py", line 743, in _compose_mro
    types = [n for n in types if is_related(n)]
  File "/usr/local/lib/python3.9/functools.py", line 743, in <listcomp>
    types = [n for n in types if is_related(n)]
  File "/usr/local/lib/python3.9/functools.py", line 742, in is_related
    and issubclass(cls, typ))
TypeError: issubclass() argument 2 cannot be a parameterized generic
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Fri Dec 10 08:05:13 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 10 Dec 2021 13:05:13 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1639141513.95.0.0225857807514.issue46032@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

The above traceback is because the `isinstance(list[str], type)` check at Lib/functools.py:848 evaluates to `True`. Related: #45665.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Fri Dec 10 08:05:52 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 10 Dec 2021 13:05:52 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639141552.45.0.807673163188.issue46028@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Indeed, seems my original hunch is correct. Steve, could you take a look when you have some time?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Fri Dec 10 08:05:56 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 10 Dec 2021 13:05:56 +0000
Subject: [issue45665] Problems caused by isinstance(list[int],
 type) returning True
In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org>
Message-ID: <1639141556.02.0.235396687209.issue45665@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

#46032 is related to this issue.

----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45665>
_______________________________________

From report at bugs.python.org  Fri Dec 10 08:12:06 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 10 Dec 2021 13:12:06 +0000
Subject: [issue46023] Modules/makesetup generated rules ignore *disabled*
In-Reply-To: <1639041830.9.0.701619101169.issue46023@roundup.psfhosted.org>
Message-ID: <1639141926.74.0.270338785724.issue46023@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 036bbb1d1b6156a1a72c40e9f907f302505085bc by Christian Heimes in branch 'main':
bpo-46023: Fix makesetup handling of disabled rule (GH-30001)
https://github.com/python/cpython/commit/036bbb1d1b6156a1a72c40e9f907f302505085bc


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46023>
_______________________________________

From report at bugs.python.org  Fri Dec 10 08:32:42 2021
From: report at bugs.python.org (Daniel)
Date: Fri, 10 Dec 2021 13:32:42 +0000
Subject: [issue46036] Single-phase initialized modules gets initialized
 multiple times in 3.10.0
Message-ID: <1639143162.4.0.670333199133.issue46036@roundup.psfhosted.org>


New submission from Daniel <danielfa at fixedit.ai>:

The documentation (https://docs.python.org/3/c-api/init.html#c.Py_NewInterpreter) states:


For modules using single-phase initialization, e.g. PyModule_Create(), the first time a particular extension is imported, it is initialized normally, and a (shallow) copy of its module?s dictionary is squirreled away. When the same extension is imported by another (sub-)interpreter, a new module is initialized and filled with the contents of this copy; the extension?s init function is not called. Objects in the module?s dictionary thus end up shared across (sub-)interpreters, which might cause unwanted behavior (see Bugs and caveats below).


This does however seem to have changed (sometime between 3.6.9 and 3.10.0). Consider the following code:


#include <Python.h>

/*
 * Create a module "my_spam" that uses single-phase initialization
 */
static PyModuleDef EmbModule = {
      PyModuleDef_HEAD_INIT, "my_spam", NULL, -1,
      NULL,
      NULL, NULL, NULL, NULL
};

/*
 * According to the docs this function is only called once when dealing with
 * subinterpreters, the next time a shallow copy of the initial state is
 * returned. This does however not seem to be the case in Python 3.10.0..
 */
static PyObject* PyInit_emb(void) {
  PyObject *module = PyModule_Create(&EmbModule);
  PyModule_AddObject(module, "test", PyDict_New());

  printf("Init my_spam module %p\n", module);
  return module;
}

/*
 * Main program
 */

int main(int argc, char *argv[]) {
  PyImport_AppendInittab("my_spam", &PyInit_emb);
  Py_Initialize();

  // Save the main state
  PyThreadState *mainstate = PyThreadState_Get();

  // Create two new interpreters
  PyThreadState *inter1 = Py_NewInterpreter();
  PyThreadState *inter2 = Py_NewInterpreter();

  // Import the my_spam module into the first subinterpreter
  // and change the global variable of it
  PyThreadState_Swap(inter1);
  PyRun_SimpleString("import sys; print(sys.version_info)");
  PyRun_SimpleString("import my_spam; print('my_spam.test: ', my_spam.test)");
  PyRun_SimpleString("my_spam.test[1]=1; print('my_spam.test: ', my_spam.test)");

  // Import the my_spam module into the second subinterpreter
  // and change the global variable of it
  PyThreadState_Swap(inter2);
  PyRun_SimpleString("import sys; print(sys.version_info)");
  PyRun_SimpleString("import my_spam; print('my_spam.test: ', my_spam.test)");
  PyRun_SimpleString("my_spam.test[2]=2; print('my_spam.test: ', my_spam.test)");

  // Close the subinterpreters
  Py_EndInterpreter(inter2);
  PyThreadState_Swap(inter1);
  Py_EndInterpreter(inter1);

  // Swap back to the main state and finalize python
  PyThreadState_Swap(mainstate);
  if (Py_FinalizeEx() < 0) {
      exit(120);
  }

  return 0;
}



Compiled with python 3.6.9 this does act according to the documentation:


$ gcc test_subinterpreters.c -I/home/daniel/.pyenv/versions/3.6.9/include/python3.6m -L/home/daniel/.pyenv/versions/3.6.9/lib -lpython3.6m && LD_LIBRARY_PATH=/home/daniel/.pyenv/versions/3.6.9/lib ./a.out
sys.version_info(major=3, minor=6, micro=9, releaselevel='final', serial=0)
Init my_spam module 0x7ff7a63d1ef8
my_spam.test:  {}
my_spam.test:  {1: 1}
sys.version_info(major=3, minor=6, micro=9, releaselevel='final', serial=0)
my_spam.test:  {1: 1}
my_spam.test:  {1: 1, 2: 2}


But compiled with 3.10.0 the module is reinitialized and thus objects in the module are not shared between the subinterpreters:


$ gcc test_subinterpreters.c -I/home/daniel/.pyenv/versions/3.10.0/include/python3.10 -L/home/daniel/.pyenv/versions/3.10.0/lib -lpython3.10 && LD_LIBRARY_PATH=/home/daniel/.pyenv/versions/3.10.0/lib ./a.out
sys.version_info(major=3, minor=10, micro=0, releaselevel='final', serial=0)
Init my_spam module 0x7f338a9a9530
my_spam.test:  {}
my_spam.test:  {1: 1}
sys.version_info(major=3, minor=10, micro=0, releaselevel='final', serial=0)
Init my_spam module 0x7f338a9a96c0
my_spam.test:  {}
my_spam.test:  {2: 2}


To me the new behavior seems nicer, but at the very least the documentation should be updated. It also seems like if this could break integrations, albeit it is an unlikely "feature" to rely on.

----------
components: C API
messages: 408209
nosy: daniel-falk
priority: normal
severity: normal
status: open
title: Single-phase initialized modules gets initialized multiple times in 3.10.0
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46036>
_______________________________________

From report at bugs.python.org  Fri Dec 10 08:39:45 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 10 Dec 2021 13:39:45 +0000
Subject: [issue45654] Freeze the runpy module.
In-Reply-To: <1635444830.43.0.574749380857.issue45654@roundup.psfhosted.org>
Message-ID: <1639143585.25.0.735516012937.issue45654@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
nosy: +christian.heimes
nosy_count: 4.0 -> 5.0
pull_requests: +28253
pull_request: https://github.com/python/cpython/pull/30028

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45654>
_______________________________________

From report at bugs.python.org  Fri Dec 10 08:42:49 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 10 Dec 2021 13:42:49 +0000
Subject: [issue45654] Freeze the runpy module.
In-Reply-To: <1635444830.43.0.574749380857.issue45654@roundup.psfhosted.org>
Message-ID: <1639143769.61.0.19577101417.issue45654@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

I noticed that the types module is only used for ModuleType. PR GH-30028 gets rid of 205 kB object code:

   205K  Python/deepfreeze/types.o

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45654>
_______________________________________

From report at bugs.python.org  Fri Dec 10 09:31:36 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Fri, 10 Dec 2021 14:31:36 +0000
Subject: [issue45723] Improve and simplify configure.ac checks
In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org>
Message-ID: <1639146696.25.0.949840921451.issue45723@roundup.psfhosted.org>


Change by Erlend E. Aasland <erlend.aasland at innova.no>:


----------
pull_requests: +28254
pull_request: https://github.com/python/cpython/pull/30029

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45723>
_______________________________________

From report at bugs.python.org  Fri Dec 10 09:47:26 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 10 Dec 2021 14:47:26 +0000
Subject: [issue45665] Problems caused by isinstance(list[int],
 type) returning True
In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org>
Message-ID: <1639147646.23.0.208488393761.issue45665@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
dependencies: +functools' singledispatch does not support GenericAlias

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45665>
_______________________________________

From report at bugs.python.org  Fri Dec 10 09:50:20 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 10 Dec 2021 14:50:20 +0000
Subject: [issue45665] Problems caused by isinstance(list[int],
 type) returning True
In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org>
Message-ID: <1639147820.9.0.529503038659.issue45665@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
dependencies:  -functools' singledispatch does not support GenericAlias

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45665>
_______________________________________

From report at bugs.python.org  Fri Dec 10 09:59:57 2021
From: report at bugs.python.org (Jacob Hayes)
Date: Fri, 10 Dec 2021 14:59:57 +0000
Subject: [issue45359] TopologicalSorter is not Generic at runtime (but is in
 typeshed)
In-Reply-To: <1633299530.43.0.181161136207.issue45359@roundup.psfhosted.org>
Message-ID: <1639148397.7.0.317122018787.issue45359@roundup.psfhosted.org>


Jacob Hayes <jacob.r.hayes at gmail.com> added the comment:

Thanks for the tips! I've been using this patch in my own code in a early imported `__init__.py`:

```
from graphlib import TopologicalSorter
from types import GenericAlias

if not hasattr(TopologicalSorter, "__class_getitem__"):  # pragma: no cover
    TopologicalSorter.__class_getitem__ = classmethod(GenericAlias)  # type: ignore
```

Certainly a bit hacky, but aside from no-op on >=3.11 and satisfying mypy, it supports runtime type inspection via `get_type_hints` before 3.11 (which otherwise still errors for stringized versions). The stringized versions are probably a bit simpler/safer for most folks though :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45359>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:11:47 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Fri, 10 Dec 2021 15:11:47 +0000
Subject: [issue46029] "ValueError: Invalid isoformat string" from a valid
 string
In-Reply-To: <1639105279.05.0.259148747281.issue46029@roundup.psfhosted.org>
Message-ID: <1639149107.74.0.997195277766.issue46029@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

fromisoformat() is only designed to parse the output of isformat().

See issue 35829 for further discussion. I'm going to close this issue as a duplicate.

----------
nosy: +eric.smith
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> datetime: parse "Z" timezone suffix in fromisoformat()

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46029>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:12:38 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Fri, 10 Dec 2021 15:12:38 +0000
Subject: [issue46024] Different behaviour with zipfile
In-Reply-To: <1639045155.54.0.671926991121.issue46024@roundup.psfhosted.org>
Message-ID: <1639149158.86.0.808624206901.issue46024@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46024>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:17:20 2021
From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=)
Date: Fri, 10 Dec 2021 15:17:20 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639149440.47.0.131314929125.issue46006@roundup.psfhosted.org>


Change by Miro Hron?ok <miro at hroncok.cz>:


----------
nosy: +hroncok

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:19:09 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 15:19:09 +0000
Subject: [issue30718] [doc] open builtin function: specifying the size of
 buffer has no effect for text files
In-Reply-To: <1497989929.05.0.713607879185.issue30718@psf.upfronthosting.co.za>
Message-ID: <1639149549.78.0.497643113546.issue30718@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
assignee:  -> docs at python
components: +Documentation -Interpreter Core
keywords: +easy
nosy: +docs at python
title: open builtin function: specifying the size of buffer has no effect for text files -> [doc] open builtin function: specifying the size of buffer has no effect for text files
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30718>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:19:58 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 10 Dec 2021 15:19:58 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1639149598.49.0.887669826225.issue46032@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:26:47 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 10 Dec 2021 15:26:47 +0000
Subject: [issue45653] Freeze the encodings module.
In-Reply-To: <1635444712.46.0.923300343963.issue45653@roundup.psfhosted.org>
Message-ID: <1639150007.92.0.0271988064796.issue45653@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
nosy: +christian.heimes
nosy_count: 5.0 -> 6.0
pull_requests: +28255
pull_request: https://github.com/python/cpython/pull/30030

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45653>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:38:13 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 15:38:13 +0000
Subject: [issue16977] argparse: mismatch between choices parsing and
 usage/error message
In-Reply-To: <1358303407.58.0.0453921356618.issue16977@psf.upfronthosting.co.za>
Message-ID: <1639150693.27.0.214299319867.issue16977@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

We could make the error message less wrong:

>>> p.parse_args(['d'])
usage: [-h] {a,b,c}
: error: argument a: invalid choice: 'd' (choose a value in 'abc')



% git diff
diff --git a/Lib/argparse.py b/Lib/argparse.py
index b44fa4f0f6..f03cc1f110 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -2499,8 +2499,8 @@ def _check_value(self, action, value):
         # converted value must be one of the choices (if specified)
         if action.choices is not None and value not in action.choices:
             args = {'value': value,
-                    'choices': ', '.join(map(repr, action.choices))}
-            msg = _('invalid choice: %(value)r (choose from %(choices)s)')
+                    'choices': repr(action.choices)}
+            msg = _('invalid choice: %(value)r (choose a value in %(choices)s)')
             raise ArgumentError(action, msg % args)
 
     # =======================

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16977>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:48:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 15:48:45 +0000
Subject: [issue18349] argparse usage should preserve () in metavars such as
 range(20)
In-Reply-To: <1372832211.16.0.544648995095.issue18349@psf.upfronthosting.co.za>
Message-ID: <1639151325.73.0.166144511686.issue18349@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11:

>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('foo', type=int, choices=range(20), metavar='range(0,20)')
_StoreAction(option_strings=[], dest='foo', nargs=None, const=None, default=None, type=<class 'int'>, choices=range(0, 20), help=None, metavar='range(0,20)')
>>> parser.format_usage()
'usage: [-h] range0,20\n'

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18349>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:50:50 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 15:50:50 +0000
Subject: [issue11708] argparse: suggestion for formatting optional positional
 args
In-Reply-To: <1301372470.63.0.394832292121.issue11708@psf.upfronthosting.co.za>
Message-ID: <1639151450.35.0.460320254231.issue11708@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
type:  -> enhancement
versions: +Python 3.11 -Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue11708>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:55:25 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 15:55:25 +0000
Subject: [issue23994] argparse fails to detect program name when there is a
 slash at the end of the program's path
In-Reply-To: <1429379283.39.0.0511547854084.issue23994@psf.upfronthosting.co.za>
Message-ID: <1639151725.88.0.785355650002.issue23994@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I am unable to reproduce this problem on 3.11 on a Mac.

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23994>
_______________________________________

From report at bugs.python.org  Fri Dec 10 10:58:08 2021
From: report at bugs.python.org (vladmihaisima)
Date: Fri, 10 Dec 2021 15:58:08 +0000
Subject: [issue46037] logging.config.dictConfig with disable_existing_loggers
 set, also disables loggers in configuration
Message-ID: <1639151888.32.0.171616624845.issue46037@roundup.psfhosted.org>


New submission from vladmihaisima <vladmihaisima at gmail.com>:

When invoking logging.config.dictConfig - if a logger was previously disabled (for example by a call to "logging.config.dictConfig({'version': 1})") - the loggers specified in the dictionary will not be enabled.

Documentation at https://docs.python.org/3/library/logging.config.html specifies for disable_existing_loggers that "... behaviour is to disable any existing non-root loggers unless they or their ancestors are explicitly named in the logging configuration.". There is no explicit mention for what happens when a logger exists and is already disabled. I would have assumed that if present it will be enabled, but that does not seem to be the case.

So I think that if a logger is disabled invoking dictConfig cannot re-enable it.

See attached code for a reproducible case.

----------
files: bug.py
messages: 408216
nosy: vladmihaisima
priority: normal
severity: normal
status: open
title: logging.config.dictConfig with disable_existing_loggers set, also disables loggers in configuration
versions: Python 3.10, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50486/bug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46037>
_______________________________________

From report at bugs.python.org  Fri Dec 10 11:06:27 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 16:06:27 +0000
Subject: [issue17890] argparse: mutually exclusive groups full of
 help-suppressed args can cause AssertionErrors
In-Reply-To: <1367455382.45.0.0611766927148.issue17890@psf.upfronthosting.co.za>
Message-ID: <1639152387.63.0.696592092574.issue17890@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I'm unable to reproduce this problem on 3.11:

>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> group = parser.add_mutually_exclusive_group()
>>> group.add_argument('--spam', help=argparse.SUPPRESS)
_StoreAction(option_strings=['--spam'], dest='spam', nargs=None, const=None, default=None, type=None, choices=None, help='==SUPPRESS==', metavar=None)
>>> parser.add_argument('--' + 'eggs' * 20, dest='eggs')
_StoreAction(option_strings=['--eggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggs'], dest='eggs', nargs=None, const=None, default=None, type=None, choices=None, help=None, metavar=None)
>>> parser.print_usage()
usage: [-h]  [--eggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggseggs EGGS]
>>>

----------
nosy: +iritkatriel
resolution:  -> fixed
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17890>
_______________________________________

From report at bugs.python.org  Fri Dec 10 11:19:15 2021
From: report at bugs.python.org (Oleg Iarygin)
Date: Fri, 10 Dec 2021 16:19:15 +0000
Subject: [issue46038] Mark /configure file as generated in .gitattributes
Message-ID: <1639153155.2.0.704018156223.issue46038@roundup.psfhosted.org>


New submission from Oleg Iarygin <oleg at arhadthedev.net>:

configure is regenerated from configure.ac using a custom container with appropriate version of tools (quay.io/tiran/cpython_autoconf by Christian Heimes). As a result, configure falls into the same category as files generated by Argument Clinic, Freeze and Parser/asdl_c.py. Due to size and churn of these artifacts, they are marked in .gitattributes as generated so GitHub Pull Request Diff Viewer collapses them into a short notification. The pull request associated with this issue does the same for configure.

Actually, configure diff is so large that sometimes it crosses a threshold and GitHub collapses it by force with "Large diffs are not rendered by default" or even "xxx additions, yyy deletions not shown because the diff is too large. Please use a local Git client to view these changes". See GH-29756 as an extreme example (15,430 insertions and deletions) and <https://github.com/python/cpython/commits/main/configure> for an average.

----------
components: Build
messages: 408218
nosy: arhadthedev
priority: normal
severity: normal
status: open
title: Mark /configure file as generated in .gitattributes
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46038>
_______________________________________

From report at bugs.python.org  Fri Dec 10 11:19:27 2021
From: report at bugs.python.org (Oleg Iarygin)
Date: Fri, 10 Dec 2021 16:19:27 +0000
Subject: [issue46038] Mark /configure file as generated in .gitattributes
In-Reply-To: <1639153155.2.0.704018156223.issue46038@roundup.psfhosted.org>
Message-ID: <1639153167.95.0.54025785754.issue46038@roundup.psfhosted.org>


Change by Oleg Iarygin <oleg at arhadthedev.net>:


----------
keywords: +patch
pull_requests: +28256
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30031

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46038>
_______________________________________

From report at bugs.python.org  Fri Dec 10 11:22:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 16:22:55 +0000
Subject: [issue28841] urlparse.urlparse() parses invalid URI without
 generating an error (examples provided)
In-Reply-To: <1480521425.85.0.782501279738.issue28841@psf.upfronthosting.co.za>
Message-ID: <1639153375.45.0.426166069919.issue28841@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11:

>>> urllib.parse.urlparse('http://www.google.com:/abc')
ParseResult(scheme='http', netloc='www.google.com:', path='/abc', params='', query='', fragment='')


The discussion above was mostly leaning towards won't fix, except for the suggestion to

> Based on the RFC, one could argue that urlunsplit should omit the colon.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28841>
_______________________________________

From report at bugs.python.org  Fri Dec 10 11:26:16 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 16:26:16 +0000
Subject: [issue22047] argparse improperly prints mutually exclusive options
 when they are in a group
In-Reply-To: <1406131424.14.0.0235697032218.issue22047@psf.upfronthosting.co.za>
Message-ID: <1639153576.6.0.541595454089.issue22047@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I am unable to reproduce this on 3.11:

% ./python.exe tt.py -h
usage: tt.py [-h] [[-hello]]

options:
  -h, --help  show this help message and exit
  -hello      A flag

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22047>
_______________________________________

From report at bugs.python.org  Fri Dec 10 11:33:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 16:33:55 +0000
Subject: [issue31768] argparse drops '|'s when the arguments are too long
In-Reply-To: <1507758565.64.0.213398074469.issue31768@psf.upfronthosting.co.za>
Message-ID: <1639154035.08.0.952817015224.issue31768@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

In 3.11 the problem is still there, but the cutoff to make Eric's script show it is now 26 rather than 8:

% ./python.exe tt.py 25
usage: tt.py [-h] [-v | -q | -x [X] | -y [Y] | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z | Z]

% ./python.exe tt.py 26
usage: tt.py [-h] [-v] [-q] [-x [X]] [-y [Y]]
             [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z] [Z]

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31768>
_______________________________________

From report at bugs.python.org  Fri Dec 10 11:43:46 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 16:43:46 +0000
Subject: [issue34628] urllib.request.urlopen fails when userinfo is present in
 URL
In-Reply-To: <1536683596.21.0.0269046726804.issue34628@psf.upfronthosting.co.za>
Message-ID: <1639154626.81.0.338007769835.issue34628@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34628>
_______________________________________

From report at bugs.python.org  Fri Dec 10 11:54:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 16:54:57 +0000
Subject: [issue16807] argparse group nesting lost on inheritance
In-Reply-To: <1356745167.13.0.671311915058.issue16807@psf.upfronthosting.co.za>
Message-ID: <1639155297.11.0.314250978876.issue16807@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11: 

>>> argparse.ArgumentParser(add_help=False, parents=[parent]).print_help()
usage: [--foo FOO] [-a | -b]

options:
  -a
  -b

the group:
  --foo FOO

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16807>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:00:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 17:00:45 +0000
Subject: [issue17113] argparse.RawDescriptionHelpFormatter should not delete
 blank lines
In-Reply-To: <1359899140.94.0.20575006786.issue17113@psf.upfronthosting.co.za>
Message-ID: <1639155645.95.0.132136872771.issue17113@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Adding a space as Paul suggests works. I'll close this soon if nobody objects.

----------
nosy: +iritkatriel
resolution:  -> wont fix
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17113>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:04:32 2021
From: report at bugs.python.org (Mitchell Hentges)
Date: Fri, 10 Dec 2021 17:04:32 +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: <1639155872.41.0.483523206096.issue43749@roundup.psfhosted.org>


Mitchell Hentges <mitch9654 at gmail.com> added the comment:

Hey, can I request a backport of this change? For my use case, 3.9+ would be great, but going back to 3.7 should be viable? I trust your judgement :)

I'll happily create the PRs for the backport, but it looks like the bug has to be indicated as "needs backport to X.Y" by Python maintainers first (https://devguide.python.org/gitbootcamp/?highlight=backport#backporting-merged-changes)

----------
nosy: +mitchhentges

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:05:07 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Fri, 10 Dec 2021 17:05:07 +0000
Subject: [issue21461] Recognize -pthread
In-Reply-To: <1399626963.64.0.665177402844.issue21461@psf.upfronthosting.co.za>
Message-ID: <1639155907.4.0.642302380806.issue21461@roundup.psfhosted.org>


Change by Thomas Klausner <tk at giga.or.at>:


----------
pull_requests: +28257
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30032

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21461>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:07:21 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 17:07:21 +0000
Subject: [issue28609] argparse claims '*' positional argument is required in
 error output
In-Reply-To: <1478272763.12.0.609109547521.issue28609@psf.upfronthosting.co.za>
Message-ID: <1639156041.77.0.421243720547.issue28609@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

>>> parser.parse_args([])
usage: [-h] [-V] COMMAND [ARGUMENT ...]
: error: the following arguments are required: COMMAND, ARGUMENT

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28609>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:14:07 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 10 Dec 2021 17:14:07 +0000
Subject: [issue45582] Rewrite getpath.c in Python
In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org>
Message-ID: <1639156447.06.0.130777361022.issue45582@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset 3f398a77d37b5dfd51dabbc362d482a482fa885a by neonene in branch 'main':
bpo-45582: Fix test_embed failure during a PGO build on Windows (GH-30014)
https://github.com/python/cpython/commit/3f398a77d37b5dfd51dabbc362d482a482fa885a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45582>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:15:56 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 17:15:56 +0000
Subject: [issue15125] argparse: positional arguments containing - in name not
 handled well
In-Reply-To: <1340292847.64.0.123942573403.issue15125@psf.upfronthosting.co.za>
Message-ID: <1639156556.01.0.947516124158.issue15125@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15125>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:17:09 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 17:17:09 +0000
Subject: [issue24338] In argparse adding wrong arguments makes malformed
 namespace
In-Reply-To: <1433070096.48.0.744562806973.issue24338@psf.upfronthosting.co.za>
Message-ID: <1639156629.05.0.384461951198.issue24338@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

>From the discussion and "rejected" resolution it looks like the intention was to close this issue. I will do that soon if nobody objects.

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24338>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:26:23 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 17:26:23 +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: <1639157183.2.0.863606904213.issue43749@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28258
pull_request: https://github.com/python/cpython/pull/30033

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:26:27 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 17:26:27 +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: <1639157187.39.0.884591071267.issue43749@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28259
pull_request: https://github.com/python/cpython/pull/30034

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:27:21 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Fri, 10 Dec 2021 17:27:21 +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: <1639157241.67.0.726891220676.issue43749@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

3.10 and 3.9 - OK, but 3. is security fixes only, I'm afraid.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:27:35 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Fri, 10 Dec 2021 17:27:35 +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: <1639157255.1.0.338599575269.issue43749@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

*3.8, I meant.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:29:34 2021
From: report at bugs.python.org (Roy Smith)
Date: Fri, 10 Dec 2021 17:29:34 +0000
Subject: [issue17113] argparse.RawDescriptionHelpFormatter should not delete
 blank lines
In-Reply-To: <1359899140.94.0.20575006786.issue17113@psf.upfronthosting.co.za>
Message-ID: <1639157374.86.0.00383519239467.issue17113@roundup.psfhosted.org>


Roy Smith <roy at panix.com> added the comment:

It's nice to see this is still being worked on after all these years :-)

I'm not actually convinced the proposed fix makes sense.  It swaps out one incorrect behavior for a different incorrect behavior.  If it really is more effort than it's worth to fix this (and given msg223371, I agree it probably is), then at least the original behavior makes more sense, as it's got years of history behind it and dropping an extra blank line is less arbitrary than adding an extra space.  

I've long since forgotten what real-world issue led me to open this, but it seems like it be easier to just document that extra trailing whitespace may not be honored.

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17113>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:31:17 2021
From: report at bugs.python.org (Mitchell Hentges)
Date: Fri, 10 Dec 2021 17:31:17 +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: <1639157477.84.0.357166433492.issue43749@roundup.psfhosted.org>


Mitchell Hentges <mitch9654 at gmail.com> added the comment:

That's great, thanks!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:37:50 2021
From: report at bugs.python.org (Mark Shannon)
Date: Fri, 10 Dec 2021 17:37:50 +0000
Subject: [issue29988] with statements are not ensuring that __exit__ is called
 if __enter__ succeeds
In-Reply-To: <1491349378.03.0.0671954460373.issue29988@psf.upfronthosting.co.za>
Message-ID: <1639157870.64.0.915188889719.issue29988@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29988>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:48:52 2021
From: report at bugs.python.org (Mark Shannon)
Date: Fri, 10 Dec 2021 17:48:52 +0000
Subject: [issue46039] Break up the YIELD_FROM instruction.
Message-ID: <1639158532.51.0.938199888812.issue46039@roundup.psfhosted.org>


New submission from Mark Shannon <mark at hotpy.org>:

The YIELD_FROM instruction does three things:

* It sends a value to the sub-iterator
* It yields the value from the sub-iterator back up to its caller
* Loops back on itself

So we should implement this as:

SEND        <--+
YIELD_VALUE    |
JUMP_ABSOLUTE -+

Doing so would allow us to simplify gen.send and gen.throw as they wouldn't need all the special cases for 'yield from'.

Zero cost exception handling allows us to handle throw in the bytecode with no runtime overhead:

while True:
    SEND -> exit
    try:
        YIELD_VALUE
    except BaseException as ex:
        sub_iterator.throw(ex)
exit:

----------
assignee: Mark.Shannon
components: Interpreter Core
messages: 408232
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Break up the YIELD_FROM instruction.
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46039>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:51:50 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Fri, 10 Dec 2021 17:51:50 +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: <1639158710.8.0.746104925057.issue43749@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset bb8d645f3a09645686cf8f66bd46dcfa4efac713 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) (GH-30034)
https://github.com/python/cpython/commit/bb8d645f3a09645686cf8f66bd46dcfa4efac713


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:53:12 2021
From: report at bugs.python.org (Mark Shannon)
Date: Fri, 10 Dec 2021 17:53:12 +0000
Subject: [issue46039] Break up the YIELD_FROM instruction.
In-Reply-To: <1639158532.51.0.938199888812.issue46039@roundup.psfhosted.org>
Message-ID: <1639158792.16.0.652252888646.issue46039@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
keywords: +patch
pull_requests: +28260
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30035

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46039>
_______________________________________

From report at bugs.python.org  Fri Dec 10 12:55:37 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 17:55:37 +0000
Subject: [issue17113] argparse.RawDescriptionHelpFormatter should not delete
 blank lines
In-Reply-To: <1359899140.94.0.20575006786.issue17113@psf.upfronthosting.co.za>
Message-ID: <1639158937.53.0.893281705116.issue17113@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17113>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:06:14 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Fri, 10 Dec 2021 18:06: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: <1639159574.61.0.7803478305.issue43749@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset bad16f0cf71a6b11ef62f86be6b3d3567cd70a16 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) (GH-30033)
https://github.com/python/cpython/commit/bad16f0cf71a6b11ef62f86be6b3d3567cd70a16


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:09:15 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 10 Dec 2021 18:09:15 +0000
Subject: [issue45654] Freeze the runpy module.
In-Reply-To: <1635444830.43.0.574749380857.issue45654@roundup.psfhosted.org>
Message-ID: <1639159755.72.0.282717370614.issue45654@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 16638a4bdb802ae52d386a39d2dbef14de3fbc92 by Christian Heimes in branch 'main':
bpo-45654: No need to freeze types (GH-30028)
https://github.com/python/cpython/commit/16638a4bdb802ae52d386a39d2dbef14de3fbc92


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45654>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:10:36 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 10 Dec 2021 18:10:36 +0000
Subject: [issue21461] Recognize -pthread
In-Reply-To: <1399626963.64.0.665177402844.issue21461@psf.upfronthosting.co.za>
Message-ID: <1639159836.99.0.441678062504.issue21461@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Which platforms or compilers use -pthread?

----------
components: +Build -Extension Modules
nosy: +christian.heimes
versions: +Python 3.11 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21461>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:12:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 18:12:57 +0000
Subject: [issue17024] cElementTree calls end() on parser taget even if start()
 fails
In-Reply-To: <1359040208.76.0.707549580683.issue17024@psf.upfronthosting.co.za>
Message-ID: <1639159977.35.0.913654664455.issue17024@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This test passes on 3.11 (on a Mac).

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17024>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:13:59 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Fri, 10 Dec 2021 18:13:59 +0000
Subject: [issue21461] Recognize -pthread
In-Reply-To: <1399626963.64.0.665177402844.issue21461@psf.upfronthosting.co.za>
Message-ID: <1639160039.76.0.573425504564.issue21461@roundup.psfhosted.org>


Thomas Klausner <tk at giga.or.at> added the comment:

gcc supports this flag. According to the man page:

This option consistently for both compilation and linking.  This option is supported on GNU/Linux targets, most other Unix derivatives, and also on x86 Cygwin and MinGW targets.

On NetBSD, using -pthread is the recommended method to enable thread support.

clang on NetBSD also supports this flag. I don't have access to clang on other systems.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21461>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:23:29 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 18:23:29 +0000
Subject: [issue21178] doctest cause warnings in tests using generators
In-Reply-To: <1396954146.87.0.0393521418681.issue21178@psf.upfronthosting.co.za>
Message-ID: <1639160609.81.0.790144420079.issue21178@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21178>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:28:22 2021
From: report at bugs.python.org (Stanislav Syekirin)
Date: Fri, 10 Dec 2021 18:28:22 +0000
Subject: [issue46040] asyncio.coroutine documented as removed in 3.10
Message-ID: <1639160902.02.0.980259307717.issue46040@roundup.psfhosted.org>


New submission from Stanislav Syekirin <syekirin at gmail.com>:

https://docs.python.org/3.10/library/asyncio-task.html#generator-based-coroutines

This page says about asyncio.coroutine:

    Deprecated since version 3.8, removed in version 3.10

However, asyncio.coroutine is still working in 3.10 and has been removed, as far as I can see, here: https://bugs.python.org/issue43216.

----------
assignee: docs at python
components: Documentation
messages: 408240
nosy: Zabolekar, docs at python
priority: normal
severity: normal
status: open
title: asyncio.coroutine documented as removed in 3.10
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46040>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:32:57 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 10 Dec 2021 18:32:57 +0000
Subject: [issue21461] Recognize -pthread
In-Reply-To: <1399626963.64.0.665177402844.issue21461@psf.upfronthosting.co.za>
Message-ID: <1639161177.76.0.404620916744.issue21461@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Python's configure script should detect when a platform needs -pthread and automatically include the flags for linking and compiling of all files. Under which circumstances do you need -pthread in a Setup file?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21461>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:34:10 2021
From: report at bugs.python.org (Maxwell Bernstein)
Date: Fri, 10 Dec 2021 18:34:10 +0000
Subject: [issue46041] Add reference counting micro-optimizations to
 listobject.c
Message-ID: <1639161250.42.0.698258533036.issue46041@roundup.psfhosted.org>


New submission from Maxwell Bernstein <tekk.nolagi at gmail.com>:

Avoid reference counting in the fast path of list.contains and list.index

----------
messages: 408242
nosy: tekknolagi
priority: normal
severity: normal
status: open
title: Add reference counting micro-optimizations to listobject.c

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46041>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:34:29 2021
From: report at bugs.python.org (Maxwell Bernstein)
Date: Fri, 10 Dec 2021 18:34:29 +0000
Subject: [issue46041] Add reference counting micro-optimizations to
 listobject.c
In-Reply-To: <1639161250.42.0.698258533036.issue46041@roundup.psfhosted.org>
Message-ID: <1639161269.12.0.260808272056.issue46041@roundup.psfhosted.org>


Change by Maxwell Bernstein <tekk.nolagi at gmail.com>:


----------
keywords: +patch
pull_requests: +28261
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30036

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46041>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:34:29 2021
From: report at bugs.python.org (Maxwell Bernstein)
Date: Fri, 10 Dec 2021 18:34:29 +0000
Subject: [issue39425] list.count performance regression
In-Reply-To: <1579713363.79.0.989493842853.issue39425@roundup.psfhosted.org>
Message-ID: <1639161269.21.0.126154148849.issue39425@roundup.psfhosted.org>


Change by Maxwell Bernstein <tekk.nolagi at gmail.com>:


----------
nosy: +tekknolagi
nosy_count: 5.0 -> 6.0
pull_requests: +28262
pull_request: https://github.com/python/cpython/pull/30036

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39425>
_______________________________________

From report at bugs.python.org  Fri Dec 10 13:42:21 2021
From: report at bugs.python.org (Brett Cannon)
Date: Fri, 10 Dec 2021 18:42:21 +0000
Subject: [issue31370] Remove support for threads-less builds
In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za>
Message-ID: <1639161741.04.0.961202545964.issue31370@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:

This has unfortunately turned out to be a blocker on getting WASI support as there's not direct threading support in WebAssembly.

----------
nosy: +brett.cannon

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31370>
_______________________________________

From report at bugs.python.org  Fri Dec 10 14:00:06 2021
From: report at bugs.python.org (Mischiew Rithe)
Date: Fri, 10 Dec 2021 19:00:06 +0000
Subject: [issue41248] Python manual forced in maximized window
In-Reply-To: <1594235851.53.0.79291256825.issue41248@roundup.psfhosted.org>
Message-ID: <1639162806.72.0.163226179923.issue41248@roundup.psfhosted.org>


Mischiew Rithe <mischiew at gmail.com> added the comment:

The problem still exists in version 3.10.1, in Windows.

When the user wants to get the documentation, the whole screen is hidden by it, which is very inconvenient.

If the user does not want this behaviour, they have to change the shortcut, for instance in:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python 3.10

This is not possible if the user doesn't have the admin rights.

There is no reason to force a maximized window for the documentation, but there are reasons not to: it's invasive, now monitors are often too large to make it a comfortable reading format for a single window, the OS is multi-tasking and the user will most likely read the documentation while editing code on an IDE and needs to see both.

----------
versions: +Python 3.10 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41248>
_______________________________________

From report at bugs.python.org  Fri Dec 10 14:07:14 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 10 Dec 2021 19:07:14 +0000
Subject: [issue44938] Expose PyErr_ChainExceptions in the stable API
In-Reply-To: <1629222263.76.0.471437987741.issue44938@roundup.psfhosted.org>
Message-ID: <1639163234.67.0.709497313534.issue44938@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:

related: https://www.python.org/dev/peps/pep-0490/ (rejected pep to auto-chain from C API calls)

I don't come across it often, but I did just review some code at work today where the chain might have been nice (though not a big deal).

----------
nosy: +gregory.p.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44938>
_______________________________________

From report at bugs.python.org  Fri Dec 10 14:29:51 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 19:29:51 +0000
Subject: [issue22714] target of 'import statement' entry in general index for
 'i' is wrong
In-Reply-To: <1414125308.24.0.874909264609.issue22714@psf.upfronthosting.co.za>
Message-ID: <1639164591.61.0.549947468717.issue22714@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> wont fix
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22714>
_______________________________________

From report at bugs.python.org  Fri Dec 10 14:31:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 19:31:57 +0000
Subject: [issue18636] mingw: setup _ssl module
In-Reply-To: <1375472116.92.0.328904140064.issue18636@psf.upfronthosting.co.za>
Message-ID: <1639164717.75.0.679344494442.issue18636@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18636>
_______________________________________

From report at bugs.python.org  Fri Dec 10 14:52:51 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Fri, 10 Dec 2021 19:52:51 +0000
Subject: [issue4733] Add a "decode to declared encoding" version of urlopen to
 urllib
In-Reply-To: <1230068654.82.0.881542673607.issue4733@psf.upfronthosting.co.za>
Message-ID: <1639165971.56.0.445544265589.issue4733@roundup.psfhosted.org>


Daniel Diniz <ajaksu at gmail.com> added the comment:

As Victor notes, this is a controversial issue. And I'll add that the need for this feature seems not to have been brought up up in over a decade. So I'm closing this.

----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue4733>
_______________________________________

From report at bugs.python.org  Fri Dec 10 14:57:33 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Fri, 10 Dec 2021 19:57:33 +0000
Subject: [issue1182143] making builtin exceptions more informative
Message-ID: <1639166253.24.0.360902817684.issue1182143@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1182143>
_______________________________________

From report at bugs.python.org  Fri Dec 10 15:38:21 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Fri, 10 Dec 2021 20:38:21 +0000
Subject: [issue766910] fix one or two bugs in trace.py
Message-ID: <1639168701.75.0.382301402384.issue766910@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
nosy: +ajaksu2
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue766910>
_______________________________________

From report at bugs.python.org  Fri Dec 10 16:21:59 2021
From: report at bugs.python.org (Eryk Sun)
Date: Fri, 10 Dec 2021 21:21:59 +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: <1639171319.92.0.219813444834.issue43749@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

The Windows implementation of symlink_or_copy() actually copies "python.exe" and "pythonw.exe" launchers from "Lib/venv/scripts/nt". One cannot simply copy the "python3.exe" executable because the required DLLs aren't copied. If this seemed to work when testing, it was only because the installation directory was in PATH. The solution that actually works is to copy the launcher as "python3.exe".

----------
nosy: +eryksun
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 16:24:21 2021
From: report at bugs.python.org (Carl Friedrich Bolz-Tereick)
Date: Fri, 10 Dec 2021 21:24:21 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
Message-ID: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>


New submission from Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>:

The error range for the "duplicate argument in function definition" SyntaxError is too large:

$ cat x.py 
def f(a, b, c, d, e, f, g, a): pass
$ python x.py
  File "/home/cfbolz/projects/cpython/x.py", line 1
    def f(a, b, c, d, e, f, g, a): pass
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: duplicate argument 'a' in function definition

I would expect only the second 'a' to be underlined.

I can try to fix this.

----------
messages: 408248
nosy: Carl.Friedrich.Bolz, pablogsal
priority: normal
severity: normal
status: open
title: Error range of "duplicate argument" SyntaxErrors is too big

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Fri Dec 10 16:36:06 2021
From: report at bugs.python.org (Eryk Sun)
Date: Fri, 10 Dec 2021 21:36:06 +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: <1639172166.23.0.53594521356.issue43749@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


----------
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 16:44:00 2021
From: report at bugs.python.org (C.A.M. Gerlach)
Date: Fri, 10 Dec 2021 21:44:00 +0000
Subject: [issue40358] pathlib's relative_to should behave like os.path.relpath
In-Reply-To: <1587513783.17.0.6950267733.issue40358@roundup.psfhosted.org>
Message-ID: <1639172640.55.0.466941287699.issue40358@roundup.psfhosted.org>


C.A.M. Gerlach <CAM.Gerlach at Gerlach.CAM> added the comment:

For the record, requested [on Discourse](https://discuss.python.org/t/how-to-go-on-with-a-tiny-improvement-idea-for-pathlib/12472) as well, with a fairly similar proposal.

----------
nosy: +CAM-Gerlach

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40358>
_______________________________________

From report at bugs.python.org  Fri Dec 10 16:44:50 2021
From: report at bugs.python.org (Andre Roberge)
Date: Fri, 10 Dec 2021 21:44:50 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639172690.22.0.0246687413168.issue46042@roundup.psfhosted.org>


Change by Andre Roberge <andre.roberge at gmail.com>:


----------
nosy: +aroberge

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Fri Dec 10 17:27:14 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 10 Dec 2021 22:27:14 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639175234.13.0.103000555832.issue46042@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Thanks for the catch Carl!

> I can try to fix this.

Awesome, I will wait for the PR!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Fri Dec 10 17:59:11 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 22:59:11 +0000
Subject: [issue21964] inconsistency in list-generator comprehension with
 yield(-from)
In-Reply-To: <1405119987.38.0.925003339613.issue21964@psf.upfronthosting.co.za>
Message-ID: <1639177151.32.0.308492734104.issue21964@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I think this issue was resolved by now. This is what happens on 3.11:

>>> l = ["abc", range(3)]
>>> g = [(yield from i) for i in l]
  File "<stdin>", line 1
SyntaxError: 'yield' inside list comprehension

>>> g2 = ((yield from i) for i in l)
  File "<stdin>", line 1
SyntaxError: 'yield' inside generator expression

----------
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21964>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:00:24 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:00:24 +0000
Subject: [issue42114] Documentation of ctypes.CDLL does not correspond to code
In-Reply-To: <1603317735.12.0.0166150677555.issue42114@roundup.psfhosted.org>
Message-ID: <1639177224.12.0.56480826518.issue42114@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset c1051e08b3c6d9045322763876a4b0aea98d79f9 by Louis Sautier in branch 'main':
bpo-42114: ctypes documentation: fix winmode parameter default value (GH-29976)
https://github.com/python/cpython/commit/c1051e08b3c6d9045322763876a4b0aea98d79f9


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42114>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:00:44 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 23:00:44 +0000
Subject: [issue42114] Documentation of ctypes.CDLL does not correspond to code
In-Reply-To: <1603317735.12.0.0166150677555.issue42114@roundup.psfhosted.org>
Message-ID: <1639177244.65.0.184005456772.issue42114@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28263
pull_request: https://github.com/python/cpython/pull/30037

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42114>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:00:51 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 23:00:51 +0000
Subject: [issue42114] Documentation of ctypes.CDLL does not correspond to code
In-Reply-To: <1603317735.12.0.0166150677555.issue42114@roundup.psfhosted.org>
Message-ID: <1639177251.74.0.343061733626.issue42114@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28264
pull_request: https://github.com/python/cpython/pull/30038

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42114>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:02:15 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 23:02:15 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1639177335.19.0.891898110569.issue45635@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 0fe104fce7da709edddb701baa2249e3275db1fd by Irit Katriel in branch 'main':
bpo-45635: refactor print_exception_recursive into smaller functions to standardize error handling (GH-30015)
https://github.com/python/cpython/commit/0fe104fce7da709edddb701baa2249e3275db1fd


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:05:31 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:05:31 +0000
Subject: [issue27062] `inspect` doesn't have `__all__`
In-Reply-To: <1463689783.23.0.292900715898.issue27062@psf.upfronthosting.co.za>
Message-ID: <1639177531.24.0.942557715985.issue27062@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 810c1769f1c24ed907bdf3cc1086db4e602a28ae by Kumar Aditya in branch 'main':
bpo-27062: add `__all__` to inspect module (GH-30003)
https://github.com/python/cpython/commit/810c1769f1c24ed907bdf3cc1086db4e602a28ae


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27062>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:06:48 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:06:48 +0000
Subject: [issue27062] `inspect` doesn't have `__all__`
In-Reply-To: <1463689783.23.0.292900715898.issue27062@psf.upfronthosting.co.za>
Message-ID: <1639177608.14.0.765538839078.issue27062@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:

Thanks! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27062>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:08:50 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Fri, 10 Dec 2021 23:08:50 +0000
Subject: [issue21461] Recognize -pthread
In-Reply-To: <1399626963.64.0.665177402844.issue21461@psf.upfronthosting.co.za>
Message-ID: <1639177730.49.0.644765193316.issue21461@roundup.psfhosted.org>


Thomas Klausner <tk at giga.or.at> added the comment:

I must confess, I don't know.
This patch has been in pkgsrc since at least the import of the first python 2.7 package in 2011, and I haven't dug deeper.

If you think it is unnecessary, I'll trust you. I've just removed it from the python 3.10 package in pkgsrc.

----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21461>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:14:14 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 10 Dec 2021 23:14:14 +0000
Subject: [issue31370] Remove support for threads-less builds
In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za>
Message-ID: <1639178054.5.0.265519135744.issue31370@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:

https://web.dev/webassembly-threads/ suggests otherwise.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31370>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:15:20 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Fri, 10 Dec 2021 23:15:20 +0000
Subject: [issue21459] DragonFlyBSD support
In-Reply-To: <1399626494.21.0.91219272779.issue21459@psf.upfronthosting.co.za>
Message-ID: <1639178120.85.0.874104484838.issue21459@roundup.psfhosted.org>


Thomas Klausner <tk at giga.or.at> added the comment:

Not interested in this any longer, and Dragonfly's Dports doesn't carry this patch, so it's probably not needed any longer.

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21459>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:20:56 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 23:20:56 +0000
Subject: [issue9504] signal.signal/signal.alarm not working as expected
In-Reply-To: <1280910836.88.0.645209486589.issue9504@psf.upfronthosting.co.za>
Message-ID: <1639178456.89.0.904198092453.issue9504@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I'm unable to reproduce this on 3.11 on a Mac. Has it been fixed?

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9504>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:22:33 2021
From: report at bugs.python.org (Nicholas Bond)
Date: Fri, 10 Dec 2021 23:22:33 +0000
Subject: [issue46043] Python Launcher Not Opening Files.
Message-ID: <1639178553.87.0.850014051129.issue46043@roundup.psfhosted.org>


New submission from Nicholas Bond <nicholasjbond2020 at gmail.com>:

Python launcher opens its preferences and no terminal or Tkinter application opens. It appears as something was launched because for a fraction of a second, I see a window and then the icon glides back to its position on the desktop.

However, python files and Tkinter GUIs work when run through the IDLE and through other text editors, e.g. when I build the program in sublime text, the python launcher application opens and launches the Tkinter window.

Even the simplest of programs don't work. I tried opening this:
number = input("Type in a number:")

I ran this outside of the text editor(dragging the .py file onto the python launcher) and it still did not work.

----------
components: macOS
messages: 408260
nosy: ned.deily, nicholasjbond2020, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python Launcher Not Opening Files.
type: crash
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46043>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:28:07 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:28:07 +0000
Subject: [issue46014] functools.singledispatch does not support Union types
In-Reply-To: <1638970452.65.0.012237534186.issue46014@roundup.psfhosted.org>
Message-ID: <1639178887.16.0.971404459225.issue46014@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 3cb357a2e6ac18ee98db5d450414e773744e3c76 by Yurii Karabas in branch 'main':
bpo-46014: Add ability to use typing.Union with singledispatch (GH-30017)
https://github.com/python/cpython/commit/3cb357a2e6ac18ee98db5d450414e773744e3c76


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46014>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:29:02 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:29:02 +0000
Subject: [issue46014] functools.singledispatch does not support Union types
In-Reply-To: <1638970452.65.0.012237534186.issue46014@roundup.psfhosted.org>
Message-ID: <1639178942.79.0.610695449623.issue46014@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:

Support added as an enhancement in Python 3.11. Thanks, Yurii! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46014>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:29:38 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:29:38 +0000
Subject: [issue42114] Documentation of ctypes.CDLL does not correspond to code
In-Reply-To: <1603317735.12.0.0166150677555.issue42114@roundup.psfhosted.org>
Message-ID: <1639178978.52.0.303964972522.issue42114@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset f8eebb0db720cd81fb736d9cbfd16faf2ec68b53 by Miss Islington (bot) in branch '3.9':
bpo-42114: ctypes documentation: fix winmode parameter default value (GH-29976) (GH-30038)
https://github.com/python/cpython/commit/f8eebb0db720cd81fb736d9cbfd16faf2ec68b53


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42114>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:29:50 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:29:50 +0000
Subject: [issue42114] Documentation of ctypes.CDLL does not correspond to code
In-Reply-To: <1603317735.12.0.0166150677555.issue42114@roundup.psfhosted.org>
Message-ID: <1639178990.73.0.0746727682066.issue42114@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 8f3728edcbc205913772f8dc04cccd8bdc476ff4 by Miss Islington (bot) in branch '3.10':
bpo-42114: ctypes documentation: fix winmode parameter default value (GH-29976) (GH-30037)
https://github.com/python/cpython/commit/8f3728edcbc205913772f8dc04cccd8bdc476ff4


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42114>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:30:28 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:30:28 +0000
Subject: [issue42114] Documentation of ctypes.CDLL does not correspond to code
In-Reply-To: <1603317735.12.0.0166150677555.issue42114@roundup.psfhosted.org>
Message-ID: <1639179028.68.0.822210534862.issue42114@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:

Thanks! ? ? ?

----------
assignee:  -> docs at python
components: +Documentation -ctypes
nosy: +docs at python
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42114>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:34:36 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 23:34:36 +0000
Subject: [issue25834] getpass falls back when sys.stdin is changed
In-Reply-To: <1449774081.69.0.580172668816.issue25834@psf.upfronthosting.co.za>
Message-ID: <1639179276.8.0.894890055826.issue25834@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Adam, do you have a suggestion what the check should be?

----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25834>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:34:50 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:34:50 +0000
Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI
In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org>
Message-ID: <1639179290.99.0.360842159525.issue43795@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 98e506ae8a7997658a08fbf77ac016d200588cb3 by Petr Viktorin in branch 'main':
bpo-43795: Document stable_abi.txt format and contents (GH-29956)
https://github.com/python/cpython/commit/98e506ae8a7997658a08fbf77ac016d200588cb3


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43795>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:36:19 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:36:19 +0000
Subject: [issue13236] unittest needs more flush calls
In-Reply-To: <1319137324.16.0.266090134048.issue13236@psf.upfronthosting.co.za>
Message-ID: <1639179379.31.0.180601324208.issue13236@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 83fa1291fd0a25216a4a9e990f423682fda67cbe by Serhiy Storchaka in branch '3.10':
[3.10] bpo-13236: Flush the output stream more often in unittest (GH-29864) (GH-29929)
https://github.com/python/cpython/commit/83fa1291fd0a25216a4a9e990f423682fda67cbe


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13236>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:36:24 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 23:36:24 +0000
Subject: [issue13236] unittest needs more flush calls
In-Reply-To: <1319137324.16.0.266090134048.issue13236@psf.upfronthosting.co.za>
Message-ID: <1639179384.35.0.359901301694.issue13236@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +28265
pull_request: https://github.com/python/cpython/pull/30039

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13236>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:44:34 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:44:34 +0000
Subject: [issue42918] Nested multi-line expression will lead to "compile()"
 fails
In-Reply-To: <1610517717.73.0.740461753555.issue42918@roundup.psfhosted.org>
Message-ID: <1639179874.41.0.743417350184.issue42918@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 28179aac796ed1debdce336c4b8ca18e8475d40d by Weipeng Hong in branch 'main':
bpo-42918: Improve build-in function compile() in mode 'single' (GH-29934)
https://github.com/python/cpython/commit/28179aac796ed1debdce336c4b8ca18e8475d40d


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42918>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:44:38 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 10 Dec 2021 23:44:38 +0000
Subject: [issue42918] Nested multi-line expression will lead to "compile()"
 fails
In-Reply-To: <1610517717.73.0.740461753555.issue42918@roundup.psfhosted.org>
Message-ID: <1639179878.2.0.00787635219133.issue42918@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +28266
pull_request: https://github.com/python/cpython/pull/30040

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42918>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:44:54 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 10 Dec 2021 23:44:54 +0000
Subject: [issue20559] urllib/http fail to sanitize a non-ascii url
In-Reply-To: <1391834064.13.0.416589140445.issue20559@psf.upfronthosting.co.za>
Message-ID: <1639179894.17.0.332993923949.issue20559@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20559>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:45:06 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:45:06 +0000
Subject: [issue37971] Wrong trace with multiple decorators (linenumber wrong
 in frame)
In-Reply-To: <1567017172.25.0.486267767179.issue37971@roundup.psfhosted.org>
Message-ID: <1639179906.85.0.31654732688.issue37971@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset b593bdc7803cc75461f6f8888ad03cb7d8dfc416 by Carl Friedrich Bolz-Tereick in branch 'main':
bpo-37971: fix the position of decorator application (GH-30027)
https://github.com/python/cpython/commit/b593bdc7803cc75461f6f8888ad03cb7d8dfc416


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37971>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:53:30 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 10 Dec 2021 23:53:30 +0000
Subject: [issue46014] functools.singledispatch does not support Union types
In-Reply-To: <1638970452.65.0.012237534186.issue46014@roundup.psfhosted.org>
Message-ID: <1639180410.15.0.871954786048.issue46014@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

This is awesome! Should a note be added to the functools documentation mentioning the new feature? (Genuine question ? I'm not sure whether it's necessary myself.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46014>
_______________________________________

From report at bugs.python.org  Fri Dec 10 18:59:03 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Fri, 10 Dec 2021 23:59:03 +0000
Subject: [issue45929] extend json.tool --json-lines to ignore empty rows
In-Reply-To: <1638200958.63.0.173460715414.issue45929@roundup.psfhosted.org>
Message-ID: <1639180743.41.0.10735023968.issue45929@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:

I agree with Serhiy that in general the fact that json.tool crashes here is useful: similarly to an exception in Python code, it can inform the user that some data they feed to json.tool is invalid.

At the same time, I find it a bit obnoxious that the current implementation doesn't allow for the *final character* of the input to be a newline (or "characters" in case of \r\n... but it should still only ignore *a single effective newline*).

I mean, if the user starts spewing newlines in the middle of the file... that might easily be an error. If the file ends with 5 empty lines, that might easily be an error. But, if the file really is:

{'line': 1, 'data': ...}\n
{'line': 2, 'data': ...}\n
{'line': 3, 'data': ...}\n

I think that should be pragmatically accepted by json.tool, especially since many text editors now add newline characters at file ends.

----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45929>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:02:04 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Sat, 11 Dec 2021 00:02:04 +0000
Subject: [issue45859] test_collections has a wrong test in case _itemgetter is
 not available
In-Reply-To: <1637527591.49.0.376717916242.issue45859@roundup.psfhosted.org>
Message-ID: <1639180924.05.0.108662208494.issue45859@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 7c5b01b5101923fc38274c491bd55239ee9f0416 by Miss Islington (bot) in branch '3.8':
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only (GH-29691) (GH-29710)
https://github.com/python/cpython/commit/7c5b01b5101923fc38274c491bd55239ee9f0416


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45859>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:03:00 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Sat, 11 Dec 2021 00:03:00 +0000
Subject: [issue45822] Py_CompileString does not respect the coding cookie with
 the new parser if flags are empty
In-Reply-To: <1637091566.73.0.796016842609.issue45822@roundup.psfhosted.org>
Message-ID: <1639180980.66.0.949153213483.issue45822@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset e1e3f648ad6ab467356d2d14e1d208583c1a76c6 by Miss Islington (bot) in branch '3.10':
bpo-45822: Minor cleanups to the test_Py_CompileString test (GH-29750) (GH-29758)
https://github.com/python/cpython/commit/e1e3f648ad6ab467356d2d14e1d208583c1a76c6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45822>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:03:19 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Sat, 11 Dec 2021 00:03:19 +0000
Subject: [issue45822] Py_CompileString does not respect the coding cookie with
 the new parser if flags are empty
In-Reply-To: <1637091566.73.0.796016842609.issue45822@roundup.psfhosted.org>
Message-ID: <1639180999.98.0.253297344118.issue45822@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 5f622f1d5c5425ed1e992da6611edfb486a9bf7c by Miss Islington (bot) in branch '3.9':
bpo-45822: Minor cleanups to the test_Py_CompileString test (GH-29750) (GH-29759)
https://github.com/python/cpython/commit/5f622f1d5c5425ed1e992da6611edfb486a9bf7c


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45822>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:04:24 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Sat, 11 Dec 2021 00:04:24 +0000
Subject: [issue19737] Documentation of globals() and locals() should be
 improved
In-Reply-To: <1385225461.09.0.671908077084.issue19737@psf.upfronthosting.co.za>
Message-ID: <1639181064.97.0.0896775877219.issue19737@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 4fe5585240f64c3d14eb635ff82b163f92074b3a by 180909 in branch 'main':
bpo-19737: Improved the documentation for globals (GH-29823)
https://github.com/python/cpython/commit/4fe5585240f64c3d14eb635ff82b163f92074b3a


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19737>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:04:32 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 11 Dec 2021 00:04:32 +0000
Subject: [issue19737] Documentation of globals() and locals() should be
 improved
In-Reply-To: <1385225461.09.0.671908077084.issue19737@psf.upfronthosting.co.za>
Message-ID: <1639181072.66.0.428549796099.issue19737@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +28267
pull_request: https://github.com/python/cpython/pull/30041

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19737>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:04:39 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 11 Dec 2021 00:04:39 +0000
Subject: [issue19737] Documentation of globals() and locals() should be
 improved
In-Reply-To: <1385225461.09.0.671908077084.issue19737@psf.upfronthosting.co.za>
Message-ID: <1639181079.16.0.957892016193.issue19737@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28268
pull_request: https://github.com/python/cpython/pull/30042

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19737>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:10:22 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 00:10:22 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639181422.46.0.049994516776.issue46028@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

I'm going to need a decent amount of time to learn all of these components, because I never use this OS, Tox, nor virtualenv :) I'll try and get to it, but don't hold your breath. Luckily, Modules/getpath.py is much easier to follow and modify than the old systems.

If there's a pyvenv.cfg involved, base_executable should be calculated based on the "home" key in it. Previously, I don't think we calculated it at all on Linux - it was just sys.executable before site.py changes anything.

On Windows, it was always intended to be "the executable that new venvs should be created with" so that venvs created from venvs would be based off the same install, rather than trying to chain. I have no idea what the correct path for that is in this context, so could do with some help.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:12:26 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 00:12:26 +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: <1639181546.02.0.638543214279.issue43749@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

We'd also need to update the launcher to launch the executable with its name, which it currently doesn't do. I was looking at this recently for some other reason.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:30:23 2021
From: report at bugs.python.org (STINNER Victor)
Date: Sat, 11 Dec 2021 00:30:23 +0000
Subject: [issue9504] signal.signal/signal.alarm not working as expected
In-Reply-To: <1280910836.88.0.645209486589.issue9504@psf.upfronthosting.co.za>
Message-ID: <1639182623.75.0.445380350686.issue9504@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

https://www.python.org/dev/peps/pep-0475/ changed deeply how Python handles signals. Python now tries to restart syscalls interrupted by signals (EINTR). A Python function only raises an exception if the Python signal handler raises an exception.

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9504>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:31:42 2021
From: report at bugs.python.org (STINNER Victor)
Date: Sat, 11 Dec 2021 00:31:42 +0000
Subject: [issue20559] urllib/http fail to sanitize a non-ascii url
In-Reply-To: <1391834064.13.0.416589140445.issue20559@psf.upfronthosting.co.za>
Message-ID: <1639182702.11.0.561064189547.issue20559@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
nosy:  -vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20559>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:32:28 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Sat, 11 Dec 2021 00:32:28 +0000
Subject: [issue19737] Documentation of globals() and locals() should be
 improved
In-Reply-To: <1385225461.09.0.671908077084.issue19737@psf.upfronthosting.co.za>
Message-ID: <1639182748.41.0.832024434671.issue19737@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 1f7000808e8385e2a29ffd0ef6aac9a6139d3d92 by Miss Islington (bot) in branch '3.10':
bpo-19737: Improved the documentation for globals (GH-29823) (GH-30041)
https://github.com/python/cpython/commit/1f7000808e8385e2a29ffd0ef6aac9a6139d3d92


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19737>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:32:33 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Sat, 11 Dec 2021 00:32:33 +0000
Subject: [issue19737] Documentation of globals() and locals() should be
 improved
In-Reply-To: <1385225461.09.0.671908077084.issue19737@psf.upfronthosting.co.za>
Message-ID: <1639182753.23.0.129235612296.issue19737@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 9299e3a39c3b1dd7d5db0d88080249c2dab3070f by Miss Islington (bot) in branch '3.9':
bpo-19737: Improved the documentation for globals (GH-29823) (GH-30042)
https://github.com/python/cpython/commit/9299e3a39c3b1dd7d5db0d88080249c2dab3070f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19737>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:33:08 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Sat, 11 Dec 2021 00:33:08 +0000
Subject: [issue19737] Documentation of globals() and locals() should be
 improved
In-Reply-To: <1385225461.09.0.671908077084.issue19737@psf.upfronthosting.co.za>
Message-ID: <1639182788.01.0.13524336812.issue19737@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:

Thanks! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19737>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:34:50 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Sat, 11 Dec 2021 00:34:50 +0000
Subject: [issue13236] unittest needs more flush calls
In-Reply-To: <1319137324.16.0.266090134048.issue13236@psf.upfronthosting.co.za>
Message-ID: <1639182890.12.0.766491600105.issue13236@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset d55a03e02e69fb7f639998de71ed3f44c2f4f999 by Miss Islington (bot) in branch '3.9':
[3.10] bpo-13236: Flush the output stream more often in unittest (GH-29929) (GH-30039)
https://github.com/python/cpython/commit/d55a03e02e69fb7f639998de71ed3f44c2f4f999


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13236>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:36:03 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Sat, 11 Dec 2021 00:36:03 +0000
Subject: [issue13236] unittest needs more flush calls
In-Reply-To: <1319137324.16.0.266090134048.issue13236@psf.upfronthosting.co.za>
Message-ID: <1639182963.41.0.219496655503.issue13236@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:

Thanks, Serhiy! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13236>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:40:12 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 11 Dec 2021 00:40:12 +0000
Subject: [issue23469] Delete Misc/*.wpr files
In-Reply-To: <1424048342.99.0.00819785192711.issue23469@psf.upfronthosting.co.za>
Message-ID: <1639183212.56.0.0959211894319.issue23469@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Since the files have effectively been abandoned, I think removing them should be considered now.  The three files in /Misc, for wing-3, 4, and 5, are
python-wing3.wpr
python-wing4.wpr
python-wing5.wpr

The current version of Wing is 8.1.1.  The files were last edited in March 2011, a decade ago, by M. Foord.  The last contains

#!wing
#!version=5.0
##################################################################
# Wing IDE project file                                          #
##################################################################
[project attributes]
proj.directory-list = [{'dirloc': loc('..'),
                        'excludes': [u'.hg',
                                     u'Lib/unittest/__pycache__',
                                     u'Lib/unittest/test/__pycache__',
                                     u'Lib/__pycache__',
                                     u'build',
                                     u'Doc/build'],
                        'filter': '*',
                        'include_hidden': False,
                        'recursive': True,
                        'watch_for_changes': True}]
proj.file-type = 'shared'

*4.* is the same except for the version comment.  Both are specialized for working with Lib/unittest, failing to exclude most of the other __pycache__ directories.  I wonder whether current Wing now knows that it should ignore __cache__ directories.  (I considered emailing support at wingware.com, but decided to wait.)  In the absence of more comments, we could inquire on python-dev.

In 2019, these .ini-format configuration data files were marked as executable scripts.  I believe that this was a mistake.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23469>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:40:48 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 11 Dec 2021 00:40:48 +0000
Subject: [issue23469] Delete Misc/*.wpr files
In-Reply-To: <1424048342.99.0.00819785192711.issue23469@psf.upfronthosting.co.za>
Message-ID: <1639183248.9.0.900947695279.issue23469@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

url: https://github.com/python/cpython/blob/main/Misc/python-wing5.wpr

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23469>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:42:01 2021
From: report at bugs.python.org (Matthias Bussonnier)
Date: Sat, 11 Dec 2021 00:42:01 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
Message-ID: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>


New submission from Matthias Bussonnier <bussonniermatthias at gmail.com>:

This page: https://docs.python.org/3/distutils/sourcedist.html

Is the first result on google for "python sdist", but does not mention that all but tar.gz and zip are supported by PyPI.

----------
assignee: docs at python
components: Documentation
messages: 408288
nosy: docs at python, mbussonn
priority: normal
severity: normal
status: open
title: Update distutils documentation to  say PyPI only accepts tar.gz and zip.

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:43:03 2021
From: report at bugs.python.org (Matthias Bussonnier)
Date: Sat, 11 Dec 2021 00:43:03 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639183383.92.0.103426970031.issue46044@roundup.psfhosted.org>


Change by Matthias Bussonnier <bussonniermatthias at gmail.com>:


----------
keywords: +patch
pull_requests: +28269
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30043

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Fri Dec 10 19:44:12 2021
From: report at bugs.python.org (Matthias Bussonnier)
Date: Sat, 11 Dec 2021 00:44:12 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639183452.56.0.604694307057.issue46044@roundup.psfhosted.org>


Change by Matthias Bussonnier <bussonniermatthias at gmail.com>:


----------
nosy: +brett.cannon

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Fri Dec 10 20:12:04 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 11 Dec 2021 01:12:04 +0000
Subject: [issue46013] Confusing period in object.__hash__ doc
In-Reply-To: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org>
Message-ID: <1639185124.45.0.4259623383.issue46013@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46013>
_______________________________________

From report at bugs.python.org  Fri Dec 10 22:21:25 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 11 Dec 2021 03:21:25 +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: <1639192885.21.0.319526541302.issue43749@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

The code to copy a file could be rewritten to use a regex match. For example:

            # Copy src to dst. If src is a base executable, copy a launcher.
            dirname, filename = os.path.split(src)
            m = re.match(r'(pythonw?)[0-9._]*((?:_d)?(?:\.exe|\.pdb))$',
                    filename.lower())
            if m is not None:
                src = os.path.join(os.path.dirname(__file__),
                        'scripts', 'nt', m.group(1) + m.group(2))
                # If the base environment is a Python source build, use
                # the launcher in the build directory instead of
                # "Lib/venv/scripts/nt".
                if sysconfig.is_python_build(True) or not os.path.isfile(src):
                    basename = ('venvlauncher' if m.group(1) == 'python' else
                                'venvwlauncher')
                    src = os.path.join(dirname, basename + m.group(2))

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43749>
_______________________________________

From report at bugs.python.org  Fri Dec 10 22:56:45 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 11 Dec 2021 03:56:45 +0000
Subject: [issue44289] tarfile.is_tarfile() and tarfile.open() when used with
 file object may cause tarfile operations to fail
In-Reply-To: <1622646545.23.0.614350359918.issue44289@roundup.psfhosted.org>
Message-ID: <1639195005.6.0.755081436657.issue44289@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
nosy: +lars.gustaebel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44289>
_______________________________________

From report at bugs.python.org  Fri Dec 10 23:39:53 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 11 Dec 2021 04:39:53 +0000
Subject: [issue46041] Add reference counting micro-optimizations to
 listobject.c
In-Reply-To: <1639161250.42.0.698258533036.issue46041@roundup.psfhosted.org>
Message-ID: <1639197593.0.0.383171152413.issue46041@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

The OP self-closed the PR.

----------
nosy: +rhettinger
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46041>
_______________________________________

From report at bugs.python.org  Fri Dec 10 23:39:53 2021
From: report at bugs.python.org (Xinhang Xu)
Date: Sat, 11 Dec 2021 04:39:53 +0000
Subject: [issue44946] Integer operations are inefficient for "medium" integers.
In-Reply-To: <1629282332.14.0.448234766884.issue44946@roundup.psfhosted.org>
Message-ID: <1639197593.23.0.508192140253.issue44946@roundup.psfhosted.org>


Change by Xinhang Xu <xuxinhang4567 at 126.com>:


----------
nosy: +xuxinhang
nosy_count: 3.0 -> 4.0
pull_requests: +28270
pull_request: https://github.com/python/cpython/pull/30044

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44946>
_______________________________________

From report at bugs.python.org  Sat Dec 11 02:40:23 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Sat, 11 Dec 2021 07:40:23 +0000
Subject: [issue22239] asyncio: nested event loop
In-Reply-To: <1408557830.66.0.604610139339.issue22239@psf.upfronthosting.co.za>
Message-ID: <1639208423.18.0.762669153578.issue22239@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
nosy: +kumaraditya303

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22239>
_______________________________________

From report at bugs.python.org  Sat Dec 11 03:38:24 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Sat, 11 Dec 2021 08:38:24 +0000
Subject: [issue45855] PyCapsule_Import still using PyImport_ImportModuleNoBlock
In-Reply-To: <1637425638.46.0.745441938277.issue45855@roundup.psfhosted.org>
Message-ID: <1639211904.63.0.157334332236.issue45855@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
nosy: +kumaraditya303
nosy_count: 2.0 -> 3.0
pull_requests: +28271
pull_request: https://github.com/python/cpython/pull/30046

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45855>
_______________________________________

From report at bugs.python.org  Sat Dec 11 05:31:04 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Sat, 11 Dec 2021 10:31:04 +0000
Subject: [issue46045] NetBSD: do not use POSIX semaphores
Message-ID: <1639218664.63.0.969239482314.issue46045@roundup.psfhosted.org>


New submission from Thomas Klausner <tk at giga.or.at>:

On NetBSD by default, the following tests do not finish in > 1h:

1:07:13 load avg: 0.00 running: test_compileall (1 hour 7 min), test_multiprocessing_fork (1 hour 7 min), test_concurrent_futures (1 hour 6 min)

Defining HAVE_BROKEN_POSIX_SEMAPHORES fixes this, and they finish:

0:00:32 load avg: 10.63 [408/427/17] test_compileall passed ...
...
0:02:37 load avg: 3.04 [427/427/22] test_concurrent_futures passed (2 min 33 sec)

The last one fails:
test_multiprocessing_fork

with most of the subtests failing like this:

ERROR: test_shared_memory_SharedMemoryServer_ignores_sigint (test.test_multiprocessing_fork.WithProcessesTestSharedMemory)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/scratch/lang/python310/work/Python-3.10.1/Lib/test/_test_multiprocessing.py", line 4006, in test_shared_memory_SharedMemoryServer_ignores_sigint
    sl = smm.ShareableList(range(10))
  File "/scratch/lang/python310/work/Python-3.10.1/Lib/multiprocessing/managers.py", line 1372, in ShareableList
    sl = shared_memory.ShareableList(sequence)
  File "/scratch/lang/python310/work/Python-3.10.1/Lib/multiprocessing/shared_memory.py", line 327, in __init__
    self.shm = SharedMemory(name, create=True, size=requested_size)
  File "/scratch/lang/python310/work/Python-3.10.1/Lib/multiprocessing/shared_memory.py", line 92, in __init__
    self._fd = _posixshmem.shm_open(
OSError: [Errno 86] Not supported: '/psm_b1ec903a'

I think this is a separate issue, so I'd like to define HAVE_BROKEN_POSIX_SEMAPHORES for now.

This has been done in pkgsrc since at least python 2.7 (in 2011), I haven't dug deeper.

----------
components: Interpreter Core
messages: 408291
nosy: wiz
priority: normal
severity: normal
status: open
title: NetBSD: do not use POSIX semaphores
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46045>
_______________________________________

From report at bugs.python.org  Sat Dec 11 05:37:46 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Sat, 11 Dec 2021 10:37:46 +0000
Subject: [issue46045] NetBSD: do not use POSIX semaphores
In-Reply-To: <1639218664.63.0.969239482314.issue46045@roundup.psfhosted.org>
Message-ID: <1639219066.82.0.270679973538.issue46045@roundup.psfhosted.org>


Change by Thomas Klausner <tk at giga.or.at>:


----------
keywords: +patch
pull_requests: +28272
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30047

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46045>
_______________________________________

From report at bugs.python.org  Sat Dec 11 05:56:19 2021
From: report at bugs.python.org (Souvik Ghosh)
Date: Sat, 11 Dec 2021 10:56:19 +0000
Subject: [issue46046] I/O bound threads got to no chance to run with small CPU
 bound threads with new GIL
Message-ID: <1639220179.27.0.659005921662.issue46046@roundup.psfhosted.org>


New submission from Souvik Ghosh <souvikghosh872 at gmail.com>:

According to David Beazley' talk in PyCon'2010 in Atlanta Georgia, he demonstrated about a new GIL with running CPU bound and I/O bound threads together.

He said the talk that the threads which are forced to timeout of 5ms, will have the lower priority(which is CPU bound) and the thread which suspends the GIL within 5ms will have higher priority (which is I/O bound). 

What happens in the following code is if I set args=(10000000,) (seven zero after 1) then only I/O bound runs and returns when CPU bound takes much time to execute. But if I decrease that args to args=(1000,) then I/O bound got no chance to reaquire the GIL in the meantime even though the sys.getswitchinterval() is equal to 5ms(By default). If I/O bound doesn't reacquire GIL with args=(10000,) then the time to execute to run 
only the CPU bound takes 0.42777760000035414 seconds. Thats means almost ticks 0.42777760000035414/0.005=85 (approx) times to set the priority in between the two threads. In that case if the I/O got more priority within that time, it should have returned the value within that ticks. But I didn't happen. 

import threading
from queue import Queue
from timeit import default_timer as timer
import urllib.request


q = Queue()  # Queue technique to pass returns among threads while running


def decrement(numbers):  # CPU bound
    while numbers > 0:
        numbers -= 1
        if not q.empty():
            """I added this method because this thread will run most of the time
            because it's mostly cpu bound"""
            print(numbers)
            print(q.get(block=False))
            print(timer() - start)  # It tell after when exactly I/O bound returns value after both the threads started to run


def get_data():  # I/O bound

    with urllib.request.urlopen("https://www.google.com") as dt:
        q.put(dt.read(), block=False)


if __name__ == "__main__":
    start = timer()
    t1 = threading.Thread(target=get_data)
    #t2 = threading.Thread(target=decrement, args=(10000000,)) #For this I/O responds and returns
    t2 = threading.Thread(target=decrement, args=(100000,)) # I/O doesn't responds at all
    t1.start()
    t2.start()

    t1.join()
    t2.join()
    print(timer() - start)

Look at the second code...


import threading
from queue import Queue
from timeit import default_timer as timer
import urllib.request
import sys


q = Queue()  # Queue technique to pass returns among threads while running


def decrement(numbers):  # CPU bound
    while numbers > 0:
        numbers -= 1
        if not q.empty():
            """I added this method because this thread will run most of the time
            because it's mostly cpu bound"""
            print(numbers)
            print(q.get(block=False))
            print(timer() - start)  # It tell after when exactly I/O bound returns value after both the threads started to run


def get_data():  # I/O bound

    with urllib.request.urlopen("https://www.google.com") as dt:
        q.put(dt.read(), block=False)


if __name__ == "__main__":
    sys.setswitchinterval(0.0000000000000000000000000001)
    start = timer()
    t1 = threading.Thread(target=get_data)
    #t2 = threading.Thread(target=decrement, args=(1000000,)) #I/O responds with this 
    t2 = threading.Thread(target=decrement, args=(10000,))    # I/O doesn't responds at all even with this 0.0000000000000000000000000001 seconds of threads switching interval
    t1.start()
    t2.start()

    t1.join()
    t2.join()
    print(timer() - start)

Can't we have a more better version of GIL to set I/O threads(overall) priorities even more better and not to degrade the CPU bound and better callbacks in response? Or, try to remove the GIL?

Thank you so much, great future of Python!

----------
components: Interpreter Core
files: GIL9.py
messages: 408292
nosy: souvikghosh
priority: normal
severity: normal
status: open
title: I/O bound threads got to no chance to run with small CPU bound threads with new GIL
type: performance
versions: Python 3.10
Added file: https://bugs.python.org/file50487/GIL9.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46046>
_______________________________________

From report at bugs.python.org  Sat Dec 11 05:59:28 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 11 Dec 2021 10:59:28 +0000
Subject: [issue45929] extend json.tool --json-lines to ignore empty rows
In-Reply-To: <1638200958.63.0.173460715414.issue45929@roundup.psfhosted.org>
Message-ID: <1639220368.51.0.305452481571.issue45929@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

The current implementation allows for the final character of the input to be a newline. It does not allow double newlines. In the original example 

   echo -e '{"foo":1}\n{"bar":2}\n'

the echo command adds a newline to the output (which already contains the trailing newline), so the result ends with two newlines. Use option -n to disable adding newline in echo.

I afraid that if we add support of empty lines, soon we will get requests for supporting comments, encoding cookies, single-quote strings, non-quoted keys, hexadecimal integers and other possible JSON extensions.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45929>
_______________________________________

From report at bugs.python.org  Sat Dec 11 06:04:09 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 11 Dec 2021 11:04:09 +0000
Subject: [issue21964] inconsistency in list-generator comprehension with
 yield(-from)
In-Reply-To: <1405119987.38.0.925003339613.issue21964@psf.upfronthosting.co.za>
Message-ID: <1639220649.09.0.982438568125.issue21964@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Resolved in issue10544.

----------
nosy: +serhiy.storchaka
resolution: out of date -> duplicate
stage: test needed -> resolved
status: pending -> closed
superseder:  -> yield expression inside generator expression does nothing

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21964>
_______________________________________

From report at bugs.python.org  Sat Dec 11 07:12:05 2021
From: report at bugs.python.org (Jonas Witschel)
Date: Sat, 11 Dec 2021 12:12:05 +0000
Subject: [issue46047] When using Py_NewInterpreter,
 some modules fail to import in Python 3.10
Message-ID: <1639224725.06.0.440012701527.issue46047@roundup.psfhosted.org>


New submission from Jonas Witschel <git at diabonas.de>:

Consider the following minimal example C code which is trying to import jsonschema (https://python-jsonschema.readthedocs.io/en/stable/), compiled using "gcc test_newinterpreter.c -I /usr/include/python3.10 -lpython3.10 -o test_newinterpreter" or similar:

#include <Python.h>

int main(void) {
	Py_Initialize();
	PyThreadState *interpreter = Py_NewInterpreter();
	PyRun_SimpleString("import jsonschema");
	Py_Finalize();	
}

In Python 3.9.9, this works as expected. However in Python 3.10.0, the following error is produced:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/jsonschema/__init__.py", line 21, in <module>
    from jsonschema._types import TypeChecker
  File "/usr/lib/python3.10/site-packages/jsonschema/_types.py", line 168, in <module>
    draft3_type_checker = TypeChecker(
TypeError: TypeChecker() takes no arguments

Removing the Py_NewInterpreter() call makes the example work as expected in Python 3.10.0.

This might be related to the enhancements to the type cache from bpo-42745.

Another recent bug report I found that might possibly be related is bpo-46036.

This bug breaks some WeeChat plugins that try to import one of the affected modules, e.g. weechat-matrix (https://github.com/poljar/weechat-matrix).

----------
components: C API, Subinterpreters
messages: 408295
nosy: diabonas
priority: normal
severity: normal
status: open
title: When using Py_NewInterpreter, some modules fail to import in Python 3.10
type: compile error
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46047>
_______________________________________

From report at bugs.python.org  Sat Dec 11 07:13:26 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Sat, 11 Dec 2021 12:13:26 +0000
Subject: [issue46043] Python Launcher Not Opening Files.
In-Reply-To: <1639178553.87.0.850014051129.issue46043@roundup.psfhosted.org>
Message-ID: <1639224806.18.0.220279237753.issue46043@roundup.psfhosted.org>


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

Are you on macOS 10.15 or later?  If so, this is a duplicate of issue40477.

A workaround mentioned in that issue is to make sure that Terminal.app is open.

----------
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46043>
_______________________________________

From report at bugs.python.org  Sat Dec 11 07:26:32 2021
From: report at bugs.python.org (Jonas Witschel)
Date: Sat, 11 Dec 2021 12:26:32 +0000
Subject: [issue46047] When using Py_NewInterpreter,
 some modules fail to import in Python 3.10
In-Reply-To: <1639224725.06.0.440012701527.issue46047@roundup.psfhosted.org>
Message-ID: <1639225592.47.0.739457138653.issue46047@roundup.psfhosted.org>


Jonas Witschel <git at diabonas.de> added the comment:

Downstream bug report in Arch Linux: https://bugs.archlinux.org/task/72979

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46047>
_______________________________________

From report at bugs.python.org  Sat Dec 11 07:46:23 2021
From: report at bugs.python.org (Carl Friedrich Bolz-Tereick)
Date: Sat, 11 Dec 2021 12:46:23 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639226783.49.0.625960267044.issue46042@roundup.psfhosted.org>


Carl Friedrich Bolz-Tereick <cfbolz at gmx.de> added the comment:

let's see whether I promised too much, I don't know CPython's symtable.c too well yet ;-). Will shout for help when I get stuck.

Anyway, here is a related bug, coming from the same symtable function symtable_add_def_helper, also with an imprecise error location:

$ cat x.py 
{i for i in range(5)
        if (j := 0)
            for j in range(5)}

$ ./python x.py 
  File "/home/cfbolz/projects/cpython/x.py", line 1
    {i for i in range(5)
    ^^^^^^^^^^^^^^^^^^^^
SyntaxError: comprehension inner loop cannot rebind assignment expression target 'j'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:05:13 2021
From: report at bugs.python.org (Jonas Witschel)
Date: Sat, 11 Dec 2021 13:05:13 +0000
Subject: [issue46047] When using Py_NewInterpreter,
 some modules fail to import in Python 3.10
In-Reply-To: <1639224725.06.0.440012701527.issue46047@roundup.psfhosted.org>
Message-ID: <1639227913.2.0.261865450753.issue46047@roundup.psfhosted.org>


Jonas Witschel <git at diabonas.de> added the comment:

I notice this has already been reported as bpo-46006 and bpo-46034, so closing in favour of these.

----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46047>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:08:09 2021
From: report at bugs.python.org (Jonas Witschel)
Date: Sat, 11 Dec 2021 13:08:09 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639228089.37.0.645411497522.issue46006@roundup.psfhosted.org>


Change by Jonas Witschel <git at diabonas.de>:


----------
nosy: +diabonas

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:13:55 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 13:13:55 +0000
Subject: [issue46048] embeddable distro cannot import modules
Message-ID: <1639228435.55.0.0507692076358.issue46048@roundup.psfhosted.org>


New submission from Steve Dower <steve.dower at python.org>:

The embeddable distro cannot import native modules.

This is because the '.' entry in the ._pth file is incorrect parsed by the new getpath module (issue45582).

----------
assignee: steve.dower
components: Interpreter Core
messages: 408300
nosy: lukasz.langa, steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: embeddable distro cannot import modules
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46048>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:15:27 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 13:15:27 +0000
Subject: [issue46048] embeddable distro cannot import modules
In-Reply-To: <1639228435.55.0.0507692076358.issue46048@roundup.psfhosted.org>
Message-ID: <1639228527.73.0.93982316946.issue46048@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
keywords: +patch
pull_requests: +28273
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30048

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46048>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:24:12 2021
From: report at bugs.python.org (John Belmonte)
Date: Sat, 11 Dec 2021 13:24:12 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1639229052.3.0.492776333187.issue45995@roundup.psfhosted.org>


Change by John Belmonte <john at neggie.net>:


----------
keywords: +patch
nosy: +jbelmonte
nosy_count: 5.0 -> 6.0
pull_requests: +28274
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30049

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:29:31 2021
From: report at bugs.python.org (=?utf-8?q?Adam_Barto=C5=A1?=)
Date: Sat, 11 Dec 2021 13:29:31 +0000
Subject: [issue25834] getpass falls back when sys.stdin is changed
In-Reply-To: <1449774081.69.0.580172668816.issue25834@psf.upfronthosting.co.za>
Message-ID: <1639229371.24.0.987228200147.issue25834@roundup.psfhosted.org>


Adam Barto? <drekin at gmail.com> added the comment:

Sorry, I don't. But my use case is not relevant any more since my package was a workround for problems with entering Unicode interactively on Windows, and these problems were resolved in Python since then.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25834>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:38:21 2021
From: report at bugs.python.org (Souvik Ghosh)
Date: Sat, 11 Dec 2021 13:38:21 +0000
Subject: [issue46046] I/O bound threads got to no chance to run with small CPU
 bound threads with new GIL
In-Reply-To: <1639220179.27.0.659005921662.issue46046@roundup.psfhosted.org>
Message-ID: <1639229901.56.0.369299496218.issue46046@roundup.psfhosted.org>


Souvik Ghosh <souvikghosh872 at gmail.com> added the comment:

Python-ideas link in here:-
https://mail.python.org/archives/list/python-ideas at python.org/message/A5MX6SQUHP65JC6V5ZFCCHMMJURM4KHB/

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46046>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:43:48 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 13:43:48 +0000
Subject: [issue46048] embeddable distro cannot import modules
In-Reply-To: <1639228435.55.0.0507692076358.issue46048@roundup.psfhosted.org>
Message-ID: <1639230228.06.0.656099903118.issue46048@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset 971ece8e1738b1107dda692cc44c6d8ddce384cd by Steve Dower in branch 'main':
bpo-46048: Fix parsing of single character lines in getpath readlines() (GH-30048)
https://github.com/python/cpython/commit/971ece8e1738b1107dda692cc44c6d8ddce384cd


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46048>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:46:56 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 13:46:56 +0000
Subject: [issue46048] embeddable distro cannot import modules
In-Reply-To: <1639228435.55.0.0507692076358.issue46048@roundup.psfhosted.org>
Message-ID: <1639230416.51.0.0758195625549.issue46048@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46048>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:48:47 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 11 Dec 2021 13:48:47 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1639230527.59.0.33227897308.issue46032@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
keywords: +patch
pull_requests: +28275
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30050

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:48:48 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 13:48:48 +0000
Subject: [issue46049] ._pth files untested on Linux
Message-ID: <1639230528.94.0.623170663642.issue46049@roundup.psfhosted.org>


New submission from Steve Dower <steve.dower at python.org>:

Currently ._pth files are "enabled" for all platforms, but are only tested on Windows.

Extend the tests in test_site to work on all platforms.

----------
assignee: steve.dower
components: Interpreter Core
messages: 408304
nosy: steve.dower
priority: normal
severity: normal
stage: patch review
status: open
title: ._pth files untested on Linux
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46049>
_______________________________________

From report at bugs.python.org  Sat Dec 11 08:59:20 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 11 Dec 2021 13:59:20 +0000
Subject: [issue34624] -W option and PYTHONWARNINGS env variable does not
 accept module regexes
In-Reply-To: <1536622594.77.0.0269046726804.issue34624@psf.upfronthosting.co.za>
Message-ID: <1639231160.5.0.0404216894156.issue34624@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Adding regular expression support to -W and PYTHONWARNINGS env var turns the options into potential attack vectors. It can introduce REDOS vulnerability.

----------
keywords: +security_issue
nosy: +christian.heimes
type:  -> enhancement
versions: +Python 3.11 -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34624>
_______________________________________

From report at bugs.python.org  Sat Dec 11 09:00:00 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 14:00:00 +0000
Subject: [issue46049] ._pth files untested on Linux
In-Reply-To: <1639230528.94.0.623170663642.issue46049@roundup.psfhosted.org>
Message-ID: <1639231200.52.0.78245794269.issue46049@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
keywords: +patch
pull_requests: +28276
pull_request: https://github.com/python/cpython/pull/30051

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46049>
_______________________________________

From report at bugs.python.org  Sat Dec 11 09:13:32 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 11 Dec 2021 14:13:32 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1639232012.5.0.575825911453.issue46032@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Yes, it is related to issue45665. It is a complicated case due to coincidence of several circumstances.

1. isinstance(list[int], type) is True, while isinstance(typing.List[int], type) is False. list[int] is considered a type in this check.

2. list[int].__mro__ == list.__mro__, while typing.List[int] does not have the __mro__ attribute.  list[int] is considered a type in this check.

3. issubclass(cls, list[int]) raises a TypeError (the same for typing.List[int]). list[int] cannot be used as a type here.

4. 2-argument registry() does not check the type of its first argument. f.registry(42, ...) is silently passed.

In 2-argument registry() typing.List[int] is passed due to (4) and ignored in dispatch() due to (2). list[int] is passed due to (4), but caused error due to (3).

In other uses of registry() (1-argument decorator factory and decorator with annotations) typing.List[int] is not passed due to 1. list[int] is passed due to (1) and caused error due to (3).

The proposed PR makes list[int] be treated the same way as typing.List[int]. It also makes 2-argument registry() rejecting invalid first argument, so all three forms of registry() accept and reject now the same types.

----------
versions: +Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sat Dec 11 09:14:36 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 11 Dec 2021 14:14:36 +0000
Subject: [issue45665] Problems caused by isinstance(list[int],
 type) returning True
In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org>
Message-ID: <1639232076.54.0.432789513124.issue45665@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
dependencies: +functools' singledispatch does not support GenericAlias

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45665>
_______________________________________

From report at bugs.python.org  Sat Dec 11 09:34:42 2021
From: report at bugs.python.org (Matt Bogosian)
Date: Sat, 11 Dec 2021 14:34:42 +0000
Subject: [issue34798] pprint ignores the compact parameter for dicts
In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za>
Message-ID: <1639233282.9.0.261984697193.issue34798@roundup.psfhosted.org>


Matt Bogosian <eb3f73+python+org at yaymail.com> added the comment:

Please consider highlighting that dicts are not included in the documentation. While *technically* true, this ...

> compact impacts the way that long sequences (lists, tuples, sets, etc) are formatted. If compact is false (the default) then each item of a sequence will be formatted on a separate line. If compact is true, as many items as will fit within the width will be formatted on each output line.

... has several problems.

First, sequence is a term of art that also has a common meaning. This creates a potential ambiguity in the understanding of the reader. Resolving that ambiguity in this context requires that readers have already internalized that dicts are not Python sequences. Those new to Python may not understand the (to them, subtle) differences between Python's iterables and sequences. Second, the "etc" only expands that ambiguity and invites confusion. Third, the term "items" is strongly associated with dicts and is used several times throughout the paragraph.

This ...

> According to https://docs.python.org/3/library/pprint.html compact impacts the way that sequences are displayed, and a dict is not a sequence.

... is unhelpfully pedantic, and ignorant of the needs of the newcomer (a key demographic of documentation). Documentation is a core product surface with a diverse audience. Rather than focus on technical correctness, documentation authors should focus on accessibility. Redundancy is a feature, not a bug. You can't predict how your reader got to that slice of the documentation. Imagine this as an opportunity to educate or reinforce concepts for readers, not as an opportunity to argue from a position of technical superiority.

The fact that there are now four developers who have taken their time to file patches, bugs, and comments is pretty strong signal that confusion exists among the audience and that the documentation is insufficient.

----------
nosy: +posita

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34798>
_______________________________________

From report at bugs.python.org  Sat Dec 11 09:39:09 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 14:39:09 +0000
Subject: [issue25834] getpass falls back when sys.stdin is changed
In-Reply-To: <1449774081.69.0.580172668816.issue25834@psf.upfronthosting.co.za>
Message-ID: <1639233549.21.0.739604281991.issue25834@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Thanks, I'll close this and we can revisit if a new use case turns up.

----------
resolution:  -> later
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25834>
_______________________________________

From report at bugs.python.org  Sat Dec 11 09:42:18 2021
From: report at bugs.python.org (Roundup Robot)
Date: Sat, 11 Dec 2021 14:42:18 +0000
Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work
In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org>
Message-ID: <1639233738.44.0.669345220104.issue45997@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
keywords: +patch
nosy: +python-dev
nosy_count: 3.0 -> 4.0
pull_requests: +28277
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30052

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45997>
_______________________________________

From report at bugs.python.org  Sat Dec 11 10:06:21 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 15:06:21 +0000
Subject: [issue46049] ._pth files untested on Linux
In-Reply-To: <1639230528.94.0.623170663642.issue46049@roundup.psfhosted.org>
Message-ID: <1639235181.13.0.546648829063.issue46049@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset bfc59ed0a00106f5ba4a32a0c5b3dbe71d12665d by Steve Dower in branch 'main':
bpo-46049: Fixes ._pth support on non-Windows (GH-30051)
https://github.com/python/cpython/commit/bfc59ed0a00106f5ba4a32a0c5b3dbe71d12665d


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46049>
_______________________________________

From report at bugs.python.org  Sat Dec 11 10:36:50 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 15:36:50 +0000
Subject: [issue18861] Problems with recursive automatic exception chaining
In-Reply-To: <1377657727.9.0.627993776621.issue18861@psf.upfronthosting.co.za>
Message-ID: <1639237010.79.0.24342157039.issue18861@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I think this problem is actually simpler than what we've been discussing. 

First, note that by-and-large our current system works:

>>> try:
...   raise VE(1)
... except VE as e1:
...   try:
...     raise VE(2)
...   except VE as e2:
...     raise VE(3) from e2
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
ValueError: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: 2

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
ValueError: 3

----------------------------

Here VE(2) is the cause of VE(3) and VE(1) is the context of VE(2), so VE(1) is not hidden by the fact that VE(3) has a cause.

The reason that Nick's example didn't work is because he is doing

    raise VE(3) from VE(2)

i.e., creating a new exception VE(2) that doesn't have VE(1) as a context. I'm not sure there is a use case for this, so I don't think we need to worry about it.


The case of None does need fixing. We use None to indicate that there was no cause (while suppressing context). But None can't have a context, so VE(1) gets lost. We could, instead of None, use a NoException(Exception) class. This exception would be chained with the current exc_info() as context so that it works like VE(1) as above, and the traceback printing logic will know that it needs to be omitted from the output.


This proposal involves no changes to the exception propagation mechanism of the interpreter. It would require these changes:

1. Define the new exception type
2. in do_raise, in the case of raise-from the None case changes
3. traceback display code needs to be updated to omit NoExceptions

----------
versions: +Python 3.11 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18861>
_______________________________________

From report at bugs.python.org  Sat Dec 11 10:44:25 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 15:44:25 +0000
Subject: [issue46049] ._pth files untested on Linux
In-Reply-To: <1639230528.94.0.623170663642.issue46049@roundup.psfhosted.org>
Message-ID: <1639237465.9.0.00471891151182.issue46049@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46049>
_______________________________________

From report at bugs.python.org  Sat Dec 11 10:45:36 2021
From: report at bugs.python.org (Ned Batchelder)
Date: Sat, 11 Dec 2021 15:45:36 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639237536.45.0.58385990214.issue46028@roundup.psfhosted.org>


Ned Batchelder <ned at nedbatchelder.com> added the comment:

Tox isn't needed, just venv from the stdlib:


$ python3.11.0a2 -m venv venv_a2

$ venv_a2/bin/python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))"
/private/tmp/venv_a2/bin/python
True

$ python3.11.0a3 -m venv venv_a3

$ venv_a3/bin/python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))"
/usr/local/bin/python
False

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Sat Dec 11 10:47:47 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 11 Dec 2021 15:47:47 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639237536.45.0.58385990214.issue46028@roundup.psfhosted.org>
Message-ID: <c625710f-8ba9-1b6f-a605-2693066c2b44@python.org>


Steve Dower <steve.dower at python.org> added the comment:

What's the contents of the pyvenv.cfg in these cases?

It looks like the first case is definitely wrong, because the base 
executable should not be in "venv_a2" (that's sys.executable), but I 
don't know where it should be on your system.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Sat Dec 11 10:52:41 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 15:52:41 +0000
Subject: [issue23469] Delete Misc/*.wpr files
In-Reply-To: <1424048342.99.0.00819785192711.issue23469@psf.upfronthosting.co.za>
Message-ID: <1639237961.13.0.153884453347.issue23469@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy -patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23469>
_______________________________________

From report at bugs.python.org  Sat Dec 11 11:12:52 2021
From: report at bugs.python.org (Yevhenii Hyzyla)
Date: Sat, 11 Dec 2021 16:12:52 +0000
Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work
In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org>
Message-ID: <1639239172.44.0.513560840794.issue45997@roundup.psfhosted.org>


Change by Yevhenii Hyzyla <hyzyla at gmail.com>:


----------
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45997>
_______________________________________

From report at bugs.python.org  Sat Dec 11 11:15:21 2021
From: report at bugs.python.org (Ned Batchelder)
Date: Sat, 11 Dec 2021 16:15:21 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639239321.44.0.127212050883.issue46028@roundup.psfhosted.org>


Ned Batchelder <ned at nedbatchelder.com> added the comment:

The two venvs seem analogous:


$ cat venv_a2/pyvenv.cfg
home = /usr/local/bin
include-system-site-packages = false
version = 3.11.0

$ ls -al venv_a2/bin
total 72
drwxr-xr-x  13 nedbatchelder  wheel   416 Dec 11 10:43 ./
drwxr-xr-x   6 nedbatchelder  wheel   192 Dec 11 10:43 ../
-rw-r--r--   1 nedbatchelder  wheel  9033 Dec 11 10:43 Activate.ps1
-rw-r--r--   1 nedbatchelder  wheel  1993 Dec 11 10:43 activate
-rw-r--r--   1 nedbatchelder  wheel   919 Dec 11 10:43 activate.csh
-rw-r--r--   1 nedbatchelder  wheel  2061 Dec 11 10:43 activate.fish
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip*
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip3*
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip3.11*
lrwxr-xr-x   1 nedbatchelder  wheel    14 Dec 11 10:43 python@ -> python3.11.0a2
lrwxr-xr-x   1 nedbatchelder  wheel    14 Dec 11 10:43 python3@ -> python3.11.0a2
lrwxr-xr-x   1 nedbatchelder  wheel    14 Dec 11 10:43 python3.11@ -> python3.11.0a2
lrwxr-xr-x   1 nedbatchelder  wheel    29 Dec 11 10:43 python3.11.0a2@ -> /usr/local/bin/python3.11.0a2

$ cat venv_a3/pyvenv.cfg
home = /usr/local/bin
include-system-site-packages = false
version = 3.11.0

$ ls -al venv_a3/bin
total 72
drwxr-xr-x  13 nedbatchelder  wheel   416 Dec 11 10:43 ./
drwxr-xr-x   6 nedbatchelder  wheel   192 Dec 11 10:43 ../
-rw-r--r--   1 nedbatchelder  wheel  9033 Dec 11 10:43 Activate.ps1
-rw-r--r--   1 nedbatchelder  wheel  1993 Dec 11 10:43 activate
-rw-r--r--   1 nedbatchelder  wheel   919 Dec 11 10:43 activate.csh
-rw-r--r--   1 nedbatchelder  wheel  2061 Dec 11 10:43 activate.fish
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip*
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip3*
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip3.11*
lrwxr-xr-x   1 nedbatchelder  wheel    14 Dec 11 10:43 python@ -> python3.11.0a3
lrwxr-xr-x   1 nedbatchelder  wheel    14 Dec 11 10:43 python3@ -> python3.11.0a3
lrwxr-xr-x   1 nedbatchelder  wheel    14 Dec 11 10:43 python3.11@ -> python3.11.0a3
lrwxr-xr-x   1 nedbatchelder  wheel    29 Dec 11 10:43 python3.11.0a3@ -> /usr/local/bin/python3.11.0a3

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Sat Dec 11 11:15:38 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sat, 11 Dec 2021 16:15:38 +0000
Subject: [issue45578] Missing tests for the dis module
In-Reply-To: <1634926558.7.0.911953252083.issue45578@roundup.psfhosted.org>
Message-ID: <1639239338.4.0.693149887389.issue45578@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
pull_requests: +28278
pull_request: https://github.com/python/cpython/pull/30058

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45578>
_______________________________________

From report at bugs.python.org  Sat Dec 11 11:25:35 2021
From: report at bugs.python.org (matt)
Date: Sat, 11 Dec 2021 16:25:35 +0000
Subject: [issue46050] [pathlib] Option so that OSError does not block glob in
 pathlib library
Message-ID: <1639239935.56.0.723240753411.issue46050@roundup.psfhosted.org>


New submission from matt <github.gitmatt at xoxy.net>:

Hi there,
ISSUE DESCRIPTION
when I browse starting from the linux root ('/')
    path = pathlib.Path('/')
    _glob = '**/*'
    for p in path.glob(_glob):

The program stops on my machine because of OSError.
  File "/usr/lib/python3.8/pathlib.py", line 535, in _select_from
    entries = list(scandir_it)

OSError: [Errno 22] Invalid argument: '/proc/5916/task/5916/net'

****************************************
Entering post mortem debugging...
****************************************
> /usr/lib/python3.8/pathlib.py(535)_select_from()
    533         try:
    534             with scandir(parent_path) as scandir_it:
--> 535                 entries = list(scandir_it)
    536             for entry in entries:
    537                 if self.dironly:

I also another case is if a cloud drive is disconnected.

QUICK SOLUTION
I solved both issues for me by adding an adding an except OSError: return at the end of the two function below:

class _WildcardSelector(_Selector):
    def _select_from(self, parent_path, is_dir, exists, scandir):
        (...)
        except OSError:
            return

class _RecursiveWildcardSelector(_Selector):
    def _iterate_directories(self, parent_path, is_dir, scandir):
        (...)
        except OSError:
            return

FEATURE REQUEST
I don't know the consequences of those 2 modifications so perhaps they could follow an option when calling glob with an optional parameter ignoreOSerror = false by default?!

----------
components: Library (Lib)
messages: 408314
nosy: matt32106
priority: normal
severity: normal
status: open
title: [pathlib] Option so that OSError does not block glob in pathlib library
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46050>
_______________________________________

From report at bugs.python.org  Sat Dec 11 11:28:40 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 16:28:40 +0000
Subject: [issue46040] asyncio.coroutine documented as removed in 3.10
In-Reply-To: <1639160902.02.0.980259307717.issue46040@roundup.psfhosted.org>
Message-ID: <1639240120.76.0.666296911485.issue46040@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
components: +asyncio
nosy: +asvetlov, yselivanov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46040>
_______________________________________

From report at bugs.python.org  Sat Dec 11 11:29:01 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 11 Dec 2021 16:29:01 +0000
Subject: [issue45949] Provide pure-Python implementation of
 Programs/_freeze_module for cross building
In-Reply-To: <1638372868.47.0.982140813893.issue45949@roundup.psfhosted.org>
Message-ID: <1639240141.07.0.562790564851.issue45949@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

In his code review Eric made a point that the relationship of variables and their impact on normal and cross builds are not obvious. I'm going to introduce new variables for freezing and freezing dependencies. Bonus: Cross builds no longer build non-functional _bootstrap_python and Programs/_freeze_module.

Normal build:

PYTHON_FOR_FREEZE=./_bootstrap_python
FREEZE_MODULE_BOOTSTRAP=./Programs/_freeze_module
FREEZE_MODULE_BOOTSTRAP_DEPS=Programs/_freeze_module
FREEZE_MODULE=$(PYTHON_FOR_FREEZE) $(srcdir)/Programs/_freeze_module.py
FREEZE_MODULE_DEPS=_bootstrap_python $(srcdir)/Programs/_freeze_module.py


Cross build:

PYTHON_FOR_FREEZE=/path/to/build/python
FREEZE_MODULE_BOOTSTRAP=$(PYTHON_FOR_FREEZE) $(srcdir)/Programs/_freeze_module.py
FREEZE_MODULE_BOOTSTRAP_DEPS=$(srcdir)/Programs/_freeze_module.py
FREEZE_MODULE=$(FREEZE_MODULE_BOOTSTRAP)
FREEZE_MODULE_DEPS=$(FREEZE_MODULE_BOOTSTRAP_DEPS)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________

From report at bugs.python.org  Sat Dec 11 11:38:25 2021
From: report at bugs.python.org (Martin Reboredo)
Date: Sat, 11 Dec 2021 16:38:25 +0000
Subject: [issue40059] Provide a toml module in the standard library
In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org>
Message-ID: <1639240705.16.0.620905847493.issue40059@roundup.psfhosted.org>


Martin Reboredo <yakoyoku at gmail.com> added the comment:

A new python-ideas mail thread was created for this, you can check it out at https://mail.python.org/archives/list/python-ideas at python.org/thread/IWJ3I32A4TY6CIVQ6ONPEBPWP4TOV2V7/.

----------
nosy: +YakoYakoYokuYoku

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40059>
_______________________________________

From report at bugs.python.org  Sat Dec 11 11:41:58 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 16:41:58 +0000
Subject: [issue34798] pprint ignores the compact parameter for dicts
In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za>
Message-ID: <1639240918.49.0.727717529391.issue34798@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Don't discuss on a closed issue. Create a new one if there is still a problem.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34798>
_______________________________________

From report at bugs.python.org  Sat Dec 11 11:58:12 2021
From: report at bugs.python.org (Ken Jin)
Date: Sat, 11 Dec 2021 16:58:12 +0000
Subject: [issue46040] asyncio.coroutine documented as removed in 3.10
In-Reply-To: <1639160902.02.0.980259307717.issue46040@roundup.psfhosted.org>
Message-ID: <1639241892.25.0.491261530665.issue46040@roundup.psfhosted.org>


Change by Ken Jin <kenjin4096 at gmail.com>:


----------
keywords: +easy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46040>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:04:58 2021
From: report at bugs.python.org (Saaket Prakash)
Date: Sat, 11 Dec 2021 17:04:58 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639242298.35.0.426055896126.issue46028@roundup.psfhosted.org>


Saaket Prakash <saaketp at gmail.com> added the comment:

I tried the same stuff as nedbat on WSL2, and I see similar change in the path of sys._base_executable (though I get a different "base" path on a3, so the path exists even there).

$ ~/.pyenv/versions/3.11.0a2/bin/python -m venv venv_a2
$ ~/.pyenv/versions/3.11.0a3/bin/python -m venv venv_a3
$ venv_a2/bin/python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))"
/home/ss/venv_a2/bin/python
True

$ venv_a3/bin/python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))"
/home/ss/.pyenv/versions/3.11.0a3/bin/python
True

$ cat venv_a2/pyvenv.cfg
home = /home/ss/.pyenv/versions/3.11.0a2/bin
include-system-site-packages = false
version = 3.11.0

$ cat venv_a3/pyvenv.cfg
home = /home/ss/.pyenv/versions/3.11.0a3/bin
include-system-site-packages = false
version = 3.11.0

----------
nosy: +saaketp

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:14:12 2021
From: report at bugs.python.org (Saaket Prakash)
Date: Sat, 11 Dec 2021 17:14:12 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639242852.94.0.613690453963.issue46028@roundup.psfhosted.org>


Saaket Prakash <saaketp at gmail.com> added the comment:

But on windows with the python.org installer, the behavior is same for both both a2 and a3.

# With a3 installed

> py -m venv venv_a3
> venv_a3/Scripts/python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))"
C:\Users\ss\AppData\Local\Programs\Python\Python311\python.exe
True
> cat venv_a3/pyvenv.cfg
home = C:\Users\ss\AppData\Local\Programs\Python\Python311
include-system-site-packages = false
version = 3.11.0

# With a2 installed

> py -m venv venv_a2
> venv_a2/Scripts/python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))"
C:\Users\ss\AppData\Local\Programs\Python\Python311\python.exe
True
> cat venv_a2/pyvenv.cfg
home = C:\Users\ss\AppData\Local\Programs\Python\Python311
include-system-site-packages = false
version = 3.11.0

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:21:14 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 11 Dec 2021 17:21:14 +0000
Subject: [issue40059] Provide a toml module in the standard library
In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org>
Message-ID: <1639243274.6.0.384135220315.issue40059@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

I just noticed that tomli has dropped support for Python 3.6. That's a road block for general adoption of the package in the Python ecosystem. Python 3.6 is the default Python interpreter in CentOS 8, C8S, RHEL 8, and Ubuntu 18.04 LTS. https://github.com/hukkin/tomli/pull/134

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40059>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:27:01 2021
From: report at bugs.python.org (quapka)
Date: Sat, 11 Dec 2021 17:27:01 +0000
Subject: [issue46051] Make @atexit.register work for functions with arguments
Message-ID: <1639243621.71.0.144294694671.issue46051@roundup.psfhosted.org>


New submission from quapka <quapka at gmail.com>:

Hi folks!

Let me first present an example that motivated this issue. Imagine a script that builds Docker images and later starts them as Docker containers. To avoid having to stop the containers "manually" (in code and potentially forgot) I had an idea to register each container when started and stop each using atexit module. I chose to encapsulate this behavior inside a class. A much simplified example looks like this:

    import atexit

    class Program:
        # keep a class level list of started containers
        running_containers = []

        @atexit.register
        @classmethod
        def clean_up(cls, *args, **kwargs):
            for container in cls.running_containers:
                print(f'stopping {container}')

        def start_container(self, container):
            print(f'starting {container}')
            self.__class__.running_containers.append(container)

    prog = Program()
    a.start_container('container_A')
    a.start_container('container_B')

And I'd expect this to produce:

    starting container_A
    starting container_B
    stopping container_A
    stopping container_B

To me, this reads rather nicely: the Program.clean_up method can be called by the user, but if he forgets it will be handled for him using atexit. However, this code does not work. :) I've spent some time debugging and what follows are my observations:

1) If the order of decorators is @atexit.register and then @classmethod then the code throws 'TypeError: the first argument must be callable'. I believe it is because classmethod and staticmethod are descriptors without the __call__ method implemented. atexit.register does not check this and instead of func.__func__ (which resolves to Program.clean_up) gets func (a classmethod) which is not callable (https://github.com/python/cpython/blob/main/Modules/atexitmodule.c#L147).

2) If the order of decorators is swapped (@classmethod and @atexit.register) then the code throws "Error in atexit._run_exitfuncs:\nTypeError: clean_up() missing 1 required positional argument: 'cls'". From my limited understanding of CPython and atexitmodule.c I think what happens is that the @atexit.register returns (https://github.com/python/cpython/blob/main/Modules/atexitmodule.c#L180) the func without the args and kwargs (since this issue https://bugs.python.org/issue1597824).

3) However, if I step away from decorating using @atexit.register and instead use

    [...]
    atexit.register(Program.clean_up) # <-- register post definition
    prog = Program()
    a.start_container('container_A')
    a.start_container('container_B')

then the code works as expected and outputs:

    starting container_A
    starting container_B
    stopping container_A
    stopping container_B


To summarize, I don't like 3) as it puts the responsibility in a bit awkward place (good enough if I'm the only user, but I wonder about the more general library-like cases). My decorating skills are a bit dull now and it's my first time seriously looking into CPython internals - I've tried to encapsulate atexit.register in my custom decorator, to check whether that could be a workaround but overall was unsuccessful. In short, I'd say that in both 1) and 2) the cls arg is lost when atexit calls the function. I've tried to dig it up from the func passed to atexit.register

    def my_atexit_decorator(func, *args, **kwargs):
        cls = # some magic with under attrs and methods
        register.atexit(func, cls=cls, *args, **kwargs)
        [...]

, but failed (it also felt like a fragile approach).

I was not able to understand why @atexit.register does not work when the function's signature is not empty. Also, if fixable I'm happy to actually put the effort into fixing it myself (looks like a nice first CPython PR), but I'd like to have someone else's opinion before I start marching in the wrong direction. Also, let me know if you'd like more details or code/tests I've produced while debugging this.

Cheers!

----------
messages: 408321
nosy: quapka
priority: normal
severity: normal
status: open
title: Make @atexit.register work for functions with arguments
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46051>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:41:06 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 11 Dec 2021 17:41:06 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639244466.88.0.00107020569143.issue46042@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
keywords: +patch
pull_requests: +28279
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30059

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:41:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 17:41:42 +0000
Subject: [issue28816] [doc] Clarify that zipimport does not invoke import
 hooks to load custom files from zip.
In-Reply-To: <1480326340.52.0.39566018579.issue28816@psf.upfronthosting.co.za>
Message-ID: <1639244502.56.0.673908923692.issue28816@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28280
status: pending -> open
pull_request: https://github.com/python/cpython/pull/30060

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28816>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:41:53 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 11 Dec 2021 17:41:53 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639244513.42.0.0110531842363.issue46042@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Don't worry, turns out it was a bit messier than I thought, so I prepared the PR. If you have some time, it would be great if you can take a quick look.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:45:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 17:45:57 +0000
Subject: [issue12833] Document the need to pass the prompt to raw_input() with
 readline
In-Reply-To: <1314205212.4.0.313319940132.issue12833@psf.upfronthosting.co.za>
Message-ID: <1639244757.44.0.790928409727.issue12833@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: needs patch -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12833>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:47:21 2021
From: report at bugs.python.org (Carl Friedrich Bolz-Tereick)
Date: Sat, 11 Dec 2021 17:47:21 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639244841.04.0.291817762237.issue46042@roundup.psfhosted.org>


Carl Friedrich Bolz-Tereick <cfbolz at gmx.de> added the comment:

Oh no, I was about to open mine ;-)

https://github.com/python/cpython/compare/main...cfbolz:bpo-46042-syntax-error-range-duplicate-argument?expand=1

Basically equivalent, but I fixed the second bug too (would be very easy to add to yours)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:48:13 2021
From: report at bugs.python.org (Carl Friedrich Bolz-Tereick)
Date: Sat, 11 Dec 2021 17:48:13 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639244893.75.0.615800366972.issue46042@roundup.psfhosted.org>


Carl Friedrich Bolz-Tereick <cfbolz at gmx.de> added the comment:

ah, confused, seems you fixed them both too. will take a closer look!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:54:46 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 17:54:46 +0000
Subject: [issue24012] Add error checks to PyInit_pyexpat()
In-Reply-To: <1429471995.2.0.707709004529.issue24012@psf.upfronthosting.co.za>
Message-ID: <1639245286.42.0.674562343993.issue24012@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This is all sorted now:

iritkatriel at Irits-MBP cpython % grep "PyModule_AddObject(" Modules/pyexpat.c 
    if (PyModule_AddObject(mod, name, submodule) < 0) {
    if (PyModule_AddObject(errors_module, "codes", codes_dict) < 0) {
    if (PyModule_AddObject(errors_module, "messages", rev_codes_dict) < 0) {
    if (PyModule_AddObject(mod, "features", list) < 0) {
        if (PyModule_AddObject(mod, "version_info", versionInfo) < 0) {
    if (PyModule_AddObject(mod, "expat_CAPI", capi_object) < 0) {
iritkatriel at Irits-MBP cpython % grep "PyDict_SetItem(" Modules/pyexpat.c
            PyDict_SetItem(self->intern, result, result) == 0)
            else if (PyDict_SetItem(container, n, v)) {
    int res = PyDict_SetItem(rev_codes_dict, num, str);
iritkatriel at Irits-MBP cpython % grep "PySys_GetObject(" Modules/pyexpat.c
iritkatriel at Irits-MBP cpython %

----------
nosy: +iritkatriel
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24012>
_______________________________________

From report at bugs.python.org  Sat Dec 11 12:56:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 17:56:22 +0000
Subject: [issue24010] Add error checks to PyInit__locale()
In-Reply-To: <1429471599.85.0.679825670624.issue24010@psf.upfronthosting.co.za>
Message-ID: <1639245382.9.0.135957763485.issue24010@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This function now looks like this:

PyMODINIT_FUNC
PyInit__locale(void)
{
    return PyModuleDef_Init(&_localemodule);
}

----------
nosy: +iritkatriel
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24010>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:03:46 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sat, 11 Dec 2021 18:03:46 +0000
Subject: [issue46040] asyncio.coroutine documented as removed in 3.10
In-Reply-To: <1639160902.02.0.980259307717.issue46040@roundup.psfhosted.org>
Message-ID: <1639245826.87.0.296544224388.issue46040@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
keywords: +patch
pull_requests: +28281
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30061

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46040>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:15:59 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 18:15:59 +0000
Subject: [issue35999] multpirocessing.Process alive after SIGTERM on parent
In-Reply-To: <1550231724.21.0.67060075553.issue35999@roundup.psfhosted.org>
Message-ID: <1639246559.38.0.0600725342692.issue35999@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This example is not working for me on 3.11:

>>> from multiprocessing import Process
>>> from time import sleep
>>> from os import getpid
>>> 
>>> def log(daemon_mode):
...     while True:
...         print('worker %i %s' % (getpid(), daemon_mode))
...         sleep(3)
... 
>>> 
>>> print('parent pid %i' % getpid())
parent pid 77378
>>> 
>>> a = Process(target=log, args=(0,), daemon=False)
>>> a.start()
>>> <frozen importlib._bootstrap>:744: DeprecationWarning: BuiltinImporter.module_repr() is deprecated and slated for removal in Python 3.12
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/iritkatriel/src/cpython-654/Lib/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iritkatriel/src/cpython-654/Lib/multiprocessing/spawn.py", line 126, in _main
    self = reduction.pickle.load(from_parent)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: Can't get attribute 'log' on <module '__main__' (built-in)>

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35999>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:24:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 18:24:31 +0000
Subject: [issue14484] missing return in win32_kill?
In-Reply-To: <1333462226.23.0.725280599354.issue14484@psf.upfronthosting.co.za>
Message-ID: <1639247071.01.0.591146738679.issue14484@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

That piece of code is still there, the function is now called os_kill_impl.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14484>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:28:07 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sat, 11 Dec 2021 18:28:07 +0000
Subject: [issue46040] asyncio.coroutine documented as removed in 3.10
In-Reply-To: <1639160902.02.0.980259307717.issue46040@roundup.psfhosted.org>
Message-ID: <1639247287.25.0.0547355974448.issue46040@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset 991736697dff693b6c9f8964bb7540081bbf4ddb by Andrew Svetlov in branch '3.10':
[3.10] bpo-46040: Fix removal text for @asyncio.coroutine (GH-30061)
https://github.com/python/cpython/commit/991736697dff693b6c9f8964bb7540081bbf4ddb


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46040>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:28:26 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sat, 11 Dec 2021 18:28:26 +0000
Subject: [issue46040] asyncio.coroutine documented as removed in 3.10
In-Reply-To: <1639160902.02.0.980259307717.issue46040@roundup.psfhosted.org>
Message-ID: <1639247306.54.0.880856068797.issue46040@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46040>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:35:18 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 18:35:18 +0000
Subject: [issue27227] argparse fails to parse [] when using choices and
 nargs='*'
In-Reply-To: <1465117156.8.0.428303445441.issue27227@psf.upfronthosting.co.za>
Message-ID: <1639247718.48.0.565682555747.issue27227@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27227>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:39:08 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 18:39:08 +0000
Subject: [issue27718] help('signal') incomplete (e.g: signal.signal not
 visible)
In-Reply-To: <1470746479.88.0.0919609545752.issue27718@psf.upfronthosting.co.za>
Message-ID: <1639247948.25.0.576528904357.issue27718@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27718>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:41:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 18:41:20 +0000
Subject: [issue37700] shutil.copyfile does not raise SpecialFileError for
 socket files
In-Reply-To: <1564374136.89.0.594392746042.issue37700@roundup.psfhosted.org>
Message-ID: <1639248080.12.0.837820918579.issue37700@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37700>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:43:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 18:43:57 +0000
Subject: [issue37701] shutil.copyfile raises SpecialFileError for symlink to
 fifo
In-Reply-To: <1564375011.26.0.591034083368.issue37701@roundup.psfhosted.org>
Message-ID: <1639248237.47.0.758469580444.issue37701@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37701>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:49:54 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 18:49:54 +0000
Subject: [issue27257] get_addresses results in traceback with an addrspec with
 an empty local part.
In-Reply-To: <1465327493.81.0.354921385455.issue27257@psf.upfronthosting.co.za>
Message-ID: <1639248594.07.0.434453779693.issue27257@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I am unable to reproduce this on 3.11:

>>> with open(b'lkml-exception.mail', mode = 'r') as f:
...  msg = email.message_from_file(f, policy=email.policy.SMTP)
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
AttributeError: module 'email' has no attribute 'policy'
>>> import email.policy
>>> with open(b'lkml-exception.mail', mode = 'r') as f:
...  msg = email.message_from_file(f, policy=email.policy.SMTP)
... 
>>> msg.get_all('to')
['unlisted-recipients:;, @pop.kundenserver.de']
>>>

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27257>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:52:23 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 18:52:23 +0000
Subject: [issue26571] turtle regression in 3.5
In-Reply-To: <1458104355.45.0.620158354917.issue26571@psf.upfronthosting.co.za>
Message-ID: <1639248743.29.0.64334799751.issue26571@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26571>
_______________________________________

From report at bugs.python.org  Sat Dec 11 13:55:14 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 18:55:14 +0000
Subject: [issue9338] argparse optionals with nargs='?',
 '*' or '+' can't be followed by positionals
In-Reply-To: <1279881989.28.0.725806934086.issue9338@psf.upfronthosting.co.za>
Message-ID: <1639248914.56.0.60619859031.issue9338@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11:

>>> import argparse
>>> parser = argparse.ArgumentParser(prog='PROG')
>>> 
>>> parser.add_argument('--badger', nargs='+')
_StoreAction(option_strings=['--badger'], dest='badger', nargs='+', const=None, default=None, type=None, choices=None, help=None, metavar=None)
>>> parser.add_argument('spam')
_StoreAction(option_strings=[], dest='spam', nargs=None, const=None, default=None, type=None, choices=None, help=None, metavar=None)
>>> parser.parse_args('--badger A B C D'.split())
usage: PROG [-h] [--badger BADGER [BADGER ...]] spam
PROG: error: the following arguments are required: spam

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9338>
_______________________________________

From report at bugs.python.org  Sat Dec 11 14:06:37 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 19:06:37 +0000
Subject: [issue34557] When sending binary file to a Microsoft FTP server over
 FTP TLS, the SSL unwind method hangs
In-Reply-To: <1535738453.08.0.56676864532.issue34557@psf.upfronthosting.co.za>
Message-ID: <1639249597.1.0.309939094563.issue34557@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
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 <report at bugs.python.org>
<https://bugs.python.org/issue34557>
_______________________________________

From report at bugs.python.org  Sat Dec 11 14:08:53 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 19:08:53 +0000
Subject: [issue9504] signal.signal/signal.alarm not working as expected
In-Reply-To: <1280910836.88.0.645209486589.issue9504@psf.upfronthosting.co.za>
Message-ID: <1639249733.46.0.607519976366.issue9504@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9504>
_______________________________________

From report at bugs.python.org  Sat Dec 11 14:10:38 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 19:10:38 +0000
Subject: [issue29221] ABC Recursion Error on isinstance() with less than
 recursion limit class hierarchy depth
In-Reply-To: <1484021927.49.0.387886726852.issue29221@psf.upfronthosting.co.za>
Message-ID: <1639249838.7.0.876376305702.issue29221@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29221>
_______________________________________

From report at bugs.python.org  Sat Dec 11 14:13:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 19:13:45 +0000
Subject: [issue19459] Python does not support the GEORGIAN-PS charset
In-Reply-To: <1383216779.28.0.251946690468.issue19459@psf.upfronthosting.co.za>
Message-ID: <1639250025.69.0.65832550053.issue19459@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19459>
_______________________________________

From report at bugs.python.org  Sat Dec 11 14:14:50 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 19:14:50 +0000
Subject: [issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC
In-Reply-To: <1540110172.83.0.788709270274.issue35037@psf.upfronthosting.co.za>
Message-ID: <1639250090.48.0.971795214865.issue35037@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35037>
_______________________________________

From report at bugs.python.org  Sat Dec 11 14:21:24 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sat, 11 Dec 2021 19:21:24 +0000
Subject: [issue46005] [doc] replace 'distutils' examples with 'setuptools'
In-Reply-To: <1638864537.57.0.967787312853.issue46005@roundup.psfhosted.org>
Message-ID: <1639250484.05.0.0582366998705.issue46005@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Or maybe we should just include https://github.com/python/cpython/blob/main/Doc/distutils/_setuptools_disclaimer.rst as others do?

I will send my proposal :)

----------
nosy: +sobolevn

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46005>
_______________________________________

From report at bugs.python.org  Sat Dec 11 14:23:23 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sat, 11 Dec 2021 19:23:23 +0000
Subject: [issue46005] [doc] replace 'distutils' examples with 'setuptools'
In-Reply-To: <1638864537.57.0.967787312853.issue46005@roundup.psfhosted.org>
Message-ID: <1639250603.87.0.836315017771.issue46005@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
pull_requests: +28282
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30062

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46005>
_______________________________________

From report at bugs.python.org  Sat Dec 11 15:11:37 2021
From: report at bugs.python.org (Chih-Hsuan Yen)
Date: Sat, 11 Dec 2021 20:11:37 +0000
Subject: [issue40059] Provide a toml module in the standard library
In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org>
Message-ID: <1639253497.9.0.54393932818.issue40059@roundup.psfhosted.org>


Change by Chih-Hsuan Yen <yan12125+foss at gmail.com>:


----------
nosy:  -yan12125

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40059>
_______________________________________

From report at bugs.python.org  Sat Dec 11 15:22:30 2021
From: report at bugs.python.org (Nicholas Bond)
Date: Sat, 11 Dec 2021 20:22:30 +0000
Subject: [issue46043] Python Launcher Not Opening Files.
In-Reply-To: <1639178553.87.0.850014051129.issue46043@roundup.psfhosted.org>
Message-ID: <1639254150.04.0.235890703167.issue46043@roundup.psfhosted.org>


Nicholas Bond <nicholasjbond2020 at gmail.com> added the comment:

I am on macOS 12 and it still doesn't work when Terminal.app is open.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46043>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:00:22 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 11 Dec 2021 21:00:22 +0000
Subject: [issue23948] Deprecate os.kill() on Windows
In-Reply-To: <1429025061.32.0.415018485708.issue23948@psf.upfronthosting.co.za>
Message-ID: <1639256422.68.0.869111090411.issue23948@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


----------
resolution:  -> rejected
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23948>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:00:33 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 11 Dec 2021 21:00:33 +0000
Subject: [issue42962] Windows: SystemError during os.kill(...,
 signal.CTRL_C_EVENT)
In-Reply-To: <1611007954.59.0.488720921329.issue42962@roundup.psfhosted.org>
Message-ID: <1639256433.31.0.592057769711.issue42962@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> missing return in win32_kill?

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42962>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:12:25 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 11 Dec 2021 21:12:25 +0000
Subject: [issue44674] dataclasses should allow frozendict default value
In-Reply-To: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org>
Message-ID: <1639257145.29.0.231563738084.issue44674@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:


New changeset e029c53e1a408b89a4e3edf30a9b38b094f9c880 by Eric V. Smith in branch 'main':
bpo-44674: Use unhashability as a proxy for mutability for default dataclass __init__ arguments. (GH-29867)
https://github.com/python/cpython/commit/e029c53e1a408b89a4e3edf30a9b38b094f9c880


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44674>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:13:04 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 11 Dec 2021 21:13:04 +0000
Subject: [issue44674] dataclasses should allow frozendict default value
In-Reply-To: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org>
Message-ID: <1639257184.11.0.392311960155.issue44674@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44674>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:15:13 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 11 Dec 2021 21:15:13 +0000
Subject: [issue14484] missing return in win32_kill?
In-Reply-To: <1333462226.23.0.725280599354.issue14484@psf.upfronthosting.co.za>
Message-ID: <1639257313.53.0.492485821398.issue14484@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

The details of os.kill() on Windows have been discussed extensively for years in various issues such as bpo-26350, bp-23948, and bp42962. But the problem of the missing return statement is always overwhelmed by discussion of the egregiously bad design of this function and its misuse, which depends on bugs in WinAPI GenerateConsoleCtrlEvent() when passed a PID that is not a process group ID and/or not attached to the console.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14484>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:15:52 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 11 Dec 2021 21:15:52 +0000
Subject: [issue14484] missing return in win32_kill?
In-Reply-To: <1333462226.23.0.725280599354.issue14484@psf.upfronthosting.co.za>
Message-ID: <1639257352.39.0.150262084403.issue14484@roundup.psfhosted.org>


Change by Eryk Sun <eryksun at gmail.com>:


----------
Removed message: https://bugs.python.org/msg408336

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14484>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:16:15 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 11 Dec 2021 21:16:15 +0000
Subject: [issue14484] missing return in win32_kill?
In-Reply-To: <1333462226.23.0.725280599354.issue14484@psf.upfronthosting.co.za>
Message-ID: <1639257375.43.0.189729101825.issue14484@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

The details of os.kill() on Windows have been discussed extensively for years in various issues such as bpo-26350, bpo-23948, and bpo-42962. But the problem of the missing return statement is always overwhelmed by discussion of the egregiously bad design of this function and its misuse, which depends on bugs in WinAPI GenerateConsoleCtrlEvent() when passed a PID that is not a process group ID and/or not attached to the console.

----------
versions: +Python 3.7 -Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14484>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:16:40 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 11 Dec 2021 21:16:40 +0000
Subject: [issue46024] Different behaviour with zipfile
In-Reply-To: <1639045155.54.0.671926991121.issue46024@roundup.psfhosted.org>
Message-ID: <1639257400.19.0.263444304921.issue46024@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Actually, printing out:
print(repr(path), repr(ZipPath(path)))
would be more useful.

If I don't hear back in a few days, I'm going to close this issue.

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46024>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:17:21 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 11 Dec 2021 21:17:21 +0000
Subject: [issue27718] help('signal') incomplete (e.g: signal.signal not
 visible)
In-Reply-To: <1470746479.88.0.0919609545752.issue27718@psf.upfronthosting.co.za>
Message-ID: <1639257441.78.0.64408228919.issue27718@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
keywords: +patch
nosy: +serhiy.storchaka
nosy_count: 6.0 -> 7.0
pull_requests: +28283
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30063

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27718>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:18:12 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 11 Dec 2021 21:18:12 +0000
Subject: [issue45650] cgitb does not emit CGI headers when format='text'
In-Reply-To: <1635439639.23.0.69927337911.issue45650@roundup.psfhosted.org>
Message-ID: <1639257492.22.0.0724495417645.issue45650@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Having not heard back about a use case for this, I'm going to close it. If you want to move this forward, I suggest proposing it on the python-ideas mailing list.

----------
resolution:  -> rejected
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45650>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:18:48 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 11 Dec 2021 21:18:48 +0000
Subject: [issue44053] Can't connect to a server also not showing any type of
 output
In-Reply-To: <1620284980.8.0.330788733855.issue44053@roundup.psfhosted.org>
Message-ID: <1639257528.68.0.876703832923.issue44053@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Closing due to lack of feedback.

----------
resolution:  -> not a bug
stage:  -> resolved
status: pending -> closed
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44053>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:20:15 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 11 Dec 2021 21:20:15 +0000
Subject: [issue24372] Documentation for ssl.wrap_socket's ssl_version
 parameter is odd
In-Reply-To: <1433337046.56.0.760667574061.issue24372@psf.upfronthosting.co.za>
Message-ID: <1639257615.54.0.722310750356.issue24372@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24372>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:21:07 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sat, 11 Dec 2021 21:21:07 +0000
Subject: [issue44475] Dataclass Causes Infinite Recursion when using type of
 bytes
In-Reply-To: <1624287996.71.0.124244983784.issue44475@roundup.psfhosted.org>
Message-ID: <1639257667.88.0.688980598992.issue44475@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Closing due to lack of feedback.

----------
resolution:  -> not a bug
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44475>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:21:33 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 11 Dec 2021 21:21:33 +0000
Subject: [issue27718] help('signal') incomplete (e.g: signal.signal not
 visible)
In-Reply-To: <1470746479.88.0.0919609545752.issue27718@psf.upfronthosting.co.za>
Message-ID: <1639257693.29.0.2369503393.issue27718@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

This is due to use functools.wraps(). If __all__ is not defined all non-builtin functions should have correct __module__ to be displayed by pydoc. functools.wraps() assigns __module__, __name__, __qualname__, __doc__ and __annotations__. __module__ should be preserved ('signal', not '_signal'), __name__ and __qualname__ are already correct, __annotations__ does not exist. So only __doc__ should be copied.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27718>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:28:34 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 11 Dec 2021 21:28:34 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639258114.71.0.208591963559.issue46042@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset 59435eea08d30796174552c0ca03c59b41adf8a5 by Pablo Galindo Salgado in branch 'main':
bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059)
https://github.com/python/cpython/commit/59435eea08d30796174552c0ca03c59b41adf8a5


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:28:47 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 11 Dec 2021 21:28:47 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639258127.0.0.245063369065.issue46042@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28284
pull_request: https://github.com/python/cpython/pull/30064

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:29:46 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 11 Dec 2021 21:29:46 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639258186.84.0.929013256512.issue46042@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 16:32:05 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 11 Dec 2021 21:32:05 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639258325.2.0.648355200503.issue46042@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

> Oh no, I was about to open mine ;-)

Sorry, Carl, I apologize. I hope it was not too disruptive to do the work. I was taking a look and I felt bad that the issue was probably messier than I thought and I didn't want you to have to iterate many times :(

Thanks a lot for helping review the PR and for pointing out the extra cases!!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 17:10:38 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sat, 11 Dec 2021 22:10:38 +0000
Subject: [issue9436] test_sysconfig failure: build a 32-bit Python a 64-bit OS
In-Reply-To: <1280591591.84.0.476083865565.issue9436@psf.upfronthosting.co.za>
Message-ID: <1639260638.38.0.127706074808.issue9436@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9436>
_______________________________________

From report at bugs.python.org  Sat Dec 11 17:12:16 2021
From: report at bugs.python.org (Anton Bryl)
Date: Sat, 11 Dec 2021 22:12:16 +0000
Subject: [issue46052] Ctrl+C,
 Ctrl+V in IDLE on Windows do not work with Cyrillic keyboard layout
Message-ID: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>


New submission from Anton Bryl <anton.bryl at gmail.com>:

Ctrl+C and Ctrl+V key combinations in IDLE on Windows do not work with Cyrillic keyboard layout. It is unexpected, as well as inconvenient when editing string constants.

----------
assignee: terry.reedy
components: IDLE
messages: 408345
nosy: anton.bryl, terry.reedy
priority: normal
severity: normal
status: open
title: Ctrl+C, Ctrl+V in IDLE on Windows do not work with Cyrillic keyboard layout
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sat Dec 11 17:17:08 2021
From: report at bugs.python.org (Eryk Sun)
Date: Sat, 11 Dec 2021 22:17:08 +0000
Subject: [issue37701] shutil.copyfile raises SpecialFileError for symlink to
 fifo
In-Reply-To: <1564375011.26.0.591034083368.issue37701@roundup.psfhosted.org>
Message-ID: <1639261028.37.0.311478562435.issue37701@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> Raising a SpecialFileError would be OK if `follow_symlinks` was False.

I expect it to fail if follow_symlinks is True, which is the default value. I expect it to succeed with follow_symlinks=False, which should create a shallow copy of just the symlink, regardless of its target. Instead, what happens is that it calls shutil._stat(fn) on both src and dst, regardless of follow_symlinks. I think the call should be shutil._stat(fn, follow_symlinks). This requires updating shutil._stat() to pass the value to fn.stat() and os.stat().

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37701>
_______________________________________

From report at bugs.python.org  Sat Dec 11 18:00:45 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 11 Dec 2021 23:00:45 +0000
Subject: [issue29221] ABC Recursion Error on isinstance() with less than
 recursion limit class hierarchy depth
In-Reply-To: <1484021927.49.0.387886726852.issue29221@psf.upfronthosting.co.za>
Message-ID: <1639263645.5.0.211616851464.issue29221@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It is still reproducible if increase the depth. In 3.8-3.10 it needs 329 nested classes, in 3.11 -- 496.

Seems the limit is sys.getrecursionlimit()//k - 4, where k=4 in 3.7 and older, k=3 in 3.8-3.10, and k=2 in 3.11. It is much better than was initially, but the ideal is k=1.

----------
resolution: out of date -> 
stage: resolved -> 
status: closed -> open
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29221>
_______________________________________

From report at bugs.python.org  Sat Dec 11 18:08:05 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 11 Dec 2021 23:08:05 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1639264085.84.0.577557164098.issue46032@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

The PR looks good to me. I think it's also important that we document that these types aren't supported, as it's not mentioned anywhere at the moment. Related: Issue34498.

----------
nosy: +uriyyo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sat Dec 11 18:15:12 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Sat, 11 Dec 2021 23:15:12 +0000
Subject: [issue46053] NetBSD: ossaudio support incomplete
Message-ID: <1639264512.66.0.774714620496.issue46053@roundup.psfhosted.org>


New submission from Thomas Klausner <tk at giga.or.at>:

When compiling Python on NetBSD, the ossaudio module is not enabled.
1. the code tries to export some #define that are not in the public OSS API (but that some other implementations provide)
2. on NetBSD, you need to link against libossaudio when using OSS

----------
components: Extension Modules
messages: 408349
nosy: wiz
priority: normal
severity: normal
status: open
title: NetBSD: ossaudio support incomplete
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46053>
_______________________________________

From report at bugs.python.org  Sat Dec 11 18:17:51 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Sat, 11 Dec 2021 23:17:51 +0000
Subject: [issue46053] NetBSD: ossaudio support incomplete
In-Reply-To: <1639264512.66.0.774714620496.issue46053@roundup.psfhosted.org>
Message-ID: <1639264671.16.0.00613104740418.issue46053@roundup.psfhosted.org>


Change by Thomas Klausner <tk at giga.or.at>:


----------
keywords: +patch
pull_requests: +28285
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30065

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46053>
_______________________________________

From report at bugs.python.org  Sat Dec 11 18:26:47 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 11 Dec 2021 23:26:47 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1639265207.62.0.52867569688.issue46032@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
components: +Documentation
type: enhancement -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sat Dec 11 18:41:17 2021
From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=)
Date: Sat, 11 Dec 2021 23:41:17 +0000
Subject: [issue43794] OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING /
 wrap SSL_OP_IGNORE_UNEXPECTED_EOF
In-Reply-To: <1617977591.38.0.697961461689.issue43794@roundup.psfhosted.org>
Message-ID: <1639266077.15.0.385632266361.issue43794@roundup.psfhosted.org>


Alex Gr?nholm <alex.gronholm at nextday.fi> added the comment:

OpenSSL 1.1.1 also handled EOFs strictly, but this behavior was generally suppressed in the ssl module through the default setting of suppress_ragged_eofs=True (thus enabling truncation attacks by default). The PR changes the behavior of existing applications in such a way that previously detectable unexpected EOFs are now no longer detectable by default. To make matters worse, EOF errors are not translated to SSLEOFError anymore, and instead I have to match the strerror attribute in SSLError to detect this condition.

----------
nosy: +alex.gronholm

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43794>
_______________________________________

From report at bugs.python.org  Sat Dec 11 18:51:18 2021
From: report at bugs.python.org (Thomas Klausner)
Date: Sat, 11 Dec 2021 23:51:18 +0000
Subject: [issue30512] CAN Socket support for NetBSD
In-Reply-To: <1496155843.0.0.360939407267.issue30512@psf.upfronthosting.co.za>
Message-ID: <1639266678.62.0.590187449872.issue30512@roundup.psfhosted.org>


Change by Thomas Klausner <tk at giga.or.at>:


----------
pull_requests: +28286
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30066

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30512>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:01:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 00:01:55 +0000
Subject: [issue41222] POpen bufsize=0 ignored with universal_newlines=True
In-Reply-To: <1594065242.21.0.841046846995.issue41222@roundup.psfhosted.org>
Message-ID: <1639267315.15.0.813670578661.issue41222@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41222>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:08:06 2021
From: report at bugs.python.org (wats0ns)
Date: Sun, 12 Dec 2021 00:08:06 +0000
Subject: [issue36207] robotsparser deny all with some rules
In-Reply-To: <1551865321.24.0.407834320039.issue36207@roundup.psfhosted.org>
Message-ID: <1552951200.45.0.980846340144.issue36207@roundup.psfhosted.org>


wats0ns <quentin.maire at protonmail.ch> added the comment:

I can't find a documentation about it, but all of the robots.txt checkers I find behave like this. You can test on this site: http://www.eskimoz.fr/robots.txt, I believe that this is how it's implemented now in most parsers ?

----------
nosy: +quentin-maire

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36207>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:11:21 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 00:11:21 +0000
Subject: [issue36207] robotsparser deny all with some rules
In-Reply-To: <1551865321.24.0.407834320039.issue36207@roundup.psfhosted.org>
Message-ID: <1639267881.7.0.822198029299.issue36207@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I restored one non-spam message from the OP that was deleted.

Changing to enhancement because this is not a bug (i.e., deviation from documentation).

I don't know enough about this to have a view on whether this enhancement request should be accepted.

----------
nosy: +iritkatriel
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36207>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:18:24 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 00:18:24 +0000
Subject: [issue26216] run runtktests.py error when test tkinter
In-Reply-To: <1453901780.17.0.263140202656.issue26216@psf.upfronthosting.co.za>
Message-ID: <1639268304.09.0.127817660556.issue26216@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

runtktests.py was deleted here: https://github.com/python/cpython/pull/28929

----------
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26216>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:21:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 00:21:42 +0000
Subject: [issue21737] runpy.run_path() fails with frozen __main__ modules
In-Reply-To: <1402590260.07.0.642136179062.issue21737@psf.upfronthosting.co.za>
Message-ID: <1639268502.28.0.653259465428.issue21737@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The code looks very different from the patch now, is this issue still relevant?

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21737>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:26:56 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 00:26:56 +0000
Subject: [issue22858] unittest.__init__:main shadows unittest.main
In-Reply-To: <1415874204.41.0.576776716148.issue22858@psf.upfronthosting.co.za>
Message-ID: <1639268816.7.0.596378099065.issue22858@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.11 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22858>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:38:04 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 00:38:04 +0000
Subject: [issue20123] pydoc.synopsis fails to load binary modules
In-Reply-To: <1388874425.94.0.221860493391.issue20123@psf.upfronthosting.co.za>
Message-ID: <1639269484.65.0.436867595081.issue20123@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Re-enabling the test is tracked on 20128, so this issue is no longer needed.

----------
nosy: +iritkatriel
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20123>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:39:32 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 00:39:32 +0000
Subject: [issue20128] Re-enable test_modules_search_builtin() in test_pydoc
In-Reply-To: <1388905827.82.0.948519018287.issue20128@psf.upfronthosting.co.za>
Message-ID: <1639269572.66.0.115191686323.issue20128@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20128>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:45:46 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 00:45:46 +0000
Subject: [issue17840] base64_codec uses assert for runtime validity checks
In-Reply-To: <1366875650.57.0.151905786577.issue17840@psf.upfronthosting.co.za>
Message-ID: <1639269946.73.0.242454815151.issue17840@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.11 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17840>
_______________________________________

From report at bugs.python.org  Sat Dec 11 19:51:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 00:51:42 +0000
Subject: [issue26951] [doc] Unintuitive error when using generator expression
 in class property
In-Reply-To: <1462372473.02.0.946073615941.issue26951@psf.upfronthosting.co.za>
Message-ID: <1639270302.45.0.476925713313.issue26951@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
title: Unintuitive error when using generator expression in class property -> [doc] Unintuitive error when using generator expression in class property
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26951>
_______________________________________

From report at bugs.python.org  Sat Dec 11 20:22:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 01:22:28 +0000
Subject: [issue10116] Sporadic failures in test_urllibnet
In-Reply-To: <1287150282.16.0.127032822399.issue10116@psf.upfronthosting.co.za>
Message-ID: <1639272148.7.0.11429965263.issue10116@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The www.example.com url was replaced by a local one in Issue36019, so this seems to complete what remained to do here.

----------
nosy: +iritkatriel
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10116>
_______________________________________

From report at bugs.python.org  Sat Dec 11 20:24:16 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sun, 12 Dec 2021 01:24:16 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639272256.71.0.628803180875.issue46042@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset 438817fdd5b731d486285d205bed2e78b655c0d6 by Miss Islington (bot) in branch '3.10':
bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059) (GH-30064)
https://github.com/python/cpython/commit/438817fdd5b731d486285d205bed2e78b655c0d6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sat Dec 11 20:30:46 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sun, 12 Dec 2021 01:30:46 +0000
Subject: [issue46052] Ctrl+C,
 C+V in IDLE on Windows do not work with Cyrillic keys
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639272646.98.0.926894082814.issue46052@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

IDLE is a tkinter application and tkinter wraps the tcl/tk GUI framework. Your problem is mostly in the interaction between Windows, your Cyrillic input method, and tk.  As a test, run

import tkinter as tk
r = tk.Tk()
t = tk.Text(r)
t.pack()

Click in the box, type something, and try Ctrl-X, -C, -V.  If they work, we can add explicit bindings somewhat similar to those IDLE makes.

Also, how do you make your keyboard a Cyrillic keyboard.

EP, are you aware of any related tk issues?  Serhiy, do you know of any specific problems with Cyrillic and tkinter/tk?

----------
assignee: terry.reedy -> 
components: +Tkinter
nosy: +epaine, serhiy.storchaka
title: Ctrl+C, Ctrl+V in IDLE on Windows do not work with Cyrillic keyboard layout -> Ctrl+C, C+V in IDLE on Windows do not work with Cyrillic keys

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sat Dec 11 20:43:28 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sun, 12 Dec 2021 01:43:28 +0000
Subject: [issue45977] Unexpected effect of sys.pycache_prefix = ""
In-Reply-To: <1638590311.18.0.778355816492.issue45977@roundup.psfhosted.org>
Message-ID: <1639273408.4.0.376912882205.issue45977@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Thanks, I've misunderstood how it works. It makes sense now. Closing as not a bug.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45977>
_______________________________________

From report at bugs.python.org  Sat Dec 11 22:16:47 2021
From: report at bugs.python.org (AegisEmerald545)
Date: Sun, 12 Dec 2021 03:16:47 +0000
Subject: [issue46043] Python Launcher Not Opening Files.
In-Reply-To: <1639178553.87.0.850014051129.issue46043@roundup.psfhosted.org>
Message-ID: <1639279007.52.0.107715053148.issue46043@roundup.psfhosted.org>


AegisEmerald545 <corcodoaiemarianraul at gmail.com> added the comment:

Same here. macOS Monterey with an Apple Silicon SoC and there seems not to be any workaround this time

----------
nosy: +AegisEmerald545

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46043>
_______________________________________

From report at bugs.python.org  Sun Dec 12 00:09:47 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Sun, 12 Dec 2021 05:09:47 +0000
Subject: [issue23469] Delete Misc/*.wpr files
In-Reply-To: <1424048342.99.0.00819785192711.issue23469@psf.upfronthosting.co.za>
Message-ID: <1639285787.73.0.680662859612.issue23469@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 4.0 -> 5.0
pull_requests: +28287
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30067

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23469>
_______________________________________

From report at bugs.python.org  Sun Dec 12 00:24:58 2021
From: report at bugs.python.org (Carl Friedrich Bolz-Tereick)
Date: Sun, 12 Dec 2021 05:24:58 +0000
Subject: [issue46042] Error range of "duplicate argument" SyntaxErrors is too
 big
In-Reply-To: <1639171461.19.0.894286110082.issue46042@roundup.psfhosted.org>
Message-ID: <1639286698.59.0.51610020182.issue46042@roundup.psfhosted.org>


Carl Friedrich Bolz-Tereick <cfbolz at gmx.de> added the comment:

Oh, don't worry, it's all good! It got fixed and I learned something.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46042>
_______________________________________

From report at bugs.python.org  Sun Dec 12 00:29:47 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sun, 12 Dec 2021 05:29:47 +0000
Subject: [issue46054] Incorrect error when parsing non-utf8 files
Message-ID: <1639286987.92.0.127175285023.issue46054@roundup.psfhosted.org>


New submission from Pablo Galindo Salgado <pablogsal at gmail.com>:

Python3.9 shows:

 ../3.9/python /bin/ls
SyntaxError: Non-UTF-8 code starting with '\xfc' in file /bin/ls on line 2, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for detail

while 3.10 shows:

 python /bin/ls
  File "/bin/ls", line 0

SyntaxError: unknown parsing error

----------
components: Parser
messages: 408361
nosy: lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Incorrect error when parsing non-utf8 files
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46054>
_______________________________________

From report at bugs.python.org  Sun Dec 12 00:31:00 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sun, 12 Dec 2021 05:31:00 +0000
Subject: [issue46054] Incorrect error when parsing non-utf8 files
In-Reply-To: <1639286987.92.0.127175285023.issue46054@roundup.psfhosted.org>
Message-ID: <1639287060.74.0.846832786902.issue46054@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
keywords: +patch
pull_requests: +28288
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30068

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46054>
_______________________________________

From report at bugs.python.org  Sun Dec 12 00:33:38 2021
From: report at bugs.python.org (Xinhang Xu)
Date: Sun, 12 Dec 2021 05:33:38 +0000
Subject: [issue46055] Speed up binary shifting operators
Message-ID: <1639287218.01.0.821172330488.issue46055@roundup.psfhosted.org>


New submission from Xinhang Xu <xuxinhang4567 at 126.com>:

See its PR.

---------

Inspired by [bpo-44946](https://bugs.python.org/issue44946), I found there were no special shortcuts for shifting operation applied to "medium value" long object. So I modified CPython's VM to accelerate my python project where there is plenty of binary shifting operation. I guess somebody else might also need it.

----------
components: Interpreter Core
messages: 408362
nosy: xuxinhang
priority: normal
pull_requests: 28289
severity: normal
status: open
title: Speed up binary shifting operators
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46055>
_______________________________________

From report at bugs.python.org  Sun Dec 12 00:36:38 2021
From: report at bugs.python.org (Ned Deily)
Date: Sun, 12 Dec 2021 05:36:38 +0000
Subject: [issue46043] Python Launcher Not Opening Files.
In-Reply-To: <1639178553.87.0.850014051129.issue46043@roundup.psfhosted.org>
Message-ID: <1639287398.65.0.934864151225.issue46043@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

There is definitely something odd going on here. I am seeing different behaviors across different systems: I have at least one macOS 12.0.1 system where the Launcher app seems to work OK with the current 3.10.1 (as long as the Terminal.app is already running) but then on some other 12.0.1 systems and on an 11.6.1 system it fails as you describe it. This is also across a mixture of Intel and Apple Silicon systems and VMs so no obvious correlation there. Launching via IDLE does seem to work properly on the systems I've tested so perhaps that might be a temporary workaround as well as just manually running the script in a Terminal.app window. I am going to close this issue as a duplicate of Issue40477 and am bumping the priority with the aim to have a fix prior to the next round of releases in early January.

----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Python Launcher app on macOS 10.15 Catalina fails to run scripts

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46043>
_______________________________________

From report at bugs.python.org  Sun Dec 12 00:39:29 2021
From: report at bugs.python.org (Ned Deily)
Date: Sun, 12 Dec 2021 05:39:29 +0000
Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts
In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org>
Message-ID: <1639287569.74.0.305351777576.issue40477@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

>From comments in duplicate Issue46043:
"There is definitely something odd going on here. I am seeing different behaviors across different systems: I have at least one macOS 12.0.1 system where the Launcher app seems to work OK with the current 3.10.1 (as long as the Terminal.app is already running) but then on some other 12.0.1 systems and on an 11.6.1 system it fails as you describe it. This is also across a mixture of Intel and Apple Silicon systems and VMs so no obvious correlation there. Launching via IDLE does seem to work properly on the systems I've tested so perhaps that might be a temporary workaround as well as just manually running the script in a Terminal.app window. I am going to close this issue as a duplicate of Issue40477 and am bumping the priority with the aim to have a fix prior to the next round of releases in early January."

----------
nosy: +AegisEmerald545, nicholasjbond2020
priority: high -> critical
title: Python Launcher app on macOS 10.15 Catalina fails to run scripts -> Python Launcher app on macOS 10.15+ fails to run scripts

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40477>
_______________________________________

From report at bugs.python.org  Sun Dec 12 01:31:09 2021
From: report at bugs.python.org (Gianni Mariani)
Date: Sun, 12 Dec 2021 06:31:09 +0000
Subject: [issue44674] dataclasses should allow frozendict default value
In-Reply-To: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org>
Message-ID: <1639290669.19.0.634727990233.issue44674@roundup.psfhosted.org>


Gianni Mariani <gianni at mariani.ws> added the comment:

Excellent. Thanks!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44674>
_______________________________________

From report at bugs.python.org  Sun Dec 12 02:07:03 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 12 Dec 2021 07:07:03 +0000
Subject: [issue46054] Incorrect error when parsing non-utf8 files
In-Reply-To: <1639286987.92.0.127175285023.issue46054@roundup.psfhosted.org>
Message-ID: <1639292823.14.0.883236718382.issue46054@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +28290
pull_request: https://github.com/python/cpython/pull/30069

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46054>
_______________________________________

From report at bugs.python.org  Sun Dec 12 02:07:14 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sun, 12 Dec 2021 07:07:14 +0000
Subject: [issue46054] Incorrect error when parsing non-utf8 files
In-Reply-To: <1639286987.92.0.127175285023.issue46054@roundup.psfhosted.org>
Message-ID: <1639292834.06.0.196841276252.issue46054@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset 4325a766f5f603ef6dfb8c4d5798e5e73cb5efd5 by Pablo Galindo Salgado in branch 'main':
bpo-46054: Fix parsing error when parsing non-utf8 characters in source files (GH-30068)
https://github.com/python/cpython/commit/4325a766f5f603ef6dfb8c4d5798e5e73cb5efd5


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46054>
_______________________________________

From report at bugs.python.org  Sun Dec 12 03:31:27 2021
From: report at bugs.python.org (John Belmonte)
Date: Sun, 12 Dec 2021 08:31:27 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1639297887.28.0.671126054271.issue45995@roundup.psfhosted.org>


John Belmonte <john at neggie.net> added the comment:

> For Decimal, we'd need to "own" the string formatting, taking that responsibility away from mpdecimal, but there are already other reasons to do that.

After some digging, I believe this is the background on forking pieces of mpdecimal (and why the existing source copy inside Python doesn't count as a fork):
  https://bugs.python.org/issue45708#msg405895
  https://github.com/python/cpython/pull/29438

If I understand correctly, the PR for supporting underscore separators in Decimal formatting is only taking control of generating a mpd_spec_t from the spec string.  Formatting itself is still done by mpd_qformat_spec().

So there's outstanding work to also pull the formatting code itself into _decimal.c.  (And this is wanted anyway to reconcile existing libmpdec formatting modifications:  https://github.com/python/cpython/commit/298131a44896a4fec1ea829814ad52409d59aba5)

And this is all because vendors have the crazy practice of unbundling libmpdec from Python.  (If a project is bundling the source of another, there may be some reason...?)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Sun Dec 12 03:41:19 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 12 Dec 2021 08:41:19 +0000
Subject: [issue45874] urllib.parse.parse_qsl does not parse empty query string
 with strict parsing
In-Reply-To: <1637620540.89.0.438888661904.issue45874@roundup.psfhosted.org>
Message-ID: <1639298479.21.0.730656343127.issue45874@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset e6fe10d34096a23be7d26271cf6aba429313b01d by Christian Sattler in branch 'main':
bpo-45874: Handle empty query string correctly in urllib.parse.parse_qsl (#29716)
https://github.com/python/cpython/commit/e6fe10d34096a23be7d26271cf6aba429313b01d


----------
nosy: +asvetlov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45874>
_______________________________________

From report at bugs.python.org  Sun Dec 12 03:45:28 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 12 Dec 2021 08:45:28 +0000
Subject: [issue45855] PyCapsule_Import still using PyImport_ImportModuleNoBlock
In-Reply-To: <1637425638.46.0.745441938277.issue45855@roundup.psfhosted.org>
Message-ID: <1639298728.17.0.334991782224.issue45855@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset 41026c3155012d6ea50e01205c163b6739c675b8 by Kumar Aditya in branch 'main':
bpo-45855: Replaced deprecated `PyImport_ImportModuleNoBlock` with PyImport_ImportModule (GH-30046)
https://github.com/python/cpython/commit/41026c3155012d6ea50e01205c163b6739c675b8


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45855>
_______________________________________

From report at bugs.python.org  Sun Dec 12 03:47:07 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 12 Dec 2021 08:47:07 +0000
Subject: [issue45855] Replace PyImport_ImportModuleNoBlock with
 PyImport_ImportModule in std modules
In-Reply-To: <1637425638.46.0.745441938277.issue45855@roundup.psfhosted.org>
Message-ID: <1639298827.56.0.568711950093.issue45855@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: PyCapsule_Import still using PyImport_ImportModuleNoBlock -> Replace PyImport_ImportModuleNoBlock with PyImport_ImportModule in std modules

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45855>
_______________________________________

From report at bugs.python.org  Sun Dec 12 04:09:43 2021
From: report at bugs.python.org (Georg Brandl)
Date: Sun, 12 Dec 2021 09:09:43 +0000
Subject: [issue45855] Replace PyImport_ImportModuleNoBlock with
 PyImport_ImportModule in std modules
In-Reply-To: <1637425638.46.0.745441938277.issue45855@roundup.psfhosted.org>
Message-ID: <1639300183.69.0.392032351556.issue45855@roundup.psfhosted.org>


Change by Georg Brandl <georg at python.org>:


----------
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45855>
_______________________________________

From report at bugs.python.org  Sun Dec 12 04:27:53 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sun, 12 Dec 2021 09:27:53 +0000
Subject: [issue44674] dataclasses should allow frozendict default value
In-Reply-To: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org>
Message-ID: <1639301273.0.0.987049966008.issue44674@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

@gianni: can you verify that your use case works in 3.11?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44674>
_______________________________________

From report at bugs.python.org  Sun Dec 12 04:49:56 2021
From: report at bugs.python.org (Georg Brandl)
Date: Sun, 12 Dec 2021 09:49:56 +0000
Subject: [issue45855] Replace PyImport_ImportModuleNoBlock with
 PyImport_ImportModule in std modules
In-Reply-To: <1637425638.46.0.745441938277.issue45855@roundup.psfhosted.org>
Message-ID: <1639302596.63.0.137625291329.issue45855@roundup.psfhosted.org>


Georg Brandl <georg at python.org> added the comment:


New changeset f4095e53ab708d95e019c909d5928502775ba68f by Georg Brandl in branch 'main':
bpo-45855: document that `no_block` has no use anymore in PyCapsule_Import (#29665)
https://github.com/python/cpython/commit/f4095e53ab708d95e019c909d5928502775ba68f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45855>
_______________________________________

From report at bugs.python.org  Sun Dec 12 04:50:44 2021
From: report at bugs.python.org (Georg Brandl)
Date: Sun, 12 Dec 2021 09:50:44 +0000
Subject: [issue45855] Replace PyImport_ImportModuleNoBlock with
 PyImport_ImportModule in std modules
In-Reply-To: <1637425638.46.0.745441938277.issue45855@roundup.psfhosted.org>
Message-ID: <1639302644.29.0.277332184625.issue45855@roundup.psfhosted.org>


Change by Georg Brandl <georg at python.org>:


----------
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45855>
_______________________________________

From report at bugs.python.org  Sun Dec 12 04:58:30 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 12 Dec 2021 09:58:30 +0000
Subject: [issue46055] Speed up binary shifting operators
In-Reply-To: <1639287218.01.0.821172330488.issue46055@roundup.psfhosted.org>
Message-ID: <1639303110.87.0.273749046805.issue46055@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Could you please show any microbenchmarking results?

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46055>
_______________________________________

From report at bugs.python.org  Sun Dec 12 05:05:25 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 12 Dec 2021 10:05:25 +0000
Subject: [issue45684] `functools.singledispatchmethod` does not define
 `__class_getitem__`
In-Reply-To: <1635790981.47.0.0130236033988.issue45684@roundup.psfhosted.org>
Message-ID: <1639303525.39.0.738567309164.issue45684@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Closing this, as I don't think the use case I presented is strong enough, and there are ultimately more important things to worry about.

----------
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45684>
_______________________________________

From report at bugs.python.org  Sun Dec 12 05:36:45 2021
From: report at bugs.python.org (Roundup Robot)
Date: Sun, 12 Dec 2021 10:36:45 +0000
Subject: [issue13966] Add disable_interspersed_args() to
 argparse.ArgumentParser
In-Reply-To: <1328687368.18.0.265955669963.issue13966@psf.upfronthosting.co.za>
Message-ID: <1639305405.95.0.837748294926.issue13966@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
nosy: +python-dev
nosy_count: 5.0 -> 6.0
pull_requests: +28291
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30071

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13966>
_______________________________________

From report at bugs.python.org  Sun Dec 12 06:13:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 11:13:31 +0000
Subject: [issue6634] [doc] sys.exit() called from threads other than the main
 one: undocumented behaviour
In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za>
Message-ID: <1639307611.31.0.0890345005956.issue6634@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Since 3.8 we have threading.excepthook() so the situation is different now: 

https://github.com/python/cpython/pull/13515

I think it still makes sense to change the wording of the doc for sys.exit() a bit, and add a reference to the relevant section of the threading doc.

----------
keywords: +easy
nosy: +iritkatriel
title: sys.exit() called from threads other than the main one: undocumented behaviour -> [doc] sys.exit() called from threads other than the main one: undocumented behaviour
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue6634>
_______________________________________

From report at bugs.python.org  Sun Dec 12 06:19:40 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 11:19:40 +0000
Subject: [issue24224] test_msilib is inadequate
In-Reply-To: <1431928593.08.0.843064802562.issue24224@psf.upfronthosting.co.za>
Message-ID: <1639307980.47.0.0202225392246.issue24224@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

It seems that most of the tests in this script were written after this issue was created. If there is still need to extend them, it would help to elaborate here on what is still needed. Otherwise, we could close this.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24224>
_______________________________________

From report at bugs.python.org  Sun Dec 12 06:30:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 11:30:42 +0000
Subject: [issue22833] The decode_header() function decodes raw part to bytes
 or str, depending on encoded part
In-Reply-To: <1415587360.95.0.777626227555.issue22833@psf.upfronthosting.co.za>
Message-ID: <1639308642.72.0.146158511312.issue22833@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22833>
_______________________________________

From report at bugs.python.org  Sun Dec 12 06:35:36 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 11:35:36 +0000
Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails
 on FreeBSD with ZFS
In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za>
Message-ID: <1639308936.64.0.282771067456.issue19838@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

issue15745 has been fixed in the meantime (about 6 years ago).

If nobody objects I will close this as out of date. If there is still a problem with the test is will be reported for a current python version.

----------
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19838>
_______________________________________

From report at bugs.python.org  Sun Dec 12 06:52:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 11:52:22 +0000
Subject: [issue18778] email docstrings and comments say about Unicode strings
In-Reply-To: <1376896820.36.0.260467198244.issue18778@psf.upfronthosting.co.za>
Message-ID: <1639309942.29.0.343058824488.issue18778@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18778>
_______________________________________

From report at bugs.python.org  Sun Dec 12 07:03:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 12:03:33 +0000
Subject: [issue25668] Deadlock in logging caused by a possible race condition
 with "format"
In-Reply-To: <1447942973.46.0.788007678714.issue25668@psf.upfronthosting.co.za>
Message-ID: <1639310613.73.0.664663554893.issue25668@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> wont fix
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25668>
_______________________________________

From report at bugs.python.org  Sun Dec 12 07:04:32 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 12:04:32 +0000
Subject: [issue27920] Embedding python in a shared library fails to import the
 Python module
In-Reply-To: <1472672150.5.0.175635801824.issue27920@psf.upfronthosting.co.za>
Message-ID: <1639310672.8.0.390060288959.issue27920@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

3.4 is no longer maintained. Please create a new issue if you are still having this problem on a current python version (>= 3.9).

----------
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27920>
_______________________________________

From report at bugs.python.org  Sun Dec 12 07:33:41 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Sun, 12 Dec 2021 12:33:41 +0000
Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts
In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org>
Message-ID: <1639312421.32.0.323140090968.issue40477@roundup.psfhosted.org>


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

FWIW, I'm experimenting with using Scripting Bridge instead of raw Apple Events in Python Laucher.  Mostly to check if that fixes the issue because I can run scripts in Terminal using Scripting Bridge from a Python script using PyObjC.

Scripting Bridge would also result in slightly easier to read code. 


On my machine (M1 Mac Book running macOS 12.0.1) Python Launcher cannot start scripts (as described in this issue). Same when I strip code signatures (and ad-hoc sign without using the hardened runtime)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40477>
_______________________________________

From report at bugs.python.org  Sun Dec 12 07:45:16 2021
From: report at bugs.python.org (wolfgang kuehn)
Date: Sun, 12 Dec 2021 12:45:16 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 cooperate security settingss
Message-ID: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>


New submission from wolfgang kuehn <wolfgang-kuehn at decatur.de>:

I just installed Python3.10.1 from the Windows 10 App Store. 
Most workflows depend on creating virtual environments, but (1)

    python -m venv venv

    # -> Error 1260: Windows cannot open this program because it has been prevented by a software restriction policy

However, a (2)

    python -m venv --without-pip venv

completes, only to not allow execution of (3)

    .\venv\Scripts\python.exe
    # -> Error 1260: Windows cannot open this program because it has been prevented by a software restriction policy


Reason for this probably are the (not so unreasonable) cooperate Software Restriction Policy (in our case enforced by Applocker):
You are not allowed to execute from where you are allowed to write.

So basically Python is broken in many MS Windows cooperate settings. Cooperate meaning (Software Restriction Policies) + (Usage of Virtual Environments). 

And my feeling is that it does not need to be, the virtual environment implementation with those *.exe copies being a kludge, IMHO.


Note: (2) is reminiscent of bpo-45337, which was fixed with 3.9.

----------
components: Installation
messages: 408380
nosy: wolfgang-kuehn
priority: normal
severity: normal
status: open
title: Cannot use virtual environment on Windows 10 in cooperate security settingss
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Sun Dec 12 07:49:06 2021
From: report at bugs.python.org (wolfgang kuehn)
Date: Sun, 12 Dec 2021 12:49:06 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 cooperate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639313346.27.0.821316611237.issue46056@roundup.psfhosted.org>


Change by wolfgang kuehn <wolfgang-kuehn at decatur.de>:


----------
title: Cannot use virtual environment on Windows 10 in cooperate security settingss -> Cannot use virtual environment on Windows 10 in cooperate security settings
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Sun Dec 12 08:06:47 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 13:06:47 +0000
Subject: [issue18778] email docstrings and comments use python 2 language
 (Unicode strings)
In-Reply-To: <1376896820.36.0.260467198244.issue18778@psf.upfronthosting.co.za>
Message-ID: <1639314407.28.0.411708444734.issue18778@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
assignee:  -> docs at python
components: +Documentation
nosy: +docs at python
title: email docstrings and comments say about Unicode strings -> email docstrings and comments use python 2 language (Unicode strings)

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18778>
_______________________________________

From report at bugs.python.org  Sun Dec 12 08:07:13 2021
From: report at bugs.python.org (Anton Bryl)
Date: Sun, 12 Dec 2021 13:07:13 +0000
Subject: [issue46052] Ctrl+C,
 C+V in IDLE on Windows do not work with Cyrillic keys
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639314433.44.0.821429185334.issue46052@roundup.psfhosted.org>


Anton Bryl <anton.bryl at gmail.com> added the comment:

Tried the tkinter example.
The exact same problem occurs there as well: when a Cyrillic layout is on, Ctrl+Letter combinations do not work (it's in fact not just Ctrl+C and Ctrl+V, but apparently all of them).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 08:10:20 2021
From: report at bugs.python.org (Anton Bryl)
Date: Sun, 12 Dec 2021 13:10:20 +0000
Subject: [issue46052] Ctrl+C,
 C+V in IDLE on Windows do not work with Cyrillic keys
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639314620.24.0.732045746548.issue46052@roundup.psfhosted.org>


Anton Bryl <anton.bryl at gmail.com> added the comment:

> Also, how do you make your keyboard a Cyrillic keyboard.

On Windows, just install a keyboard layout for e.g. Russian. As soon as you switch to it, all Ctrl+Letter combinations stop working. Switch back to EN, and everything's working again.

As the code is written in Latin alphabet, it's only rarely a problem, but, as I mentioned, sometimes one needs to edit string constants, and then it's an inconvenience (normally the exact same key combinations work).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 08:14:12 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 13:14:12 +0000
Subject: [issue6942] email.generator.Generator memory consumption
In-Reply-To: <1253318032.63.0.187743524666.issue6942@psf.upfronthosting.co.za>
Message-ID: <1639314852.95.0.0650704231135.issue6942@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Ross, the link to your code no longer works. Do you still have it, and if so could you paste/upload it here?

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue6942>
_______________________________________

From report at bugs.python.org  Sun Dec 12 08:19:55 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Sun, 12 Dec 2021 13:19:55 +0000
Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts
In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org>
Message-ID: <1639315195.72.0.652125210938.issue40477@roundup.psfhosted.org>


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

It looks like this is related to code signing and entitlements, in particular:

* On my system Terminal.app is in the "Automation" list in the Security & Privacy control panel, and none of the installed Python Launchers are
* The script let below works (assuming PyObjC is installed):
```
import ScriptingBridge

command = """cd '' && '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3'  '/Users/ronald/issuequery.py'  && echo Exit status: $? && exit 1"""

app = ScriptingBridge.SBApplication.applicationWithBundleIdentifier_("com.apple.Terminal")

app.activate()
res = app.doScript_in_(command, None)
print(res)
```

* Python Launcher does not work when launched normally
* Python Launcher *does* work when I run "/Applcations/Python 3.X/Python Launcher/Contents/MacOS/Python Launcher" in Terminal.app and try to open a python file using Python Launcher
  - I've tried this with 3 variants of Python Launcher: 3.9.7 from python.org installer, no modifications; 3.10.1 from python.org installer, stripped signature and resigned ad-hoc; 3.11 installed from source with ScriptingBridge.

As mentioned before I've experimented with ScriptingBridge in Python Launcher, replacing "doscript.m" by the code below:
```
#import <Cocoa/Cocoa.h>
#import <ScriptingBridge/ScriptingBridge.h>
#import "doscript.h"

extern int
doscript(const char *command)
{
    NSObject* terminalApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.Terminal"];
    //[terminalApp activate];
    NSObject* res = [terminalApp doScript:[NSString stringWithUTF8String:command] in:nil];

    NSRunAlertPanel(@"script result", @"%@", @"ok",nil, nil, res);

    return 0;
}
```

That's equivalent to the python code I posted earlier. This is not production quality code, it compiles with a warning about "doScript:in:" that can be avoided by a different way of using ScriptingBridge. That's irrelevant for this experiment though.

When I test the call to "doScript:in:" *fails* (returns nil) when launching the app regularly, and *succeeds* when running as a terminal command (as mentioned earlier).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40477>
_______________________________________

From report at bugs.python.org  Sun Dec 12 08:26:15 2021
From: report at bugs.python.org (Xinhang Xu)
Date: Sun, 12 Dec 2021 13:26:15 +0000
Subject: [issue46055] Speed up binary shifting operators
In-Reply-To: <1639287218.01.0.821172330488.issue46055@roundup.psfhosted.org>
Message-ID: <1639315575.14.0.849779545786.issue46055@roundup.psfhosted.org>


Xinhang Xu <xuxinhang4567 at 126.com> added the comment:

I post a comment to the PR showing its performance improvement. I paste it below. I think the result not bad.

-------------

I use timeit to measure time costs and any other operators or calls are excluded. For each testcase, the former is dcd2796 and the latter is this PR's base 036bbb1.

64-bit Release building. Run in Windows 10 1709 (64-bit)

python -m timeit " i = 1; i <<= 3; i >>= 3"  # small value (cost down by 36%)
5000000 loops, best of 5: 92.7 nsec per loop
2000000 loops, best of 5: 145 nsec per loop

python -m timeit " i = 1; i <<= 10; i >>= 10"  # medium value (-25%)
2000000 loops, best of 5: 114 nsec per loop
2000000 loops, best of 5: 151 nsec per loop

python -m timeit " i = 1; i <<= 100; i >>= 100"  # big value  (-12%)
1000000 loops, best of 5: 209 nsec per loop
1000000 loops, best of 5: 238 nsec per loop

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46055>
_______________________________________

From report at bugs.python.org  Sun Dec 12 08:30:56 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sun, 12 Dec 2021 13:30:56 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 corporate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639315856.29.0.027989259377.issue46056@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
title: Cannot use virtual environment on Windows 10 in cooperate security settings -> Cannot use virtual environment on Windows 10 in corporate security settings

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Sun Dec 12 08:38:24 2021
From: report at bugs.python.org (AnLong)
Date: Sun, 12 Dec 2021 13:38:24 +0000
Subject: [issue16594] SocketServer should set SO_REUSEPORT along with
 SO_REUSEADDR when present
In-Reply-To: <1354439249.45.0.0324812571604.issue16594@psf.upfronthosting.co.za>
Message-ID: <1639316304.46.0.837388247653.issue16594@roundup.psfhosted.org>


Change by AnLong <aisk1988 at gmail.com>:


----------
keywords: +patch
nosy: +asaka
nosy_count: 2.0 -> 3.0
pull_requests: +28292
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30072

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16594>
_______________________________________

From report at bugs.python.org  Sun Dec 12 08:57:13 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Sun, 12 Dec 2021 13:57:13 +0000
Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts
In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org>
Message-ID: <1639317433.83.0.876750778397.issue40477@roundup.psfhosted.org>


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

Pfff.... Apple's documentation is too incomplete.

In recent versions the apple events entitlement only works when the program also has an NSAppleEventsUsageDescription key in Info.plist with a string value that describes why it needs the entitlement, this information is shown to the user on first launch.

When I add this key to info.plist and resign the launcher works.

I forgot to create a screenshot of this and cannot recreate the system dialog that gets shown, probably documentement somewhere that I haven't found yet...

For now I used:

<key>NSAppleEventsUsageDescription</key>
<string>Python Launcher needs this to run scripts in a Terminal window</string>

This requires no code changes.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40477>
_______________________________________

From report at bugs.python.org  Sun Dec 12 09:51:26 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 14:51:26 +0000
Subject: [issue1525919] email package content-transfer-encoding behaviour
 changed
Message-ID: <1639320686.28.0.356834303238.issue1525919@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The encoding functions are now doing

orig = msg.get_payload(decode=True)

Does this fix the double-encoding issue?


This change was made in 
https://github.com/python/cpython/commit/00ae435deef434f471e39bea3f3ab3a3e3cd90fe

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1525919>
_______________________________________

From report at bugs.python.org  Sun Dec 12 09:53:18 2021
From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=)
Date: Sun, 12 Dec 2021 14:53:18 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
Message-ID: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>


New submission from L?szl? Attila T?th <laszlo.attila.toth at gmail.com>:

I tried to use the following code where the --db-password is not shown in the --help output (Originally I wanted to use mutually exclusive groups but that feature also works strangely, so I changed them to regular groups).

def register_db_args(parser: argparse.ArgumentParser):
    grp = parser.add_argument_group('Database settings')
    grp.add_argument('--db-config', dest='db_config_file',
                     help='Config file containg all details including password')

    grp.add_argument('--db-host')
    grp.add_argument('--db-port')
    grp.add_argument('--db-user')

    xgrp = grp.add_argument_group()
    xgrp.add_argument('--db-password')
    xgrp.add_argument('--db-password-env')
    xgrp.add_argument('--db-password-file')

----------
components: Library (Lib)
messages: 408388
nosy: Laszlo.Attila.Toth
priority: normal
severity: normal
status: open
title: argparse: embedded groups may prevent options from being in help output
type: behavior
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Sun Dec 12 09:57:46 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 14:57:46 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>
Message-ID: <1639321066.76.0.931991332581.issue46057@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Please complete the bug report: How did you run this function, what output did you get and what output did you expect?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Sun Dec 12 10:21:38 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 15:21:38 +0000
Subject: [issue20369] concurrent.futures.wait() blocks forever when given
 duplicate Futures
In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za>
Message-ID: <1639322498.96.0.93057923177.issue20369@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
components: +Library (Lib)
nosy: +iritkatriel
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20369>
_______________________________________

From report at bugs.python.org  Sun Dec 12 10:24:35 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 15:24:35 +0000
Subject: [issue20369] concurrent.futures.wait() blocks forever when given
 duplicate Futures
In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za>
Message-ID: <1639322675.43.0.69834286535.issue20369@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy -patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20369>
_______________________________________

From report at bugs.python.org  Sun Dec 12 10:31:40 2021
From: report at bugs.python.org (E. Paine)
Date: Sun, 12 Dec 2021 15:31:40 +0000
Subject: [issue46052] Ctrl+C,
 C+V in IDLE on Windows do not work with Cyrillic keys
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639323100.95.0.282775534802.issue46052@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

I have reproduced the behaviour described in Wish (from the Tk head). Having tried other applications, I can also confirm that it is normal for inputs to be treated in this manner (e.g. using Ctrl-C on my Latin keyboard with the input device set to Russian copies to the clipboard). I'll take it up with the Tk team.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 10:44:37 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 15:44:37 +0000
Subject: [issue45636] Merge BINARY_*/INPLACE_* into BINARY_OP
In-Reply-To: <1635372832.22.0.99301821488.issue45636@roundup.psfhosted.org>
Message-ID: <1639323877.52.0.119914256761.issue45636@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +iritkatriel
nosy_count: 3.0 -> 4.0
pull_requests: +28293
pull_request: https://github.com/python/cpython/pull/30073

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45636>
_______________________________________

From report at bugs.python.org  Sun Dec 12 10:46:30 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 15:46:30 +0000
Subject: [issue45636] Merge BINARY_*/INPLACE_* into BINARY_OP
In-Reply-To: <1635372832.22.0.99301821488.issue45636@roundup.psfhosted.org>
Message-ID: <1639323990.37.0.455802146502.issue45636@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests:  -28293

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45636>
_______________________________________

From report at bugs.python.org  Sun Dec 12 10:47:51 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 15:47:51 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1639324071.18.0.399587323094.issue45635@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28295
pull_request: https://github.com/python/cpython/pull/30073

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Sun Dec 12 10:47:51 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 15:47:51 +0000
Subject: [issue45636] Merge BINARY_*/INPLACE_* into BINARY_OP
In-Reply-To: <1635372832.22.0.99301821488.issue45636@roundup.psfhosted.org>
Message-ID: <1639324071.09.0.899433829529.issue45636@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28294
pull_request: https://github.com/python/cpython/pull/30073

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45636>
_______________________________________

From report at bugs.python.org  Sun Dec 12 10:58:33 2021
From: report at bugs.python.org (E. Paine)
Date: Sun, 12 Dec 2021 15:58:33 +0000
Subject: [issue46052] Ctrl+C,
 C+V in IDLE on Windows do not work with Cyrillic keys
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639324713.23.0.555167654592.issue46052@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

Actually, doing a bit more research, issue31244 came up (and more specifically msg300716). It was concluded there that the issue should not be fixed, though there was some C/C++ code reported in the last message that the OP claims could potentially solve the issue if added to either Tk or Python.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 10:59:58 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sun, 12 Dec 2021 15:59:58 +0000
Subject: [issue46054] Incorrect error when parsing non-utf8 files
In-Reply-To: <1639286987.92.0.127175285023.issue46054@roundup.psfhosted.org>
Message-ID: <1639324798.16.0.207817267453.issue46054@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
pull_requests: +28296
pull_request: https://github.com/python/cpython/pull/30074

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46054>
_______________________________________

From report at bugs.python.org  Sun Dec 12 11:08:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 16:08:57 +0000
Subject: [issue1599254] mailbox: other programs' messages can vanish without
 trace
Message-ID: <1639325337.62.0.113449499023.issue1599254@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11 - the test in mailbox-test.patch fails.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1599254>
_______________________________________

From report at bugs.python.org  Sun Dec 12 11:25:28 2021
From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=)
Date: Sun, 12 Dec 2021 16:25:28 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>
Message-ID: <1639326328.45.0.24411109797.issue46057@roundup.psfhosted.org>


L?szl? Attila T?th <laszlo.attila.toth at gmail.com> added the comment:

Sorry, these are two bugs in fact. The current one, the help with minmal code:

import argparse

parser = argparse.ArgumentParser()
grp = parser.add_argument_group('Database settings')
grp.add_argument('--db-config')
xgrp = grp.add_argument_group()
xgrp.add_argument('--db-password')
parser.parse_args(['-h'])


The group's help output shows only --db-config option:

Database settings:
  --db-config DB_CONFIG

If I change the xgrp to be mutually exclusive group as:
xgrp = grp.add_mutually_exclusive_group()

then the output is the same as I expect for the previous code, too:

Database settings:
  --db-config DB_CONFIG
  --db-password DB_PASSWORD

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Sun Dec 12 11:27:18 2021
From: report at bugs.python.org (E. Paine)
Date: Sun, 12 Dec 2021 16:27:18 +0000
Subject: [issue46052] Ctrl+C,
 C+V in IDLE on Windows do not work with Cyrillic keys
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639326438.42.0.0265571398779.issue46052@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

Sorry for the spam...

OK, making the corresponding ctypes calls to the commands reported in issue31244 succeeds in the Python REPL, but the Tk text's behaviour doesn't change. In IDLE, the ctypes calls fail.

ctypes.windll.Kernel32.SetConsoleCP(1251)
ctypes.windll.Kernel32.SetConsoleOutputCP(1251)
locale.setlocale(locale.LC_ALL, 'Russian')

Hence, I don't think this a viable option. And it would not be viable for either this project, nor Tk, to write our own codepages, so I'm not sure whether it is worth raising it with the Tk team.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 11:29:30 2021
From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=)
Date: Sun, 12 Dec 2021 16:29:30 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>
Message-ID: <1639326570.6.0.215317166484.issue46057@roundup.psfhosted.org>


L?szl? Attila T?th <laszlo.attila.toth at gmail.com> added the comment:

And the leading part is the same for both the mutually exclusive and the argument groups:

usage: test1.py [-h] [--db-config DB_CONFIG] [--db-password DB_PASSWORD]

optional arguments:
  -h, --help            show this help message and exit

Database settings:
....

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Sun Dec 12 11:35:16 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 16:35:16 +0000
Subject: [issue27258] Exception in BytesGenerator.flatten
In-Reply-To: <1465329163.65.0.664069941673.issue27258@psf.upfronthosting.co.za>
Message-ID: <1639326916.83.0.158826944322.issue27258@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I am also unable to reproduce the issue on 3.11 with the attached script and input.

Please create a new issue if this problem still exists in a current python version (>= 3.9).

----------
nosy: +iritkatriel
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27258>
_______________________________________

From report at bugs.python.org  Sun Dec 12 11:52:53 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sun, 12 Dec 2021 16:52:53 +0000
Subject: [issue46054] Incorrect error when parsing non-utf8 files
In-Reply-To: <1639286987.92.0.127175285023.issue46054@roundup.psfhosted.org>
Message-ID: <1639327973.06.0.586882222486.issue46054@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset 94483f1e3cec182fabe19268e579f63045bc984a by Miss Islington (bot) in branch '3.10':
bpo-46054: Fix parsing error when parsing non-utf8 characters in source files (GH-30068) (GH-30069)
https://github.com/python/cpython/commit/94483f1e3cec182fabe19268e579f63045bc984a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46054>
_______________________________________

From report at bugs.python.org  Sun Dec 12 11:53:04 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sun, 12 Dec 2021 16:53:04 +0000
Subject: [issue46054] Incorrect error when parsing non-utf8 files
In-Reply-To: <1639286987.92.0.127175285023.issue46054@roundup.psfhosted.org>
Message-ID: <1639327984.87.0.466732080044.issue46054@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset c6d1c52c166968fb722ae26d44aa2c1c030dc613 by Pablo Galindo Salgado in branch 'main':
bpo-46054: Correct non-utf8 character tests in test_exceptions (GH-30074)
https://github.com/python/cpython/commit/c6d1c52c166968fb722ae26d44aa2c1c030dc613


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46054>
_______________________________________

From report at bugs.python.org  Sun Dec 12 11:55:04 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sun, 12 Dec 2021 16:55:04 +0000
Subject: [issue46052] Ctrl+C,
 C+V in tk.Text on Windows do not work with Cyrillic keys
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639328104.36.0.927531159837.issue46052@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

It appears that your particular keyboard program is translating Ctrl + letter key combinations to something other than the default Ascii Control-letter code.  Do you see the same problem with Notepad?  To test what tcl/tk and hence tkinter see, expand the test code to

import tkinter as tk
r = tk.Tk()
t = tk.Text(r)
t.pack()

def keyevent(e):
    if c := e.char:
        print(f'char: {c}, ord: {ord(c)}, ', end='')
    print(f'code: {e.keycode}, sym: {e.keysym}, num: {e.keysym_num}.')
t.bind('<Key>', keyevent)

If I type c and ctrl + c in the tk box, I see the following in either the IDLE Shell or Command Prompt.

char: c, ord: 99, code: 67, sym: c, num: 99.
code: 17, sym: Control_L, num: 65507.
char: , ord: 3, code: 67, sym: c, num: 99.

I expect the third line will be different for you when you switch to Russian.

Your immediate fix is to use either the IDLE Edit menu or the right-click context menu to access copy and paste functions.  A longer term fix might be to get a different Russian keyboard program.

Assuming that I am correct above, I will make this an IDLE doc issue to add something about non-ascii keyboard issues, and include the test program above.

----------
title: Ctrl+C, C+V in IDLE on Windows do not work with Cyrillic keys -> Ctrl+C, C+V in tk.Text on Windows do not work with Cyrillic keys

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 12:06:10 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 17:06:10 +0000
Subject: [issue37602] nonzero fixer problem
In-Reply-To: <1563255027.06.0.811777029402.issue37602@roundup.psfhosted.org>
Message-ID: <1639328770.96.0.213068059863.issue37602@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +iritkatriel
nosy_count: 5.0 -> 6.0
pull_requests: +28297
status: pending -> open
pull_request: https://github.com/python/cpython/pull/30075

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37602>
_______________________________________

From report at bugs.python.org  Sun Dec 12 12:19:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 17:19:22 +0000
Subject: [issue25299] argparse: TypeError: __init__() takes at least 4
 arguments (4 given)
In-Reply-To: <1443785146.27.0.85852377889.issue25299@psf.upfronthosting.co.za>
Message-ID: <1639329562.09.0.5920930519.issue25299@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This is working on 3.11:

>>> from argparse import ArgumentParser
>>> parser = ArgumentParser()
>>> parser.add_argument("--foo", help="foo", action='store_const')
_StoreConstAction(option_strings=['--foo'], dest='foo', nargs=0, const=None, default=None, type=None, choices=None, help='foo', metavar=None)
>>> parser.print_usage()
usage: [-h] [--foo]
>>> 

So I agree this issue can be closed.

----------
nosy: +iritkatriel
resolution:  -> fixed
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25299>
_______________________________________

From report at bugs.python.org  Sun Dec 12 12:26:36 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 17:26:36 +0000
Subject: [issue39306] Lib/configparser.py - RawConfigParser.set does not pass
 non-truthy values through to Interpolation.before_set
In-Reply-To: <1578771708.17.0.449482349848.issue39306@roundup.psfhosted.org>
Message-ID: <1639329996.43.0.319405619297.issue39306@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Hans, as mentioned on the PR, the merit of this change needs to be discussed. If you would like to pursue this, please begin by explaining the use case.

If you lost interest in this problem, let's close this issue.

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39306>
_______________________________________

From report at bugs.python.org  Sun Dec 12 12:47:07 2021
From: report at bugs.python.org (quapka)
Date: Sun, 12 Dec 2021 17:47:07 +0000
Subject: [issue46051] Make @atexit.register work for functions with arguments
In-Reply-To: <1639243621.71.0.144294694671.issue46051@roundup.psfhosted.org>
Message-ID: <1639331227.68.0.985372178253.issue46051@roundup.psfhosted.org>


quapka <quapka at gmail.com> added the comment:

I'm adding the tests I've written for this issue. First, the tests that do pass already: https://github.com/quapka/cpython/commit/913055932be4be1c61ac8383615045f8bceee4e8

Secondly, the ones that I'd expect to pass as well, but fail atm:
https://github.com/quapka/cpython/commit/916968fcebe0266baebce7209ef6db25c091b604

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46051>
_______________________________________

From report at bugs.python.org  Sun Dec 12 13:50:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 18:50:45 +0000
Subject: [issue12165] [doc] clarify documentation of nonlocal
In-Reply-To: <1306216657.18.0.255448168009.issue12165@psf.upfronthosting.co.za>
Message-ID: <1639335045.14.0.320801936012.issue12165@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The doc has been updated by now and mentions "excluding globals".
I'm changing the title to reflect Terry's last comment.

One comment on his suggestion: I would remove/change "the nonlocal statement is similar to the global statement" because it's not obvious in what way it is similar just from the sentence, I think this is more confusing then helpful.

----------
keywords: +easy -patch
nosy: +iritkatriel
title: Nonlocal does not include global; clarify doc -> [doc] clarify documentation of nonlocal
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12165>
_______________________________________

From report at bugs.python.org  Sun Dec 12 13:58:58 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 18:58:58 +0000
Subject: [issue20907] behavioral differences between shutil.unpack_archive and
 ZipFile.extractall
In-Reply-To: <1394703965.34.0.603199781912.issue20907@psf.upfronthosting.co.za>
Message-ID: <1639335538.8.0.0570434980775.issue20907@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.11 -Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20907>
_______________________________________

From report at bugs.python.org  Sun Dec 12 13:59:47 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 18:59:47 +0000
Subject: [issue20741] Documentation archives should be available also in
 tar.xz format
In-Reply-To: <1393142720.31.0.255845110134.issue20741@psf.upfronthosting.co.za>
Message-ID: <1639335587.47.0.968868450474.issue20741@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20741>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:00:24 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 19:00:24 +0000
Subject: [issue20741] Documentation archives should be available also in
 tar.xz format
In-Reply-To: <1393142720.31.0.255845110134.issue20741@psf.upfronthosting.co.za>
Message-ID: <1639335624.93.0.811146465285.issue20741@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
status: closed -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20741>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:01:00 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 19:01:00 +0000
Subject: [issue16247] Report failing url in URLError?
In-Reply-To: <1350390680.77.0.132205585956.issue16247@psf.upfronthosting.co.za>
Message-ID: <1639335660.42.0.603268419117.issue16247@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16247>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:01:14 2021
From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=)
Date: Sun, 12 Dec 2021 19:01:14 +0000
Subject: [issue46058] argparse: arg groups and mutually exclusive groups
 behave inconsitently
Message-ID: <1639335674.28.0.221723621867.issue46058@roundup.psfhosted.org>


New submission from L?szl? Attila T?th <laszlo.attila.toth at gmail.com>:

I tried to add arguments to process DB-related settings, either from typing import Optional
from a file
or explicitly specifying them. In theory with nested groups (by add_argument_group
and add_mutually_exlusive_group) this can be implemented in almost straightforward way:


# test.py
import argparse

parser = argparse.ArgumentParser()
dbsettings = parser.add_argument_group('Database settings')
xdbgrp = dbsettings.add_mutually_exclusive_group(required=True)
xdbgrp.add_argument('--db-config')

grp = xdbgrp.add_argument_group(required=True)
grp.add_argument('--db-host')
grp.add_argument('--db-user')

xgrp = grp.add_mutually_exclusive_group()
xgrp.add_argument('--db-password')
xgrp.add_argument('--db-password-file')
parser.parse_args()


But there are issues:
1) the add_mutually_exclusive_group has only one optional parameter, required=False by default,
   so I cannot provide a title, I have to create yet another group (xdbgrp in the example)

2) I would expect the parser do the complete argument parsing and validation, so I don't
   need to implement certain steps. In this example I expect to have a --db-host arg
   if the --db-config is not specified. But if I add  ``required=True``, the argparse
   module expects that with --db-config the --db-host is also specified.
   In other words the xdbgrp mutually exclusive group fails to be mutually exclusive.

3) While xgrp behaves correctly, I cannot specify both --db-password and --db-password-file,
   I still can specify them with --db-config (see #2)

4) If I run it as: python3 test.py  --db-host x
   the command fails:
   usage: test.py [-h] --db-config DB_CONFIG --db-host DB_HOST [--db-user DB_USER]
               [--db-password DB_PASSWORD | --db-password-file DB_PASSWORD_FILE]
   test.py: error: one of the arguments --db-config is required

   So both --db-config and --db-host are required, the embedded group, grp fails to work,
   or prehaps again the xdbgrp fails (depends on the view)


5) Removing all required=True options the following is accepted:
   python3 test.py  --db-host x --db-config y
   so the xdbgrp mutually exclusive group again doesn't work.

6) Only xdbgrp is required, --db-host is not:
    python3 test.py  --db-host x
    usage: test.py [-h] --db-config DB_CONFIG [--db-host DB_HOST] [--db-user DB_USER]
                [--db-password DB_PASSWORD | --db-password-file DB_PASSWORD_FILE]
    test.py: error: one of the arguments --db-config is required
    Again, the group embedded into a mutually exclusive group is not handled correctly

What is expected:
1) add_mutually_exclusive_group can have title/description, but unfortunately it is not
backward compatible

2) If I add a mutally exclusive group, it has XOR relation between its arguments and
   argument groups.

3) An argument group is handled as a single entity similar to an argument.
   Basically this is the same as #2.

4) A required argument affects only its argument group and the parent group
   and so on till the parser, but this chain stops at a mutually exclusive group,
   based on #2 and #3 .

----------
components: Library (Lib)
messages: 408405
nosy: Laszlo.Attila.Toth
priority: normal
severity: normal
status: open
title: argparse: arg groups and mutually exclusive groups behave inconsitently
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46058>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:03:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 19:03:33 +0000
Subject: [issue17763] test_pydoc fails with the installed testsuite
In-Reply-To: <1366125816.55.0.847870350484.issue17763@psf.upfronthosting.co.za>
Message-ID: <1639335813.52.0.89597123595.issue17763@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> third party
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17763>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:05:24 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 19:05:24 +0000
Subject: [issue34135] The results of time.tzname print broken.
In-Reply-To: <1531803123.68.0.56676864532.issue34135@psf.upfronthosting.co.za>
Message-ID: <1639335924.91.0.623560503886.issue34135@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> out of date
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34135>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:07:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 19:07:28 +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: <1639336048.32.0.18753961627.issue17120@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17120>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:10:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 19:10:33 +0000
Subject: [issue6642] returning after forking a child thread doesn't call
 Py_Finalize
In-Reply-To: <1249410110.52.0.861898541816.issue6642@psf.upfronthosting.co.za>
Message-ID: <1639336233.82.0.143936352502.issue6642@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue6642>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:21:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 19:21:22 +0000
Subject: [issue28884] Python 3.5.2 non-segfaulting bugs (from PyPy)
In-Reply-To: <1481025303.32.0.218031723176.issue28884@psf.upfronthosting.co.za>
Message-ID: <1639336882.6.0.0503508039659.issue28884@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

B7 passes on 3.11.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28884>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:33:23 2021
From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=)
Date: Sun, 12 Dec 2021 19:33:23 +0000
Subject: [issue46058] argparse: arg groups and mutually exclusive groups
 behave inconsitently
In-Reply-To: <1639335674.28.0.221723621867.issue46058@roundup.psfhosted.org>
Message-ID: <1639337603.36.0.0775135102148.issue46058@roundup.psfhosted.org>


L?szl? Attila T?th <laszlo.attila.toth at gmail.com> added the comment:

Checking the code the add_mutually_exclusive_group has only kwargs, so one part can be fixed (POC, breaks tests):

--- Lib/argparse.py
+++ Lib/argparse.py
@@ -1648,8 +1648,8 @@ def _remove_action(self, action):

 class _MutuallyExclusiveGroup(_ArgumentGroup):

-    def __init__(self, container, required=False):
-        super(_MutuallyExclusiveGroup, self).__init__(container)
+    def __init__(self, container, required=False, title=None, description=None):
+        super(_MutuallyExclusiveGroup, self).__init__(container, title, description)
         self.required = required
         self._container = container

@@ -2529,6 +2529,14 @@ def format_help(self):
             formatter.add_arguments(action_group._group_actions)
             formatter.end_section()

+        for mutual_group in self._mutually_exclusive_groups:
+            if not mutual_group.title:
+                continue
+            formatter.start_section(mutual_group.title)
+            formatter.add_text(mutual_group.description)
+            formatter.add_arguments(mutual_group._group_actions)
+            formatter.end_section()
+
         # epilog
         formatter.add_text(self.epilog)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46058>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:36:12 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 12 Dec 2021 19:36:12 +0000
Subject: [issue45840] Improve cross-references in the data model documentation
In-Reply-To: <1637287286.96.0.846227383123.issue45840@roundup.psfhosted.org>
Message-ID: <1639337772.19.0.381840135621.issue45840@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
pull_requests: +28298
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/30077

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45840>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:38:32 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 19:38:32 +0000
Subject: [issue46058] argparse: arg groups and mutually exclusive groups
 behave inconsitently
In-Reply-To: <1639335674.28.0.221723621867.issue46058@roundup.psfhosted.org>
Message-ID: <1639337912.71.0.917241016275.issue46058@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions:  -Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46058>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:44:27 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 12 Dec 2021 19:44:27 +0000
Subject: [issue45729] [doc] "history and license" link has wrong target
In-Reply-To: <1636128373.81.0.436284013167.issue45729@roundup.psfhosted.org>
Message-ID: <1639338267.52.0.251650762608.issue45729@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy:  -AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45729>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:45:16 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 12 Dec 2021 19:45:16 +0000
Subject: [issue45985] AttributeError from @property inadvertantly flows into
 __getattr__
In-Reply-To: <1638702146.56.0.573091484317.issue45985@roundup.psfhosted.org>
Message-ID: <1639338316.38.0.0627922900504.issue45985@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
versions:  -Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45985>
_______________________________________

From report at bugs.python.org  Sun Dec 12 14:52:30 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 19:52:30 +0000
Subject: [issue39071] [doc] email.parser.BytesParser - parse and parsebytes
 work not equivalent
In-Reply-To: <1576571549.52.0.292971717442.issue39071@roundup.psfhosted.org>
Message-ID: <1639338750.43.0.515314925531.issue39071@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The relevant section in the docs is
https://docs.python.org/3/library/email.parser.html#email.parser.Parser
It currently doesn't advise against using the text parser in any way. 


At the top of the page, the second paragraph says:

"You can pass the parser a bytes, string or file object, and the parser will return to you the root EmailMessage instance of the object structure."

----------
assignee:  -> docs at python
components: +Documentation
nosy: +docs at python, iritkatriel
title: email.parser.BytesParser - parse and parsebytes work not equivalent -> [doc] email.parser.BytesParser - parse and parsebytes work not equivalent
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39071>
_______________________________________

From report at bugs.python.org  Sun Dec 12 15:01:54 2021
From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=)
Date: Sun, 12 Dec 2021 20:01:54 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>
Message-ID: <1639339314.32.0.964368879522.issue46057@roundup.psfhosted.org>


L?szl? Attila T?th <laszlo.attila.toth at gmail.com> added the comment:

The fix is something like this for _ArgumentGroup, but as the container may not be an _ArgumentGroup, it breaks the tests.

--- Lib/argparse.py
+++ Lib/argparse.py
@@ -1635,9 +1640,13 @@ def __init__(self, container, title=None, description=None, **kwargs):
         self._has_negative_number_optionals = \
             container._has_negative_number_optionals
         self._mutually_exclusive_groups = container._mutually_exclusive_groups
+        self._container = container

     def _add_action(self, action):
-        action = super(_ArgumentGroup, self)._add_action(action)
+        if self.title:
+            action = super(_ArgumentGroup, self)._add_action(action)
+        else:
+            action = self._container._add_action(action)
         self._group_actions.append(action)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Sun Dec 12 17:16:59 2021
From: report at bugs.python.org (Jan Kaliszewski)
Date: Sun, 12 Dec 2021 22:16:59 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1639347419.17.0.880032978879.issue20751@roundup.psfhosted.org>


Jan Kaliszewski <zuo at kaliszewski.net> added the comment:

Sure. But don't you think there should be ``.__get__(a, type(a))`` rather than ``.__get__(a, A)``? Then the whole statement would be true regardless of whether A is the actual type of a, or only a superclass of the type of a.

That would also be more consistent with the second point of the description, i.e., the one about *Instance Binding* (where we have ``type(a).__dict__['x'].__get__(a, type(a))``).

Also, I believe that ``type(a).__mro__`` would be more consistent (than ``a.__class__.mro``) with that point.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Sun Dec 12 18:07:35 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 23:07:35 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>
Message-ID: <1639350455.75.0.0661671820779.issue46057@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

According to the docs it should be

>>> xgrp = parser.add_argument_group()

rather than

>>> xgrp = grp.add_argument_group()


This seems to work:



>>> parser = argparse.ArgumentParser()
>>> grp = parser.add_argument_group('Database settings')
>>> grp.add_argument('--db-config')
_StoreAction(option_strings=['--db-config'], dest='db_config', nargs=None, const=None, default=None, type=None, choices=None, help=None, metavar=None)
>>> xgrp = parser.add_argument_group()
>>> xgrp.add_argument('--db-password')
_StoreAction(option_strings=['--db-password'], dest='db_password', nargs=None, const=None, default=None, type=None, choices=None, help=None, metavar=None)
>>> parser.parse_args(['-h'])
usage: [-h] [--db-config DB_CONFIG] [--db-password DB_PASSWORD]

options:
  -h, --help            show this help message and exit

Database settings:
  --db-config DB_CONFIG

  --db-password DB_PASSWORD

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Sun Dec 12 18:28:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Sun, 12 Dec 2021 23:28:33 +0000
Subject: [issue22047] argparse improperly prints mutually exclusive options
 when they are in a group
In-Reply-To: <1406131424.14.0.0235697032218.issue22047@psf.upfronthosting.co.za>
Message-ID: <1639351713.54.0.771581011428.issue22047@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

While I was unable to reproduce this rendering error, there are other issues due to nesting of argument groups, and I wonder if we should deprecate those operations, along the lines of Paul's patch on this issue (but with deprecation rather than raising an exception).

Other related issues:  issue46057 (from today), issue16807, issue45690, issue43259, (there are probably more).

----------
nosy: +rhettinger, serhiy.storchaka
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22047>
_______________________________________

From report at bugs.python.org  Sun Dec 12 18:52:33 2021
From: report at bugs.python.org (John Belmonte)
Date: Sun, 12 Dec 2021 23:52:33 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1639353153.33.0.902838834028.issue45995@roundup.psfhosted.org>


John Belmonte <john at neggie.net> added the comment:

potential short-term solution for Decimal:

  if negative zero option is set and sign is negative:
      pre-round into a temp using mpd_qrescale()
      if mpd_iszero(temp):
          change sign to positive

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Sun Dec 12 19:10:38 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 13 Dec 2021 00:10:38 +0000
Subject: [issue46052] Ctrl+C,
 C+V in tk.Text on Windows do not work with Cyrillic keys
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639354238.76.0.203561716712.issue46052@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

This is a duplicate of #31244, but I continue here with more experiments using the code above.  I first confirmed that on Windows, CapsLock is really 'caps inversion.  Keycode 67 is the keycode for 'C' given in https://www.tcl.tk/man/tcl/TkCmd/keysyms.html (Ascii keyboards have the capitals on keycaps), but the chars 'c' and 'C', without and with shift, are 4 different events.

char: c, ord: 99, code: 67, sym: c, num: 99.
code: 16, sym: Shift_L, num: 65505.
char: C, ord: 67, code: 67, sym: C, num: 67.
code: 20, sym: Caps_Lock, num: 65509.
char: C, ord: 67, code: 67, sym: C, num: 67.
code: 16, sym: Shift_L, num: 65505.
char: c, ord: 99, code: 67, sym: c, num: 99.

Next, the same keypresses with Ctrl added.  At least on Windows, Ctrl+c, Shift+Ctrl+c, Ctrl+C, and Shift+Ctrl+C are different events that have the same Ascii code but are differentiated by the key sym that would have been generated without the control modifier and the state of the Shift key.  (Note, for instance, that on the file menu, the addition of 'Shift' modifies 'Save' to 'Save as').

code: 17, sym: Control_L, num: 65507.
char: , ord: 3, code: 67, sym: c, num: 99.
code: 17, sym: Control_L, num: 65507.
code: 16, sym: Shift_L, num: 65505.
char: , ord: 3, code: 67, sym: C, num: 67.
code: 20, sym: Caps_Lock, num: 65509.
code: 17, sym: Control_L, num: 65507.
char: , ord: 3, code: 67, sym: C, num: 67.
code: 17, sym: Control_L, num: 65507.
code: 16, sym: Shift_L, num: 65505.
char: , ord: 3, code: 67, sym: c, num: 99.

I loaded the Win 10 Russian package.  Repeating the no-ctrl block, we get the Cyrillic ? and ?.  The keysym field is '??' instead of the char because non-ascii letters are not valid as keysyms.  The keysym_num field is correct as if the keysym were the non-ascii letter.

char: ?, ord: 1089, code: 67, sym: ??, num: 1089.
code: 16, sym: Shift_L, num: 65505.
char: ?, ord: 1057, code: 67, sym: ??, num: 1057.
code: 20, sym: Caps_Lock, num: 65509.
char: ?, ord: 1057, code: 67, sym: ??, num: 1057.
code: 16, sym: Shift_L, num: 65505.
char: ?, ord: 1089, code: 67, sym: ??, num: 1089.

With Ctrl added, the generated character is still ascii 3, control-C and the keycode is still 67.  But the keysym and keysym_num are changed and they no longer match neither ascii 'c' or 'C'.  So the event matches neither the control-c or control-C events and the copy event is not invoked.

code: 17, sym: Control_L, num: 65507.
char: , ord: 3, code: 67, sym: ??, num: 1089.
code: 17, sym: Control_L, num: 65507.
code: 16, sym: Shift_L, num: 65505.
char: , ord: 3, code: 67, sym: ??, num: 1057.
code: 20, sym: Caps_Lock, num: 65509.
code: 17, sym: Control_L, num: 65507.
char: , ord: 3, code: 67, sym: ??, num: 1057.
code: 17, sym: Control_L, num: 65507.
code: 16, sym: Shift_L, num: 65505.
char: , ord: 3, code: 67, sym: ??, num: 1089.

The workaround considered in #31244 was to add key-x bindings specific to a particular Windows IME.  But this does not work as key sequences only allow ascii alphanumerics as keysyms.  (See https://www.tcl.tk/man/tcl8.6/TkCmd/bind.html, event details.)

There are non-ascii letter descriptions, such as 'Cyrillic_es' listed in https://www.tcl.tk/man/tcl/TkCmd/keysyms.html, but I suspect that these only work for native keyboards, with the non-ascii chars on the keycaps, that generate the keycodes specific to each key as listed in that doc.  Cyrillic_es has keycode 1747, not 67.  When I tried binding '<Key-Cyrillic_es>' there was no TclError, but a Russian es, '?' or '?', did not invoke the handler.

Instead of expanding keybindings, we should consider collapsing events to undo the IME translation.  '??' is not a valid keysym, so there seems to be no generic 'non-Ascii IME letter' event.  But we could try replacing the keysym with the ascii char that would have been there if there were no IME.  The problem is that modifying the python event will not change the tk event.  Nor can it be used with event_generate.  Rather it has to be turn back into 'sequence' string, taking into account the .state attribute.

Automated testing would be done by calling the key event handler with a synthesized Event instance.

EP: Since Key-X, where x is a non-ascii char, in not a legal sequence and cannot be bound to anything, it seems reasonable to ask that tk itself translate control key events into bindable control sequences.  They might object that this would break any code that catches '??' events in generic key handlers to do something language specific.  But perhaps they could add a non-default option.

----------
assignee:  -> terry.reedy
stage:  -> test needed
versions: +Python 3.11 -Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 19:46:36 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Mon, 13 Dec 2021 00:46:36 +0000
Subject: [issue46059] Typo in match Statement example
Message-ID: <1639356396.07.0.913283855262.issue46059@roundup.psfhosted.org>


New submission from Vivek Vashist <vivekvashist at gmail.com>:

Possible Typo in match statement example. https://docs.python.org/3/tutorial/controlflow.html#match-statements


BROKEN:
> python
Python 3.10.0b4 (default, Nov 15 2021, 18:26:05) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from enum import Enum
>>> class Color(Enum):
...     RED = 0
...     GREEN = 1
...     BLUE = 2
...
>>> match color:
...     case Color.RED:
...         print("I see red!")
...     case Color.GREEN:
...         print("Grass is green")
...     case Color.BLUE:
...         print("I'm feeling the blues :(")
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'color' is not defined. Did you mean: 'Color'?


WORKING:

> python
Python 3.10.0b4 (default, Nov 15 2021, 18:26:05) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>>
>>> from enum import Enum
>>> class Color(Enum):
...     RED = 0
...     GREEN = 1
...     BLUE = 2
...
>>> match Color:
...     case Color.RED:
...         print("I see red!")
...     case Color.GREEN:
...         print("Grass is green")
...     case Color.BLUE:
...         print("I'm feeling the blues :(")

----------
assignee: docs at python
components: Documentation
messages: 408415
nosy: docs at python, vivekvashist
priority: normal
severity: normal
status: open
title: Typo in match Statement example
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46059>
_______________________________________

From report at bugs.python.org  Sun Dec 12 20:20:32 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 13 Dec 2021 01:20:32 +0000
Subject: [issue31244] IDLE: work around shortcuts bug in Windows' IMEs and tk
In-Reply-To: <1503317029.77.0.700563383458.issue31244@psf.upfronthosting.co.za>
Message-ID: <1639358432.94.0.0470085507546.issue31244@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

What makes IDLE different from other desktop apps is that is it written in Python, uses the tkinter wrapping of cross-platform tcl/tk, and allows users to customize nearly all hotkey shortcuts.  But tk only allows Ascii chars, with modifiers, for hotkeys.  This issue would be much easier if IDLE had a fixed set of bindings, or even a fixed set for each major platform.

Issue 46052 is a duplicate of this.  In experiments reported there, using the Win10 Russian IME, I determined that the event.char for a Ctrl + letter-key combination is the corresponding Ascii control character, even when switched to Russian.  The difference is that event.keysym is '??' instead of an ascii letter and event.keysym_num is the unicode ordinal of the russian letter instead of the ascii letter.  So ('c', 99) becomes ('??', 1089).  I propose on #46052 to solve these issues by undoing this change and generating the event that would have happened in ENG mode.

----------
resolution:  -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder:  -> Ctrl+C, C+V in tk.Text on Windows do not work with Cyrillic keys

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31244>
_______________________________________

From report at bugs.python.org  Sun Dec 12 20:28:55 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 13 Dec 2021 01:28:55 +0000
Subject: [issue46052] IDLE: make Ctrl,
 Alt + IME non-ascii letter work on Windows
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639358935.25.0.856303885983.issue46052@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I closed #31244 as a duplicate of this.

The modifier code for tkinter.Event.__repr__ can be used to construct the modifier part of the reconstructed event sequence.  Just join with '-' instead of '|'.

----------
title: Ctrl+C, C+V in tk.Text on Windows do not work with Cyrillic keys -> IDLE: make Ctrl,Alt + IME non-ascii letter work on Windows

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 20:40:55 2021
From: report at bugs.python.org (Shantanu)
Date: Mon, 13 Dec 2021 01:40:55 +0000
Subject: [issue40059] Provide a toml module in the standard library
In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org>
Message-ID: <1639359655.86.0.974988147879.issue40059@roundup.psfhosted.org>


Shantanu <hauntsaninja at gmail.com> added the comment:

Given that this currently seems blocked on the broad question of "how should additions and removals to the stdlib be managed", I'd like to not focus too hard just yet on the specifics of tomli. I assume it's unlikely, but for all we know, the SC could determine that all newly included modules have to be written from scratch, following along the lines of recent additions like zoneinfo, graphlib and importlib.metadata.

There's a lot we could bikeshed or debate... e.g., it's not even clear to me what a toml package in the stdlib would be named, never mind what it means for an unreleased version of a commonly used third party toml package dropping support for an imminently EOL version of Python. I'm possibly totally out of line, but in my head, the process would look something like this:

Step 1: Hear back from the SC about criteria and considerations for new modules in the stdlib
Step 2: Determine whether a TOML library *in the abstract* is something that would meet the outlined criteria (potentially e.g. is this something we even want? is this something we can maintain?)
Step 3: Determine if we have an implementation (written from scratch, copied, or derived from something pre-existing) that would meet the outlined criteria
Step 4: Do all the rest of the work to meet the outlined criteria (potentially e.g. go through PEP process, create proposed impl, write a backport, bikeshed api and name, etc)

I guess I have the following questions:

- Is my understanding correct that this issue is blocked on SC guidance?
- Is there anything we could do in advance of SC guidance that would be productive?
  Brett previously mentioned bringing it up with the author of tomli, as per https://github.com/hukkin/tomli/issues/141 they seem supportive
- Is there a good place to follow along or be notified of SC thoughts?
  I see no mention of stdlib changes in https://github.com/python/steering-council and the discuss thread linked above seems to have petered out.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40059>
_______________________________________

From report at bugs.python.org  Sun Dec 12 21:07:40 2021
From: report at bugs.python.org (Senthil Kumaran)
Date: Mon, 13 Dec 2021 02:07:40 +0000
Subject: [issue16247] Report failing url in URLError?
In-Reply-To: <1639335660.44.0.340160161143.issue16247@roundup.psfhosted.org>
Message-ID: <CAPOVWOQ_9S_rN48C=M3q=iHuPWsS--sR2FGEe_VXUEAxuW42yg@mail.gmail.com>


Senthil Kumaran <senthil at python.org> added the comment:

It is going to take a few weeks for me to get to my alerts, I will address
this as soon as I get to it .

Thanks for the triage, Irit.

On Mon, Dec 13, 2021, 12:31 AM Irit Katriel <report at bugs.python.org> wrote:

>
> Change by Irit Katriel <iritkatriel at gmail.com>:
>
>
> ----------
> status: open -> pending
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue16247>
> _______________________________________
>

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16247>
_______________________________________

From report at bugs.python.org  Sun Dec 12 21:23:38 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Mon, 13 Dec 2021 02:23:38 +0000
Subject: [issue37584] Multiple test failures with OSError: [Errno 84] Invalid
 or incomplete multibyte or wide character on ZFS with utf8only=on
In-Reply-To: <1563012837.05.0.658851590788.issue37584@roundup.psfhosted.org>
Message-ID: <1639362218.75.0.370442139127.issue37584@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:

Confirmed.

Repro: Do an ubuntu 20.04 install and choose "experimental zfs" support during install - https://ubuntu.com/blog/zfs-focus-on-ubuntu-20-04-lts-whats-new).  On such a zfs filesystem, the following tests from a ./python -m test.regrtest run fail in 3.10:

11 tests failed:
    test_cmd_line_script test_httpservers test_imp test_import
    test_ntpath test_os test_posixpath test_socket test_unicode_file
    test_unicode_file_functions test_zipimport

Move over to a tmpfs and all but test_httpservers now pass.  test_httpservers tries to create such a path on /tmp

======================================================================
ERROR: test_undecodable_filename (test.test_httpservers.SimpleHTTPServerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/greg/test/cpython/Lib/test/test_httpservers.py", line 400, in test_undecodable_filename
    with open(os.path.join(self.tempdir, filename), 'wb') as f:
OSError: [Errno 84] Invalid or incomplete multibyte or wide character: '/tmp/tmpnt9ch98x/@test_124227_tmp\udce7w\udcf0.txt'


I expect any filesystem mounted to reject non-UTF8 pathnames to cause similar failures.  Our test suite needs to detect this environment and skip these tests there.

----------
nosy: +gregory.p.smith
versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37584>
_______________________________________

From report at bugs.python.org  Sun Dec 12 21:58:57 2021
From: report at bugs.python.org (Eryk Sun)
Date: Mon, 13 Dec 2021 02:58:57 +0000
Subject: [issue46052] IDLE: make Ctrl,
 Alt + IME non-ascii letter work on Windows
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639364337.58.0.808893940543.issue46052@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

The alternate keyboard shortcuts for the clipboard work fine with a Russian keyboard layout:

   copy: Ctrl+Insert
    cut: Shift+Delete
  paste: Shift+Insert

Some programs also support Alt+Backspace for undo (Ctrl+Z). Watch out with Shift+Delete in GUI shells, since it physically deletes files, bypassing the recycle bin (trash), instead of cutting the selected files to the clipboard.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 22:01:59 2021
From: report at bugs.python.org (Eryk Sun)
Date: Mon, 13 Dec 2021 03:01:59 +0000
Subject: [issue46052] IDLE: make Ctrl,
 Alt + IME non-ascii letter work on Windows
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639364519.56.0.0496634361153.issue46052@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

I think the following wiki article still applies even though it was first discussed in 2003: "KeySyms on platforms other than X11" [1]. In particular, it states the following:

    On Windows and MacOS X Tk only supports keysyms correctly for a 
    limited number of keys, namely special keys, and the ranges of ASCII
    and ISO-8859-1 (support of ISO-8859-1 on MacOS X since 8.4.2).

I can confirm the result for the Russian keyboard mapping. The value of keysym is "??", even when combined with the control key. 

x:
        char: '?', ord: 0447, code: 0058, sym: '??', num: 0447.
Ctrl+x:
        char: '\x18', ord: 0018, code: 0058, sym: '??', num: 0447.
c:
        char: '?', ord: 0441, code: 0043, sym: '??', num: 0441.
Ctrl+c:
        char: '\x03', ord: 0003, code: 0043, sym: '??', num: 0441.
v:
        char: '?', ord: 043c, code: 0056, sym: '??', num: 043c.
Crl+v:
        char: '\x16', ord: 0016, code: 0056, sym: '??', num: 043c.

(I modified the keyevent function from msg408400 to use hexadecimal and repr formatting.)

I checked Ubuntu 20.04 with a Russian keyboard layout. It seems in Linux the combination with the control key changes keysym and keysym_num to use the ASCII characters "x", "c", and "v": 

x:
        char: '?', ord: 0447, code: 0035, sym: 'Cyrillic_che', num: 06de.
Ctrl+x:
        char: '\x18', ord: 0018, code: 0035, sym: 'x', num: 0078.
c:
        char: '?', ord: 0441, code: 0036, sym: 'Cyrillic_es', num: 06d3.
Ctrl+c:
        char: '\x03', ord: 0003, code: 0036, sym: 'c', num: 0063.
v:
        char: '?', ord: 043c, code: 0037, sym: 'Cyrillic_em', num: 06cd.
Crl+v:
        char: '\x16', ord: 0016, code: 0037, sym: 'v', num: 0076.

---
[1] https://wiki.tcl-lang.org/page/KeySyms+on+platforms+other+than+X11

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Sun Dec 12 22:38:05 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 13 Dec 2021 03:38:05 +0000
Subject: [issue20741] Documentation archives should be available also in
 tar.xz format
In-Reply-To: <1393142720.31.0.255845110134.issue20741@psf.upfronthosting.co.za>
Message-ID: <1639366685.96.0.323393227542.issue20741@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

Documentation downloads are still built and provided for each release (as linked to from https://www.python.org/doc/ and https://www.python.org/doc/versions/) as well as daily for the heads of each active bugfix and feature branch, in each case via the "Download these documents" link on the top page of the release/branch documentation set, for  example, https://docs.python.org/3/ -> https://docs.python.org/3/download.html. The downloadable doc formats are still .zip and .bz2 while cPython source archives are still .tgz and .xz formats. Julien Palard (@mdk) is the release team documentation expert.  Julien, what do you think?

----------
assignee:  -> mdk
components: +Documentation
nosy: +mdk, ned.deily
resolution: out of date -> 
status: pending -> open
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20741>
_______________________________________

From report at bugs.python.org  Mon Dec 13 00:08:56 2021
From: report at bugs.python.org (Eryk Sun)
Date: Mon, 13 Dec 2021 05:08:56 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 corporate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639372136.48.0.842047562007.issue46056@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

Try using symlinks if you're allowed, e.g. `python -m venv --symlinks <name>`.

Note that a virtual environment created with symlinks is unreliable in some cases because ShellExecute[Ex]W() eagerly resolves a symlink before calling CreateProcessW().

Also, you won't be able to use EXE script wrappers in an active environment due to the security restrictions in place on your system. You'll need to use `python -m <module>` alternative commands, such as `python -m pip` instead of `pip`.

----------
components:  -Windows
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Mon Dec 13 00:10:39 2021
From: report at bugs.python.org (Paul Bryan)
Date: Mon, 13 Dec 2021 05:10:39 +0000
Subject: [issue46060] Clarify asyncio.new_event_loop return value
Message-ID: <1639372239.16.0.586208830445.issue46060@roundup.psfhosted.org>


New submission from Paul Bryan <pbryan at mperativ.io>:

Currently, the documentation states it creates a new event loop; it should also indicate that it returns the newly created event loop.

----------
assignee: docs at python
components: Documentation
messages: 408425
nosy: docs at python, pbryan2
priority: normal
severity: normal
status: open
title: Clarify asyncio.new_event_loop return value
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46060>
_______________________________________

From report at bugs.python.org  Mon Dec 13 00:15:10 2021
From: report at bugs.python.org (Paul Bryan)
Date: Mon, 13 Dec 2021 05:15:10 +0000
Subject: [issue46060] Clarify asyncio.new_event_loop return value
In-Reply-To: <1639372239.16.0.586208830445.issue46060@roundup.psfhosted.org>
Message-ID: <1639372510.78.0.626635006043.issue46060@roundup.psfhosted.org>


Change by Paul Bryan <pbryan at anode.ca>:


----------
keywords: +patch
nosy: +pbryan
nosy_count: 2.0 -> 3.0
pull_requests: +28299
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30078

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46060>
_______________________________________

From report at bugs.python.org  Mon Dec 13 00:40:20 2021
From: report at bugs.python.org (Larry Hastings)
Date: Mon, 13 Dec 2021 05:40:20 +0000
Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails
 on FreeBSD with ZFS
In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za>
Message-ID: <1639374020.45.0.180869058406.issue19838@roundup.psfhosted.org>


Larry Hastings <larry at hastings.org> added the comment:

I can confirm that the behavior is fixed in ZFS on Linux.  My test case C program now prints "Everything is okay." when run on a ZFS partition on Linux, and test_touch_common from the current tree passes every time.  ZFS fixing this was the best possible outcome.

I'll go ahead and just close it now--why wait!  If somebody confirms that the test still fails on FreeBSD, please open a new issue.

Thanks for checking in, Irit!

----------
stage: patch review -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19838>
_______________________________________

From report at bugs.python.org  Mon Dec 13 01:48:31 2021
From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=)
Date: Mon, 13 Dec 2021 06:48:31 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>
Message-ID: <1639378111.1.0.107134874113.issue46057@roundup.psfhosted.org>


L?szl? Attila T?th <laszlo.attila.toth at gmail.com> added the comment:

According to the documentation only the ArgumentParser has add_argument_group option, which is not true, the code allows me to add a subgroup to any group. The complete example is in issue 4608: https://bugs.python.org/issue46058

If add_argument_group shouldn't be used for a regular argument group,
I suggest the following change: _ActionsContainer.add_argument_group should return self if title is not specified and raise error if add_argument_group("...") is called on a group with title.

This is close to the originally intended, documented behaviour.

I'd still allow groups without title in mutually exclusive groups and vice versa.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Mon Dec 13 02:53:07 2021
From: report at bugs.python.org (Elmir)
Date: Mon, 13 Dec 2021 07:53:07 +0000
Subject: [issue46005] [doc] replace 'distutils' examples with 'setuptools'
In-Reply-To: <1638864537.57.0.967787312853.issue46005@roundup.psfhosted.org>
Message-ID: <1639381987.71.0.348255695309.issue46005@roundup.psfhosted.org>


Elmir <elmir.jagudin at maxiv.lu.se> added the comment:

I think it would be very helpful to include an example how to build with setuptools as well. As it in the end boils down to two simple steps:

* install 'setuptools' package
* change import line:

"from distutils.core import setup, Extension" 

to

"from setuptools import setup, Extension"

It took me a lot of time to figure out that 'setuptools' have this 'drop-in replacement' API for distutils. IMHO, it's not very well documented anywhere.

I can make a PR with such addition, if you thinks it's good idea.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46005>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:10:04 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 13 Dec 2021 09:10:04 +0000
Subject: [issue46059] Typo in match Statement example
In-Reply-To: <1639356396.07.0.913283855262.issue46059@roundup.psfhosted.org>
Message-ID: <1639386604.45.0.0810461421425.issue46059@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
keywords: +patch
nosy: +AlexWaygood
nosy_count: 2.0 -> 3.0
pull_requests: +28300
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30079

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46059>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:20:26 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 09:20:26 +0000
Subject: [issue45840] Improve cross-references in the data model documentation
In-Reply-To: <1637287286.96.0.846227383123.issue45840@roundup.psfhosted.org>
Message-ID: <1639387226.73.0.287609768554.issue45840@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 7da90251ae80f5faac938b659675ff159d565537 by Alex Waygood in branch '3.10':
bpo-45840: Improve cross-references in the data model documentation (GH-29633) (GH-30077)
https://github.com/python/cpython/commit/7da90251ae80f5faac938b659675ff159d565537


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45840>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:21:59 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 09:21:59 +0000
Subject: [issue27718] help('signal') incomplete (e.g: signal.signal not
 visible)
In-Reply-To: <1470746479.88.0.0919609545752.issue27718@psf.upfronthosting.co.za>
Message-ID: <1639387319.86.0.525994301477.issue27718@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset e08c0d8eec528f1d7a282ee19bcadb9aae9ec123 by Serhiy Storchaka in branch 'main':
bpo-27718: Fix help for the signal module (GH-30063)
https://github.com/python/cpython/commit/e08c0d8eec528f1d7a282ee19bcadb9aae9ec123


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27718>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:22:21 2021
From: report at bugs.python.org (Ajaya Sutar)
Date: Mon, 13 Dec 2021 09:22:21 +0000
Subject: [issue46061] Journal execution gives fatal error in Python 3.10.1
Message-ID: <1639387341.54.0.200759283155.issue46061@roundup.psfhosted.org>


New submission from Ajaya Sutar <ajaya.sutar at siemens.com>:

+++ General Fault Exception
+++ Invalid read from 0000000000000000
    rsp:       74b27f8a10, rip:     7ffe704e2f93, rbp:       74b27f8ce9
    rsi:                0, rdi:                0
    rax:                0, rbx:               7f, rcx:      194b6e90000, rdx:      194b6e90000
    r8:       194b6db96c0, r9:                 1, r10:             8000, r11:       74b27f8a00
    r12:                0, r13:                0, r14:      19484550e40, r15:                0
[ 1] 7FFE704E2F93 pylifecycle\fatal_output_debug Line 2492 +0x43               (python310) 
[ 2] 7FFE704E3CCA pylifecycle\fatal_error Line 2734 +0x2ba                     (python310) 
[ 3] 7FFE704E3E4C pylifecycle\_Py_FatalErrorFormat Line 2784 +0xec             (python310) 
[ 4] 7FFE704E6F52 pystate\PyThreadState_Delete Line 930 +0x52                  (python310) 
[ 5] 7FFE704E1BF9 pylifecycle\new_interpreter Line 1967 +0x269                 (python310) 
[ 6] 7FFE704E1CDF pylifecycle\Py_NewInterpreter Line 1988 +0x1f                (python310)

----------
components: C API
messages: 408431
nosy: eaqrzn
priority: normal
severity: normal
status: open
title: Journal execution gives fatal error in Python 3.10.1
type: crash
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46061>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:38:18 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 09:38:18 +0000
Subject: [issue27718] help('signal') incomplete (e.g: signal.signal not
 visible)
In-Reply-To: <1470746479.88.0.0919609545752.issue27718@psf.upfronthosting.co.za>
Message-ID: <1639388298.01.0.80577494547.issue27718@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
pull_requests: +28301
pull_request: https://github.com/python/cpython/pull/30080

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27718>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:38:54 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Mon, 13 Dec 2021 09:38:54 +0000
Subject: [issue46061] Journal execution gives fatal error in Python 3.10.1
In-Reply-To: <1639387341.54.0.200759283155.issue46061@roundup.psfhosted.org>
Message-ID: <1639388334.35.0.536116918809.issue46061@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Please show the code that causes this problem. There?s not enough information here to reproduce this failure.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46061>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:38:56 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 13 Dec 2021 09:38:56 +0000
Subject: [issue45840] Improve cross-references in the data model documentation
In-Reply-To: <1637287286.96.0.846227383123.issue45840@roundup.psfhosted.org>
Message-ID: <1639388336.84.0.938492765165.issue45840@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
pull_requests: +28302
pull_request: https://github.com/python/cpython/pull/30081

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45840>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:53:07 2021
From: report at bugs.python.org (Thomas Arendsen Hein)
Date: Mon, 13 Dec 2021 09:53:07 +0000
Subject: [issue1525919] email package content-transfer-encoding behaviour
 changed
Message-ID: <1639389187.38.0.688205177315.issue1525919@roundup.psfhosted.org>


Thomas Arendsen Hein <thomas at intevation.de> added the comment:

Default python3 on Debian buster:
$ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.mime.text
>>> mt = email.mime.text.MIMEText('Ta m?re', 'plain', 'utf-8')
>>> print(mt.as_string())
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64

VGEgbcOocmU=

>>> email.encoders.encode_quopri(mt)
>>> print(mt.as_string())
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Transfer-Encoding: quoted-printable

Ta=20m=C3=A8re

So the encoded text looks good now, but there are still duplicate headers.

Old output (python2.7) is identical to what Asheesh Laroia (paulproteus)
reported for python2.5:
---
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Transfer-Encoding: quoted-printable

VGEgbcOocmU=3D
---

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1525919>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:53:17 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Mon, 13 Dec 2021 09:53:17 +0000
Subject: [issue45919] Use WinAPI GetFileType() in is_valid_fd()
In-Reply-To: <1638127307.77.0.0584468495635.issue45919@roundup.psfhosted.org>
Message-ID: <1639389197.67.0.0214341317753.issue45919@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
keywords: +patch
nosy: +corona10
nosy_count: 5.0 -> 6.0
pull_requests: +28303
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30082

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45919>
_______________________________________

From report at bugs.python.org  Mon Dec 13 04:55:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 09:55:31 +0000
Subject: [issue1525919] email package content-transfer-encoding behaviour
 changed
Message-ID: <1639389331.28.0.184126966432.issue1525919@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1525919>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:04:39 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 10:04:39 +0000
Subject: [issue37602] nonzero fixer problem
In-Reply-To: <1563255027.06.0.811777029402.issue37602@roundup.psfhosted.org>
Message-ID: <1639389879.3.0.139617146575.issue37602@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 481f3ffdbe40bd19677a1ba0ac2e7cece8949b47 by Irit Katriel in branch 'main':
bpo-37602: Clarify that the lib2to3 nonzero fixer changes only definitions (GH-30075)
https://github.com/python/cpython/commit/481f3ffdbe40bd19677a1ba0ac2e7cece8949b47


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37602>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:04:49 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 13 Dec 2021 10:04:49 +0000
Subject: [issue37602] nonzero fixer problem
In-Reply-To: <1563255027.06.0.811777029402.issue37602@roundup.psfhosted.org>
Message-ID: <1639389889.65.0.394127462328.issue37602@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
keywords: +patch
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +28304
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30083

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37602>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:05:24 2021
From: report at bugs.python.org (wolfgang kuehn)
Date: Mon, 13 Dec 2021 10:05:24 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 corporate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639389924.03.0.713035426784.issue46056@roundup.psfhosted.org>


wolfgang kuehn <wolfgang-kuehn at decatur.de> added the comment:

symlinks do not work for me, this may be another bug (should I create a new issue?):

    python -m venv --without-pip --symlinks venv

Unable to symlink 'C:\\Users\\****\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\idle.exe' to 'C:\\****\venv\\Scripts\\idle.exe'
Error: [Errno 22] Invalid argument: 'C:\\Users\\****\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\idle.exe'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:15:06 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 13 Dec 2021 10:15:06 +0000
Subject: [issue27718] help('signal') incomplete (e.g: signal.signal not
 visible)
In-Reply-To: <1470746479.88.0.0919609545752.issue27718@psf.upfronthosting.co.za>
Message-ID: <1639390506.36.0.829650383503.issue27718@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +28305
pull_request: https://github.com/python/cpython/pull/30084

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27718>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:15:13 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 10:15:13 +0000
Subject: [issue27718] help('signal') incomplete (e.g: signal.signal not
 visible)
In-Reply-To: <1470746479.88.0.0919609545752.issue27718@psf.upfronthosting.co.za>
Message-ID: <1639390513.33.0.611517212158.issue27718@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset e55deaabd8de338138cf29aea6890996e794c997 by Serhiy Storchaka in branch '3.10':
[3.10] bpo-27718: Fix help for the signal module (GH-30063) (GH-30080)
https://github.com/python/cpython/commit/e55deaabd8de338138cf29aea6890996e794c997


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27718>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:41:38 2021
From: report at bugs.python.org (Martin Whitehead)
Date: Mon, 13 Dec 2021 10:41:38 +0000
Subject: [issue46062] In IDLE,
 'File > Save As' seems not to allow creation of a new folder
Message-ID: <1639392097.98.0.679705685324.issue46062@roundup.psfhosted.org>


New submission from Martin Whitehead <mw.python_bug_tracker at nym.hush.com>:

The problem: In both the IDLE shell and the editor,  'File > Save As' seems not to allow creation of a new folder.  

My system: 
IDLE v3.8.10 (64 bit)
Python 3.8.10 Tk version 8.6.10
Linus Mint  20.2 Uma (64 bit), which is based on Ubuntu 20.04 LTS (Focal Fossa)

----------
assignee: terry.reedy
components: IDLE
messages: 408437
nosy: suffolkpunch, terry.reedy
priority: normal
severity: normal
status: open
title: In IDLE,  'File > Save As' seems not to allow creation of a new folder
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46062>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:43:39 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 13 Dec 2021 10:43:39 +0000
Subject: [issue27718] help('signal') incomplete (e.g: signal.signal not
 visible)
In-Reply-To: <1470746479.88.0.0919609545752.issue27718@psf.upfronthosting.co.za>
Message-ID: <1639392219.74.0.884400331356.issue27718@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 80f98b1614cc8e58d8a5ec72c94d27f663e23035 by Miss Islington (bot) in branch '3.9':
[3.10] bpo-27718: Fix help for the signal module (GH-30063) (GH-30080)
https://github.com/python/cpython/commit/80f98b1614cc8e58d8a5ec72c94d27f663e23035


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27718>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:45:18 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 10:45:18 +0000
Subject: [issue37602] nonzero fixer problem
In-Reply-To: <1563255027.06.0.811777029402.issue37602@roundup.psfhosted.org>
Message-ID: <1639392318.68.0.810251963512.issue37602@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28306
pull_request: https://github.com/python/cpython/pull/30085

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37602>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:45:59 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 10:45:59 +0000
Subject: [issue37602] nonzero fixer problem
In-Reply-To: <1563255027.06.0.811777029402.issue37602@roundup.psfhosted.org>
Message-ID: <1639392359.93.0.826757047058.issue37602@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 80eb8ab81fbe46497f16071b311c9d8e13ec2d3b by Miss Islington (bot) in branch '3.9':
bpo-37602: Clarify that the lib2to3 nonzero fixer changes only definitions (GH-30075) (GH-30083)
https://github.com/python/cpython/commit/80eb8ab81fbe46497f16071b311c9d8e13ec2d3b


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37602>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:47:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 10:47:42 +0000
Subject: [issue37602] nonzero fixer problem
In-Reply-To: <1563255027.06.0.811777029402.issue37602@roundup.psfhosted.org>
Message-ID: <1639392462.35.0.522675157968.issue37602@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 310bae628a9b065d29dbdbf4f7f5beb9fcc72ace by Irit Katriel in branch '3.10':
[3.10] bpo-37602: Clarify that the lib2to3 nonzero fixer changes only definitions (GH-30075) (GH-30085)
https://github.com/python/cpython/commit/310bae628a9b065d29dbdbf4f7f5beb9fcc72ace


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37602>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:48:01 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 10:48:01 +0000
Subject: [issue37602] nonzero fixer problem
In-Reply-To: <1563255027.06.0.811777029402.issue37602@roundup.psfhosted.org>
Message-ID: <1639392481.42.0.870597606708.issue37602@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37602>
_______________________________________

From report at bugs.python.org  Mon Dec 13 05:52:32 2021
From: report at bugs.python.org (Eryk Sun)
Date: Mon, 13 Dec 2021 10:52:32 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 corporate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639392752.47.0.017934394028.issue46056@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> symlinks do not work for me

Sorry, I forgot that you're using the store app. The store app has to use the copied venv launchers. 

When a store app is run from the command line, the system executes an appexec link from "%LocalAppData%\Microsoft\WindowsApps". Unfortunately appexec links have to be executed directly in order for CreateProcessW() to find the required app information that's in the link. The API doesn't manually reparse symlinks until it reaches an appexec link.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Mon Dec 13 06:05:19 2021
From: report at bugs.python.org (Ajaya Sutar)
Date: Mon, 13 Dec 2021 11:05:19 +0000
Subject: [issue46061] Journal execution gives fatal error in Python 3.10.1
In-Reply-To: <1639387341.54.0.200759283155.issue46061@roundup.psfhosted.org>
Message-ID: <1639393519.25.0.943389450847.issue46061@roundup.psfhosted.org>


Ajaya Sutar <ajaya.sutar at siemens.com> added the comment:

It is a simply python script. Even if you will run a simply python script without any content that is giving error. Just for example journal.py if we run it is also giving error. In python 3.8, we are able to create // create sub-interpreter using Py_NewInterpreter  and it is working fine. but in python 3.10.1 it is not working fine. it is giving fatal error.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46061>
_______________________________________

From report at bugs.python.org  Mon Dec 13 06:12:53 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 11:12:53 +0000
Subject: [issue27718] help('signal') incomplete (e.g: signal.signal not
 visible)
In-Reply-To: <1470746479.88.0.0919609545752.issue27718@psf.upfronthosting.co.za>
Message-ID: <1639393973.27.0.104068669007.issue27718@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27718>
_______________________________________

From report at bugs.python.org  Mon Dec 13 06:18:25 2021
From: report at bugs.python.org (wolfgang kuehn)
Date: Mon, 13 Dec 2021 11:18:25 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 corporate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639394305.82.0.995109798039.issue46056@roundup.psfhosted.org>


wolfgang kuehn <wolfgang-kuehn at decatur.de> added the comment:

Currently we have a glitch in our internal access rights system. This resulted in me loosing my Admin-privileges.
I can only install python from the app-store, which is ok.
But without venv support I am stuck for the time being.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Mon Dec 13 06:21:48 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 13 Dec 2021 11:21:48 +0000
Subject: [issue46061] Journal execution gives fatal error in Python 3.10.1
In-Reply-To: <1639387341.54.0.200759283155.issue46061@roundup.psfhosted.org>
Message-ID: <1639394508.59.0.871059521025.issue46061@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

We cannot help you unless you show us your code and provide a reproducer.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46061>
_______________________________________

From report at bugs.python.org  Mon Dec 13 06:55:25 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Mon, 13 Dec 2021 11:55:25 +0000
Subject: [issue46061] Journal execution gives fatal error in Python 3.10.1
In-Reply-To: <1639387341.54.0.200759283155.issue46061@roundup.psfhosted.org>
Message-ID: <1639396525.2.0.217815322874.issue46061@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46061>
_______________________________________

From report at bugs.python.org  Mon Dec 13 06:59:59 2021
From: report at bugs.python.org (Bar Harel)
Date: Mon, 13 Dec 2021 11:59:59 +0000
Subject: [issue10850] inconsistent behavior concerning
 multiprocessing.manager.BaseManager._Server
In-Reply-To: <1294360374.53.0.588595674921.issue10850@psf.upfronthosting.co.za>
Message-ID: <1639396799.52.0.704489023498.issue10850@roundup.psfhosted.org>


Change by Bar Harel <bzvi7919 at gmail.com>:


----------
keywords: +patch
pull_requests: +28307
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30086

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10850>
_______________________________________

From report at bugs.python.org  Mon Dec 13 07:12:03 2021
From: report at bugs.python.org (Sami Salonen)
Date: Mon, 13 Dec 2021 12:12:03 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
Message-ID: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>


New submission from Sami Salonen <sersei at gmail.com>:

https://bugs.python.org/issue45628 breaks file rotation.

I name my log files after module name, run the modules in separate processes, use the same log config in them, and store the log files in one common directory. For example, for modules `a.b` and `a.b.c` I have the following log files:

a.b.log
a.b.c.log

Now after bpo-45628 fix, `getFilesToDelete` treats the rotated log files from those modules the same, and deletes wrong files. If `backupCount` is set to e.g. 7, only total of 7 files are stored instead of 7 of each.

----------
components: Library (Lib)
messages: 408445
nosy: Sami Salonen
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler deletes wrong files
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Mon Dec 13 07:14:04 2021
From: report at bugs.python.org (Sami Salonen)
Date: Mon, 13 Dec 2021 12:14:04 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639397644.28.0.907298118628.issue46063@roundup.psfhosted.org>


Sami Salonen <sersei at gmail.com> added the comment:

Breaking PR: https://github.com/python/cpython/pull/29310

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Mon Dec 13 07:14:36 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Mon, 13 Dec 2021 12:14:36 +0000
Subject: [issue16594] SocketServer should set SO_REUSEPORT along with
 SO_REUSEADDR when present
In-Reply-To: <1354439249.45.0.0324812571604.issue16594@psf.upfronthosting.co.za>
Message-ID: <1639397676.6.0.300635894558.issue16594@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset b56774bd93822e1598bb5d6c1d0b1fe8c45a750d by AN Long in branch 'main':
bpo-16594: Add allow_reuse_port on socketserver (GH-30072)
https://github.com/python/cpython/commit/b56774bd93822e1598bb5d6c1d0b1fe8c45a750d


----------
nosy: +asvetlov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16594>
_______________________________________

From report at bugs.python.org  Mon Dec 13 07:19:12 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 12:19:12 +0000
Subject: [issue45840] Improve cross-references in the data model documentation
In-Reply-To: <1637287286.96.0.846227383123.issue45840@roundup.psfhosted.org>
Message-ID: <1639397952.59.0.32830629792.issue45840@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 2029c58097e49b5aedc152ab65958a9db35ebd1e by Alex Waygood in branch '3.9':
 [3.9] bpo-45840: Improve cross-references in the data model documentation (GH-29633) (GH-30081)
https://github.com/python/cpython/commit/2029c58097e49b5aedc152ab65958a9db35ebd1e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45840>
_______________________________________

From report at bugs.python.org  Mon Dec 13 07:19:38 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 12:19:38 +0000
Subject: [issue45840] Improve cross-references in the data model documentation
In-Reply-To: <1637287286.96.0.846227383123.issue45840@roundup.psfhosted.org>
Message-ID: <1639397978.81.0.0227785934471.issue45840@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45840>
_______________________________________

From report at bugs.python.org  Mon Dec 13 07:43:42 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 13 Dec 2021 12:43:42 +0000
Subject: [issue46060] Clarify asyncio.new_event_loop return value
In-Reply-To: <1639372239.16.0.586208830445.issue46060@roundup.psfhosted.org>
Message-ID: <1639399422.28.0.354697988695.issue46060@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28308
pull_request: https://github.com/python/cpython/pull/30088

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46060>
_______________________________________

From report at bugs.python.org  Mon Dec 13 07:52:34 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Mon, 13 Dec 2021 12:52:34 +0000
Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys
 standard streams
In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za>
Message-ID: <1639399954.5.0.488320307187.issue32849@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
nosy: +corona10
nosy_count: 5.0 -> 6.0
pull_requests: +28310
pull_request: https://github.com/python/cpython/pull/30082

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32849>
_______________________________________

From report at bugs.python.org  Mon Dec 13 07:52:34 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Mon, 13 Dec 2021 12:52:34 +0000
Subject: [issue30225] EBADF error on x86 Tiger 3.x buildbot
In-Reply-To: <1493712772.54.0.125879756705.issue30225@psf.upfronthosting.co.za>
Message-ID: <1639399954.38.0.838706727746.issue30225@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
nosy: +corona10
nosy_count: 4.0 -> 5.0
pull_requests: +28309
pull_request: https://github.com/python/cpython/pull/30082

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30225>
_______________________________________

From report at bugs.python.org  Mon Dec 13 07:58:03 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Mon, 13 Dec 2021 12:58:03 +0000
Subject: [issue45919] Use WinAPI GetFileType() in is_valid_fd()
In-Reply-To: <1638127307.77.0.0584468495635.issue45919@roundup.psfhosted.org>
Message-ID: <1639400283.81.0.680414400966.issue45919@roundup.psfhosted.org>


Dong-hee Na <donghee.na at python.org> added the comment:


New changeset 191c431de7d9b23484dd16f67e62c6e85a1fac7f by Dong-hee Na in branch 'main':
bpo-45919: Use WinAPI GetFileType() in is_valid_fd() (GH-30082)
https://github.com/python/cpython/commit/191c431de7d9b23484dd16f67e62c6e85a1fac7f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45919>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:05:16 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 13 Dec 2021 13:05:16 +0000
Subject: [issue45840] Improve cross-references in the data model documentation
In-Reply-To: <1637287286.96.0.846227383123.issue45840@roundup.psfhosted.org>
Message-ID: <1639400716.08.0.695497875915.issue45840@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Thanks, Serhiy!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45840>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:06:50 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Mon, 13 Dec 2021 13:06:50 +0000
Subject: [issue45919] Use WinAPI GetFileType() in is_valid_fd()
In-Reply-To: <1638127307.77.0.0584468495635.issue45919@roundup.psfhosted.org>
Message-ID: <1639400810.97.0.904862283375.issue45919@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45919>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:14:42 2021
From: report at bugs.python.org (Fabian Dill)
Date: Mon, 13 Dec 2021 13:14:42 +0000
Subject: [issue46064] Permalinks to underscored documentation entries don't
 work.
Message-ID: <1639401282.19.0.555190776199.issue46064@roundup.psfhosted.org>


New submission from Fabian Dill <fabian.dill at web.de>:

As an example, go to https://docs.python.org/3/library/constants.html and request a permalink to __debug__. The link you get will not jump to it.
The link I get is https://docs.python.org/3/library/constants.html#debug__

----------
assignee: docs at python
components: Documentation
messages: 408451
nosy: Fabian Dill, docs at python
priority: normal
severity: normal
status: open
title: Permalinks to underscored documentation entries don't work.
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46064>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:19:00 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 13 Dec 2021 13:19:00 +0000
Subject: [issue46064] Permalinks to underscored documentation entries don't
 work.
In-Reply-To: <1639401282.19.0.555190776199.issue46064@roundup.psfhosted.org>
Message-ID: <1639401540.27.0.111560162503.issue46064@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

I can't reproduce this -- the permalink to __debug__ that I get is the same as the one you have posted here, and works fine for me on my laptop, phone and iPad.

----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46064>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:19:42 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Mon, 13 Dec 2021 13:19:42 +0000
Subject: [issue45915] Use fcntl(fd, F_GETFD) to check whether an fd is valid
In-Reply-To: <1638094386.96.0.551592531479.issue45915@roundup.psfhosted.org>
Message-ID: <1639401582.41.0.301562112022.issue45915@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
nosy: +corona10
nosy_count: 3.0 -> 4.0
pull_requests: +28311
pull_request: https://github.com/python/cpython/pull/30082

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45915>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:25:37 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 13 Dec 2021 13:25:37 +0000
Subject: [issue46060] Clarify asyncio.new_event_loop return value
In-Reply-To: <1639372239.16.0.586208830445.issue46060@roundup.psfhosted.org>
Message-ID: <1639401937.68.0.208123549386.issue46060@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28312
pull_request: https://github.com/python/cpython/pull/30089

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46060>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:26:28 2021
From: report at bugs.python.org (Ramzi Trabelsi)
Date: Mon, 13 Dec 2021 13:26:28 +0000
Subject: [issue46065] re.findall takes forever and never ends
Message-ID: <1639401988.73.0.733937004071.issue46065@roundup.psfhosted.org>


New submission from Ramzi Trabelsi <ramzi.tra at gmail.com>:

parsing emails from this text took forever and never ends. Here the code 
 and the file res.html is attached.
The Behavior is same on Windows 10, 11 and Ubuntu 18.04

CODE:

import re
pattern_email      = r"[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]{2,3}"
with open("res.html","r",encoding="utf-8") as FF:
	TEXT = FF.read()
matched_email          = re.findall(pattern_email,TEXT)

----------
components: macOS
files: res.zip
messages: 408453
nosy: ned.deily, ramzitra, ronaldoussoren
priority: normal
severity: normal
status: open
title: re.findall takes forever and never ends
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file50488/res.zip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46065>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:31:51 2021
From: report at bugs.python.org (Ramzi Trabelsi)
Date: Mon, 13 Dec 2021 13:31:51 +0000
Subject: [issue46065] re.findall takes forever and never ends
In-Reply-To: <1639401988.73.0.733937004071.issue46065@roundup.psfhosted.org>
Message-ID: <1639402311.82.0.829080663445.issue46065@roundup.psfhosted.org>


Change by Ramzi Trabelsi <ramzi.tra at gmail.com>:


----------
components:  -macOS

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46065>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:32:45 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 13 Dec 2021 13:32:45 +0000
Subject: [issue46065] re.findall takes forever and never ends
In-Reply-To: <1639401988.73.0.733937004071.issue46065@roundup.psfhosted.org>
Message-ID: <1639402365.07.0.0303230799845.issue46065@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett, serhiy.storchaka -ned.deily, ronaldoussoren
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46065>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:33:49 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Mon, 13 Dec 2021 13:33:49 +0000
Subject: [issue16594] SocketServer should set SO_REUSEPORT along with
 SO_REUSEADDR when present
In-Reply-To: <1354439249.45.0.0324812571604.issue16594@psf.upfronthosting.co.za>
Message-ID: <1639402429.17.0.862642517599.issue16594@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16594>
_______________________________________

From report at bugs.python.org  Mon Dec 13 08:48:55 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 13:48:55 +0000
Subject: [issue14484] missing return in win32_kill?
In-Reply-To: <1333462226.23.0.725280599354.issue14484@psf.upfronthosting.co.za>
Message-ID: <1639403335.08.0.338110100926.issue14484@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

IMO trying to mimic POSIX behavior on Windows in the single function os.kill() was a bad design idea. Windows should have its own specific function.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14484>
_______________________________________

From report at bugs.python.org  Mon Dec 13 09:29:32 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Mon, 13 Dec 2021 14:29:32 +0000
Subject: [issue45919] Use WinAPI GetFileType() in is_valid_fd()
In-Reply-To: <1638127307.77.0.0584468495635.issue45919@roundup.psfhosted.org>
Message-ID: <1639405772.23.0.0754418937082.issue45919@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
pull_requests: +28313
pull_request: https://github.com/python/cpython/pull/30090

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45919>
_______________________________________

From report at bugs.python.org  Mon Dec 13 09:40:12 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 13 Dec 2021 14:40:12 +0000
Subject: [issue46059] Typo in match Statement example
In-Reply-To: <1639356396.07.0.913283855262.issue46059@roundup.psfhosted.org>
Message-ID: <1639406412.95.0.00809016145664.issue46059@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
type:  -> behavior
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46059>
_______________________________________

From report at bugs.python.org  Mon Dec 13 10:06:09 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 15:06:09 +0000
Subject: [issue46065] re.findall takes forever and never ends
In-Reply-To: <1639401988.73.0.733937004071.issue46065@roundup.psfhosted.org>
Message-ID: <1639407969.23.0.0763851017917.issue46065@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It ends, but it tooks several minutes to complete.

It is a limitation of the regular expression implementation in Python. Your input contains a sequence of 588431 characters which match the pattern [a-zA-Z0-9_.+-] not following by '@'. The engine finds the first character in this sequence, then scans 588431 characters matching this pattern, but does not find '@' after them. So it backtracks, steps back by one character and tries to match '@', fails, and continue stepping back until returns to the initial character. 588431 steps forward and 588431 steps back are needed to find that no matches starting at this position. So it steps forward and try the proce3dure from a new position. No it does 588430 steps in both direction. Totally it needs to do 588431+588430+588429+...+1 ~ 588431**2/2 ~ 173e9 steps. It takes a long time.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46065>
_______________________________________

From report at bugs.python.org  Mon Dec 13 10:13:22 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 15:13:22 +0000
Subject: [issue46065] re.findall takes forever and never ends
In-Reply-To: <1639401988.73.0.733937004071.issue46065@roundup.psfhosted.org>
Message-ID: <1639408402.26.0.663126662906.issue46065@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

The simplest example is:

re.search('a@', 'a'*100000)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46065>
_______________________________________

From report at bugs.python.org  Mon Dec 13 10:27:16 2021
From: report at bugs.python.org (Ramzi Trabelsi)
Date: Mon, 13 Dec 2021 15:27:16 +0000
Subject: [issue46065] re.findall takes forever and never ends
In-Reply-To: <1639401988.73.0.733937004071.issue46065@roundup.psfhosted.org>
Message-ID: <1639409236.94.0.53786546289.issue46065@roundup.psfhosted.org>


Ramzi Trabelsi <ramzi.tra at gmail.com> added the comment:

thanks for the answer. Is there any workaround for this ?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46065>
_______________________________________

From report at bugs.python.org  Mon Dec 13 10:36:57 2021
From: report at bugs.python.org (97littleleaf11)
Date: Mon, 13 Dec 2021 15:36:57 +0000
Subject: [issue46066] Docs: TypedDict alternative definition syntax with
 keyword args is confusing
Message-ID: <1639409817.42.0.21314101687.issue46066@roundup.psfhosted.org>


New submission from 97littleleaf11 <97littleleaf11 at gmail.com>:

According to the docs: https://docs.python.org/3/library/typing.html?#typing.TypedDict, there are two additional equivalent syntax for TypedDict definition.

Point2D = TypedDict('Point2D', x=int, y=int, label=str)
Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

However, the former one is quite confusing since we have the `total` keyword arg for TypedDict. In addition, PEP589(https://www.python.org/dev/peps/pep-0589/#id19) doesn't have this.

I think we could discard the definition syntax using keyword args in the doc.

----------
assignee: docs at python
components: Documentation
messages: 408458
nosy: 97littleleaf11, docs at python
priority: normal
severity: normal
status: open
title: Docs: TypedDict alternative definition syntax with keyword args is confusing
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46066>
_______________________________________

From report at bugs.python.org  Mon Dec 13 10:38:08 2021
From: report at bugs.python.org (97littleleaf11)
Date: Mon, 13 Dec 2021 15:38:08 +0000
Subject: [issue46066] [doc] TypedDict alternative definition syntax with
 keyword args is confusing
In-Reply-To: <1639409817.42.0.21314101687.issue46066@roundup.psfhosted.org>
Message-ID: <1639409888.47.0.445453346469.issue46066@roundup.psfhosted.org>


Change by 97littleleaf11 <97littleleaf11 at gmail.com>:


----------
title: Docs: TypedDict alternative definition syntax with keyword args is confusing -> [doc] TypedDict alternative definition syntax with keyword args is confusing

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46066>
_______________________________________

From report at bugs.python.org  Mon Dec 13 10:40:19 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 15:40:19 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639410019.76.0.0695241446881.issue46063@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +vinay.sajip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Mon Dec 13 10:43:18 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 15:43:18 +0000
Subject: [issue46065] re.findall takes forever and never ends
In-Reply-To: <1639401988.73.0.733937004071.issue46065@roundup.psfhosted.org>
Message-ID: <1639410198.33.0.708950389465.issue46065@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Limit the number of repetitions. For example use "{1,100}" (or what is the expected maximal length of email) instead of "+".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46065>
_______________________________________

From report at bugs.python.org  Mon Dec 13 10:48:21 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 15:48:21 +0000
Subject: [issue45615] Missing test for type of error when printing traceback
 for non-exception
In-Reply-To: <1635261430.95.0.190322958386.issue45615@roundup.psfhosted.org>
Message-ID: <1639410501.88.0.894911160518.issue45615@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +patch
pull_requests: +28314
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30091

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45615>
_______________________________________

From report at bugs.python.org  Mon Dec 13 11:08:59 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 16:08:59 +0000
Subject: [issue20392] Inconsistency with uppercase file extensions in
 MimeTypes.guess_type
In-Reply-To: <1390670268.05.0.579524422182.issue20392@psf.upfronthosting.co.za>
Message-ID: <1639411739.85.0.512811850872.issue20392@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
keywords: +easy -patch
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20392>
_______________________________________

From report at bugs.python.org  Mon Dec 13 11:26:14 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 16:26:14 +0000
Subject: [issue12411] cgi.parse_multipart is broken on 3.x
In-Reply-To: <1309014548.2.0.906650270303.issue12411@psf.upfronthosting.co.za>
Message-ID: <1639412774.54.0.76920163286.issue12411@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Senthil, was this last part done in issue29979?

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12411>
_______________________________________

From report at bugs.python.org  Mon Dec 13 11:34:00 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 16:34:00 +0000
Subject: [issue21390] readline: setlocale() returns NULL on Android
In-Reply-To: <1398843223.64.0.854948810113.issue21390@psf.upfronthosting.co.za>
Message-ID: <1639413240.06.0.953001705222.issue21390@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Neither of the patches were applied. Is this still needed?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21390>
_______________________________________

From report at bugs.python.org  Mon Dec 13 11:41:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 16:41:20 +0000
Subject: [issue30716] Failing tests with installed 3.6.2rc1 on Win 10-64
In-Reply-To: <1497984928.25.0.777622060627.issue30716@psf.upfronthosting.co.za>
Message-ID: <1639413680.92.0.656234334541.issue30716@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Shall we close this? I don't think 3.6 test failures will still be looked into.

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30716>
_______________________________________

From report at bugs.python.org  Mon Dec 13 11:45:36 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 13 Dec 2021 16:45:36 +0000
Subject: [issue46052] IDLE: make Ctrl,
 Alt + IME non-ascii letter work on Windows
In-Reply-To: <1639260736.08.0.703954085889.issue46052@roundup.psfhosted.org>
Message-ID: <1639413936.72.0.842593984667.issue46052@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Thank you Eryk.  The X/Ubuntu behavior is what I want to simulate.  I can only wonder why tk has not fixed that for non-X systems.  Are Alt+letter combinations also fixed on Ubuntu, so that, for instance, Alt+M-key is seen as Alt-M even with Russian layout?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46052>
_______________________________________

From report at bugs.python.org  Mon Dec 13 11:57:29 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 13 Dec 2021 16:57:29 +0000
Subject: [issue30716] Failing tests with installed 3.6.2rc1 on Win 10-64
In-Reply-To: <1497984928.25.0.777622060627.issue30716@psf.upfronthosting.co.za>
Message-ID: <1639414649.76.0.573246680355.issue30716@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30716>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:00:34 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 17:00:34 +0000
Subject: [issue33099] test_poplib hangs with the changes done in PR
In-Reply-To: <1521411483.84.0.467229070634.issue33099@psf.upfronthosting.co.za>
Message-ID: <1639414834.9.0.649448339431.issue33099@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

#32706 is now fixed, does that resolve this issue as well?

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33099>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:14:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 17:14:57 +0000
Subject: [issue40927] ./python -m test test___all__ test_binhex fails
In-Reply-To: <1591699636.51.0.837580045442.issue40927@roundup.psfhosted.org>
Message-ID: <1639415697.84.0.722255836499.issue40927@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40927>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:18:25 2021
From: report at bugs.python.org (Jonas Witschel)
Date: Mon, 13 Dec 2021 17:18:25 +0000
Subject: [issue46067] SSLContext.set_npn_protocols broken in Python 3.10,
 tries to call non-existing _set_npn_protocols
Message-ID: <1639415904.86.0.18905683137.issue46067@roundup.psfhosted.org>


New submission from Jonas Witschel <git at diabonas.de>:

Consider the following minimal example:

import ssl
context = ssl.create_default_context()
context.set_npn_protocols(['http/1.1', 'spdy/2'])

In Python 3.10, it fails with the following error:

AttributeError: 'SSLContext' object has no attribute '_set_npn_protocols'. Did you mean: 'set_npn_protocols'?

This is because bpo-43669 (https://github.com/python/cpython/commit/39258d3595300bc7b952854c915f63ae2d4b9c3e) removed _set_npn_protocols, while it is still used by SSLContext.set_npn_protocols: https://github.com/python/cpython/blob/191c431de7d9b23484dd16f67e62c6e85a1fac7f/Lib/ssl.py#L551

Note that the function is already deprecated in Python 3.10 and throws a

DeprecationWarning: ssl NPN is deprecated, use ALPN instead

but should still probably continue working for now.

----------
assignee: christian.heimes
components: SSL
messages: 408466
nosy: christian.heimes, diabonas
priority: normal
severity: normal
status: open
title: SSLContext.set_npn_protocols broken in Python 3.10, tries to call non-existing _set_npn_protocols
type: compile error
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46067>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:23:07 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 17:23:07 +0000
Subject: [issue45643] SIGSTKFLT is missing from the signals module on Linux
In-Reply-To: <1635417063.88.0.746261778756.issue45643@roundup.psfhosted.org>
Message-ID: <1639416187.29.0.681487191714.issue45643@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:


New changeset a62be77266b1beadd42d4952186332bc0847b7d6 by Gareth Rees in branch 'main':
bpo-45643: Add signal.SIGSTKFLT on platforms where this is defined (GH-29266)
https://github.com/python/cpython/commit/a62be77266b1beadd42d4952186332bc0847b7d6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45643>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:24:43 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 17:24:43 +0000
Subject: [issue45643] Add signal.SIGSTKFLT constant (Linux)
In-Reply-To: <1635417063.88.0.746261778756.issue45643@roundup.psfhosted.org>
Message-ID: <1639416283.16.0.2164268198.issue45643@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: SIGSTKFLT is missing from the signals module on Linux -> Add signal.SIGSTKFLT constant (Linux)

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45643>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:25:08 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 17:25:08 +0000
Subject: [issue45643] Add signal.SIGSTKFLT constant (Linux)
In-Reply-To: <1635417063.88.0.746261778756.issue45643@roundup.psfhosted.org>
Message-ID: <1639416308.57.0.732107372755.issue45643@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

I merged your PR, thanks!

I'm curious how people use this signal :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45643>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:26:33 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 17:26:33 +0000
Subject: [issue40927] ./python -m test test___all__ test_binhex fails
In-Reply-To: <1591699636.51.0.837580045442.issue40927@roundup.psfhosted.org>
Message-ID: <1639416393.34.0.0851074388479.issue40927@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Oh thanks Irit! It's too easy to forget closing an issue!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40927>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:27:46 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 17:27:46 +0000
Subject: [issue30716] Failing tests with installed 3.6.2rc1 on Win 10-64
In-Reply-To: <1497984928.25.0.777622060627.issue30716@psf.upfronthosting.co.za>
Message-ID: <1639416466.43.0.862443385952.issue30716@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

It seems like this issue has been fixed in bpo-27425.

----------
resolution: out of date -> duplicate
superseder:  -> Tests fail because of git's newline preferences on Windows

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30716>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:29:09 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 17:29:09 +0000
Subject: [issue21390] readline: setlocale() returns NULL on Android
In-Reply-To: <1398843223.64.0.854948810113.issue21390@psf.upfronthosting.co.za>
Message-ID: <1639416549.72.0.204861403622.issue21390@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Since 2014, Android got getter support for Unix locales.

Since nobody was able to say if the issue still exists on Android since 2014, nor if my patch fix the issue, I perfer to close the issue as out of date.

----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21390>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:29:21 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 17:29:21 +0000
Subject: [issue12411] cgi.parse_multipart is broken on 3.x
In-Reply-To: <1309014548.2.0.906650270303.issue12411@psf.upfronthosting.co.za>
Message-ID: <1639416561.75.0.689301892805.issue12411@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
nosy:  -vstinner
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12411>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:35:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 17:35:22 +0000
Subject: [issue12411] cgi.parse_multipart is broken on 3.x
In-Reply-To: <1309014548.2.0.906650270303.issue12411@psf.upfronthosting.co.za>
Message-ID: <1639416922.1.0.424449739327.issue12411@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12411>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:36:57 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 13 Dec 2021 17:36:57 +0000
Subject: [issue46066] [doc] TypedDict alternative definition syntax with
 keyword args is confusing
In-Reply-To: <1639409817.42.0.21314101687.issue46066@roundup.psfhosted.org>
Message-ID: <1639417017.08.0.600124386116.issue46066@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +gvanrossum, kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46066>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:40:54 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 17:40:54 +0000
Subject: [issue23747] [doc] platform module exposes win32_ver function on
 posix systems
In-Reply-To: <1427103016.81.0.503768282249.issue23747@psf.upfronthosting.co.za>
Message-ID: <1639417254.67.0.84068940698.issue23747@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: platform module exposes win32_ver function on posix systems -> [doc] platform module exposes win32_ver function on posix systems
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23747>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:50:29 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 17:50:29 +0000
Subject: [issue39757] EmailMessage bad encoding for international domain
In-Reply-To: <1582709775.3.0.571538664603.issue39757@roundup.psfhosted.org>
Message-ID: <1639417829.47.0.460995874373.issue39757@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39757>
_______________________________________

From report at bugs.python.org  Mon Dec 13 12:53:17 2021
From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=)
Date: Mon, 13 Dec 2021 17:53:17 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>
Message-ID: <1639417997.93.0.509597758121.issue46057@roundup.psfhosted.org>


L?szl? Attila T?th <laszlo.attila.toth at gmail.com> added the comment:

my idea regarding _ArgumentGroup,add_argument_group is in the attached file. This doesn't solve the complete help output issue, but addresses the incorrectly called _ArgumentGroup.add_argument_group - a warn() call and return self.
As a result the help output for embedded groups (not mutually exclusive groups) work as expected. If the title parameter is specified, this
scenario is not checked, and so on.

----------
keywords: +patch
Added file: https://bugs.python.org/file50489/argparse-add-arg_grp-deprecation.diff

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Mon Dec 13 13:01:38 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 13 Dec 2021 18:01:38 +0000
Subject: [issue45653] Freeze the encodings module.
In-Reply-To: <1635444712.46.0.923300343963.issue45653@roundup.psfhosted.org>
Message-ID: <1639418498.93.0.611873850949.issue45653@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Eric, I have a simple reproducer for the issue:

This works:

$ LC_ALL=en_US.utf-8 TESTPATH=$(pwd)/Lib:$(pwd)/build/lib.linux-x86_64-3.11 ./Programs/_testembed test_init_setpath_config

This fails because it cannot load ISO-8859-1 / latin-1 codec

$ LC_ALL=en_US.latin1 TESTPATH=$(pwd)/Lib:$(pwd)/build/lib.linux-x86_64-3.11 ./Programs/_testembed test_init_setpath_config
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'conf_program_name'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  is in build tree = 0
  stdlib dir = ''
  sys._base_executable = 'conf_executable'
  sys.base_prefix = ''
  sys.base_exec_prefix = ''
  sys.platlibdir = 'lib'
  sys.executable = 'conf_executable'
  sys.prefix = ''
  sys.exec_prefix = ''
  sys.path = [
    '/home/heimes/dev/python/cpython/Lib',
    '/home/heimes/dev/python/cpython/build/lib.linux-x86_64-3.11',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
LookupError: unknown encoding: ISO-8859-1

Current thread 0x00007f9c42be6740 (most recent call first):
  <no Python frame>



With this patch I'm seeing that encodings.__path__ is not absolute and that __spec__ has an empty submodule_search_locations.

--- a/Lib/encodings/__init__.py
+++ b/Lib/encodings/__init__.py
@@ -98,9 +98,12 @@ def search_function(encoding):
             # module with side-effects that is not in the 'encodings' package.
             mod = __import__('encodings.' + modname, fromlist=_import_tail,
                              level=0)
-        except ImportError:
+        except ImportError as e:
             # ImportError may occur because 'encodings.(modname)' does not exist,
             # or because it imports a name that does not exist (see mbcs and oem)
+            sys.stderr.write(f"exception: {e}\n")
+            sys.stderr.write(f"encodings.__path__: {__path__}\n")
+            sys.stderr.write(f"encodings.__spec__: {__spec__}\n")
             pass
         else:
             break


$ LC_ALL=en_US.latin1 TESTPATH=$(pwd)/Lib:$(pwd)/build/lib.linux-x86_64-3.11 ./Programs/_testembed test_init_setpath_config
exception: No module named 'encodings.latin_1'
encodings.__path__: ['encodings']
encodings.__spec__: ModuleSpec(name='encodings', loader=<class '_frozen_importlib.FrozenImporter'>, origin='frozen', submodule_search_locations=[])
exception: No module named 'encodings.iso_8859_1'
encodings.__path__: ['encodings']
encodings.__spec__: ModuleSpec(name='encodings', loader=<class '_frozen_importlib.FrozenImporter'>, origin='frozen', submodule_search_locations=[])


It should have this search location:

>>> import encodings
>>> encodings.__spec__
ModuleSpec(name='encodings', loader=<class '_frozen_importlib.FrozenImporter'>, origin='frozen', submodule_search_locations=['/home/heimes/dev/python/cpython/Lib/encodings'])

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45653>
_______________________________________

From report at bugs.python.org  Mon Dec 13 13:14:44 2021
From: report at bugs.python.org (Paul Bryan)
Date: Mon, 13 Dec 2021 18:14:44 +0000
Subject: [issue46060] Clarify asyncio.new_event_loop return value
In-Reply-To: <1639372239.16.0.586208830445.issue46060@roundup.psfhosted.org>
Message-ID: <1639419284.89.0.658315621905.issue46060@roundup.psfhosted.org>


Change by Paul Bryan <pbryan at mperativ.io>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46060>
_______________________________________

From report at bugs.python.org  Mon Dec 13 13:19:56 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 13 Dec 2021 18:19:56 +0000
Subject: [issue46062] tkinter.filedialog.SaveAs: create new folder on Ubuntu?
In-Reply-To: <1639392097.98.0.679705685324.issue46062@roundup.psfhosted.org>
Message-ID: <1639419596.15.0.709163090395.issue46062@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

This is not an IDLE issue, as IDLE merely calls tkinter.filedialog.SaveAS(args).show() and uses the returned path to open and write the file.  

This is likely not a tkinter issue either, but I will leave it open for now for others to comment.  SaveAs subclasses _Dialog, which subclasses tkinter.commondialog.Dialog.  For SaveAs .show calls tk_getSaveFile. This "pops up a dialog box for the user to select a file to save" and returns a full path or "".
https://www.tcl.tk/man/tcl8.6/TkCmd/getOpenFile.html makes little promise about the dialog.  On Windows, it opens a standard system SaveAs dialog, which allows directory navigation and creation.  On macOS it opens a macOS dialog.  I don't know about other systems.

You might want to ask or python-list or idledev list about the experience of others with newer Python versions.

----------
assignee: terry.reedy -> 
components: +Tkinter -IDLE
nosy: +serhiy.storchaka
title: In IDLE,  'File > Save As' seems not to allow creation of a new folder -> tkinter.filedialog.SaveAs: create new folder on Ubuntu?

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46062>
_______________________________________

From report at bugs.python.org  Mon Dec 13 13:23:05 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 18:23:05 +0000
Subject: [issue21910] [doc] File protocol should document if writelines must
 handle generators sensibly
In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za>
Message-ID: <1639419785.27.0.189298525944.issue21910@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: File protocol should document if writelines must handle generators sensibly -> [doc] File protocol should document if writelines must handle generators sensibly
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21910>
_______________________________________

From report at bugs.python.org  Mon Dec 13 13:34:33 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 18:34:33 +0000
Subject: [issue16392] [doc] import crashes on circular imports in ext modules
In-Reply-To: <1351946554.54.0.101006341814.issue16392@psf.upfronthosting.co.za>
Message-ID: <1639420473.42.0.739400955461.issue16392@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: import crashes on circular imports in ext modules -> [doc] import crashes on circular imports in ext modules
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16392>
_______________________________________

From report at bugs.python.org  Mon Dec 13 13:40:21 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 18:40:21 +0000
Subject: [issue17505] [doc] email.header.Header.__unicode__ does not decode
 header
In-Reply-To: <1363852013.63.0.253070231302.issue17505@psf.upfronthosting.co.za>
Message-ID: <1639420821.67.0.024007063417.issue17505@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
title: email.header.Header.__unicode__ does not decode header -> [doc] email.header.Header.__unicode__ does not decode header
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17505>
_______________________________________

From report at bugs.python.org  Mon Dec 13 13:49:20 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 18:49:20 +0000
Subject: [issue24116] --with-pydebug has no effect when the final python
 binary is compiled
In-Reply-To: <1430637278.73.0.597162622661.issue24116@psf.upfronthosting.co.za>
Message-ID: <1639421360.43.0.61278641176.issue24116@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24116>
_______________________________________

From report at bugs.python.org  Mon Dec 13 14:22:07 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 19:22:07 +0000
Subject: [issue19888] Three argument type() super call sets __name__ but not
 __qualname__
In-Reply-To: <1386194767.46.0.367836396475.issue19888@psf.upfronthosting.co.za>
Message-ID: <1639423327.08.0.255198732175.issue19888@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue19888>
_______________________________________

From report at bugs.python.org  Mon Dec 13 14:47:07 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Mon, 13 Dec 2021 19:47:07 +0000
Subject: [issue46066] [doc] TypedDict alternative definition syntax with
 keyword args is confusing
In-Reply-To: <1639409817.42.0.21314101687.issue46066@roundup.psfhosted.org>
Message-ID: <1639424827.81.0.978850952965.issue46066@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

This is not really just a doc issue then, is it? Maybe we should just deprecate the feature?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46066>
_______________________________________

From report at bugs.python.org  Mon Dec 13 14:48:54 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 13 Dec 2021 19:48:54 +0000
Subject: [issue45949] Provide pure-Python implementation of
 Programs/_freeze_module for cross building
In-Reply-To: <1638372868.47.0.982140813893.issue45949@roundup.psfhosted.org>
Message-ID: <1639424934.6.0.901440345341.issue45949@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset eb483c46d62707bdf705491f76cf1fa9642fb47e by Christian Heimes in branch 'main':
bpo-45949: Pure Python freeze module for cross builds (GH-29899)
https://github.com/python/cpython/commit/eb483c46d62707bdf705491f76cf1fa9642fb47e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________

From report at bugs.python.org  Mon Dec 13 14:53:06 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 13 Dec 2021 19:53:06 +0000
Subject: [issue45949] Provide pure-Python implementation of
 Programs/_freeze_module for cross building
In-Reply-To: <1638372868.47.0.982140813893.issue45949@roundup.psfhosted.org>
Message-ID: <1639425186.81.0.154211921259.issue45949@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Thanks for your review, Eric!

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________

From report at bugs.python.org  Mon Dec 13 15:01:15 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 13 Dec 2021 20:01:15 +0000
Subject: [issue46062] tkinter.filedialog.SaveAs: create new folder on Ubuntu?
In-Reply-To: <1639392097.98.0.679705685324.issue46062@roundup.psfhosted.org>
Message-ID: <1639425675.27.0.798300205345.issue46062@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

On other systems it opens a simple dialog window implemented in Tk. AFAIK it does not support creating new directories. Ask Tk core developers for a new feature.

----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46062>
_______________________________________

From report at bugs.python.org  Mon Dec 13 15:01:41 2021
From: report at bugs.python.org (Ammar Askar)
Date: Mon, 13 Dec 2021 20:01:41 +0000
Subject: [issue20949] Missing platform security integrations
In-Reply-To: <1394998623.61.0.250593398151.issue20949@psf.upfronthosting.co.za>
Message-ID: <1639425701.54.0.191231390283.issue20949@roundup.psfhosted.org>


Ammar Askar <ammar at ammaraskar.com> added the comment:

Hi Jeffrey, your second solution where you omit `-pie` is almost there. Instead of modifying the Makefile you can pass `-pie` in `LINKFORSHARED`:


export CFLAGS="-fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2"
export CXXFLAGS="-fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2"
export LDFLAGS="-Wl,-z,noexecstack -Wl,-z,noexecheap -Wl,-z,now -Wl,-z,relro"
export LINKFORSHARED="-pie"

$ checksec ./python
[*] '/home/ammar/workspace/cpython/python'
    Arch:     amd64-64-little
    RELRO:    Full RELRO
    Stack:    Canary found
    NX:       NX enabled
    PIE:      PIE enabled
    FORTIFY:  Enabled

----------
nosy: +ammar2

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20949>
_______________________________________

From report at bugs.python.org  Mon Dec 13 15:32:52 2021
From: report at bugs.python.org (Eric Snow)
Date: Mon, 13 Dec 2021 20:32:52 +0000
Subject: [issue45949] Provide pure-Python implementation of
 Programs/_freeze_module for cross building
In-Reply-To: <1638372868.47.0.982140813893.issue45949@roundup.psfhosted.org>
Message-ID: <1639427572.82.0.31678923523.issue45949@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

You're welcome!  Thanks for doing the work!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________

From report at bugs.python.org  Mon Dec 13 15:44:00 2021
From: report at bugs.python.org (Eric Snow)
Date: Mon, 13 Dec 2021 20:44:00 +0000
Subject: [issue45953] Statically allocate interpreter states as much as
 possible.
In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org>
Message-ID: <1639428240.04.0.205727528336.issue45953@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
pull_requests: +28315
pull_request: https://github.com/python/cpython/pull/30092

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45953>
_______________________________________

From report at bugs.python.org  Mon Dec 13 16:03:30 2021
From: report at bugs.python.org (Stefan Behnel)
Date: Mon, 13 Dec 2021 21:03:30 +0000
Subject: [issue16392] [doc] import crashes on circular imports in ext modules
In-Reply-To: <1351946554.54.0.101006341814.issue16392@psf.upfronthosting.co.za>
Message-ID: <1639429410.58.0.443336072426.issue16392@roundup.psfhosted.org>


Stefan Behnel <stefan_ml at behnel.de> added the comment:

Given that PEP-489 has landed in Py3.5, which is already retired and has been for more than a year, I think we can just close this issue as outdated.

----------
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16392>
_______________________________________

From report at bugs.python.org  Mon Dec 13 16:55:25 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Mon, 13 Dec 2021 21:55:25 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639432525.53.0.476496623723.issue46063@roundup.psfhosted.org>


Change by Vinay Sajip <vinay_sajip at yahoo.co.uk>:


----------
keywords: +patch
pull_requests: +28316
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30093

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:15:11 2021
From: report at bugs.python.org (David Peled)
Date: Mon, 13 Dec 2021 22:15:11 +0000
Subject: [issue45959] Teach pprint about dict views
In-Reply-To: <1638428816.23.0.206050902249.issue45959@roundup.psfhosted.org>
Message-ID: <1639433711.06.0.718185868491.issue45959@roundup.psfhosted.org>


Change by David Peled <davidp.info1 at gmail.com>:


----------
nosy: +david-peled

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45959>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:24:47 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 13 Dec 2021 22:24:47 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639434287.83.0.584001127114.issue46028@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

> $ cat venv_a3/pyvenv.cfg
> home = /home/ss/.pyenv/versions/3.11.0a3/bin

> $ venv_a3/bin/python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))"
> /home/ss/.pyenv/versions/3.11.0a3/bin/python
> True

This is the intended behaviour, and yes it's changed from previous versions (but not on Windows, where it was always correct). The previous value was incorrect, hence it was marked as an internal field.

If your venv doesn't have a "python" binary in the directory set as "home" in pyvenv.cfg (which by definition, according to Lib/venv/__init__.py, is dirname(sys.executable) ), then there's some other issue with venv on your platform.

----------
nosy: +vinay.sajip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:25:45 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 13 Dec 2021 22:25:45 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639434345.19.0.383759813663.issue46028@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

I'm downgrading this from release blocker. If Vinay thinks there's a venv-related release blocker here he's welcome to raise the priority again, but I only see an intentional change to an internal value. Tools relying on internal fields will have to adapt for 3.11.

----------
priority: release blocker -> normal

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:31:08 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 13 Dec 2021 22:31:08 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 corporate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639434668.17.0.864654193924.issue46056@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

If you execute "python -m venv --without-pip ..." to create, then as a workaround you can set the __PYVENV_LAUNCHER__ environment variable to the full path to the venv's python.exe and run the normal python3.10.exe.

As Eryk mentioned, you'll need to run everything through "-m" instead of the script wrappers that pip would install. This includes "-m ensurepip", which should be able to install pip into the venv normally.

Note that this is an undocumented/unsupported environment variable, and so it may change in later releases. But it should work fine throughout 3.10's lifetime (and it hasn't changed _yet_ in 3.11).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:32:32 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 13 Dec 2021 22:32:32 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 corporate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639434752.94.0.976901350349.issue46056@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

Also, if you see people discussing PEP 582, you might want to throw in a vote of support. It is intended to provide the benefits of a venv without needing to do tricks like we do for the current design, but it keeps being rejected for "not being sufficiently useful".

Seems like in your case it would be very useful. That might help sway some of the opponents.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:36:29 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 13 Dec 2021 22:36:29 +0000
Subject: [issue14484] missing return in win32_kill?
In-Reply-To: <1639403335.08.0.338110100926.issue14484@roundup.psfhosted.org>
Message-ID: <b029351c-1803-dff5-7a9a-cf0518fb0779@python.org>


Steve Dower <steve.dower at python.org> added the comment:

> Windows should have its own specific function.

Either that or mimic it properly. Having a single function that requires 
different parameters based on OS is a very user-hostile design.

If someone wants to shepherd it through the process, I'd support either 
making the typical POSIX values do sensible equivalents on Windows (as 
best possible), or adding a new function entirely and deprecating all 
use of the current one on Windows. Those are the only ways to lead 
people into writing code that works well on all platforms.

(My *real* preference is that people stop trying to kill applications ;) 
and try to set up a safe communication channel instead, but I know it's 
often unavoidable. Having common parameters that do the Right Things on 
all platforms is next best.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14484>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:45:12 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Mon, 13 Dec 2021 22:45:12 +0000
Subject: [issue46068] Change use of warnings.warn to logging.warning in a few
 places
Message-ID: <1639435512.0.0.159079727605.issue46068@roundup.psfhosted.org>


New submission from Andrei Kulakov <andrei.avk at gmail.com>:

In discussion on https://github.com/python/cpython/pull/29910 related to whether to use warnings.warn or logging.warning, I found two places in the library where it might make sense to change to logging.warning. There's probably other instances where the same change can be made but it's not easy to tell just by going through the list because the difference of when use one or the other is not always clearcut. If more instances are found, they can be added to this issue.

https://docs.python.org/3/howto/logging.html#when-to-use-logging

https://github.com/python/cpython/blob/eb483c46d62707bdf705491f76cf1fa9642fb47e/Lib/zoneinfo/_tzpath.py#L44

https://github.com/python/cpython/blob/f42a06ba279c916fb67289e47f9bc60dc5dee4ee/Lib/zipfile.py#L1480

The downside of making this change is that it may break 3rd party unit tests.

----------
components: Library (Lib)
messages: 408488
nosy: andrei.avk
priority: low
severity: normal
status: open
title: Change use of warnings.warn to logging.warning in a few places
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46068>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:46:01 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Mon, 13 Dec 2021 22:46:01 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639435561.27.0.649453521116.issue46028@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

> This is the intended behaviour, and yes it's changed from previous versions ... The previous value was incorrect, hence it was marked as an internal field.

But the value as it's calculated now seems to give a file that doesn't exist - how can that be correct?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:46:11 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 22:46:11 +0000
Subject: [issue14484] missing return in win32_kill?
In-Reply-To: <1333462226.23.0.725280599354.issue14484@psf.upfronthosting.co.za>
Message-ID: <1639435571.6.0.163909513568.issue14484@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14484>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:50:55 2021
From: report at bugs.python.org (Ned Batchelder)
Date: Mon, 13 Dec 2021 22:50:55 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639435855.12.0.849964620223.issue46028@roundup.psfhosted.org>


Ned Batchelder <ned at nedbatchelder.com> added the comment:

This started because a set of tests in the coverage.py test suite fail with 3.11.0a3.  They attempt to create a venv in the test, and the test is already running inside a virtualenv.  The venv creation fails, with a reference to a non-existent file.

I wrote the bug about sys._base_executable because that seemed to be the central difference that was causing the problem.  I was not relying on sys._base_executable, venv was.

I will find steps to reproduce that don't reference sys._base_executable if you need them.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:54:17 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 13 Dec 2021 22:54:17 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639436057.92.0.409019658146.issue46028@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

Is sys._base_executable correct without a venv? It should be the same as sys.executable in that case.

venv calculates 'home' here: Lib/venv/__init__.py#L117

        executable = sys._base_executable
        dirname, exename = os.path.split(os.path.abspath(executable))
        context.executable = executable # not relevant to this bug
        context.python_dir = dirname    # written as "home = ..."

If the path doesn't exist later on, it's because it didn't exist in the first place. *That* could be the real bug.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Mon Dec 13 17:56:52 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 13 Dec 2021 22:56:52 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639436212.01.0.554835785359.issue46028@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

> But the value as it's calculated now seems to give a file that doesn't exist - how can that be correct?

Because we never actually use the executable referenced by the 'home' path in a pyvenv.cfg. It's only used as a starting point to locate a couple of entries in sys.path. So if the executable isn't there, it's no big deal.

It shouldn't even matter in the nested-creation case, because we still don't execute it then. It's just how we end up with the same value for 'home' in any venvs created within a venv.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:00:07 2021
From: report at bugs.python.org (Steve Dower)
Date: Mon, 13 Dec 2021 23:00:07 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639436407.09.0.315870791373.issue46028@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

> Because we never actually use the executable referenced by the 'home' path in a pyvenv.cfg.

This is actually not true on Windows or (I believe) some situations on macOS, where we need to use a redirecting launcher to actually launch the binary specified in this value. But on POSIX, because all the references are hardcoded in the binary, we can just copy the original around and it never loses track of its real home and never has to launch its original copy.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:05:58 2021
From: report at bugs.python.org (Ned Batchelder)
Date: Mon, 13 Dec 2021 23:05:58 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639436758.52.0.926720041511.issue46028@roundup.psfhosted.org>


Ned Batchelder <ned at nedbatchelder.com> added the comment:

Demonstration of a problem with only stdlib, and no undocumented features. This is on a Mac:

This works:

$ python3.10 -V
Python 3.10.0

$ python3.10 -m venv v310

$ v310/bin/python -m venv v310-nested

$ v310-nested/bin/python -V
Python 3.10.0

This does not work:

$ python3.11 -V
Python 3.11.0a3

$ python3.11 -m venv v311

$ v311/bin/python -m venv 311-nested
Error: [Errno 2] No such file or directory: '/private/tmp/bpo-46028/311-nested/bin/python'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:26:10 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 23:26:10 +0000
Subject: [issue23469] Delete Misc/*.wpr files
In-Reply-To: <1424048342.99.0.00819785192711.issue23469@psf.upfronthosting.co.za>
Message-ID: <1639437970.17.0.915555368225.issue23469@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

IMO it's ok to remove these files. If WING is maintained again, it will be trivial to add again these configuratin files. I suggest to only remove these files in Python 3.11.

----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23469>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:28:11 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 23:28:11 +0000
Subject: [issue34624] -W option and PYTHONWARNINGS env variable does not
 accept module regexes
In-Reply-To: <1536622594.77.0.0269046726804.issue34624@psf.upfronthosting.co.za>
Message-ID: <1639438091.87.0.491884656043.issue34624@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Oh, I didn't know this issue. I closed my issue bpo-43862 as a duplicate.

----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34624>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:28:26 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 23:28:26 +0000
Subject: [issue43862] warnings: -W option and PYTHONWARNINGS now use the
 message as a regex
In-Reply-To: <1618578407.09.0.811659309688.issue43862@roundup.psfhosted.org>
Message-ID: <1639438106.71.0.646579793959.issue43862@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

I mark this issue as a duplicate of bpo-34624.

----------
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> -W option and PYTHONWARNINGS env variable does not accept module regexes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43862>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:29:50 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 23:29:50 +0000
Subject: [issue34624] -W option and PYTHONWARNINGS env variable does not
 accept module regexes
In-Reply-To: <1536622594.77.0.0269046726804.issue34624@psf.upfronthosting.co.za>
Message-ID: <1639438190.25.0.310533517336.issue34624@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> Adding regular expression support to -W and PYTHONWARNINGS env var turns the options into potential attack vectors.

Why would an attacker control these options?

If an attacker controls how Python is run, they are more efficient way to take control of Python and execute arbitrary code, than just trigger a denial of service, no

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34624>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:33:49 2021
From: report at bugs.python.org (STINNER Victor)
Date: Mon, 13 Dec 2021 23:33:49 +0000
Subject: [issue34624] -W option and PYTHONWARNINGS env variable does not
 accept module regexes
In-Reply-To: <1536622594.77.0.0269046726804.issue34624@psf.upfronthosting.co.za>
Message-ID: <1639438429.29.0.0881367454673.issue34624@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

One option is to keep the current behavior by default, but support a new "/regex/" format. The /regex/ format is commonly used in Perl and sed.

Example to ignore warnings containing "deprecated" string in their message:


   python3 -W "ignore:/deprecated/"
   PYTHONWARNINGS="ignore:/deprecated/"

whereas the following commands continue to match exactly the whole warning message "deprecated":

   python3 -W "ignore:deprecated"
   PYTHONWARNINGS="ignore:deprecated"

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34624>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:49:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 23:49:55 +0000
Subject: [issue12489] email.errors.HeaderParseError if base64url is used
In-Reply-To: <1309790300.23.0.111625308862.issue12489@psf.upfronthosting.co.za>
Message-ID: <1639439395.38.0.897377329324.issue12489@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11:

>>> from email.header import decode_header
>>> decode_header('=?iso-8859-1?B?QW5tZWxkdW5nIE5ldHphbnNjaGx1c3MgU_xkcmluZzNwLmpwZw==?=')
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython-1/Lib/email/header.py", line 126, in decode_header
    word = email.base64mime.decode(encoded_string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iritkatriel/src/cpython-1/Lib/email/base64mime.py", line 112, in decode
    return a2b_base64(string.encode('raw-unicode-escape'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
binascii.Error: Invalid base64-encoded string: number of data characters (49) cannot be 1 more than a multiple of 4

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/iritkatriel/src/cpython-1/Lib/email/header.py", line 128, in decode_header
    raise HeaderParseError('Base64 decoding error')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
email.errors.HeaderParseError: Base64 decoding error

----------
nosy: +iritkatriel
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12489>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:54:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 23:54:42 +0000
Subject: [issue25948] Invalid MIME encoding generated by email.mime (line too
 long)
In-Reply-To: <1451039623.64.0.603876276349.issue25948@psf.upfronthosting.co.za>
Message-ID: <1639439682.2.0.697812181649.issue25948@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25948>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:59:35 2021
From: report at bugs.python.org (Brett Cannon)
Date: Mon, 13 Dec 2021 23:59:35 +0000
Subject: [issue31370] Remove support for threads-less builds
In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za>
Message-ID: <1639439975.38.0.279555744763.issue31370@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:

> https://web.dev/webassembly-threads/ suggests otherwise.

It actually doesn't as that post isn't for WASI, it's for WASM in the browser (I chose my acronyms carefully ?).

WASI is like POSIX for WebAssembly, so it's meant for desktop usage and thus no browser or JS engine is involved to provide web workers.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31370>
_______________________________________

From report at bugs.python.org  Mon Dec 13 18:59:51 2021
From: report at bugs.python.org (Irit Katriel)
Date: Mon, 13 Dec 2021 23:59:51 +0000
Subject: [issue23148] Missing the charset parameter in as_encoded_word()
In-Reply-To: <1420195099.17.0.393236049779.issue23148@psf.upfronthosting.co.za>
Message-ID: <1639439991.54.0.411874343432.issue23148@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I can't find as_encoded_word anywhere. Even on 3.7 branch.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23148>
_______________________________________

From report at bugs.python.org  Mon Dec 13 19:06:23 2021
From: report at bugs.python.org (Brett Cannon)
Date: Tue, 14 Dec 2021 00:06:23 +0000
Subject: [issue40059] Provide a toml module in the standard library
In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org>
Message-ID: <1639440383.55.0.533034448988.issue40059@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:

> I just noticed that tomli has dropped support for Python 3.6. That's a road block for general adoption of the package in the Python ecosystem.

It's already in pip, so I think it's already generally adopted ?. https://github.com/pypa/pip/tree/main/src/pip/_vendor/tomli

> Is my understanding correct that this issue is blocked on SC guidance?

Not officially, no. But I'm personally not going to bring it forward right now. If someone else wants to formulate a complete proposal for the SC on this then they are definitely welcome to! You will need to address where the code is coming from, why that code should be used, what's the API, etc.

The only reason the SC is mentioned here is there will be a discussion about how to maintain the stdlib, but it simply hasn't happened yet. You don't have to wait for it and asking for a TOML module might actually force the issue.

> Is there anything we could do in advance of SC guidance that would be productive?

Nope, someone eventually has to have the time to make the proposal and manage the deluge of comments.

> Is there a good place to follow along or be notified of SC thoughts?

https://github.com/python/steering-council as you already pointed out through the issues and monthly summaries. Otherwise you just need to open an issue and ask. ?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40059>
_______________________________________

From report at bugs.python.org  Mon Dec 13 19:10:12 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 00:10:12 +0000
Subject: [issue26528] NameError for built in function open when re-raising
 stored exception from yielded function
In-Reply-To: <1457611797.69.0.202848672993.issue26528@psf.upfronthosting.co.za>
Message-ID: <1639440612.12.0.332321821861.issue26528@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Reproduced on 3.11.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26528>
_______________________________________

From report at bugs.python.org  Mon Dec 13 19:22:35 2021
From: report at bugs.python.org (Martin Reboredo)
Date: Tue, 14 Dec 2021 00:22:35 +0000
Subject: [issue40059] Provide a toml module in the standard library
In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org>
Message-ID: <1639441355.46.0.918325730306.issue40059@roundup.psfhosted.org>


Martin Reboredo <yakoyoku at gmail.com> added the comment:

> Not officially, no. But I'm personally not going to bring it forward right now. If someone else wants to formulate a complete proposal for the SC on this then they are definitely welcome to! You will need to address where the code is coming from, why that code should be used, what's the API, etc.
>
> The only reason the SC is mentioned here is there will be a discussion about how to maintain the stdlib, but it simply hasn't happened yet. You don't have to wait for it and asking for a TOML module might actually force the issue.

I've been working on a document detailing the API implementation (as a PEP draft) see https://gitlab.com/YakoYakoYokuYoku/pep-toml. Although I've yet to write the code I'll to move forward with it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40059>
_______________________________________

From report at bugs.python.org  Mon Dec 13 19:53:45 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 00:53:45 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639443225.2.0.856323452896.issue46063@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset cb589d1b6bad4b75852c2e2a471a3800d5efdca7 by Vinay Sajip in branch 'main':
bpo-46063: Improve algorithm for computing which rolled-over log file? (GH-30093)
https://github.com/python/cpython/commit/cb589d1b6bad4b75852c2e2a471a3800d5efdca7


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Mon Dec 13 19:53:56 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 14 Dec 2021 00:53:56 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639443236.94.0.898852115229.issue46063@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +28317
pull_request: https://github.com/python/cpython/pull/30094

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Mon Dec 13 19:54:01 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 14 Dec 2021 00:54:01 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639443241.17.0.945432092759.issue46063@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28318
pull_request: https://github.com/python/cpython/pull/30095

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Mon Dec 13 20:04:10 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 14 Dec 2021 01:04:10 +0000
Subject: [issue45953] Statically allocate interpreter states as much as
 possible.
In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org>
Message-ID: <1639443850.41.0.0812887406878.issue45953@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:


New changeset 121f1f893a39d0b58d3d2b5597505c154ecaac2a by Eric Snow in branch 'main':
bpo-45953: Statically initialize the small ints. (gh-30092)
https://github.com/python/cpython/commit/121f1f893a39d0b58d3d2b5597505c154ecaac2a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45953>
_______________________________________

From report at bugs.python.org  Mon Dec 13 20:06:34 2021
From: report at bugs.python.org (STINNER Victor)
Date: Tue, 14 Dec 2021 01:06:34 +0000
Subject: [issue31370] Remove support for threads-less builds
In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za>
Message-ID: <1639443994.46.0.441144097737.issue31370@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

> This has unfortunately turned out to be a blocker on getting WASI support as there's not direct threading support in WebAssembly.

This issue is now closed and unrelated to WASI support. Can you please open a new separated issue for it?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31370>
_______________________________________

From report at bugs.python.org  Mon Dec 13 20:16:00 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 14 Dec 2021 01:16:00 +0000
Subject: [issue45953] Statically allocate interpreter states as much as
 possible.
In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org>
Message-ID: <1639444560.21.0.253536217362.issue45953@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
pull_requests: +28319
pull_request: https://github.com/python/cpython/pull/30096

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45953>
_______________________________________

From report at bugs.python.org  Mon Dec 13 20:18:02 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 01:18:02 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639444682.67.0.373212627651.issue46063@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset f84e2f6c0aca97c59ec8ce21715ae9bd89893307 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46063: Improve algorithm for computing which rolled-over log file? (GH-30093) (GH-30094)
https://github.com/python/cpython/commit/f84e2f6c0aca97c59ec8ce21715ae9bd89893307


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Mon Dec 13 20:19:54 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 01:19:54 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639444794.72.0.750560972885.issue46063@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset 94234228abbb84945a48049a7515dea960bc9834 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-46063: Improve algorithm for computing which rolled-over log file? (GH-30093) (GH-30095)
https://github.com/python/cpython/commit/94234228abbb84945a48049a7515dea960bc9834


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Mon Dec 13 20:31:45 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Tue, 14 Dec 2021 01:31:45 +0000
Subject: [issue45919] Use WinAPI GetFileType() in is_valid_fd()
In-Reply-To: <1638127307.77.0.0584468495635.issue45919@roundup.psfhosted.org>
Message-ID: <1639445505.28.0.254895123957.issue45919@roundup.psfhosted.org>


Dong-hee Na <donghee.na at python.org> added the comment:


New changeset 9130a4d62032468e0d4949aaa49c29afb0d854ca by Dong-hee Na in branch 'main':
bpo-45919: Remove out of date comment (GH-30090)
https://github.com/python/cpython/commit/9130a4d62032468e0d4949aaa49c29afb0d854ca


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45919>
_______________________________________

From report at bugs.python.org  Mon Dec 13 20:39:54 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Tue, 14 Dec 2021 01:39:54 +0000
Subject: [issue46068] Change use of warnings.warn to logging.warning in a few
 places
In-Reply-To: <1639435512.0.0.159079727605.issue46068@roundup.psfhosted.org>
Message-ID: <1639445994.53.0.250163503528.issue46068@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> The downside of making this change is that it may break 3rd party unit tests.

I don?t see any upside.  The modules in question have been stable for a good while.  There?s no benefit to changing them. 

Also, there is no strong agreement that the standard library should ever prefer logging.warn() over the warnings module which has mechanisms for filtering the warnings.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46068>
_______________________________________

From report at bugs.python.org  Mon Dec 13 20:44:08 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Tue, 14 Dec 2021 01:44:08 +0000
Subject: [issue46068] Change use of warnings.warn to logging.warning in a few
 places
In-Reply-To: <1639435512.0.0.159079727605.issue46068@roundup.psfhosted.org>
Message-ID: <1639446248.74.0.870599131905.issue46068@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
Removed message: https://bugs.python.org/msg408512

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46068>
_______________________________________

From report at bugs.python.org  Mon Dec 13 20:45:39 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Tue, 14 Dec 2021 01:45:39 +0000
Subject: [issue46068] Change use of warnings.warn to logging.warning in a few
 places
In-Reply-To: <1639435512.0.0.159079727605.issue46068@roundup.psfhosted.org>
Message-ID: <1639446339.33.0.0204450365872.issue46068@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> The downside of making this change is that it may break 3rd party unit tests.

I don?t see any upside.  The modules in question have been stable for a good while.  There?s no benefit to changing them. 

Also, there is no strong agreement that the standard library should ever prefer logging.warning() over the warnings module which has mechanisms for filtering the warnings, escalating them to errors, or limiting the number of times they are reported.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46068>
_______________________________________

From report at bugs.python.org  Mon Dec 13 22:31:17 2021
From: report at bugs.python.org (Eryk Sun)
Date: Tue, 14 Dec 2021 03:31:17 +0000
Subject: [issue45915] Use fcntl(fd, F_GETFD) to check whether an fd is valid
In-Reply-To: <1638094386.96.0.551592531479.issue45915@roundup.psfhosted.org>
Message-ID: <1639452677.64.0.595861860742.issue45915@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

PR 29821 adds __APPLE__ to the platforms that use fcntl(fd, F_GETFD). Is this okay on macOS, given bpo-30225? Apparently fstat() fails if the other end of a pipe is closed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45915>
_______________________________________

From report at bugs.python.org  Tue Dec 14 02:11:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 07:11:28 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>
Message-ID: <1639465888.81.0.172095134819.issue46057@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

You?re right that the api should not be there. See issue22047.

I don?t think it should be patches to call super/return self. That would just be confusing.

----------
resolution:  -> duplicate
superseder:  -> argparse improperly prints mutually exclusive options when they are in a group

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Tue Dec 14 03:09:08 2021
From: report at bugs.python.org (Aivar Annamaa)
Date: Tue, 14 Dec 2021 08:09:08 +0000
Subject: [issue46062] tkinter.filedialog.SaveAs: create new folder on Ubuntu?
In-Reply-To: <1639392097.98.0.679705685324.issue46062@roundup.psfhosted.org>
Message-ID: <1639469348.01.0.188233952538.issue46062@roundup.psfhosted.org>


Aivar Annamaa <aivar.annamaa at gmail.com> added the comment:

You may want to use zenity in a subprocess instead of this dialog in Linux, but this has its own problems (appearing behind other windows occasionally)

----------
nosy: +aivarannamaa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46062>
_______________________________________

From report at bugs.python.org  Tue Dec 14 03:59:56 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 14 Dec 2021 08:59:56 +0000
Subject: [issue23148] Missing the charset parameter in as_encoded_word()
In-Reply-To: <1420195099.17.0.393236049779.issue23148@psf.upfronthosting.co.za>
Message-ID: <1639472396.11.0.934563201308.issue23148@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

The code was completely rewritten in issue27240. No tests are needed.

----------
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23148>
_______________________________________

From report at bugs.python.org  Tue Dec 14 04:31:42 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 14 Dec 2021 09:31:42 +0000
Subject: [issue31370] Remove support for threads-less builds
In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za>
Message-ID: <1639474302.48.0.153970475445.issue31370@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Concur with Victor. It is fine to add a link to other discussion in a closed issue, but an issue closed many years ago is not a good place for a new discussion at all.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31370>
_______________________________________

From report at bugs.python.org  Tue Dec 14 04:38:01 2021
From: report at bugs.python.org (haven david)
Date: Tue, 14 Dec 2021 09:38:01 +0000
Subject: [issue46069] Super Smash Flash 2
Message-ID: <1639474681.48.0.76279555559.issue46069@roundup.psfhosted.org>


New submission from haven david <havenhaven0268 at gmail.com>:

Opportunity for you to transform into interesting characters like Mario, Sonic...
Online game with exciting battles
https://super-smashflash2.com

----------
components: Build
messages: 408519
nosy: havenhaven
priority: normal
severity: normal
status: open
title: Super Smash Flash 2
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46069>
_______________________________________

From report at bugs.python.org  Tue Dec 14 04:40:34 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 14 Dec 2021 09:40:34 +0000
Subject: [issue46069] Super Smash Flash 2
In-Reply-To: <1639474681.48.0.76279555559.issue46069@roundup.psfhosted.org>
Message-ID: <1639474834.77.0.543434319597.issue46069@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46069>
_______________________________________

From report at bugs.python.org  Tue Dec 14 05:01:53 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 10:01:53 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639476113.99.0.589640920672.issue46063@roundup.psfhosted.org>


Change by Vinay Sajip <vinay_sajip at yahoo.co.uk>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Tue Dec 14 05:08:04 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 10:08:04 +0000
Subject: [issue23010] "unclosed file" warning when defining unused logging
 FileHandler in dictConfig
In-Reply-To: <1418046415.01.0.116582999558.issue23010@psf.upfronthosting.co.za>
Message-ID: <1639476484.25.0.117635013785.issue23010@roundup.psfhosted.org>


Change by Vinay Sajip <vinay_sajip at yahoo.co.uk>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23010>
_______________________________________

From report at bugs.python.org  Tue Dec 14 05:09:02 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 10:09:02 +0000
Subject: [issue46028] 3.11.0a3: sys._base_executable is wrong,
 breaks venv - it wasn't under 3.11.0a2
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639476542.67.0.250088700892.issue46028@roundup.psfhosted.org>


Change by Vinay Sajip <vinay_sajip at yahoo.co.uk>:


----------
title: 3.11.0a3: under tox, sys._base_executable is wrong -> 3.11.0a3: sys._base_executable is wrong, breaks venv - it wasn't under 3.11.0a2

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Tue Dec 14 05:57:50 2021
From: report at bugs.python.org (graysky)
Date: Tue, 14 Dec 2021 10:57:50 +0000
Subject: [issue46070] broken subinterpreters
Message-ID: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>


New submission from graysky <graysky at archlinux.us>:

Seems as though cpython is broken when working with subinterpreters. The problematic change could be (d0d29655ff) affecting import.c.[1] Reverting this commit and rebuilding python fixes the issues on my system with some scripts that import sqlite, for example, the Kodi plugin YouTube[2] and the IMDB Trailers plugin. Others have reported similar breakage with other python code[3].

Example output when the bug manifests:

ERROR <general>: Traceback (most recent call last):
ERROR <general>:   File "/usr/lib/python3.10/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters
ERROR <general>:     
ERROR <general>: register_converter("timestamp", convert_timestamp)
ERROR <general>: 
ERROR <general>: KeyError
ERROR <general>: : 
ERROR <general>: 'timepart_full'
ERROR <general>:                                              
ERROR <general>: Exception ignored deletion of interned string failed
ERROR <general>: :


References:
1. https://github.com/python/cpython/commit/d0d29655ffc43d426ad68542d8de8304f7f1346a
2. https://github.com/anxdpanic/plugin.video.youtube/issues/255
3. https://bbs.archlinux.org/viewtopic.php?id=272121

----------
components: Interpreter Core
messages: 408520
nosy: graysky
priority: normal
severity: normal
status: open
title: broken subinterpreters
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Tue Dec 14 06:18:12 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 11:18:12 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639480692.05.0.668607157304.issue46063@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

% ./python.exe -We -m test -v test_logging -m test_compute_files_to_delete 
Raised RLIMIT_NOFILE: 256 -> 1024
== CPython 3.11.0a3+ (heads/main:9130a4d620, Dec 14 2021, 11:12:05) [Clang 13.0.0 (clang-1300.0.29.3)]
== macOS-11.6-x86_64-i386-64bit little-endian
== cwd: /Users/iritkatriel/src/cpython/build/test_python_86072?
== CPU count: 12
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 5.20 Run tests sequentially
0:00:00 load avg: 5.20 [1/1] test_logging
test_compute_files_to_delete (test.test_logging.TimedRotatingFileHandlerTest) ... Warning -- Unraisable exception
Exception ignored in: <_io.FileIO name='/var/folders/kf/0v7kz3ps62dg11v9rq0sz35m0000gn/T/test_logging_w3nn9vsi/d.e.log' mode='ab' closefd=True>
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython/Lib/test/test_logging.py", line 5469, in test_compute_files_to_delete
    for i, prefix in enumerate(prefixes):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed file <_io.TextIOWrapper name='/var/folders/kf/0v7kz3ps62dg11v9rq0sz35m0000gn/T/test_logging_w3nn9vsi/d.e.log' mode='a' encoding='UTF-8'>
Warning -- Unraisable exception
Exception ignored in: <_io.FileIO name='/var/folders/kf/0v7kz3ps62dg11v9rq0sz35m0000gn/T/test_logging_w3nn9vsi/a.b.c.log' mode='ab' closefd=True>
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython/Lib/test/test_logging.py", line 5469, in test_compute_files_to_delete
    for i, prefix in enumerate(prefixes):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed file <_io.TextIOWrapper name='/var/folders/kf/0v7kz3ps62dg11v9rq0sz35m0000gn/T/test_logging_w3nn9vsi/a.b.c.log' mode='a' encoding='UTF-8'>
Warning -- Unraisable exception
Exception ignored in: <_io.FileIO name='/var/folders/kf/0v7kz3ps62dg11v9rq0sz35m0000gn/T/test_logging_w3nn9vsi/a.b.log' mode='ab' closefd=True>
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython/Lib/test/test_logging.py", line 5469, in test_compute_files_to_delete
    for i, prefix in enumerate(prefixes):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed file <_io.TextIOWrapper name='/var/folders/kf/0v7kz3ps62dg11v9rq0sz35m0000gn/T/test_logging_w3nn9vsi/a.b.log' mode='a' encoding='UTF-8'>
Warning -- Unraisable exception
Exception ignored in: <_io.FileIO name='/var/folders/kf/0v7kz3ps62dg11v9rq0sz35m0000gn/T/test_logging_w3nn9vsi/d.e.f.log' mode='ab' closefd=True>
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython/Lib/test/test_logging.py", line 5469, in test_compute_files_to_delete
    for i, prefix in enumerate(prefixes):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed file <_io.TextIOWrapper name='/var/folders/kf/0v7kz3ps62dg11v9rq0sz35m0000gn/T/test_logging_w3nn9vsi/d.e.f.log' mode='a' encoding='UTF-8'>
ok

----------------------------------------------------------------------
Ran 1 test in 0.016s

OK
test_logging failed (env changed)

== Tests result: SUCCESS ==

1 test altered the execution environment:
    test_logging

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Tue Dec 14 06:22:49 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 11:22:49 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639480969.55.0.376925750819.issue46063@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

Ah ... forgot to set delay=True for the handlers. Will look at this soon.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Tue Dec 14 06:53:02 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 14 Dec 2021 11:53:02 +0000
Subject: [issue46023] Modules/makesetup generated rules ignore *disabled*
In-Reply-To: <1639041830.9.0.701619101169.issue46023@roundup.psfhosted.org>
Message-ID: <1639482782.28.0.124121308179.issue46023@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

GH-30001 may have introduced a regression. makesetup is dropping too many modules. Back to the drawing board!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46023>
_______________________________________

From report at bugs.python.org  Tue Dec 14 06:56:41 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 11:56:41 +0000
Subject: [issue22047] Deprecate unsupported nesting of argparse groups
In-Reply-To: <1406131424.14.0.0235697032218.issue22047@psf.upfronthosting.co.za>
Message-ID: <1639483001.42.0.146875264306.issue22047@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I am repurposing this issue for the deprecation of nesting. It is pretty clear that the functions exist by accident through inheritance. They are not documented and from the number of open issues about them they clearly are not working as people expect them to.

----------
title: argparse improperly prints mutually exclusive options when they are in a group -> Deprecate unsupported nesting of argparse groups
versions: +Python 3.11 -Python 2.7, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22047>
_______________________________________

From report at bugs.python.org  Tue Dec 14 06:57:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 11:57:42 +0000
Subject: [issue22047] Deprecate unsupported nesting of argparse groups
In-Reply-To: <1406131424.14.0.0235697032218.issue22047@psf.upfronthosting.co.za>
Message-ID: <1639483062.91.0.705559981431.issue22047@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28320
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30098

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22047>
_______________________________________

From report at bugs.python.org  Tue Dec 14 07:39:01 2021
From: report at bugs.python.org (97littleleaf11)
Date: Tue, 14 Dec 2021 12:39:01 +0000
Subject: [issue46066] TypedDict alternative definition syntax with keyword
 args is confusing
In-Reply-To: <1639409817.42.0.21314101687.issue46066@roundup.psfhosted.org>
Message-ID: <1639485541.91.0.649041009238.issue46066@roundup.psfhosted.org>


Change by 97littleleaf11 <97littleleaf11 at gmail.com>:


----------
title: [doc] TypedDict alternative definition syntax with keyword args is confusing -> TypedDict alternative definition syntax with keyword args is confusing

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46066>
_______________________________________

From report at bugs.python.org  Tue Dec 14 07:50:02 2021
From: report at bugs.python.org (Steve Dower)
Date: Tue, 14 Dec 2021 12:50:02 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639436758.52.0.926720041511.issue46028@roundup.psfhosted.org>
Message-ID: <c74ad2e2-548a-829b-bfcc-0dad7115e9fa@python.org>


Steve Dower <steve.dower at python.org> added the comment:

> $ v311/bin/python -m venv 311-nested
> Error: [Errno 2] No such file or directory: '/private/tmp/bpo-46028/311-nested/bin/python'

I assume /private/tmp/bpo-46028/311-nested/bin/python3.11 exists though? 
Probably that's the issue here - I don't know how else to get the real 
executable *name* other than copying from argv[0], and it isn't supposed 
to be necessary.

You also have v311/bin/python3.11, right? If you use that one, does it 
work? I'm trying to narrow down where the base executable is actually 
being launched and why.

----------
title: 3.11.0a3: sys._base_executable is wrong, breaks venv - it wasn't under 3.11.0a2 -> 3.11.0a3: under tox, sys._base_executable is wrong

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Tue Dec 14 07:57:53 2021
From: report at bugs.python.org (Steve Dower)
Date: Tue, 14 Dec 2021 12:57:53 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <c74ad2e2-548a-829b-bfcc-0dad7115e9fa@python.org>
Message-ID: <a1b74473-0a9c-8d1f-02d7-a9934b64919f@python.org>


Steve Dower <steve.dower at python.org> added the comment:

Or possibly that error is coming from the attempt to copy it? And since 
both executable and base_executable don't have the 3/3.x suffix, the 
copy is failing because the "real" binary does have the suffix.

This could be corrected in getpath.py with a platform-specific quirk 
that searches for suffixed binaries for base_executable, but for 
performance reasons I think we'd prefer to have that check in venv so 
that it doesn't impact every single launch of CPython.

The actual binary could also be added to pyvenv.cfg as another value - 
parsing that out in getpath.py is now considerably easier for someone to 
add than it used to be.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Tue Dec 14 08:01:18 2021
From: report at bugs.python.org (Berker Peksag)
Date: Tue, 14 Dec 2021 13:01:18 +0000
Subject: [issue23469] Delete Misc/*.wpr files
In-Reply-To: <1424048342.99.0.00819785192711.issue23469@psf.upfronthosting.co.za>
Message-ID: <1639486878.03.0.592004163251.issue23469@roundup.psfhosted.org>


Berker Peksag <berker.peksag at gmail.com> added the comment:


New changeset d46d08d9474cb00b697dbdbb12cc7ce8f8ddfcec by Kumar Aditya in branch 'main':
bpo-23469: Delete Wing IDE configuration files (GH-30067)
https://github.com/python/cpython/commit/d46d08d9474cb00b697dbdbb12cc7ce8f8ddfcec


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23469>
_______________________________________

From report at bugs.python.org  Tue Dec 14 08:02:33 2021
From: report at bugs.python.org (Berker Peksag)
Date: Tue, 14 Dec 2021 13:02:33 +0000
Subject: [issue23469] Delete Misc/*.wpr files
In-Reply-To: <1424048342.99.0.00819785192711.issue23469@psf.upfronthosting.co.za>
Message-ID: <1639486953.93.0.228137367593.issue23469@roundup.psfhosted.org>


Change by Berker Peksag <berker.peksag at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23469>
_______________________________________

From report at bugs.python.org  Tue Dec 14 08:15:26 2021
From: report at bugs.python.org (Ned Batchelder)
Date: Tue, 14 Dec 2021 13:15:26 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639487726.16.0.455228110235.issue46028@roundup.psfhosted.org>


Ned Batchelder <ned at nedbatchelder.com> added the comment:

> I assume /private/tmp/bpo-46028/311-nested/bin/python3.11 exists though? 

Yes, that file exists, but it's a symlink to a non-existent file:

$ ls -al 311-nested/bin
total 0
drwxr-xr-x  5 nedbatchelder  wheel  160 Dec 13 18:04 ./
drwxr-xr-x  6 nedbatchelder  wheel  192 Dec 13 18:04 ../
lrwxr-xr-x  1 nedbatchelder  wheel   21 Dec 13 18:04 python@ -> /usr/local/bin/python
lrwxr-xr-x  1 nedbatchelder  wheel    6 Dec 13 18:04 python3@ -> python
lrwxr-xr-x  1 nedbatchelder  wheel    6 Dec 13 18:04 python3.11@ -> python
$ ls -al /usr/local/bin/python
ls: /usr/local/bin/python: No such file or directory

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Tue Dec 14 08:16:26 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 13:16:26 +0000
Subject: [issue26952] argparse help formatter raises IndexError
In-Reply-To: <1462374887.67.0.462060112057.issue26952@psf.upfronthosting.co.za>
Message-ID: <1639487786.81.0.195500774788.issue26952@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +patch
nosy: +iritkatriel
nosy_count: 6.0 -> 7.0
pull_requests: +28321
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30099

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26952>
_______________________________________

From report at bugs.python.org  Tue Dec 14 08:25:50 2021
From: report at bugs.python.org (John Belmonte)
Date: Tue, 14 Dec 2021 13:25:50 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1639488350.22.0.835885556032.issue45995@roundup.psfhosted.org>


John Belmonte <john at neggie.net> added the comment:

implemented float and Decimal-- PR is ready for review

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Tue Dec 14 09:12:58 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 14 Dec 2021 14:12:58 +0000
Subject: [issue46023] Modules/makesetup generated rules ignore *disabled*
In-Reply-To: <1639041830.9.0.701619101169.issue46023@roundup.psfhosted.org>
Message-ID: <1639491178.66.0.628151889169.issue46023@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28322
pull_request: https://github.com/python/cpython/pull/30100

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46023>
_______________________________________

From report at bugs.python.org  Tue Dec 14 09:22:51 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 14:22:51 +0000
Subject: [issue18467] argparse - problematic 'default' behavior
In-Reply-To: <1373927590.26.0.302211166373.issue18467@psf.upfronthosting.co.za>
Message-ID: <1639491771.14.0.942819468098.issue18467@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Mat?j, did Paul's suggestion solve your use case?

----------
nosy: +iritkatriel
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18467>
_______________________________________

From report at bugs.python.org  Tue Dec 14 09:42:56 2021
From: report at bugs.python.org (Christian Heimes)
Date: Tue, 14 Dec 2021 14:42:56 +0000
Subject: [issue46023] Modules/makesetup generated rules ignore *disabled*
In-Reply-To: <1639041830.9.0.701619101169.issue46023@roundup.psfhosted.org>
Message-ID: <1639492976.99.0.42975417999.issue46023@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 74821b30539bba3cf0ac4148923ec0e9b826508e by Christian Heimes in branch 'main':
bpo-46023: Skip build if module is marked as DISABLED (GH-30100)
https://github.com/python/cpython/commit/74821b30539bba3cf0ac4148923ec0e9b826508e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46023>
_______________________________________

From report at bugs.python.org  Tue Dec 14 09:43:01 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Tue, 14 Dec 2021 14:43:01 +0000
Subject: [issue45383] PyType_FromSpec API fails to use metaclass of bases
In-Reply-To: <1633470686.49.0.00898443232155.issue45383@roundup.psfhosted.org>
Message-ID: <1639492981.73.0.693505890002.issue45383@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

I haven't forgotten this issue, but when I get to it it always leads to a rabbit hole. Sometimes just chasing refleaks, but there are deeper issues as well.

AFAICS, there's no way to call metatype.tp_new for such a class. I guess the safest option is to fail when the metaclass has a custom tp_new -- because that means the metaclass is requesting that it wants to allocate/initialize its types itself.

We can call metatype.tp_init, and probably should. And __init_subclass__ too, I suppose.

But at that point, this is duplicating a lot of existing functionality, and I'm starting to wonder if this wouldn't all be better with calling the metaclass instead.
What's missing?
- basicsize/itemsize could be allowed with __basicsize__/__itemsize__ in the dict.
- flags: we could add mechanisms to set individual flags after the type is created, as needed.
- slots can usually be applied after the class is created; maybe there should be a public function for this.
- members could theoretically be copied to individual descriptors; there doesn't seem much need for keeping tp_members around.

Does that seem like a more reasonable direction to explore?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45383>
_______________________________________

From report at bugs.python.org  Tue Dec 14 09:50:10 2021
From: report at bugs.python.org (wolfgang kuehn)
Date: Tue, 14 Dec 2021 14:50:10 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 corporate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639493410.48.0.823998046134.issue46056@roundup.psfhosted.org>


wolfgang kuehn <wolfgang-kuehn at decatur.de> added the comment:

I can confirm that setting __PYVENV_LAUNCHER__ to ANY path with prefix  ./venv/Scripts/ does indeed mark the python session as being a virtual environment, no special permissions needed.

However, you will have no tooling support whatsoever (e.g. PyCharms Package Mngt) because __PYVENV_LAUNCHER__ is, after all, non-standard.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:04:39 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 14 Dec 2021 15:04:39 +0000
Subject: [issue46059] Typo in match Statement example
In-Reply-To: <1639356396.07.0.913283855262.issue46059@roundup.psfhosted.org>
Message-ID: <1639494279.33.0.707931729097.issue46059@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28323
pull_request: https://github.com/python/cpython/pull/30101

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46059>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:04:38 2021
From: report at bugs.python.org (Ken Jin)
Date: Tue, 14 Dec 2021 15:04:38 +0000
Subject: [issue46059] Typo in match Statement example
In-Reply-To: <1639356396.07.0.913283855262.issue46059@roundup.psfhosted.org>
Message-ID: <1639494278.34.0.143966026286.issue46059@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset 1cbb88736c32ac30fd530371adf53fe7554be0a5 by Alex Waygood in branch 'main':
bpo-46059: Clarify pattern-matching example in "control flow" docs (GH-30079)
https://github.com/python/cpython/commit/1cbb88736c32ac30fd530371adf53fe7554be0a5


----------
nosy: +kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46059>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:20:03 2021
From: report at bugs.python.org (David Mc Dougall)
Date: Tue, 14 Dec 2021 15:20:03 +0000
Subject: [issue46071] Graphlib documentation
Message-ID: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org>


New submission from David Mc Dougall <dam1784 at g.rit.edu>:

The documentation for graphlib encourages users to represent their graphs in a awkward format.

Graphs are currently represented using dictionaries of nodes, for example:
graph["end_node"] = ["start_node"]

And this is unintuitive because you can't use the graph traverse edges in their forward direction.
If you look up a node in the graph, you get all of the nodes that point to the key,
as opposed to all of the nodes that the key points to.

The solution is to rewrite the documentation such that all of the edge directions are reversed.
The final topologically sorted list will be in the "opposite" direction as a consequence.

This will cause no functional changes.

----------
assignee: docs at python
components: Documentation
messages: 408535
nosy: dam1784, docs at python
priority: normal
severity: normal
status: open
title: Graphlib documentation
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46071>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:22:49 2021
From: report at bugs.python.org (Roundup Robot)
Date: Tue, 14 Dec 2021 15:22:49 +0000
Subject: [issue46071] Graphlib documentation
In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org>
Message-ID: <1639495369.2.0.7962097582.issue46071@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +28324
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30102

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46071>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:25:52 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 14 Dec 2021 15:25:52 +0000
Subject: [issue46059] Typo in match Statement example
In-Reply-To: <1639356396.07.0.913283855262.issue46059@roundup.psfhosted.org>
Message-ID: <1639495552.52.0.0372370809321.issue46059@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 503803d8c19be91becc09ca59f3febcbc324d6d2 by Miss Islington (bot) in branch '3.10':
bpo-46059: Clarify pattern-matching example in "control flow" docs (GH-30079)
https://github.com/python/cpython/commit/503803d8c19be91becc09ca59f3febcbc324d6d2


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46059>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:27:48 2021
From: report at bugs.python.org (Ken Jin)
Date: Tue, 14 Dec 2021 15:27:48 +0000
Subject: [issue46059] Typo in match Statement example
In-Reply-To: <1639356396.07.0.913283855262.issue46059@roundup.psfhosted.org>
Message-ID: <1639495668.17.0.710579597124.issue46059@roundup.psfhosted.org>


Change by Ken Jin <kenjin4096 at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46059>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:28:31 2021
From: report at bugs.python.org (Ken Jin)
Date: Tue, 14 Dec 2021 15:28:31 +0000
Subject: [issue46046] I/O bound threads got to no chance to run with small CPU
 bound threads with new GIL
In-Reply-To: <1639220179.27.0.659005921662.issue46046@roundup.psfhosted.org>
Message-ID: <1639495711.07.0.392278644556.issue46046@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:

Hi,

Thank you for your interest in Python, and especially the GIL. David Beazley opened an issue for his PyCon 2010 GIL talk at https://bugs.python.org/issue7946. You can discuss more on that issue (I suggest first reading through it, there's a really long history behind the GIL).

I'm closing this issue as a duplicate, as discussion should be redirected to the abovementioned issue7946 instead.

----------
nosy: +kj
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46046>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:28:42 2021
From: report at bugs.python.org (Zachary Ware)
Date: Tue, 14 Dec 2021 15:28:42 +0000
Subject: [issue46069] Spam
In-Reply-To: <1639474681.48.0.76279555559.issue46069@roundup.psfhosted.org>
Message-ID: <1639495722.7.0.639264040551.issue46069@roundup.psfhosted.org>


Change by Zachary Ware <zachary.ware at gmail.com>:


----------
components:  -Build
nosy:  -havenhaven
title: Super Smash Flash 2 -> Spam
versions:  -Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46069>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:28:52 2021
From: report at bugs.python.org (Alex Waygood)
Date: Tue, 14 Dec 2021 15:28:52 +0000
Subject: [issue46059] Typo in match Statement example
In-Reply-To: <1639356396.07.0.913283855262.issue46059@roundup.psfhosted.org>
Message-ID: <1639495732.32.0.26415924883.issue46059@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Thanks for the bug report, Vivek! It should be fixed now -- it might take a day or two for the online docs to update.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46059>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:29:15 2021
From: report at bugs.python.org (Zachary Ware)
Date: Tue, 14 Dec 2021 15:29:15 +0000
Subject: [issue46069] Spam
Message-ID: <1639495755.19.0.908871862246.issue46069@roundup.psfhosted.org>


Change by Zachary Ware <zachary.ware at gmail.com>:


----------
Removed message: https://bugs.python.org/msg408519

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46069>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:36:55 2021
From: report at bugs.python.org (Eric Snow)
Date: Tue, 14 Dec 2021 15:36:55 +0000
Subject: [issue46070] broken subinterpreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639496215.82.0.167638495489.issue46070@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

(related: bpo-44059)

Presumably the problem relates to global state used in different interpreters leading to an inconsistent state in the crashing extension (or its dependencies).

@graysky, do you know if this was a problem before Python 3.8?

----------
components: +Subinterpreters
nosy: +eric.snow, petr.viktorin, shihai1991
stage:  -> test needed
type:  -> behavior
versions: +Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:42:54 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 15:42:54 +0000
Subject: [issue26726] Incomplete Internationalization in Argparse Module
In-Reply-To: <1460242413.52.0.89369314936.issue26726@psf.upfronthosting.co.za>
Message-ID: <1639496574.06.0.742478664451.issue26726@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +easy
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26726>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:44:53 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Tue, 14 Dec 2021 15:44:53 +0000
Subject: [issue46070] broken subinterpreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639496693.19.0.272147786271.issue46070@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

Interned strings were broken in GH-20058, see bpo-46006. Maybe that's also the issue here?

----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Tue Dec 14 10:49:56 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Tue, 14 Dec 2021 15:49:56 +0000
Subject: [issue46071] Graphlib documentation
In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org>
Message-ID: <1639496996.4.0.646592700023.issue46071@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
nosy: +eric.smith, rhettinger, tim.peters

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46071>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:03:26 2021
From: report at bugs.python.org (graysky)
Date: Tue, 14 Dec 2021 16:03:26 +0000
Subject: [issue46070] broken subinterpreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639497806.07.0.742111155566.issue46070@roundup.psfhosted.org>


graysky <graysky at archlinux.us> added the comment:

@Eric - I have not seen this on 3.8 or 3.9.  No data before 3.8.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:07:48 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 16:07:48 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639498068.79.0.714796997493.issue46063@roundup.psfhosted.org>


Change by Vinay Sajip <vinay_sajip at yahoo.co.uk>:


----------
pull_requests: +28326
pull_request: https://github.com/python/cpython/pull/30103

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:08:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 16:08:42 +0000
Subject: [issue9350] add remove_argument_group to argparse
In-Reply-To: <1279893088.18.0.675631346333.issue9350@psf.upfronthosting.co.za>
Message-ID: <1639498122.25.0.245120706405.issue9350@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This is over a decade old and the discussion is mostly that it's not worth doing, so I suggest we close.

----------
nosy: +iritkatriel
resolution:  -> rejected
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9350>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:17:53 2021
From: report at bugs.python.org (Mark Shannon)
Date: Tue, 14 Dec 2021 16:17:53 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
Message-ID: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>


New submission from Mark Shannon <mark at hotpy.org>:

By "stats" I mean the internal numbers gathered by the VM for performance and debugging. This has nothing to do with any statistics module.

Currently various parts of the VM gather stats: the GC, dicts, the bytecode interpreter, type lookup cache, etc.

These stats have various compile time flags to turn them on and off. They have differing ways to display the stats, and no unified way to gather stats across different runs.

For the specialization stats we dump stats, which we can parse to collate stats across runs.

We should:
1. Add a --with-pystats config flag (like with-pydebug) to turn on stat gathering at build time.
2. Convert the other stats to the format used by the specialization stats, so all stats can be parsed and collated.

----------
messages: 408543
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Unify handling of stats in the CPython VM

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:22:44 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 16:22:44 +0000
Subject: [issue26726] Incomplete Internationalization in Argparse Module
In-Reply-To: <1460242413.52.0.89369314936.issue26726@psf.upfronthosting.co.za>
Message-ID: <1639498964.34.0.944905811325.issue26726@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Closing as duplicate of issue39464, which has a GitHub PR.

----------
nosy: +iritkatriel
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Allow translating argparse error messages

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26726>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:22:47 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 16:22:47 +0000
Subject: [issue39464] Allow translating argparse error messages
In-Reply-To: <1580133337.82.0.00677207154431.issue39464@roundup.psfhosted.org>
Message-ID: <1639498967.27.0.55728416534.issue39464@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Closed issue26726 as duplicate of this.

----------
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39464>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:38:50 2021
From: report at bugs.python.org (Brian Carlson)
Date: Tue, 14 Dec 2021 16:38:50 +0000
Subject: [issue46073] ast.unparse produces: 'FunctionDef' object has no
 attribute 'lineno' for valid module
Message-ID: <1639499930.14.0.345587742085.issue46073@roundup.psfhosted.org>


New submission from Brian Carlson <briancarlson6174 at gmail.com>:

Test file linked. When unparsing the output from ast.parse on a simple class, unparse throws an error: 'FunctionDef' object has no attribute 'lineno' for a valid class and valid AST. It fails when programmatically building the module AST as well.

It seems to be from this function: https://github.com/python/cpython/blob/1cbb88736c32ac30fd530371adf53fe7554be0a5/Lib/ast.py#L790

----------
components: Library (Lib)
files: test.py
messages: 408546
nosy: TheRobotCarlson
priority: normal
severity: normal
status: open
title: ast.unparse produces: 'FunctionDef' object has no attribute 'lineno' for valid module
type: crash
versions: Python 3.10, Python 3.11, Python 3.9
Added file: https://bugs.python.org/file50490/test.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46073>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:43:02 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Tue, 14 Dec 2021 16:43:02 +0000
Subject: [issue46066] TypedDict alternative definition syntax with keyword
 args is confusing
In-Reply-To: <1639409817.42.0.21314101687.issue46066@roundup.psfhosted.org>
Message-ID: <1639500182.25.0.664911090459.issue46066@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

I recommend opening an issue here: https://github.com/python/typing/issues/new/choose

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46066>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:46:22 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 14 Dec 2021 16:46:22 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639500382.62.0.762728309368.issue46063@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28327
pull_request: https://github.com/python/cpython/pull/30104

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:46:27 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 14 Dec 2021 16:46:27 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639500387.54.0.235567629099.issue46063@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28328
pull_request: https://github.com/python/cpython/pull/30105

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:46:38 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 16:46:38 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639500398.68.0.258524496114.issue46063@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset 850aefc2c651110a784cd5478af9774b1f6287a3 by Vinay Sajip in branch 'main':
bpo-46063: Add 'delay=True' to file handler initialization. (GH-30103)
https://github.com/python/cpython/commit/850aefc2c651110a784cd5478af9774b1f6287a3


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:48:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 16:48:28 +0000
Subject: [issue45292] Implement PEP 654: Exception Groups
In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org>
Message-ID: <1639500508.24.0.979761034627.issue45292@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset d60457a6673cf0263213c2f2be02c633ec2e2038 by Irit Katriel in branch 'main':
bpo-45292: [PEP-654] add except* (GH-29581)
https://github.com/python/cpython/commit/d60457a6673cf0263213c2f2be02c633ec2e2038


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45292>
_______________________________________

From report at bugs.python.org  Tue Dec 14 11:58:45 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Tue, 14 Dec 2021 16:58:45 +0000
Subject: [issue46074] deepfreeze should rehash all strings upon reset
Message-ID: <1639501125.0.0.728137663959.issue46074@roundup.psfhosted.org>


New submission from Guido van Rossum <guido at python.org>:

In https://github.com/python/cpython/pull/30096#discussion_r768802144 it is pointed out that the hash seed can be changed if the interpreter is reset.

To guard against this we need to force (re)calculation of all hash seeds in the generated code when the corresponding code object is retrieved. This can be done by adding extra code to the `_Py_get_<name>_toplevel()` functions. (Strings that are shared between code objects will have to be rehashed repeatedly -- no big deal.)

----------
components: Build
messages: 408550
nosy: gvanrossum
priority: normal
severity: normal
stage: test needed
status: open
title: deepfreeze should rehash all strings upon reset
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46074>
_______________________________________

From report at bugs.python.org  Tue Dec 14 12:03:45 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Tue, 14 Dec 2021 17:03:45 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1639501425.97.0.867890662066.issue23522@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Couldn't we just change the first occurrence of "central location" in the note to "a central location" and the second to "(different) central locations"? That would leave Steven's intention intact but satisfy those who read it as referring to *a single* central location.

----------
nosy: +gvanrossum
resolution: rejected -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Tue Dec 14 12:27:09 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 17:27:09 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639502829.26.0.850744754155.issue46063@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset 908fd691f96403a3c30d85c17dd74ed1f26a60fd by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46063: Add 'delay=True' to file handler initialization. (GH-30103) (GH-30104)
https://github.com/python/cpython/commit/908fd691f96403a3c30d85c17dd74ed1f26a60fd


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Tue Dec 14 12:27:26 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Tue, 14 Dec 2021 17:27:26 +0000
Subject: [issue46063] TimedRotatingFileHandler deletes wrong files
In-Reply-To: <1639397523.26.0.357602434319.issue46063@roundup.psfhosted.org>
Message-ID: <1639502846.55.0.066575976647.issue46063@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:


New changeset 17260e44b5ed3508e3c15f1b7ded761879e91d3e by Miss Islington (bot) in branch '3.9':
[3.9] bpo-46063: Add 'delay=True' to file handler initialization. (GH-30103) (GH-30105)
https://github.com/python/cpython/commit/17260e44b5ed3508e3c15f1b7ded761879e91d3e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46063>
_______________________________________

From report at bugs.python.org  Tue Dec 14 13:22:52 2021
From: report at bugs.python.org (Mark Shannon)
Date: Tue, 14 Dec 2021 18:22:52 +0000
Subject: [issue44525] Implement CALL_FUNCTION adaptive interpreter
 optimizations
In-Reply-To: <1624890138.2.0.824780513801.issue44525@roundup.psfhosted.org>
Message-ID: <1639506172.37.0.067026364275.issue44525@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 9f8f45144b6f0ad481e80570538cce89b414f7f9 by Mark Shannon in branch 'main':
bpo-44525: Split calls into PRECALL and CALL (GH-30011)
https://github.com/python/cpython/commit/9f8f45144b6f0ad481e80570538cce89b414f7f9


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44525>
_______________________________________

From report at bugs.python.org  Tue Dec 14 13:35:22 2021
From: report at bugs.python.org (=?utf-8?b?TWF0xJtqIFTDvcSN?=)
Date: Tue, 14 Dec 2021 18:35:22 +0000
Subject: [issue18467] argparse - problematic 'default' behavior
In-Reply-To: <1373927590.26.0.302211166373.issue18467@psf.upfronthosting.co.za>
Message-ID: <1639506922.61.0.0681268262448.issue18467@roundup.psfhosted.org>


Mat?j T?? <matej.tyc at gmail.com> added the comment:

Thanks for reaching out. I have no idea whether it helped me or not, sorry for not replying back in a timely manner :-(

I think that the feature request/bugreport originates from bad coding practices, when I wanted argparse to perform something more than just plain parsing of arguments into a data structure.

Nowadays I would tell myself to solve it by introducing a layer between argparse and the rest of the code without putting additional pressure on argparse.

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18467>
_______________________________________

From report at bugs.python.org  Tue Dec 14 13:36:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 18:36:48 +0000
Subject: [issue18467] argparse - problematic 'default' behavior
In-Reply-To: <1373927590.26.0.302211166373.issue18467@psf.upfronthosting.co.za>
Message-ID: <1639507008.56.0.979435580183.issue18467@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Thanks, I think we can close this then.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18467>
_______________________________________

From report at bugs.python.org  Tue Dec 14 14:11:03 2021
From: report at bugs.python.org (Mark Shannon)
Date: Tue, 14 Dec 2021 19:11:03 +0000
Subject: [issue44525] Implement CALL_FUNCTION adaptive interpreter
 optimizations
In-Reply-To: <1624890138.2.0.824780513801.issue44525@roundup.psfhosted.org>
Message-ID: <1639509063.05.0.0677923532647.issue44525@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
pull_requests: +28329
pull_request: https://github.com/python/cpython/pull/30107

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44525>
_______________________________________

From report at bugs.python.org  Tue Dec 14 14:29:54 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Tue, 14 Dec 2021 19:29:54 +0000
Subject: [issue45292] Implement PEP 654: Exception Groups
In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org>
Message-ID: <1639510194.17.0.94948182749.issue45292@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

We should have a discussion here about improvements that Mark Shannon would like to see, in particular to do more work in the compiler instead of the interpreter.

----------
nosy: +Mark.Shannon, gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45292>
_______________________________________

From report at bugs.python.org  Tue Dec 14 15:17:18 2021
From: report at bugs.python.org (graysky)
Date: Tue, 14 Dec 2021 20:17:18 +0000
Subject: [issue46070] broken subinterpreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639513038.74.0.992012625424.issue46070@roundup.psfhosted.org>


graysky <graysky at archlinux.us> added the comment:

While this is being evaluated, can someone give an opinion about the sanity of simply reverting https://hg.python.org/lookup/d0d29655ff for now in order to use 3.10.1?  Thanks.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Tue Dec 14 15:21:57 2021
From: report at bugs.python.org (Mark Shannon)
Date: Tue, 14 Dec 2021 20:21:57 +0000
Subject: [issue45292] Implement PEP 654: Exception Groups
In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org>
Message-ID: <1639513317.25.0.162597426296.issue45292@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:

PR 29581 resulted in a 1% slowdown, which is not terrible, but code not using except* should not be slowed down at all.

IMO, the way to avoid the slowdown is to implement except* using the existing instruction set (perhaps with a few minor additions)

We already implement try-finally, named except blocks and with statements without any complex bytecodes (except perhaps WITH_EXCEPT_START).

These used to involve a lot of state and more complex bytecodes. So it is possible to make these simplifications,
but it does take work.


There are a number of techniques we can use:

If any state is needed, push it to the stack as we do with `ctx.__exit__` in the with statement, and when pushing f_lasti in exception handlers.
Duplicate code paths when the semantics differ in different cases, as we do for finally blocks.
If anything is too complex to handle on the stack, put it in a temporary variable.
Be liberal in your use of virtual try-excepts (SETUP_FINALLY, POP_FINALLY pairs), as zero-cost exception handling should keep the cost down.


It may be too late for this advice, but if I were writing the `except*` implementation from scratch, I would:

1. Sketch out the pseudo Python that a try-except* would map to. This is a good opportunity to discover any design bugs that might result in undesirable behavior for corner cases.

2. Implement the translation in the compiler, not worrying about any redundancy or inefficiency, just correctness.

3. Look to improve the above, either in the compiler front-end, or by replacing inefficient code patterns in the back-end. Handling the optimization in the backend has the advantage that other code might benefit as well.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45292>
_______________________________________

From report at bugs.python.org  Tue Dec 14 15:45:24 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 14 Dec 2021 20:45:24 +0000
Subject: [issue45292] Implement PEP 654: Exception Groups
In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org>
Message-ID: <1639514724.72.0.692803501418.issue45292@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The PR adds two new opcodes. Let's start with the simpler of the two - JUMP_IF_NOT_EG_MATCH.   This is the exception-group variation on JUMP_IF_NOT_EXC_MATCH.

JUMP_IF_NOT_EXC_MATCH checks for a match by checking if the exception is of the given type. The result is boolean.

JUMP_IF_NOT_EG_MATCH checks for a matching by calling .split() on the exception group. The result is two exception groups (the matching part and the non-matching part).

Can we do this without a new opcode?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45292>
_______________________________________

From report at bugs.python.org  Tue Dec 14 15:57:42 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Tue, 14 Dec 2021 20:57:42 +0000
Subject: [issue46073] ast.unparse produces: 'FunctionDef' object has no
 attribute 'lineno' for valid module
In-Reply-To: <1639499930.14.0.345587742085.issue46073@roundup.psfhosted.org>
Message-ID: <1639515462.32.0.257931488159.issue46073@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Looks like this little patch can solve this problem:

```
   def unparse(ast_obj):
       unparser = _Unparser()
---    return unparser.visit(ast_obj)
+++    return unparser.visit(fix_missing_locations(ast_obj))
```

But, I am not sure we should call this helper here.

Another approach is to refactor `get_type_comment` function into something like this:

```
    def get_type_comment(self, node):
        comment = None
        if hasattr(node, 'lineno'):
            comment = self._type_ignores.get(node.lineno)
        comment = comment or node.type_comment
        if comment is not None:
            return f" # type: {comment}"
```

I feel like this is more suitable for this case. Even `ast.pyi` has this line:

```
    # TODO: Not all nodes have all of the following attributes
    lineno: int
    col_offset: int
```

So, I am going to propose a PR with the second option. Please, send your feedback!

----------
nosy: +sobolevn

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46073>
_______________________________________

From report at bugs.python.org  Tue Dec 14 15:58:48 2021
From: report at bugs.python.org (Sergei Maertens)
Date: Tue, 14 Dec 2021 20:58:48 +0000
Subject: [issue45339] concurrent.future.ThreadPoolExecutor should parameterize
 class used for threads
In-Reply-To: <1633084673.43.0.269469120691.issue45339@roundup.psfhosted.org>
Message-ID: <1639515528.79.0.621874339094.issue45339@roundup.psfhosted.org>


Sergei Maertens <sergeimaertens at gmail.com> added the comment:

I was looking for some way to be able to add a thread finalizer, a piece of code to be called when the thread pool shuts down and all threads need cleaning up. Glad I came across this issue, since the example of using a Thread subclass with a custom run (wrapped in a context manager) would fill my needs completely.

> What are examples of your some_important_context()? Is it important to call some code before destroying the thread?

I currently have a use case with a web-framework that has persistent DB connections - i.e. they span multiple HTTP requests. This also applies in the context of running a command-line script with said framework where database connections are opened.

We are calling external APIs (IO heavy), so using a ThreadPoolExecutor makes sense. However, since those "DB connection pools" are thread locals, we need to ensure that database connections are closed again to not leak resources.

The current workaround is to submit a job/function to the pool and have it close the database connections, which adds overhead since database connections are now opened and closed within the same thread that could have been re-used.

Using a context manager, we would be able to wrap the `super().run(...)` and close the database connections when the thread exits (succesfully or because of an Exception, even). This comes very close to having an `atexit` for individual threads.

Furthermore I like the idea of being able to provide the class as a context manager kwarg, but would also not be opposed to a class property specifying the Thread class to use - both would greatly enhance composability and are a cleaner solution than adding a finalizer option (similar to the `initializer` kwarg)

----------
nosy: +Sergei Maertens

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45339>
_______________________________________

From report at bugs.python.org  Tue Dec 14 16:06:00 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Tue, 14 Dec 2021 21:06:00 +0000
Subject: [issue46073] ast.unparse produces: 'FunctionDef' object has no
 attribute 'lineno' for valid module
In-Reply-To: <1639499930.14.0.345587742085.issue46073@roundup.psfhosted.org>
Message-ID: <1639515960.03.0.0610393299101.issue46073@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Moreover, there's always an option to pass `lineno` and `column` explicitly:

```
from ast import *

# if we build the module manually and try it directly
value = Module(
    body=[
        FunctionDef(
            name="items_needed",
            args=arguments(
                posonlyargs=[],
                args=[],
                kwonlyargs=[],
                kw_defaults=[],
                defaults=[],
            ),
            body=[Return(value=Constant(value="test"))],
            decorator_list=[],
            lineno=1,
            column=1,
        )
    ],
    type_ignores=[],
)

unparse(value)  # ok
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46073>
_______________________________________

From report at bugs.python.org  Tue Dec 14 16:08:16 2021
From: report at bugs.python.org (Nick)
Date: Tue, 14 Dec 2021 21:08:16 +0000
Subject: [issue46075] CookieJar.extract_cookies doesn't process cookies form
 local domains when domain is explicitly set in header
Message-ID: <1639516096.67.0.483308979986.issue46075@roundup.psfhosted.org>


New submission from Nick <keddad at yandex.ru>:

Apparently, CookieJar.extract_cookies doesn't process cookies form local domains which explicitly set domain in Set-Cookie header. That means that headers with domain specified, like "Set-Cookie: foo=baz; Domain=localhost;", are ignored. As far as I can tell, this might be actually part of the standard: https://stackoverflow.com/questions/1134290/cookies-on-localhost-with-explicit-domain/32210291#32210291 . However, it looks like other HTTP clients, including modern versions of both Chrome and Firefox do accept cookies from localhost with explicit domain=localhost, and this change doesn't appear to break existing software in any way. (simple POC to test behavior in browsers: https://gist.github.com/keddad/e2ce034f68b77e59077cdb1e887fa4a1). Maybe it would be best to also allow this behavior in Python?

----------
components: Library (Lib)
messages: 408564
nosy: keddad
priority: normal
severity: normal
status: open
title: CookieJar.extract_cookies doesn't process cookies form local domains when domain is explicitly set in header
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46075>
_______________________________________

From report at bugs.python.org  Tue Dec 14 16:12:37 2021
From: report at bugs.python.org (Nick)
Date: Tue, 14 Dec 2021 21:12:37 +0000
Subject: [issue46075] CookieJar.extract_cookies doesn't process cookies form
 local domains when domain is explicitly set in header
In-Reply-To: <1639516096.67.0.483308979986.issue46075@roundup.psfhosted.org>
Message-ID: <1639516357.79.0.500931815702.issue46075@roundup.psfhosted.org>


Change by Nick <keddad at yandex.ru>:


----------
keywords: +patch
pull_requests: +28330
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30108

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46075>
_______________________________________

From report at bugs.python.org  Tue Dec 14 16:14:03 2021
From: report at bugs.python.org (Brian Carlson)
Date: Tue, 14 Dec 2021 21:14:03 +0000
Subject: [issue46073] ast.unparse produces: 'FunctionDef' object has no
 attribute 'lineno' for valid module
In-Reply-To: <1639499930.14.0.345587742085.issue46073@roundup.psfhosted.org>
Message-ID: <1639516443.04.0.219671332453.issue46073@roundup.psfhosted.org>


Brian Carlson <briancarlson6174 at gmail.com> added the comment:

The second solution seems more optimal, in my opinion. I monkey patched the function like this in my own code:
```
def get_type_comment(self, node):
    comment = self._type_ignores.get(node.lineno) if hasattr(node, "lineno") else node.type_comment
    if comment is not None:
        return f" # type: {comment}"
```

Thanks!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46073>
_______________________________________

From report at bugs.python.org  Tue Dec 14 16:16:19 2021
From: report at bugs.python.org (Brian Carlson)
Date: Tue, 14 Dec 2021 21:16:19 +0000
Subject: [issue46073] ast.unparse produces: 'FunctionDef' object has no
 attribute 'lineno' for valid module
In-Reply-To: <1639499930.14.0.345587742085.issue46073@roundup.psfhosted.org>
Message-ID: <1639516579.86.0.263347013675.issue46073@roundup.psfhosted.org>


Brian Carlson <briancarlson6174 at gmail.com> added the comment:

I don't think passing `lineno` and `column` is preferred. It makes code generation harder because `lineno` and `column` are hard to know ahead of when code is being unparsed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46073>
_______________________________________

From report at bugs.python.org  Tue Dec 14 16:32:52 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Tue, 14 Dec 2021 21:32:52 +0000
Subject: [issue46073] ast.unparse produces: 'FunctionDef' object has no
 attribute 'lineno' for valid module
In-Reply-To: <1639499930.14.0.345587742085.issue46073@roundup.psfhosted.org>
Message-ID: <1639517572.45.0.0212068624511.issue46073@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Or, maybe this is a correct thing to do. Consider this case. Let's say we now check that `node` has `lineno` and exclude ones that don't.

Then, we write this test (in `Lib/test/test_unparse`):

```
    def test_unparse_nodes_without_lineno(self):
        # https://bugs.python.org/issue46073
        def create_module(ignores):
            return ast.Module(
                body=[
                    ast.FunctionDef(
                        name="items_needed",
                        args=ast.arguments(
                            posonlyargs=[], args=[],
                            kwonlyargs=[], kw_defaults=[], defaults=[],
                        ),
                        body=[ast.Pass()], decorator_list=[],
                    ),
                ],
                type_ignores=ignores,
            )

        ast1 = create_module([])
        self.assertASTEqual(ast1, ast.parse(ast.unparse(ast1)))

        ast2 = create_module([ast.TypeIgnore(lineno=1, tag='')])
        # This fill fail without `ast2 = ast.fix_missing_locations(ast2)`
        self.assertASTEqual(ast2, ast.parse(ast.unparse(ast2), type_comments=True))
```

In this case the second `assert` will fail, because the resulting codes would be different:

```
# "original"
def items_needed():  # type: ignore
    pass

# unparsed
def items_needed():
    pass
```

So, basically users will get different code. Which is not a good thing.

So, maybe raising an error that some `node` does not have `lineno` is good after all?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46073>
_______________________________________

From report at bugs.python.org  Tue Dec 14 16:38:04 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Tue, 14 Dec 2021 21:38:04 +0000
Subject: [issue46070] broken subinterpreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639517884.02.0.278828506346.issue46070@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

That was a fix for GH-17350, which might need to be reverted as well.

Victor, could you take another look at GH-17350? I must admit I (still) don't understand this change; what would break if it was reverted (along with the fixup from bpo-44050)?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Tue Dec 14 16:41:13 2021
From: report at bugs.python.org (Steve Dower)
Date: Tue, 14 Dec 2021 21:41:13 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639518073.28.0.398039895344.issue46028@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

Does the first venv's 'python' link to python3[.11]? If so, maybe _base_executable should be based on real_executable's filename rather than executable (that is, *after* resolving symlinks rather than before).

I don't *think* that will cause any issues, and it shouldn't be any more expensive to compute. Only has to change for when a pyvenv.cfg is detected I think.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Tue Dec 14 16:57:38 2021
From: report at bugs.python.org (coroa)
Date: Tue, 14 Dec 2021 21:57:38 +0000
Subject: [issue29699] shutil.rmtree should not fail with FileNotFoundError
 (race condition)
In-Reply-To: <1488481944.03.0.0307704051627.issue29699@psf.upfronthosting.co.za>
Message-ID: <1639519058.74.0.237704605528.issue29699@roundup.psfhosted.org>


coroa <coroa at posteo.de> added the comment:

Just realised that the "race condition" is triggered consistently on Mac OSX machines working on non-Mac filesystems, where they store extended attributes like last access time in meta files with a `._` prefix. These files are listed by `os.scandir` after their original files and are removed, as soon as the original file is unlinked.

Ie. a test.txt, ._test.txt pair will always raise FileNotFoundError for ._test.txt since the file system driver itself already removed it when the unlink on test.txt was executed.

Refer also to https://stackoverflow.com/a/70355470/2873952.

Current status seems to be:
1. https://bugs.python.org/issue29699 and https://bugs.python.org/issue37260 are duplicates.
2. https://github.com/python/cpython/pull/13580 linked from here has been closed due to lack of unit tests (but with the possibility to re-open after providing those)
3. https://github.com/python/cpython/pull/14064 is still open and seems to be mostly the same patch, does have unit tests and awaiting a second review.

What is the next step?

----------
nosy: +coroa
versions:  -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29699>
_______________________________________

From report at bugs.python.org  Tue Dec 14 17:13:19 2021
From: report at bugs.python.org (Alex Waygood)
Date: Tue, 14 Dec 2021 22:13:19 +0000
Subject: [issue25864] collections.abc.Mapping should include a __reversed__
 that raises TypeError
In-Reply-To: <1450150718.99.0.697293755498.issue25864@psf.upfronthosting.co.za>
Message-ID: <1639519999.16.0.498176772109.issue25864@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

The proposed patch appears to have been implemented in https://github.com/python/cpython/commit/97c1adf3935234da716d3289b85f72dcd67e90c2, and there has been no discussion for five years. I think this can now be closed.

----------
nosy: +AlexWaygood
resolution:  -> fixed
stage: patch review -> resolved
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25864>
_______________________________________

From report at bugs.python.org  Tue Dec 14 17:16:01 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Tue, 14 Dec 2021 22:16:01 +0000
Subject: [issue46074] deepfreeze should rehash all strings upon reset
In-Reply-To: <1639501125.0.0.728137663959.issue46074@roundup.psfhosted.org>
Message-ID: <1639520161.48.0.946218215482.issue46074@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Never mind, this was based on incorrect information. See subsequent messages in the linked thread.

----------
resolution:  -> not a bug
stage: test needed -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46074>
_______________________________________

From report at bugs.python.org  Tue Dec 14 17:25:11 2021
From: report at bugs.python.org (Alex Waygood)
Date: Tue, 14 Dec 2021 22:25:11 +0000
Subject: [issue46076] Document using __slots__ to provide per-attribute
 docstrings
Message-ID: <1639520711.47.0.591169978723.issue46076@roundup.psfhosted.org>


New submission from Alex Waygood <Alex.Waygood at Gmail.com>:

The ability to add docstrings for individual attributes, by using a dictionary for __slots__ was added in Issue36326. This is a fantastic feature, and deserves better documentation. It appears to currently only be documented in the "What's New" entry for Python 3.8: https://docs.python.org/3/whatsnew/3.8.html#inspect.

Moreover, the data model documentation currently states the following regarding using a mapping to specify __slots__:

"""
Any non-string iterable may be assigned to __slots__. Mappings may also be used; however, in the future, special meaning may be assigned to the values corresponding to each key.
"""

This is arguably now incorrect. A special meaning has been assigned to the values corresponding to each key: the values can be used for per-attribute docstrings.

----------
assignee: docs at python
components: Documentation
messages: 408573
nosy: AlexWaygood, docs at python, rhettinger
priority: normal
severity: normal
status: open
title: Document using __slots__ to provide per-attribute docstrings
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46076>
_______________________________________

From report at bugs.python.org  Tue Dec 14 17:30:39 2021
From: report at bugs.python.org (Alex Waygood)
Date: Tue, 14 Dec 2021 22:30:39 +0000
Subject: [issue46076] Document using __slots__ to provide per-attribute
 docstrings
In-Reply-To: <1639520711.47.0.591169978723.issue46076@roundup.psfhosted.org>
Message-ID: <1639521039.64.0.729484891498.issue46076@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
keywords: +patch
pull_requests: +28332
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30109

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46076>
_______________________________________

From report at bugs.python.org  Tue Dec 14 17:58:02 2021
From: report at bugs.python.org (Batuhan Taskaya)
Date: Tue, 14 Dec 2021 22:58:02 +0000
Subject: [issue44896] AttributeError in ast.unparse
In-Reply-To: <1628731580.95.0.847749574283.issue44896@roundup.psfhosted.org>
Message-ID: <1639522682.5.0.475992665322.issue44896@roundup.psfhosted.org>


Change by Batuhan Taskaya <isidentical at gmail.com>:


----------
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44896>
_______________________________________

From report at bugs.python.org  Tue Dec 14 17:58:20 2021
From: report at bugs.python.org (Batuhan Taskaya)
Date: Tue, 14 Dec 2021 22:58:20 +0000
Subject: [issue46073] ast.unparse produces: 'FunctionDef' object has no
 attribute 'lineno' for valid module
In-Reply-To: <1639499930.14.0.345587742085.issue46073@roundup.psfhosted.org>
Message-ID: <1639522700.95.0.078109716479.issue46073@roundup.psfhosted.org>


Batuhan Taskaya <isidentical at gmail.com> added the comment:

>From the first glance, this seems like a duplicate of bpo-44896.

----------
nosy: +BTaskaya

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46073>
_______________________________________

From report at bugs.python.org  Tue Dec 14 17:59:44 2021
From: report at bugs.python.org (Brett Cannon)
Date: Tue, 14 Dec 2021 22:59:44 +0000
Subject: [issue31370] Remove support for threads-less builds
In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za>
Message-ID: <1639522784.77.0.951439347884.issue31370@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:

I am not opening a new discussion; this is just recording this fact here as it has come up in other places on the internet.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31370>
_______________________________________

From report at bugs.python.org  Tue Dec 14 18:00:51 2021
From: report at bugs.python.org (Brett Cannon)
Date: Tue, 14 Dec 2021 23:00:51 +0000
Subject: [issue40059] Provide a toml module in the standard library
In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org>
Message-ID: <1639522851.51.0.593082205652.issue40059@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:

I opened https://github.com/python/steering-council/issues/92 for the SC to discuss stdlib additions in case I am not re-elected.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40059>
_______________________________________

From report at bugs.python.org  Tue Dec 14 18:39:00 2021
From: report at bugs.python.org (Craig Holmquist)
Date: Tue, 14 Dec 2021 23:39:00 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639525140.7.0.992399566579.issue46006@roundup.psfhosted.org>


Change by Craig Holmquist <craigholm at gmail.com>:


----------
nosy: +craigh

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Tue Dec 14 19:50:55 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Wed, 15 Dec 2021 00:50:55 +0000
Subject: [issue46059] Typo in match Statement example
In-Reply-To: <1639356396.07.0.913283855262.issue46059@roundup.psfhosted.org>
Message-ID: <1639529455.41.0.692028824912.issue46059@roundup.psfhosted.org>


Vivek Vashist <vivekvashist at gmail.com> added the comment:

Thanks for sorting this out Alex :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46059>
_______________________________________

From report at bugs.python.org  Tue Dec 14 20:22:53 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Wed, 15 Dec 2021 01:22:53 +0000
Subject: [issue46056] Cannot use virtual environment on Windows 10 in
 corporate security settings
In-Reply-To: <1639313116.18.0.364057363878.issue46056@roundup.psfhosted.org>
Message-ID: <1639531373.02.0.0756825563915.issue46056@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:

While the discussion is interesting for some who are trying to work around security policy mechanisms, we can't control what policies people enforce upon themselves that make their machines useless for software development.  Marking as not a bug.

The normal thing to do is to obtain an exemption to policies from the corporate security org managing your machine(s) because you have a business need for it.

If you have specific implementation changes that would make life easier, file specific issues for those to be addressed.  (ex: PEP 582 is pretty specific - and there is a package manager https://pdm.fming.dev/ that supports it)

----------
nosy: +gregory.p.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46056>
_______________________________________

From report at bugs.python.org  Tue Dec 14 20:40:48 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Wed, 15 Dec 2021 01:40:48 +0000
Subject: [issue46077] Include sha256 hashes of release downloads in
 announcement communications
Message-ID: <1639532448.32.0.197660327997.issue46077@roundup.psfhosted.org>


New submission from Gregory P. Smith <greg at krypto.org>:

The announcement email list (https://mail.python.org/archives/list/python-announce-list at python.org/) and other places we make announcements beyond just the release pages like https://www.python.org/downloads/release/python-3101/ should include a list of sha256 hashes of the release binaries in the announcement text.

This serves as an alternative confirmation that nothing has changed as such announcements are widely distributed and archived by independent parties and individuals and can thus convey a level of trust that a hash listed on the downloads page cannot (where an attacker would simply modify both).

Yes there is a gpg signature on the downloads. I encourage people to use that.  But this provides an alternate distributed mechanism to verify that nothing has changed at all since the release announcement.  Something a gpg signature cannot fully do (consider this protection against the possibility of new signed binary being put into its place by a compromised key/signer/builder/RM before anyone happens to notice and poke around).

A simple table of:

filename.tar.gz | sha256 hash
filename.msi | sha256 hash
filename.dmg | sha256 hash
...

At the end of the announcement email/post would suffice.

Less of an issue on source packages as those can be verified against the git repo. But it's nice for people to know if binaries change without an announcement and explanation and is easy for us to provide.

Bonus points if the release announcement email body itself is signed (if that is even feasible per our release signing GPG key management).

[context: see recent python-dev subject: Python release announcement format]

----------
messages: 408579
nosy: gregory.p.smith
priority: deferred blocker
severity: normal
status: open
title: Include sha256 hashes of release downloads in announcement communications
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46077>
_______________________________________

From report at bugs.python.org  Tue Dec 14 21:37:47 2021
From: report at bugs.python.org (Samuel Marks)
Date: Wed, 15 Dec 2021 02:37:47 +0000
Subject: =?utf-8?q?=5Bissue46078=5D_=60ast=2Eunparse=60_fails_on_=60class_C=3A_i?=
 =?utf-8?q?=3A_int=60=E2=80=A6_convert_broken_from_=60ast=2EAnnAssign=60_t?=
 =?utf-8?q?o_=60ast=2EAssign=60?=
Message-ID: <1639535867.25.0.73298480081.issue46078@roundup.psfhosted.org>


New submission from Samuel Marks <samuelmarks at gmail.com>:

astor fails with:
```
  File "python3.8/site-packages/astor/code_gen.py", line 63, in to_source
    generator.visit(node)
  File "python3.8/site-packages/astor/node_util.py", line 143, in visit
    return visitor(node)
  File "python3.8/site-packages/astor/code_gen.py", line 878, in visit_Module
    self.write(*node.body)
  File "python3.8/site-packages/astor/code_gen.py", line 178, in write
    visit(item)
  File "python3.8/site-packages/astor/node_util.py", line 143, in visit
    return visitor(node)
  File "python3.8/site-packages/astor/code_gen.py", line 364, in visit_ClassDef
    self.body(node.body)
  File "python3.8/site-packages/astor/code_gen.py", line 226, in body
    self.write(*statements)
  File "python3.8/site-packages/astor/code_gen.py", line 178, in write
    visit(item)
  File "python3.8/site-packages/astor/node_util.py", line 143, in visit
    return visitor(node)
  File "python3.8/site-packages/astor/code_gen.py", line 293, in visit_Assign
    self.visit(node.value)
  File "python3.8/site-packages/astor/node_util.py", line 143, in visit
    return visitor(node)
  File "python3.8/site-packages/astor/node_util.py", line 137, in abort_visit
    raise AttributeError(msg % node.__class__.__name__)
AttributeError: No defined handler for node of type NoneType
```

Whereas the now builtin to Python (3.9+) `ast.unparse` gives:
```
File "3.10/lib/python3.10/ast.py", line 1673, in unparse
    return unparser.visit(ast_obj)
  File "3.10/lib/python3.10/ast.py", line 807, in visit
    self.traverse(node)
  File "3.10/lib/python3.10/ast.py", line 798, in traverse
    super().visit(node)
  File "3.10/lib/python3.10/ast.py", line 410, in visit
    return visitor(node)
  File "3.10/lib/python3.10/ast.py", line 822, in visit_Module
    self._write_docstring_and_traverse_body(node)
  File "3.10/lib/python3.10/ast.py", line 815, in _write_docstring_and_traverse_body
    self.traverse(node.body)
  File "3.10/lib/python3.10/ast.py", line 796, in traverse
    self.traverse(item)
  File "3.10/lib/python3.10/ast.py", line 798, in traverse
    super().visit(node)
  File "3.10/lib/python3.10/ast.py", line 410, in visit
    return visitor(node)
  File "3.10/lib/python3.10/ast.py", line 1001, in visit_ClassDef
    self._write_docstring_and_traverse_body(node)
  File "3.10/lib/python3.10/ast.py", line 815, in _write_docstring_and_traverse_body
    self.traverse(node.body)
  File "3.10/lib/python3.10/ast.py", line 796, in traverse
    self.traverse(item)
  File "3.10/lib/python3.10/ast.py", line 798, in traverse
    super().visit(node)
  File "3.10/lib/python3.10/ast.py", line 410, in visit
    return visitor(node)
  File "3.10/lib/python3.10/ast.py", line 863, in visit_Assign
    self.traverse(node.value)
  File "3.10/lib/python3.10/ast.py", line 798, in traverse
    super().visit(node)
  File "3.10/lib/python3.10/ast.py", line 410, in visit
    return visitor(node)
  File "3.10/lib/python3.10/ast.py", line 414, in generic_visit
    for field, value in iter_fields(node):
  File "3.10/lib/python3.10/ast.py", line 252, in iter_fields
    for field in node._fields:
AttributeError: 'NoneType' object has no attribute '_fields'
```

Found it when I tried to unparse previously parsed:
```py
class C:
    i: int
```

Found in reality when trying to parse then emit:
- https://github.com/tensorflow/tensorflow/blob/ba146843/tensorflow/compiler/xla/python/xla_client.py#L402-L413


Which is creating this:
```
ast.Assign(targets=[ast.Name(id="interior_padding")],
           type_comment="int",
           value=None)
```

(one thing my library does is convert betwixt `ast.Assign` and `ast.AnnAssign`? later I'll be doing more interesting variable type tracing to generate big `typing.Union` of all possible types each variable may have? but if it finds `None` then it will infer `typing.Optional`.)

Here is my `ast.NodeTransformer` override for `visit_AnnAssign`: https://github.com/offscale/cdd-python/blob/968507e/cdd/doctrans_utils.py#L111-L131

Is there some way of rewriting an `ast.AnnAssign` to `ast.Assign` without losing type information?

----------
messages: 408580
nosy: samuelmarks
priority: normal
severity: normal
status: open
title: `ast.unparse` fails on `class C: i: int`? convert broken from `ast.AnnAssign` to `ast.Assign`
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46078>
_______________________________________

From report at bugs.python.org  Tue Dec 14 22:00:40 2021
From: report at bugs.python.org (theeshallnotknowethme)
Date: Wed, 15 Dec 2021 03:00:40 +0000
Subject: =?utf-8?q?=5Bissue46078=5D_=60ast=2Eunparse=60_fails_on_=60class_C=3A_i?=
 =?utf-8?q?=3A_int=60=E2=80=A6_convert_broken_from_=60ast=2EAnnAssign=60_t?=
 =?utf-8?q?o_=60ast=2EAssign=60?=
In-Reply-To: <1639535867.25.0.73298480081.issue46078@roundup.psfhosted.org>
Message-ID: <1639537240.02.0.533022391813.issue46078@roundup.psfhosted.org>


theeshallnotknowethme <nohackingofkrowten at gmail.com> added the comment:

This seems like just a problem of your library instead of a problem with Python. Are you sure this is the right place you're in?

----------
nosy: +February291948

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46078>
_______________________________________

From report at bugs.python.org  Tue Dec 14 22:07:28 2021
From: report at bugs.python.org (Joshua Insel)
Date: Wed, 15 Dec 2021 03:07:28 +0000
Subject: [issue45959] Teach pprint about dict views
In-Reply-To: <1638428816.23.0.206050902249.issue45959@roundup.psfhosted.org>
Message-ID: <1639537648.22.0.731250680818.issue45959@roundup.psfhosted.org>


Joshua Insel <joshinsel63 at gmail.com> added the comment:

According to the documentation for pprint, it is supposed to print objects on a single line if possible. See the second paragraph here: https://docs.python.org/3/library/pprint.html

----------
nosy: +joshinsel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45959>
_______________________________________

From report at bugs.python.org  Tue Dec 14 22:37:52 2021
From: report at bugs.python.org (Samuel Marks)
Date: Wed, 15 Dec 2021 03:37:52 +0000
Subject: =?utf-8?q?=5Bissue46078=5D_=60ast=2Eunparse=60_fails_on_=60class_C=3A_i?=
 =?utf-8?q?=3A_int=60=E2=80=A6_convert_broken_from_=60ast=2EAnnAssign=60_t?=
 =?utf-8?q?o_=60ast=2EAssign=60?=
In-Reply-To: <1639535867.25.0.73298480081.issue46078@roundup.psfhosted.org>
Message-ID: <1639539472.68.0.197748582764.issue46078@roundup.psfhosted.org>


Samuel Marks <samuelmarks at gmail.com> added the comment:

Just fixed the issue by using this value:
```py
"```(None)```" if sys.version_info[:2] >= (3, 9) else "```None```"
```

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46078>
_______________________________________

From report at bugs.python.org  Tue Dec 14 22:45:07 2021
From: report at bugs.python.org (Christopher Hunt)
Date: Wed, 15 Dec 2021 03:45:07 +0000
Subject: [issue37701] shutil.copyfile raises SpecialFileError for symlink to
 fifo
In-Reply-To: <1564375011.26.0.591034083368.issue37701@roundup.psfhosted.org>
Message-ID: <1639539907.01.0.209472229047.issue37701@roundup.psfhosted.org>


Christopher Hunt <chrahunt at gmail.com> added the comment:

> I expect it to fail if follow_symlinks is True, which is the default value. I expect it to succeed with follow_symlinks=False, which should create a shallow copy of just the symlink, regardless of its target.

I agree, thanks for the correction.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37701>
_______________________________________

From report at bugs.python.org  Wed Dec 15 01:10:31 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Wed, 15 Dec 2021 06:10:31 +0000
Subject: [issue46079] Broken URL in tutorial
Message-ID: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org>


New submission from Vivek Vashist <vivekvashist at gmail.com>:

URL: http://tycho.usno.navy.mil/cgi-bin/timer.pl is broken in the example 
https://docs.python.org/3/tutorial/stdlib.html#internet-access

> curl -v http://tycho.usno.navy.mil/cgi-bin/timer.pl
* Could not resolve host: tycho.usno.navy.mil
* Closing connection 0
curl: (6) Could not resolve host: tycho.usno.navy.mil

----------
assignee: docs at python
components: Documentation
messages: 408585
nosy: docs at python, vivekvashist
priority: normal
severity: normal
status: open
title: Broken URL in tutorial
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46079>
_______________________________________

From report at bugs.python.org  Wed Dec 15 01:29:31 2021
From: report at bugs.python.org (Felix Fontein)
Date: Wed, 15 Dec 2021 06:29:31 +0000
Subject: [issue46080] argparse.BooleanOptionalAction with
 default=argparse.SUPPRESS and help specified crashes
Message-ID: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org>


New submission from Felix Fontein <felix at fontein.de>:

When argparse.BooleanOptionalAction is used with default=argparse.SUPPRESS and help is specified, trying to display --help results in a crash.

Reproducer:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--test', action=argparse.BooleanOptionalAction, default=argparse.SUPPRESS, help='Foo')
parser.parse_args()

Result when running 'python t.py --help':

Traceback (most recent call last):
  File "/path/to/t.py", line 4, in <module>
    parser.parse_args()
  File "/usr/lib/python3.10/argparse.py", line 1821, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.10/argparse.py", line 1854, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.10/argparse.py", line 2063, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.10/argparse.py", line 2003, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.10/argparse.py", line 1931, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib/python3.10/argparse.py", line 1095, in __call__
    parser.print_help()
  File "/usr/lib/python3.10/argparse.py", line 2551, in print_help
    self._print_message(self.format_help(), file)
  File "/usr/lib/python3.10/argparse.py", line 2535, in format_help
    return formatter.format_help()
  File "/usr/lib/python3.10/argparse.py", line 283, in format_help
    help = self._root_section.format_help()
  File "/usr/lib/python3.10/argparse.py", line 214, in format_help
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.10/argparse.py", line 214, in <listcomp>
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.10/argparse.py", line 214, in format_help
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.10/argparse.py", line 214, in <listcomp>
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.10/argparse.py", line 530, in _format_action
    help_text = self._expand_help(action)
  File "/usr/lib/python3.10/argparse.py", line 627, in _expand_help
    return self._get_help_string(action) % params
KeyError: 'default'

The problem is that in https://github.com/python/cpython/blob/f54fee7f37563fbd569596cf94aad023ac6c3179/Lib/argparse.py#L879, default isn't tested for SUPPRESS as well. I've prepared a patch to fix that and will push it to GitHub soon.

(I've experienced the crash with Python 3.9 and 3.10; the test I've created also crashes for the current main branch, so I guess that means that Python 3.11 is also affected. I haven't tested older Python versions before 3.9.)

----------
components: Library (Lib)
messages: 408586
nosy: felixfontein
priority: normal
severity: normal
status: open
title: argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified crashes
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46080>
_______________________________________

From report at bugs.python.org  Wed Dec 15 01:35:08 2021
From: report at bugs.python.org (Felix Fontein)
Date: Wed, 15 Dec 2021 06:35:08 +0000
Subject: [issue46080] argparse.BooleanOptionalAction with
 default=argparse.SUPPRESS and help specified crashes
In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org>
Message-ID: <1639550108.63.0.62104811598.issue46080@roundup.psfhosted.org>


Change by Felix Fontein <felix at fontein.de>:


----------
keywords: +patch
pull_requests: +28333
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30111

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46080>
_______________________________________

From report at bugs.python.org  Wed Dec 15 01:36:04 2021
From: report at bugs.python.org (Felix Fontein)
Date: Wed, 15 Dec 2021 06:36:04 +0000
Subject: [issue46080] argparse.BooleanOptionalAction with
 default=argparse.SUPPRESS and help specified crashes
In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org>
Message-ID: <1639550164.42.0.39661588068.issue46080@roundup.psfhosted.org>


Change by Felix Fontein <felix at fontein.de>:


----------
type:  -> crash

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46080>
_______________________________________

From report at bugs.python.org  Wed Dec 15 01:41:16 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 15 Dec 2021 06:41:16 +0000
Subject: [issue25864] collections.abc.Mapping should include a __reversed__
 that raises TypeError
In-Reply-To: <1450150718.99.0.697293755498.issue25864@psf.upfronthosting.co.za>
Message-ID: <1639550476.37.0.160478319103.issue25864@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25864>
_______________________________________

From report at bugs.python.org  Wed Dec 15 03:21:42 2021
From: report at bugs.python.org (hongweipeng)
Date: Wed, 15 Dec 2021 08:21:42 +0000
Subject: [issue38085] Interrupting class creation in __init_subclass__ may
 lead to incorrect isinstance() and issubclass() results
In-Reply-To: <1568106581.16.0.558052842785.issue38085@roundup.psfhosted.org>
Message-ID: <1639556502.55.0.631447195101.issue38085@roundup.psfhosted.org>


Change by hongweipeng <hongweichen8888 at sina.com>:


----------
keywords: +patch
pull_requests: +28335
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30112

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38085>
_______________________________________

From report at bugs.python.org  Wed Dec 15 03:33:37 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 15 Dec 2021 08:33:37 +0000
Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library"
In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org>
Message-ID: <1639557217.94.0.567248033874.issue46079@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
title: Broken URL in tutorial -> [doc] Broken URL in "Brief Tour of the Standard Library"
type:  -> behavior
versions: +Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46079>
_______________________________________

From report at bugs.python.org  Wed Dec 15 03:38:11 2021
From: report at bugs.python.org (Ram Rachum)
Date: Wed, 15 Dec 2021 08:38:11 +0000
Subject: [issue46081] Document the msg argument for assertRaises
Message-ID: <1639557491.44.0.830591969979.issue46081@roundup.psfhosted.org>


New submission from Ram Rachum <ram at rachum.com>:

The `msg` argument to the `assertRaises` function isn't documented. The documentation should say what this argument does.

----------
assignee: docs at python
components: Documentation
messages: 408587
nosy: cool-RR, docs at python
priority: normal
severity: normal
status: open
title: Document the msg argument for assertRaises
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46081>
_______________________________________

From report at bugs.python.org  Wed Dec 15 03:39:51 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 08:39:51 +0000
Subject: [issue46080] argparse.BooleanOptionalAction with
 default=argparse.SUPPRESS and help specified crashes
In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org>
Message-ID: <1639557591.56.0.123653223889.issue46080@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Changing type. Crash is typically segfault or hang in c code rather than an exception.

----------
nosy: +iritkatriel
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46080>
_______________________________________

From report at bugs.python.org  Wed Dec 15 03:49:37 2021
From: report at bugs.python.org (Yann Droneaud)
Date: Wed, 15 Dec 2021 08:49:37 +0000
Subject: [issue46077] Include sha256 hashes of release downloads in
 announcement communications
In-Reply-To: <1639532448.32.0.197660327997.issue46077@roundup.psfhosted.org>
Message-ID: <1639558177.12.0.0727896555976.issue46077@roundup.psfhosted.org>


Change by Yann Droneaud <yann at droneaud.fr>:


----------
nosy: +ydroneaud

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46077>
_______________________________________

From report at bugs.python.org  Wed Dec 15 04:20:05 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 15 Dec 2021 09:20:05 +0000
Subject: [issue46081] Document the msg argument for assertRaises
In-Reply-To: <1639557491.44.0.830591969979.issue46081@roundup.psfhosted.org>
Message-ID: <1639560005.44.0.0869178734918.issue46081@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
versions:  -Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46081>
_______________________________________

From report at bugs.python.org  Wed Dec 15 04:34:07 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 09:34:07 +0000
Subject: [issue45292] Implement PEP 654: Exception Groups
In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org>
Message-ID: <1639560847.01.0.732090103149.issue45292@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The second opcode that the PR adds is PREP_RERAISE_STAR.

This opcode takes a list that contains:
1. all the exceptions that were raised in the executed except* clauses
2. the unmatched part of the exception group

It constructs the exception group that needs to be raised at the end.  This is done through a fairly complex operation on the BaseExceptionGroup, which merges the re-raised exceptions into the same nesting structure they had in the original exception group, so that

try:
   raise eg
except* ValueError:
   raise
except* TypeError:
   raise

is equivalent to just 'raise eg'.


Is there any overlap with existing opcodes?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45292>
_______________________________________

From report at bugs.python.org  Wed Dec 15 04:39:41 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 09:39:41 +0000
Subject: [issue45292] Implement PEP 654: Exception Groups
In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org>
Message-ID: <1639561181.18.0.703452098122.issue45292@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

The way these two opcodes are combined by the compiler to implement except* is described in the pseudo code here: 

https://github.com/python/cpython/pull/29581#issuecomment-975660029

except* uses JUMP_IF_NOT_EG_MATCH. The excepts (not-*) that collect exceptions raised in the except* clauses are virtual.

The do_reraise_star at the end is PREP_RERAISE_STAR followed by POP_EXCEPT_AND_RERAISE.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45292>
_______________________________________

From report at bugs.python.org  Wed Dec 15 04:47:05 2021
From: report at bugs.python.org (arian-f)
Date: Wed, 15 Dec 2021 09:47:05 +0000
Subject: [issue42209] Incorrect line reported in syntax error
In-Reply-To: <1604071774.71.0.0589140009748.issue42209@roundup.psfhosted.org>
Message-ID: <1639561625.4.0.466033871644.issue42209@roundup.psfhosted.org>


arian-f <arian.sanusi at flisom.com> added the comment:

There are still variations of this issue in python 3.10 - the line nr is correct - in script attached it's line 2 (the attached script is otherwise the same): 

    f'{ 1_a }'

resulting in:

  File "test.py", line 1
    ( 1_a )
       ^
SyntaxError: invalid decimal literal

or is this a different but similar bug? Can this bug be reopened or should I file a new bug?

> python -VV
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec  6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)]

----------
nosy: +arian-f
versions: +Python 3.10 -Python 3.8
Added file: https://bugs.python.org/file50491/test.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42209>
_______________________________________

From report at bugs.python.org  Wed Dec 15 05:08:37 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 10:08:37 +0000
Subject: [issue26952] argparse help formatter raises IndexError
In-Reply-To: <1462374887.67.0.462060112057.issue26952@psf.upfronthosting.co.za>
Message-ID: <1639562917.46.0.60985281169.issue26952@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 86de99588db3beff964137f4fe27dd1077a09b35 by Irit Katriel in branch 'main':
bpo-26952: [argparse] clearer error when formatting an empty mutually? (GH-30099)
https://github.com/python/cpython/commit/86de99588db3beff964137f4fe27dd1077a09b35


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26952>
_______________________________________

From report at bugs.python.org  Wed Dec 15 05:08:44 2021
From: report at bugs.python.org (miss-islington)
Date: Wed, 15 Dec 2021 10:08:44 +0000
Subject: [issue26952] argparse help formatter raises IndexError
In-Reply-To: <1462374887.67.0.462060112057.issue26952@psf.upfronthosting.co.za>
Message-ID: <1639562924.76.0.424976727433.issue26952@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +28336
pull_request: https://github.com/python/cpython/pull/30114

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26952>
_______________________________________

From report at bugs.python.org  Wed Dec 15 05:08:49 2021
From: report at bugs.python.org (miss-islington)
Date: Wed, 15 Dec 2021 10:08:49 +0000
Subject: [issue26952] argparse help formatter raises IndexError
In-Reply-To: <1462374887.67.0.462060112057.issue26952@psf.upfronthosting.co.za>
Message-ID: <1639562929.07.0.0737740628789.issue26952@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28337
pull_request: https://github.com/python/cpython/pull/30115

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26952>
_______________________________________

From report at bugs.python.org  Wed Dec 15 05:30:22 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 15 Dec 2021 10:30:22 +0000
Subject: [issue46039] Break up the YIELD_FROM instruction.
In-Reply-To: <1639158532.51.0.938199888812.issue46039@roundup.psfhosted.org>
Message-ID: <1639564222.91.0.983591894655.issue46039@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 0b50a4f0cdee41a18fb4ba6e75569f9cfaceb39e by Mark Shannon in branch 'main':
bpo-46039: Split yield from in two (GH-30035)
https://github.com/python/cpython/commit/0b50a4f0cdee41a18fb4ba6e75569f9cfaceb39e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46039>
_______________________________________

From report at bugs.python.org  Wed Dec 15 05:36:14 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 15 Dec 2021 10:36:14 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639564574.99.0.288989954394.issue46072@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
keywords: +patch
pull_requests: +28338
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30116

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Wed Dec 15 05:59:37 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 15 Dec 2021 10:59:37 +0000
Subject: [issue44035] Regenerating the configure script fails even if
 dependencies are satisfied
In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org>
Message-ID: <1639565977.26.0.565894813372.issue44035@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28339
pull_request: https://github.com/python/cpython/pull/30117

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44035>
_______________________________________

From report at bugs.python.org  Wed Dec 15 06:18:36 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 15 Dec 2021 11:18:36 +0000
Subject: [issue31370] Remove support for threads-less builds
In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za>
Message-ID: <1639567116.1.0.769424711424.issue31370@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Either reopen the issue or open a new issue. Only people subscribed to this bug are aware of the recent comments. Closed issues are hidden from the bugs home page and from the default search.

If you consider that Python must again support thread-less platforms, IMO it's a new feature and a new issue must be opened.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31370>
_______________________________________

From report at bugs.python.org  Wed Dec 15 06:21:17 2021
From: report at bugs.python.org (aziz)
Date: Wed, 15 Dec 2021 11:21:17 +0000
Subject: [issue46082] type casting of bool
Message-ID: <1639567277.19.0.409904988292.issue46082@roundup.psfhosted.org>


New submission from aziz <p146111 at nu.edu.pk>:

>>> st = "True"
>>> bool(st)
True
>>> st = "False"
>>> bool(st)
True
>>> 
>>> stk = "False"
>>> bool(stk)
True
>>> eval(stk)
False

----------
components: 2to3 (2.x to 3.x conversion tool)
messages: 408595
nosy: aziz
priority: normal
severity: normal
status: open
title: type casting of bool
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46082>
_______________________________________

From report at bugs.python.org  Wed Dec 15 07:18:57 2021
From: report at bugs.python.org (Devourer Station)
Date: Wed, 15 Dec 2021 12:18:57 +0000
Subject: [issue45981] Get raw file name in bytes from ZipFile
In-Reply-To: <1638625166.93.0.299659631229.issue45981@roundup.psfhosted.org>
Message-ID: <1639570737.91.0.412178471507.issue45981@roundup.psfhosted.org>


Devourer Station <accelerator0099 at gmail.com> added the comment:

I do think providing a rawfile field in the ZipInfo struct helps.
As a library, ZipFile should let users know what they are dealing with.
Users can get data from zip files, and ZipFile shouldn't corrupt them.
I don't mean that we should provide everything in raw bytes.
What I mean is that DATA could be CONVERTED, but couldn't be CORRUPTED.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45981>
_______________________________________

From report at bugs.python.org  Wed Dec 15 07:20:25 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 12:20:25 +0000
Subject: [issue26952] argparse help formatter raises IndexError
In-Reply-To: <1462374887.67.0.462060112057.issue26952@psf.upfronthosting.co.za>
Message-ID: <1639570825.99.0.242368330416.issue26952@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 8e4c96295bd78ae5f70b908e5dbac0da7c4c21bd by Miss Islington (bot) in branch '3.10':
bpo-26952: [argparse] clearer error when formatting an empty mutually? (GH-30099) (GH-30114)
https://github.com/python/cpython/commit/8e4c96295bd78ae5f70b908e5dbac0da7c4c21bd


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26952>
_______________________________________

From report at bugs.python.org  Wed Dec 15 07:24:53 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 12:24:53 +0000
Subject: [issue26952] argparse help formatter raises IndexError
In-Reply-To: <1462374887.67.0.462060112057.issue26952@psf.upfronthosting.co.za>
Message-ID: <1639571093.97.0.637209418378.issue26952@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset f0b274d2e21e6c7c1c0f56464070108f9bd00d20 by Miss Islington (bot) in branch '3.9':
bpo-26952: [argparse] clearer error when formatting an empty mutually? (GH-30099) (GH-30115)
https://github.com/python/cpython/commit/f0b274d2e21e6c7c1c0f56464070108f9bd00d20


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26952>
_______________________________________

From report at bugs.python.org  Wed Dec 15 07:25:23 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 12:25:23 +0000
Subject: [issue26952] argparse help formatter raises IndexError
In-Reply-To: <1462374887.67.0.462060112057.issue26952@psf.upfronthosting.co.za>
Message-ID: <1639571123.0.0.68070315334.issue26952@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26952>
_______________________________________

From report at bugs.python.org  Wed Dec 15 07:34:29 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 15 Dec 2021 12:34:29 +0000
Subject: [issue46082] type casting of bool
In-Reply-To: <1639567277.19.0.409904988292.issue46082@roundup.psfhosted.org>
Message-ID: <1639571669.9.0.295707422886.issue46082@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Hi! Your message here is a little unclear. Are you proposing a new feature (an enhancement), or filing a bug report?

In either case, I'm afraid this behavior is very unlikely to change. In general, strings in Python are always considered truthy unless they are empty, even if they are the literal string "False" or "0". This is a very important principle in Python, and changing it would raise serious backwards-compatibility concerns.

You can read more about truth-value testing here: https://docs.python.org/3/library/stdtypes.html#truth-value-testing

----------
components:  -2to3 (2.x to 3.x conversion tool)
nosy: +AlexWaygood
status: open -> pending
type: enhancement -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46082>
_______________________________________

From report at bugs.python.org  Wed Dec 15 07:52:41 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 12:52:41 +0000
Subject: [issue17975] altinstall should not install libpython3.so (conflict
 between multiple $VERSIONs)
In-Reply-To: <1368542639.2.0.817126483539.issue17975@psf.upfronthosting.co.za>
Message-ID: <1639572761.97.0.56875099103.issue17975@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17975>
_______________________________________

From report at bugs.python.org  Wed Dec 15 08:09:13 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Wed, 15 Dec 2021 13:09:13 +0000
Subject: [issue46081] Document the msg argument for assertRaises
In-Reply-To: <1639557491.44.0.830591969979.issue46081@roundup.psfhosted.org>
Message-ID: <1639573753.54.0.916866117674.issue46081@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

The documentation at https://docs.python.org/3/library/unittest.html says "All the assert methods accept a msg argument that, if specified, is used as the error message on failure (see also longMessage). Note that the msg keyword argument can be passed to assertRaises(), assertRaisesRegex(), assertWarns(), assertWarnsRegex() only when they are used as a context manager."

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46081>
_______________________________________

From report at bugs.python.org  Wed Dec 15 08:48:53 2021
From: report at bugs.python.org (Ram Rachum)
Date: Wed, 15 Dec 2021 13:48:53 +0000
Subject: [issue46081] Document the msg argument for assertRaises
In-Reply-To: <1639557491.44.0.830591969979.issue46081@roundup.psfhosted.org>
Message-ID: <1639576133.8.0.350533390911.issue46081@roundup.psfhosted.org>


Ram Rachum <ram at rachum.com> added the comment:

Thanks, but people looking at a specific function might not guess that the documentation for one of its arguments is hiding somewhere on the long page. This is especially relevant with a confusing argument like `msg`, since it's tempting to think that this would be the message of the expected exception.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46081>
_______________________________________

From report at bugs.python.org  Wed Dec 15 08:53:48 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Wed, 15 Dec 2021 13:53:48 +0000
Subject: [issue46081] Document the msg argument for assertRaises
In-Reply-To: <1639557491.44.0.830591969979.issue46081@roundup.psfhosted.org>
Message-ID: <1639576428.94.0.81212546096.issue46081@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Suggestions to improve it are welcomed. I can't think of a way to do it without cluttering things up.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46081>
_______________________________________

From report at bugs.python.org  Wed Dec 15 08:59:10 2021
From: report at bugs.python.org (Roundup Robot)
Date: Wed, 15 Dec 2021 13:59:10 +0000
Subject: [issue41354] filecmp.cmp documentation does not match actual code
In-Reply-To: <1595316543.83.0.558279011146.issue41354@roundup.psfhosted.org>
Message-ID: <1639576750.55.0.340089000017.issue41354@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +28340
pull_request: https://github.com/python/cpython/pull/30120

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41354>
_______________________________________

From report at bugs.python.org  Wed Dec 15 09:28:02 2021
From: report at bugs.python.org (Ram Rachum)
Date: Wed, 15 Dec 2021 14:28:02 +0000
Subject: [issue46081] Document the msg argument for assertRaises
In-Reply-To: <1639557491.44.0.830591969979.issue46081@roundup.psfhosted.org>
Message-ID: <1639578482.11.0.326432019913.issue46081@roundup.psfhosted.org>


Ram Rachum <ram at rachum.com> added the comment:

I'd include that same message you quoted, minus the list of functions, on each and every one of the functions that have this argument.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46081>
_______________________________________

From report at bugs.python.org  Wed Dec 15 09:28:25 2021
From: report at bugs.python.org (Thomas Wouters)
Date: Wed, 15 Dec 2021 14:28:25 +0000
Subject: [issue46083] PyUnicode_FSConverter() has confusing reference semantics
Message-ID: <1639578505.04.0.502075999768.issue46083@roundup.psfhosted.org>


New submission from Thomas Wouters <thomas at python.org>:

The PyUnicode_FSConverter function has confusing reference semantics, and confusing documentation.

https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_FSConverter says the output argument "must be a PyBytesObject* which must be released when it is no longer used." That seems to suggest one must pass a PyBytesObject to it, and indeed one of the error paths assumes an object was passed (https://github.com/python/cpython/blob/main/Objects/unicodeobject.c#L4116-- 'addr' is called 'result' in the docs). Not passing a valid object would result in trying to DECREF NULL, or garbage. However, the function doesn't actually use the object, and later in the function overwrites the value *without* DECREFing it, so passing a valid object would in fact cause a leak.

I understand the function signature is the way it is so it can be used with PyArg_ParseTuple's O& format, but there are reasons to call it directly (e.g. with METH_O functions), and it would be nice if the semantics were more clear.

----------
components: C API
messages: 408604
nosy: twouters
priority: normal
severity: normal
status: open
title: PyUnicode_FSConverter() has confusing reference semantics
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46083>
_______________________________________

From report at bugs.python.org  Wed Dec 15 09:40:12 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 14:40:12 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1639579212.08.0.109764265535.issue45711@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28341
pull_request: https://github.com/python/cpython/pull/30122

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Wed Dec 15 09:44:52 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 15 Dec 2021 14:44:52 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639579492.97.0.366677856647.issue46006@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
pull_requests: +28342
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30123

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 09:45:48 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 15 Dec 2021 14:45:48 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639579548.85.0.766768925301.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

I created PR 30123 to fix _PyUnicode_EqualToASCIIId() and type update_slot() functions. I added comments explaining why we can no longer optimize the comparison of two interned string objects.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 09:49:20 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 15 Dec 2021 14:49:20 +0000
Subject: [issue40533] [subinterpreters] Don't share Python objects between
 interpreters
In-Reply-To: <1588777895.61.0.395509624257.issue40533@roundup.psfhosted.org>
Message-ID: <1639579760.52.0.946887055447.issue40533@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Until all Python stdlib C extensions and all third-party C extensions will be modified to no longer use and define static types and will stop shared Python objects between two interpreters, we can no longer micro-optimize the comparison of two interned strings by only comparing their memory addresse. See bpo-46006.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40533>
_______________________________________

From report at bugs.python.org  Wed Dec 15 09:54:30 2021
From: report at bugs.python.org (Jim Schwartz)
Date: Wed, 15 Dec 2021 14:54:30 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
Message-ID: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>


New submission from Jim Schwartz <jschwar at sbcglobal.net>:

Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not.  I've enclosed sample scripts that compare the two and have returned the results.  the windows 10 registry entry to extend the path names fixes this issue (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled set to 1).  I've enclosed a scripts that proved this occurs and can be used for testing. I have a script that does the same thing using os_walk, but I can't attach two scripts to this Issue.

----------
components: IO, Tests, Windows
files: test_dir_scan_dir.py
messages: 408607
nosy: jschwar313, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file50492/test_dir_scan_dir.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 09:59:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 14:59:48 +0000
Subject: [issue46080] argparse.BooleanOptionalAction with
 default=argparse.SUPPRESS and help specified raises exception
In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org>
Message-ID: <1639580388.91.0.984116940322.issue46080@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
title: argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified crashes -> argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified raises exception

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46080>
_______________________________________

From report at bugs.python.org  Wed Dec 15 10:03:46 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 15 Dec 2021 15:03:46 +0000
Subject: [issue44525] Implement CALL_FUNCTION adaptive interpreter
 optimizations
In-Reply-To: <1624890138.2.0.824780513801.issue44525@roundup.psfhosted.org>
Message-ID: <1639580626.61.0.769163921226.issue44525@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 3a60bfef49b3324660a615a8e6d10710e5f669d9 by Mark Shannon in branch 'main':
bpo-44525: Specialize for calls to type and other builtin classes with 1 argument. (GH-29942)
https://github.com/python/cpython/commit/3a60bfef49b3324660a615a8e6d10710e5f669d9


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44525>
_______________________________________

From report at bugs.python.org  Wed Dec 15 10:03:40 2021
From: report at bugs.python.org (Jim Schwartz)
Date: Wed, 15 Dec 2021 15:03:40 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639580620.31.0.817631789897.issue46084@roundup.psfhosted.org>


Jim Schwartz <jschwar at sbcglobal.net> added the comment:

Here's the second file that works just fine under python 3.9 (by the way, I am using Windows 64-bit).  I didn't test this on later python versions, however, nor did I test it on 32-bit versions.  I see that many people on the internet have said to change the working directory as a work around.  Could this possibly be why?

----------
Added file: https://bugs.python.org/file50493/test_os_walk.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 10:11:46 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 15 Dec 2021 15:11:46 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639581106.18.0.800866381869.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

These bug prevent the Fedora infra team from upgrading the Koji builders to Fedora 35. Koji runs on mod_wsgi which is affected by the bug:
https://bugzilla.redhat.com/show_bug.cgi?id=2030621#c1

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 10:16:25 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 15 Dec 2021 15:16:25 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639581385.87.0.607777274039.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

See also bpo-46070: I don't know if it's related.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 10:20:38 2021
From: report at bugs.python.org (Ken Jin)
Date: Wed, 15 Dec 2021 15:20:38 +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: <1639581638.95.0.773820231198.issue41682@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:

Happened to a PR I was reviewing today:
https://github.com/python/cpython/runs/4535247255?check_suite_focus=true

----------
keywords:  -patch
nosy: +kj
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41682>
_______________________________________

From report at bugs.python.org  Wed Dec 15 10:32:41 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 15 Dec 2021 15:32:41 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639582361.15.0.175243029188.issue46072@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 342b93f9f28746abb7b221a61d5a9b26ccbb395a by Mark Shannon in branch 'main':
bpo-46072: Add --with-pystats configure option to simplify gathering of VM stats (GH-30116)
https://github.com/python/cpython/commit/342b93f9f28746abb7b221a61d5a9b26ccbb395a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Wed Dec 15 10:44:03 2021
From: report at bugs.python.org (Mark Shannon)
Date: Wed, 15 Dec 2021 15:44:03 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639583043.17.0.105027446884.issue46006@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:

The problem here is that different sub-interpreters have different strings for the same Python string.

Unless sub-interpreters are fully independent, and they cannot be due to limitations imposed by the stable API, then all sub-interpreters must share the same poll of strings.

Since the only object reachable from a string is the `str` object (which is a static global object `PyUnicode_Type`), then the invariant that no object that is unique to one sub-interpreter can be reached from another sub-interpreter remains valid if strings are shared. I.e. there is no reason not to share strings.

As Victor points out, there is no bug in 3.9 because interned strings are common across all interpreter. We should revert that behavior.

----------
nosy: +Mark.Shannon

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 11:15:50 2021
From: report at bugs.python.org (Daniel McDonald)
Date: Wed, 15 Dec 2021 16:15:50 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639584950.25.0.540216906188.issue44413@roundup.psfhosted.org>


Daniel McDonald <danielmcdonald at ucsd.edu> added the comment:

I'd like to politely request this issue be reopened. 

We recently observed a similar, if not the same, OverflowError during continuous integration using Github Actions on ubuntu-latest (20.04). We can produce the error using pure Python without pytz.

We have been unable to replicate the error using Github Actions on macos-latest, Centos 7.9, Ubuntu 18.04 or OSX 11.6.1.

Specifically, the following code, which I believe is pure python, will trigger the overflow. We've observed this using Python 3.7 and 3.9. 

import time
print(time.mktime((2017,5,26,15,30,16,4,146,1)))

Exact error output from CI can be found at the link below: 

https://github.com/biocore/microsetta-private-api/runs/4536611219?check_suite_focus=true#step:4:117

On a passing system, we receive "1495837816.0" as output. On a failing system, we observe "OverflowError: mktime argument out of range". 

More detail can be found on our issue with pytz and stub42 who helped guide a more definitive example of the bug showing it could be pure Python. That issue can be found here:

https://github.com/stub42/pytz/issues/66

Last, I apologize in advance if any detail is missing here or if this is not formatted as well as it should be. This is my first bug report with Python and am unfamiliar with the norms. Please let me know if further information may be helpful.

----------
nosy: +wasade
versions: +Python 3.7, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 11:48:00 2021
From: report at bugs.python.org (Kevin Shweh)
Date: Wed, 15 Dec 2021 16:48:00 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
Message-ID: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>


New submission from Kevin Shweh <kevin.shweh at gmail.com>:

The OrderedDict iterator caches a di_result tuple for use with iter(od.items()). It's *supposed* to only do that for the items() case, but the code does

    if (kind & (_odict_ITER_KEYS | _odict_ITER_VALUES))

to test for this case. This is the wrong test. It should be

    if ((kind & _odict_ITER_KEYS) && (kind &_odict_ITER_VALUES))

The current test allocates di_result for key and value iterators as well as items iterators.

----------
components: Library (Lib)
messages: 408616
nosy: Kevin Shweh
priority: normal
severity: normal
status: open
title: OrderedDict iterator allocates di_result unnecessarily
type: resource usage
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Wed Dec 15 11:55:42 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 15 Dec 2021 16:55:42 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639587342.91.0.107164253169.issue46084@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> Python 3.9.6 scan_dir returns filenotfound on long paths, 
> but os_walk does not.

This would be surprising. os.walk() has been implemented via os.scandir() since Python 3.5. Do you have a concrete example of the directory structure to test? 

> I see that many people on the internet have said to 
> change the working directory as a work around.  

Changing the working directory is a workaround in Unix, not Windows. Without long-path support, the working directory in Windows is limited to 258 (MAX_PATH - 2) characters.

Without long-path support, the workaround in Windows is to use an extended path, i.e. a Unicode path that's fully-qualified and normalized -- as returned by os.path.abspath() -- and prefixed by "\\\\?\\" or "\\\\?\\UNC\\" (e.g. r"\\?\C:\spam" or r"\\?\UNC\server\share\spam"). This allows the native path length limit of about 32760 characters. Some API functions and applications do not support extended paths. In particular setting an extended path as the working directory is unsupported and buggy, even if long-path support is enabled. But extended paths work fine with most file functions in the os and shutil modules, such as os.scandir(), os.stat(), os.open(), shutil.copytree(), and shutil.rmtree().

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 11:58:07 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 15 Dec 2021 16:58:07 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1639587487.27.0.374474338622.issue46085@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +rhettinger
versions:  -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:14:09 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 15 Dec 2021 17:14:09 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639588449.51.0.791307185232.issue46072@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Could you please add the new option to Doc/using/configure.rst ?

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:14:58 2021
From: report at bugs.python.org (Jim Schwartz)
Date: Wed, 15 Dec 2021 17:14:58 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639588498.24.0.567035105739.issue46084@roundup.psfhosted.org>


Jim Schwartz <jschwar at sbcglobal.net> added the comment:

yes, I do.  C:\Users\Jim\Documents\jschw_uiowtv3_old\AppData\Local\Google\Chrome\User Data\Default\Extensions\nenlahapcbofgnanklpelkaejcehkggg\0.1.823.675_0\notifications\pages\Cashback\components\CashBackResolve\components\RewardsActivation\components\CashbackSectionSimple

it's over the 260 character limit that's the default for windows 10.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:15:51 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 15 Dec 2021 17:15:51 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639588551.3.0.191016955996.issue46006@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Mark: "As Victor points out, there is no bug in 3.9 because interned strings are common across all interpreter. We should revert that behavior."

The rationale for having per-interpreter interned strings and per-interpreter _Py_IDENTIFIER() string objects can be found in bpo-39465 and bpo-40521.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:18:58 2021
From: report at bugs.python.org (STINNER Victor)
Date: Wed, 15 Dec 2021 17:18:58 +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: <1639588738.58.0.96074586938.issue41682@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
nosy:  -vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41682>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:29:08 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Wed, 15 Dec 2021 17:29:08 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639589348.84.0.399991241077.issue44413@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
pull_requests: +28343
pull_request: https://github.com/python/cpython/pull/30124

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:32:36 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 15 Dec 2021 17:32:36 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639589556.28.0.171383827114.issue46084@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

It works as expected for me:

    >>> len(p)
    261
    >>> print(p)
    C:\Temp\Jim\Documents\jschw_uiowtv3_old\AppData\Local\Google\Chrome\User Data\Default\Extensions\nenlahapcbofgnanklpelkaejcehkggg\0.1.823.675_0\notifications\pages\Cashback\components\CashBackResolve\components\RewardsActivation\components\CashbackSectionSimple

os.walk() can list the files in directory `p` if the \\?\ prefix is prepended:

    >>> next(os.walk('\\\\?\\' + p))[-1]
    ['spam.txt']

Without the prefix, the internal os.scandir() call fails, but by default the error is ignored:

    >>> next(os.walk(p))[-1]
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    StopIteration

We can print the exception to see that it's the expected ERROR_PATH_NOT_FOUND (3) error for a path that's too long:

    >>> next(os.walk(p, onerror=print))[-1]
    [WinError 3] The system cannot find the path specified: 'C:\\Temp\\Jim\\Documents\\jschw_uiowtv3_old\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\nenlahapcbofgnanklpelkaejcehkggg\\0.1.823.675_0\\notifications\\pages\\Cashback\\components\\CashBackResolve\\components\\RewardsActivation\\components\\CashbackSectionSimple'
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    StopIteration

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:37:14 2021
From: report at bugs.python.org (Giacomo)
Date: Wed, 15 Dec 2021 17:37:14 +0000
Subject: [issue46086] Add ratio_min() function to the difflib library
Message-ID: <1639589834.45.0.869314940446.issue46086@roundup.psfhosted.org>


New submission from Giacomo <baldogiacomophd at gmail.com>:

Here I propose a new function, namely .ratio_min(self,m). 

.ratio_min(self,m) is an extension of the difflib's function .ratio(self). Equivalently to .ratio(self), .ratio_min(self,m) returns a measure of two sequences' similarity (float in [0,1]). In addition to .ratio(), it can ignore matched substrings if these substrings have length less than a given threshold m. m is the second variable of the function. 

It is very useful to avoid spurious high similarity scores. 

    # NEW FUNCTION: 

    def ratio_min(self,m):
        """Return a measure of the sequences' similarity (float in [0,1]).
        Where T is the total number of elements in both sequences, and
        M_min is the number of matches with every single match has length at least m, this is 2.0*M_min / T.
        Note that this is 1 if the sequences are identical, and 0 if
        they have no substring of length m or more in common.
        .ratio_min() is similar to .ratio(). 
        .ratio_min(1) is equivalent to .ratio().
        
        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio_min(1)
        0.75
        >>> s.ratio_min(2)
        0.75
        >>> s.ratio_min(3)
        0.75
        >>> s.ratio_min(4)
        0.0
        """

        matches = sum(triple[-1] for triple in self.get_matching_blocks() if triple[-1] >=m)
        return _calculate_ratio(matches, len(self.a) + len(self.b))

----------
components: Library (Lib)
messages: 408622
nosy: gibu
priority: normal
severity: normal
status: open
title: Add ratio_min() function to the difflib library
type: enhancement
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46086>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:40:50 2021
From: report at bugs.python.org (Roundup Robot)
Date: Wed, 15 Dec 2021 17:40:50 +0000
Subject: [issue46086] Add ratio_min() function to the difflib library
In-Reply-To: <1639589834.45.0.869314940446.issue46086@roundup.psfhosted.org>
Message-ID: <1639590050.63.0.486763507728.issue46086@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +28344
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30125

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46086>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:47:43 2021
From: report at bugs.python.org (Jim Schwartz)
Date: Wed, 15 Dec 2021 17:47:43 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639590463.39.0.387229928563.issue46084@roundup.psfhosted.org>


Jim Schwartz <jschwar at sbcglobal.net> added the comment:

do you have this registry entry set to 1: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled set to 1.  It works if you do.  What version of windows do you have?  I have version 21H2 (OS Build 19044.1387).  I don't have windows 11 yet.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:48:58 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Wed, 15 Dec 2021 17:48:58 +0000
Subject: [issue46087] Zip library documentation error
Message-ID: <1639590538.75.0.882210215696.issue46087@roundup.psfhosted.org>


New submission from Arthur Milchior <arthur at milchior.fr>:

I don't have permission to assign the issue, but I intend to post the change in a few minutes as a PR

Copied from Richard Hyde's email to doc mailing list.

One of the examples of string formatting doesn't work. This applies to prior versions of Python as well.

The last set of the examples headed: 'Nesting arguments and more complex examples:' starts with the following code:

>>> for align, text in zip('<^>', ['left', 'center', 'right']):
...     '{0:{fill}{align}16}'.format(text, fill=align, align=align)
...

This omits print()
The correct code would be:

>>> for align, text in zip('<^>', ['left', 'center', 'right']):
...     print('{0:{fill}{align}16}'.format(text, fill=align, align=align))
...



-----------------------------------------------

I agree with Richard here that there is a problem. Most example don't use print, but since there is no returned expression, that's the most relevant way to express the meaning of the example. Adding an expression would just make things more complex.

Bug introducde in 28fbea412819f90698527c1997ece5aeddf8e9a7 in 2010.

----------
assignee: docs at python
components: Documentation
messages: 408624
nosy: Arthur-Milchior, docs at python
priority: normal
severity: normal
status: open
title: Zip library documentation error
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46087>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:55:20 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Wed, 15 Dec 2021 17:55:20 +0000
Subject: [issue46087] Zip library documentation error
In-Reply-To: <1639590538.75.0.882210215696.issue46087@roundup.psfhosted.org>
Message-ID: <1639590920.69.0.281991993825.issue46087@roundup.psfhosted.org>


Change by Arthur Milchior <arthur at milchior.fr>:


----------
keywords: +patch
pull_requests: +28345
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30126

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46087>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:56:01 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 15 Dec 2021 17:56:01 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639590961.26.0.823482313455.issue46084@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

If I had long paths enabled, then next(os.walk(p, onerror=print)) would not have printed the error that I showed in the example and would not have immediately raised StopIteration. Instead it would have returned a (dirpath, dirnames, filenames) result for directory `p`. Did you repeat the simple examples that I showed, exactly as shown, and get a different result?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:56:20 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 15 Dec 2021 17:56:20 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639590980.36.0.304617492949.issue46084@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

os.walk() has been implemented via os.scandir(), but by default it ignores OSErrors raised by os.scandir(), DirEntry.is_dir() and DirEntry.is_symlink(). You can get errors raised by os.scandir() if specify the onerror argument, but errors in DirEntry.is_dir() and DirEntry.is_symlink() are always ignored, so too deep directories or links to directories can be treated as files.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:57:37 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Wed, 15 Dec 2021 17:57:37 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639591057.89.0.506117897077.issue44413@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Confirmed on Ubuntu buildbot:

https://github.com/python/cpython/runs/4537544103?check_suite_focus=true

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 12:58:13 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Wed, 15 Dec 2021 17:58:13 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639591093.64.0.214360878608.issue44413@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
resolution: works for me -> 
stage: resolved -> needs patch
status: closed -> open
versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:03:17 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 15 Dec 2021 18:03:17 +0000
Subject: [issue46087] Zip library documentation error
In-Reply-To: <1639590538.75.0.882210215696.issue46087@roundup.psfhosted.org>
Message-ID: <1639591397.2.0.924467901844.issue46087@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Since it is a REPL example, no print() is needed. In REPL any expression statement prints the repr of its result. For example:

>>> for x in range(1, 5):
...     f'{x}**2 = {x**2}'
... 
'1**2 = 1'
'2**2 = 4'
'3**2 = 9'
'4**2 = 16'

There are many such examples in the documentation, and I do not think that this particular example needs a change.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46087>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:05:36 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Wed, 15 Dec 2021 18:05:36 +0000
Subject: [issue46087] Zip library documentation error
In-Reply-To: <1639590538.75.0.882210215696.issue46087@roundup.psfhosted.org>
Message-ID: <1639591536.5.0.613910234929.issue46087@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
versions:  -Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46087>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:08:06 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 15 Dec 2021 18:08:06 +0000
Subject: [issue46086] Add ratio_min() function to the difflib library
In-Reply-To: <1639589834.45.0.869314940446.issue46086@roundup.psfhosted.org>
Message-ID: <1639591686.31.0.433133568438.issue46086@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

I am removing 3.10 from the "versions" field, since additions to the standard library are only considered for unreleased versions of Python.

----------
nosy: +AlexWaygood, tim.peters
versions:  -Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46086>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:08:19 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 15 Dec 2021 18:08:19 +0000
Subject: [issue46086] Add ratio_min() function to the difflib library
In-Reply-To: <1639589834.45.0.869314940446.issue46086@roundup.psfhosted.org>
Message-ID: <1639591699.23.0.873711510593.issue46086@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy:  -AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46086>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:09:12 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Wed, 15 Dec 2021 18:09:12 +0000
Subject: [issue46087] Zip library documentation error
In-Reply-To: <1639590538.75.0.882210215696.issue46087@roundup.psfhosted.org>
Message-ID: <1639591752.62.0.0523789547256.issue46087@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Good point, Serhiy. I also don't see how the proposed change is related to any zip documentation (which is in the title of this issue).

I suggest closing this.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46087>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:10:32 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Wed, 15 Dec 2021 18:10:32 +0000
Subject: [issue46087] format library documentation error
In-Reply-To: <1639590538.75.0.882210215696.issue46087@roundup.psfhosted.org>
Message-ID: <1639591832.07.0.299680839943.issue46087@roundup.psfhosted.org>


Arthur Milchior <arthur at milchior.fr> added the comment:

ipypthon3 does not print the loop content. python3 does. I only tested with ipython. I beg your pardon. I didn't know about this difference in behavior

----------
nosy:  -eric.smith
title: Zip library documentation error -> format library documentation error

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46087>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:15:25 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 15 Dec 2021 18:15:25 +0000
Subject: [issue46087] format library documentation error
In-Reply-To: <1639590538.75.0.882210215696.issue46087@roundup.psfhosted.org>
Message-ID: <1639592125.91.0.649435499198.issue46087@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
nosy: +eric.smith
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46087>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:27:52 2021
From: report at bugs.python.org (Nathan Jensen)
Date: Wed, 15 Dec 2021 18:27:52 +0000
Subject: [issue46070] broken subinterpreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639592872.77.0.941407469932.issue46070@roundup.psfhosted.org>


Change by Nathan Jensen <ndjensen at gmail.com>:


----------
nosy: +ndjensen

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:30:10 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 15 Dec 2021 18:30:10 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639593010.01.0.0671270527587.issue46084@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> but errors in DirEntry.is_dir() and DirEntry.is_symlink() 
> are always ignored

In Windows, is_symlink() won't fail due to a long path, since that information comes from the directory listing, but is_dir() might fail for a long path if it's a symlink to a directory. Windows requires that a symlink to a directory is also a directory (i.e. the symlink reparse point is set on an empty directory), but it's not enough to check that it's a directory symlink. is_dir() requires checking that the target exists, which may fail if the path of the link is too long to open and resolve the link target.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:35:10 2021
From: report at bugs.python.org (Ben Steffensmeier)
Date: Wed, 15 Dec 2021 18:35:10 +0000
Subject: [issue46070] broken subinterpreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639593310.74.0.606768971255.issue46070@roundup.psfhosted.org>


Ben Steffensmeier <ben.steffensmeier at gmail.com> added the comment:

We have been seeing intermittent crashes on jep that we tracked down to the same change (d0d29655ff).

I have created a sample program using _testcapi that crashes about 50% of the time when run on Windows with Python 3.9.9. We have not been able to reproduce problems on any other OS.

See also: https://github.com/ninia/jep/issues/366

----------
nosy: +bsteffensmeier
Added file: https://bugs.python.org/file50494/win_py399_crash_reproducer.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Wed Dec 15 13:43:56 2021
From: report at bugs.python.org (Jim Schwartz)
Date: Wed, 15 Dec 2021 18:43:56 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639593836.49.0.412180634728.issue46084@roundup.psfhosted.org>


Jim Schwartz <jschwar at sbcglobal.net> added the comment:

the issue is with the scandir script, not the os_walk script.  I tried to upload the scandir python script before, but I guess it didn't upload.  When I was running the two scripts, I used an input of C:\\ as the input parameter.  Hope that helps.

----------
Added file: https://bugs.python.org/file50495/test_dir_scan_dir.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 14:07:01 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 15 Dec 2021 19:07:01 +0000
Subject: [issue46088] Build hangs under Visual Studio in deepfreeze stage
Message-ID: <1639595221.47.0.522675592351.issue46088@roundup.psfhosted.org>


New submission from Guido van Rossum <guido at python.org>:

I am trying to build under Visual Studio (the 2019 release) and I'm encountering the following weird issue. In the project file PCbuild\_freeze_module.vcxproj there's a command that runs the Tools\scripts\deepfreeze.py script to generate some code.

The invocation is as follows:

    <Exec Command='$(PythonForBuild) "$(PySourcePath)Tools\scripts\deepfreeze.py" "%(None.OutFile)" "-m" "%(None.ModName)" -o "%(None.IntFile)"' />

Apparently the PythonForBuild variable is unset, because this steps is trying to *open* the deepfreeze.py script using the default app for opening .py files, which in my case is VS Code.

It seems that when using PCbuild\build.bat, PythonForBuild is set (on line 121) to %PYTHON%, which presumably points to some Python interpreter. But apparently when the build is driven by VS, this is not executed and now we're stuck.

Is there someone with enough MSBUILD skills to help me fix this?

----------
components: Build, Windows
messages: 408635
nosy: gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Build hangs under Visual Studio in deepfreeze stage
type: compile error
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46088>
_______________________________________

From report at bugs.python.org  Wed Dec 15 14:12:59 2021
From: report at bugs.python.org (Jim Schwartz)
Date: Wed, 15 Dec 2021 19:12:59 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639595579.42.0.385954868458.issue46084@roundup.psfhosted.org>


Jim Schwartz <jschwar at sbcglobal.net> added the comment:

when I run the following command:

python "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py" "C:\\"

I get this output:

...
Traceback (most recent call last):
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", line 54, in <module>
    main(sys.argv[0:])
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", line 30, in main
    for file in get_files_in_dir(source):
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", line 11, in get_files_in_dir
    yield from get_files_in_dir(entry.path)
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", line 11, in get_files_in_dir
    yield from get_files_in_dir(entry.path)
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", line 11, in get_files_in_dir
    yield from get_files_in_dir(entry.path)
  [Previous line repeated 19 more times]
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", line 9, in get_files_in_dir
    for entry in os.scandir(source):
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\Jim\\Documents\\jschw_uiowtv3_old\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\nenlahapcbofgnanklpelkaejcehkggg\\0.1.823.675_0\\notifications\\pages\\Cashback\\components\\CashBackResolve\\components\\RewardsActivation\\components\\CashbackSectionSimple'

when I run the following command:

python "H:\Users\LindaJim\Documents\AWS Python Learning\test_os_walk.py" "C:\\"

I get this:

...
file is  C:\winutils\bin\winutils.exe
End time is  2021-12-15.13:11:54
Duration is  0:06:05

I don't think this should happen, right?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 14:17:18 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 19:17:18 +0000
Subject: [issue22047] Deprecate unsupported nesting of argparse groups
In-Reply-To: <1406131424.14.0.0235697032218.issue22047@psf.upfronthosting.co.za>
Message-ID: <1639595838.93.0.969195955233.issue22047@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Another issue due to nesting: issue38590.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22047>
_______________________________________

From report at bugs.python.org  Wed Dec 15 14:29:43 2021
From: report at bugs.python.org (G. Allard)
Date: Wed, 15 Dec 2021 19:29:43 +0000
Subject: [issue46089] Problems with AF_PACKET sockets
Message-ID: <1639596583.53.0.533566052583.issue46089@roundup.psfhosted.org>


New submission from G. Allard <gallard at mmic.net>:

For educational purposes, I'm developing my own IP stack in Python. It's going well but I'm stuck at a low level.
I need to implement the following (simple) task:
- open an AF_PACKET socket (socket.socket)
- bind it to a specific interface (socket.bind)
Python code would look like this:
- sock = socket.socket( socket.AF_PACKET, socket.SOCK_RAW, socket.htons( ETH_P_ALL))
- sock.setblocking( False)
- sock.bind(( 'eth0', socket.htons( ETH_P_ALL)))
It does not work. bind always return "TypeError: AF_PACKET address must be a tuple of two to five elements"
I spent many days on that problem. No success.

Desperate, I tried to verify it wasn't a kernel problem. I wrote the C version of the above snippet. 
- sock = socket( AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons( 3));
- struct sockaddr_ll addr = {0};
  addr.sll_family = AF_PACKET;
  addr.sll_ifindex = 2;  /* index of 'eth0' */
  addr.sll_protocol = htons( ETH_P_ALL);
- bind( sock, (struct sockaddr*) &addr, sizeof( addr));
I'm not an expert in C programming but it worked on first try.

First problem is that AF_PACKET sockets are broken in Python.

Second problem is inadequate documentation.
Following issue ID 25041, some documentation has been added but there is still lot of room for improvements.
For example:
- recvfrom return 2 values. The first is the binary packet and the second one is a 5 member structure. The first member of the structure is the interface name. The 5th member if the MAC address (assuming the interface is an Ethernet NIC). The 3rd one is a protocol number (the data-link protocol) whose data is in front of the returnet packet (for WiFi packets, we will see Radiotap protocol at that level).
That's a whole new world for documentors.

- socket.bind() parameter is documented to be an address. For AF_PACKET, the address is documented in "Socket Families" section. Definition is vague. The 'proto' description would be easier to understand with "An integer (in network-byte-order) representing the low level protocol (enumerated in linux/if_ether.h) or ETH_P_ALL for all protocols. This parameter is only used for filtering inbound packets."
IMO 'pkttype', 'hatype', 'addr' are there to document the information returned by recvfrom(). It's written they are "optional" but I think it's not correct.

- Working examples of AF_PACKET must be provided, possibly in a HOWTO.

When it's easier to program in C, it should tell you there is a problem on Python side.

----------
assignee: docs at python
components: Documentation
messages: 408638
nosy: docs at python, gallard
priority: normal
severity: normal
status: open
title: Problems with AF_PACKET sockets
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46089>
_______________________________________

From report at bugs.python.org  Wed Dec 15 14:50:28 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 19:50:28 +0000
Subject: [issue44999] Argparse missing translates
In-Reply-To: <1629886499.18.0.598632982374.issue44999@roundup.psfhosted.org>
Message-ID: <1639597828.27.0.906253171282.issue44999@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy:  -lys.nikolaou
type: performance -> behavior
versions: +Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44999>
_______________________________________

From report at bugs.python.org  Wed Dec 15 14:51:13 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 15 Dec 2021 19:51:13 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639597873.98.0.240296728575.issue46006@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

It sounds like this bug is another case where we have made some objects
per-interpreter but others are still global and this is causing problems.
_PyUnicode_EqualToASCIIId() wouldn't have any problems if interpreters
weren't sharing any objects (or were only sharing immutable "immortal"
objects).

For now can we just move the relevant per-interpreter strings from
PyInterpreterState.unicode_state ("interned" and "ids") up to
_PyRuntimeState.  They will then be global, which should restore 
the correct behavior.

Personally, I'd rather we not revert the original change.  Moving the data
to _PyRuntimeState would save me some effort with related work I'm doing
right now.

Of course, the potential bug would still exist in _PyUnicode_EqualToASCIIId().
Could we add a test as part of this fix to verify the failure case described
here actually works?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 14:51:30 2021
From: report at bugs.python.org (jdogzz-g5)
Date: Wed, 15 Dec 2021 19:51:30 +0000
Subject: [issue38119] resource tracker destroys shared memory segments when
 other processes should still have valid access
In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org>
Message-ID: <1639597890.06.0.0836875877785.issue38119@roundup.psfhosted.org>


Change by jdogzz-g5 <jerzor at pacbell.net>:


----------
nosy: +jdogzz-g5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38119>
_______________________________________

From report at bugs.python.org  Wed Dec 15 14:52:59 2021
From: report at bugs.python.org (Eric Snow)
Date: Wed, 15 Dec 2021 19:52:59 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639597979.34.0.170973692095.issue46006@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

FWIW, it makes sense to me for the interned strings to be per-interpreter eventually.
Otherwise strings interned by an interpreter would persist after that interpreter
is finalized, potentially leaking memory until the runtime is finalized.

However, if we end up with immortal objects then I think all the strings created
through _Py_IDENTIFIER() should be global (_PyRuntimeState).  Otherwise they must
be per-interpreter (if we have a per-interpreter GIL).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 14:58:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 15 Dec 2021 19:58:48 +0000
Subject: [issue32867] argparse assertion failure with multiline metavars
In-Reply-To: <1518930403.05.0.467229070634.issue32867@psf.upfronthosting.co.za>
Message-ID: <1639598328.29.0.311823608844.issue32867@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

It works for me on 3.11:

% ./python.exe b.py -h
usage: 11111111111111 [-h] [-v] 123456
12345
12345
123 [123456
12345
12345
123 ...]

positional arguments:
  123456
12345
12345
123
                        installation targets

options:
  -h, --help            show this help message and exit
  -v, --verbose         verbose mode

----------
nosy: +iritkatriel
resolution:  -> fixed
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32867>
_______________________________________

From report at bugs.python.org  Wed Dec 15 15:23:00 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Wed, 15 Dec 2021 20:23:00 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639599780.34.0.830278829529.issue44413@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Thank you both.  Status: Failures on Open Suse TW (Vyacheslav) and Ubuntu 20-04 (Daniel McDonald, Github Actions, and Azure Pipelines).
Success on Windows (me), macOS (Catalina-me and 11.6.1-DM), Centos 7.9 and Ubuntu 18-04 (both DM) 

I verified that the sample tuple is consistent and round-trips with time.localtime.

>>> import time
>>> time.mktime((2017,5,26,15,30,16,4,146,1))
1495827016.0
>>> time.localtime(time.mktime((2017,5,26,15,30,16,4,146,1)))
time.struct_time(tm_year=2017, tm_mon=5, tm_mday=26, tm_hour=15, tm_min=30, tm_sec=16, tm_wday=4, tm_yday=146, tm_isdst=1)

While OverflowError is documented as a legitimate response, it is not for a contemporary valid datetime such as the above.  Someone with a failure machine could try to determine what tuple vales do and don't result in the error.  Someone with both failure and success machines could add debug prints to mktime (or use C debugger) to see where the behavior of the C code diverges on the two machines.  If no one active on the issue can do either, a request could be made for help on python-list.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 15:23:57 2021
From: report at bugs.python.org (Jim Schwartz)
Date: Wed, 15 Dec 2021 20:23:57 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639599837.77.0.0264659812854.issue46084@roundup.psfhosted.org>


Jim Schwartz <jschwar at sbcglobal.net> added the comment:

my c drive and h drive are both internal drives and I run the python script from my user directory on my c drive.  Not sure if that makes any difference.  Just trying to think of things that might help you reproduce and fix this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 15:28:38 2021
From: report at bugs.python.org (Daniel McDonald)
Date: Wed, 15 Dec 2021 20:28:38 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639600118.85.0.783379211478.issue44413@roundup.psfhosted.org>


Daniel McDonald <danielmcdonald at ucsd.edu> added the comment:

Thank you, Terry. I'm currently exploring modifications to the test Andrei made within a fork of CPython using Github Actions (ubuntu-latest). These modifications include debug prints in the CPython mktime call, and some parameter exploration. I expect to have a summary of the observations this afternoon.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 15:44:19 2021
From: report at bugs.python.org (Ethan Furman)
Date: Wed, 15 Dec 2021 20:44:19 +0000
Subject: [issue46089] Problems with AF_PACKET sockets
In-Reply-To: <1639596583.53.0.533566052583.issue46089@roundup.psfhosted.org>
Message-ID: <1639601059.09.0.0550927411287.issue46089@roundup.psfhosted.org>


Ethan Furman <ethan at stoneleaf.us> added the comment:

Thank you for the thorough report.  Do you feel comfortable writing that missing documentation?

----------
nosy: +ethan.furman

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46089>
_______________________________________

From report at bugs.python.org  Wed Dec 15 15:46:45 2021
From: report at bugs.python.org (jdogzz-g5)
Date: Wed, 15 Dec 2021 20:46:45 +0000
Subject: [issue35844] Calling `Multiprocessing.Queue.close()` too quickly
 causes intermittent failure (BrokenPipeError)
In-Reply-To: <1548707332.73.0.0560406738777.issue35844@roundup.psfhosted.org>
Message-ID: <1639601205.0.0.445707594882.issue35844@roundup.psfhosted.org>


Change by jdogzz-g5 <jerzor at pacbell.net>:


----------
nosy: +jdogzz-g5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35844>
_______________________________________

From report at bugs.python.org  Wed Dec 15 15:53:03 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 15 Dec 2021 20:53:03 +0000
Subject: [issue46086] Add ratio_min() function to the difflib library
In-Reply-To: <1639589834.45.0.869314940446.issue46086@roundup.psfhosted.org>
Message-ID: <1639601583.68.0.317527183348.issue46086@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
assignee:  -> tim.peters

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46086>
_______________________________________

From report at bugs.python.org  Wed Dec 15 15:53:57 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 15 Dec 2021 20:53:57 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1639601637.64.0.141271243832.issue46085@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
nosy: +eric.snow

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Wed Dec 15 15:55:31 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Wed, 15 Dec 2021 20:55:31 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
Message-ID: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>


New submission from Brandt Bucher <brandtbucher at gmail.com>:

I'm specifically concerned about Greenlet here (since it's a dependency of pyperformance), but this discussion is equally relevant to any library like it that dynamically swaps out the currently executing frame.

CPython 3.11 makes several major changes to how frame objects are used and represented internally:

- bpo-44032: Move data stack to thread from FrameObject. (https://github.com/python/cpython/pull/26076)
- bpo-44590: Lazily allocate frame objects (https://github.com/python/cpython/pull/27077)
- bpo-45637: Store the frame pointer in the cframe (https://github.com/python/cpython/pull/29267)

These changes break Greenlet's hot-swapping of frame objects (https://github.com/python-greenlet/greenlet/blob/be41e1a24925326b72a02ef5cb6d1ed9643eb062/src/greenlet/greenlet_greenlet.hpp#L768-L811) in a pretty serious way, and it's not immediately clear what the best fix is. A fairly high-level overview of the new design:

When a frame is executing, the current thread state points to the current CFrame, which itself points to a C-level InterpreterFrame. This interpreter frame is located within a "data stack" that is managed by the thread state. If a PyFrameObject for the currently executing frame is requested (using PyThreadState_GetFrame), the new PyFrameObject points into the InterpreterFrame, where all of the important data is still stored. So far so good.

The issue is what happens next. If the InterpreterFrame is replaced, or exits in any way, its memory may be reused, or even freed entirely. The PyFrameObject is smart enough to copy the data elsewhere (into itself) when this happens, but the new design means that there is no obvious way for a third-party library to "reactivate" a frame in a way analogous to assigning to the old tstate->frame member.

While I'm pretty sure that we don't officially support this "feature", it's probably used often enough that we should at least brainstorm a workaround (if not an unstable C-API function) for affected projects. I suspect that a potential solution likely involves creating an entirely new InterpreterFrame the normal way, and copying the PyFrameObject's InterpreterFrame data into it? Not sure what would happen if the old InterpreterFrame was still alive on the data stack, though...

In any case, it probably makes sense to discuss here with affected library maintainers.

----------
assignee: brandtbucher
components: Interpreter Core
messages: 408646
nosy: Mark.Shannon, brandtbucher, gvanrossum, pablogsal
priority: normal
severity: normal
status: open
title: C extensions can't swap out live frames anymore
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Wed Dec 15 16:04:22 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 15 Dec 2021 21:04:22 +0000
Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library"
In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org>
Message-ID: <1639602262.75.0.21585593497.issue46079@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

This seems to be a temporary outage, expected to be restored in the first half of 2022.  Source:  https://www.usno.navy.mil/USNO/time/master-clock

I'll look for an alternative time source that is currently online.

----------
assignee: docs at python -> rhettinger
nosy: +rhettinger
priority: normal -> low

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46079>
_______________________________________

From report at bugs.python.org  Wed Dec 15 16:07:12 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 15 Dec 2021 21:07:12 +0000
Subject: [issue45959] Teach pprint about dict views
In-Reply-To: <1638428816.23.0.206050902249.issue45959@roundup.psfhosted.org>
Message-ID: <1639602432.37.0.852498301196.issue45959@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

More accurate to say that it aspires to print in a single line ONLY if the content fits in the specified width.  Otherwise, it prints vertically with appropriate indentation.  Indeed, that is the entire purpose of the module; otherwise, we would just use print() which always writes one line.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45959>
_______________________________________

From report at bugs.python.org  Wed Dec 15 16:26:39 2021
From: report at bugs.python.org (Jim Schwartz)
Date: Wed, 15 Dec 2021 21:26:39 +0000
Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, 
 but os_walk does not
In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org>
Message-ID: <1639603599.66.0.898469012203.issue46084@roundup.psfhosted.org>


Jim Schwartz <jschwar at sbcglobal.net> added the comment:

Please let me know if you are able to reproduce this issue.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46084>
_______________________________________

From report at bugs.python.org  Wed Dec 15 16:55:47 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 15 Dec 2021 21:55:47 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639605347.37.0.832694896975.issue44413@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

time.mktime() is a thin wrapper around the libc function mktime(3). I can confirm that glibc's mktime() on Debian 11 with glibc 2.31 is failing and returning error code -1. Fedora 35 with glibc 2.34, Alpine with musl libc 1.2.2, and RHEL 8 with glibc 2.28 are working fine.

This suggests that it is not a bug in Python, but Debian-specific platform issue. Could you please open a bug with Debian and Ubuntu?

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 17:06:14 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 15 Dec 2021 22:06:14 +0000
Subject: [issue46088] Build hangs under Visual Studio in deepfreeze stage
In-Reply-To: <1639595221.47.0.522675592351.issue46088@roundup.psfhosted.org>
Message-ID: <1639605974.24.0.983434718759.issue46088@roundup.psfhosted.org>


Change by Guido van Rossum <guido at python.org>:


----------
keywords: +patch
pull_requests: +28346
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30127

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46088>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:06:30 2021
From: report at bugs.python.org (Jeremy)
Date: Wed, 15 Dec 2021 23:06:30 +0000
Subject: [issue46091] IndendationError from multi-line indented statements
Message-ID: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org>


New submission from Jeremy <ucodery at gmail.com>:

At some point in 3.9 Python appears to have stopped accepting source that starts with an indent, then a '\', then the indented statement. From the lexical analysis [1] "Indentation cannot be split over multiple physical lines using backslashes; the whitespace up to the first backslash determines the indentation."

Running the attached program under 3.8.12 I get:
```
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377
```

But running under 3.10.0 I get:
```
  File "/Users/jeremyp/tmp/nodent.py", line 3
    """Print a Fibonacci series up to n."""
    ^
IndentationError: expected an indented block after function definition on line 1
```

Running under 3.9.9 also gives an IndentationError, both with and without -X oldparser. So this doesn't seem directly related to the new parser, but seems likely it is fall out from the general grammar restructuring.

IMHO it isn't a particularly nice feature for the language to have. Especially since not all lines like '    \' behave the same. But it was there and documented for many years, so should probably be put back. Does a core developer agree? That the implementation is not following the spec?

[1]: https://docs.python.org/3/reference/lexical_analysis.html#indentation

----------
components: Parser
files: nodent.py
messages: 408651
nosy: lys.nikolaou, pablogsal, ucodery
priority: normal
severity: normal
status: open
title: IndendationError from multi-line indented statements
versions: Python 3.10, Python 3.11, Python 3.9
Added file: https://bugs.python.org/file50496/nodent.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46091>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:17:22 2021
From: report at bugs.python.org (G. Allard)
Date: Wed, 15 Dec 2021 23:17:22 +0000
Subject: [issue46089] Problems with AF_PACKET sockets
In-Reply-To: <1639596583.53.0.533566052583.issue46089@roundup.psfhosted.org>
Message-ID: <1639610242.01.0.886962501421.issue46089@roundup.psfhosted.org>


G. Allard <gallard at mmic.net> added the comment:

Next 3 steps must be (in decreasing priorities):
- fix the code
- write a mini-howto. It will be used for test purposes
- write documentation (a Howto/tutorial)

For the 3rd step, I would accept to join a team.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46089>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:27:12 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Wed, 15 Dec 2021 23:27:12 +0000
Subject: [issue46092] Fix/update missing parameters in function signatures for
 Built-in Functions documentation.
Message-ID: <1639610832.29.0.673265280888.issue46092@roundup.psfhosted.org>


New submission from Vivek Vashist <vivekvashist at gmail.com>:

Previous issue:

https://github.com/python/cpython/pull/30113#issuecomment-994642493

As noted/pointed by Alex - I went through all the Built-in Functions and updated/fixed the missing parameters.

I'll raise a PR shortly.

----------
assignee: docs at python
components: Documentation
messages: 408653
nosy: docs at python, vivekvashist
priority: normal
severity: normal
status: open
title: Fix/update missing parameters in function signatures for Built-in Functions documentation.
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46092>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:27:48 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Wed, 15 Dec 2021 23:27:48 +0000
Subject: [issue46091] IndendationError from multi-line indented statements
In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org>
Message-ID: <1639610868.88.0.0288406325829.issue46091@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

This is a side effect on the fix in:

https://bugs.python.org/issue40847

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46091>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:28:12 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Wed, 15 Dec 2021 23:28:12 +0000
Subject: [issue46092] Fix/update missing parameters in function signatures for
 Built-in Functions documentation.
In-Reply-To: <1639610832.29.0.673265280888.issue46092@roundup.psfhosted.org>
Message-ID: <1639610892.87.0.261766711683.issue46092@roundup.psfhosted.org>


Change by Vivek Vashist <vivekvashist at gmail.com>:


----------
keywords: +patch
pull_requests: +28347
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30128

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46092>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:29:20 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Wed, 15 Dec 2021 23:29:20 +0000
Subject: [issue46092] Fix/update missing parameters in function signatures for
 Built-in Functions documentation.
In-Reply-To: <1639610832.29.0.673265280888.issue46092@roundup.psfhosted.org>
Message-ID: <1639610960.76.0.787067051023.issue46092@roundup.psfhosted.org>


Vivek Vashist <vivekvashist at gmail.com> added the comment:

PR: https://github.com/python/cpython/pull/30128

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46092>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:35:16 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Wed, 15 Dec 2021 23:35:16 +0000
Subject: [issue46091] IndendationError from multi-line indented statements
In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org>
Message-ID: <1639611316.4.0.964458634794.issue46091@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Unfortunately I am not sure if this is going to be easier to retrofit for the reasons exposed in the issue. I will try to take a look, but if you have some cycles to spare, a PR would be welcomed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46091>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:38:17 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Wed, 15 Dec 2021 23:38:17 +0000
Subject: [issue46091] IndendationError from multi-line indented statements
In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org>
Message-ID: <1639611497.3.0.512614135601.issue46091@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Actually, I am not sure if this is a bug, at least according to this comment:

https://bugs.python.org/msg370812

What are your thoughts on this Guido?

----------
nosy: +gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46091>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:44:33 2021
From: report at bugs.python.org (Daniel McDonald)
Date: Wed, 15 Dec 2021 23:44:33 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639611873.48.0.674596561576.issue44413@roundup.psfhosted.org>


Daniel McDonald <danielmcdonald at ucsd.edu> added the comment:

The use of tm_isdst=1 appears to trigger the overflow, and occurs when varying other aspects of the timetuple.  

Python's mktime wrapper can throw OverflowError in two places. The thrown error is the second location, following the call to glibc's mktime occurring in this specific if block:

https://github.com/python/cpython/blob/f62420c3d3f5d87f2b57e54b2a98682bc835f7b6/Modules/timemodule.c#L1038-L1046

Modification of Modules/timemodule.c as to printf tm struct members confirms that when tm_isdst=1, the result from mktime() is -1, and the tm_wday member is set to -1, the combination of which triggers the conditional. 

mktime within the Github Action ubuntu-latest (20.04) environment is sourced from glibc 2.31 as confirmed by ldd and nm on the compiled Python binary.

As a proof of concept, C program was written that calls mktime independent of CPython (can be compiled with "gcc bug.c -o bug"). The code below succeeds on both OSX 11.6.1 and Centos 7.9:

#include <time.h>
#include <stdio.h>

void do_test() {
  struct tm tm_works = { .tm_year=117,
                         .tm_mon=4,
                         .tm_mday=26,
                         .tm_hour=15,
                         .tm_min=30,
                         .tm_sec=16,
                         .tm_wday=4,
                         .tm_yday=145,
                         .tm_isdst=-1 };
  
  struct tm tm_fails = { .tm_year=117,
                         .tm_mon=4,
                         .tm_mday=26,
                         .tm_hour=15,
                         .tm_min=30,
                         .tm_sec=16,
                         .tm_wday=4,
                         .tm_yday=145,
                         .tm_isdst=1 };

  time_t works = mktime(&tm_works);
  time_t fails = mktime(&tm_fails);

  if(works == -1) {
      printf("Unexpected failure\n");
  } else {
      if(works == fails) {
          printf("Test passed\n");
      } else {
          printf("Test failed: works=%d; fails=%d\n", (int)works, (int)fails);
      }
  }
}

int main(int argc, char **argv) {
    do_test();
}

When compiled and run within in the Github Actions ubuntu-latest (20.04) environment, the erroneous behavior occurs:

https://github.com/wasade/cpython/runs/4541212472?check_suite_focus=true#step:17:57

The use of tm_isdst=1 is valid according to multiple sources, a few examples are linked below. The sources are consistent, and indicate a positive value means Daylight Savings Time is in effect. 

https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html
https://www.cplusplus.com/reference/ctime/tm/

At this time, I believe this remains unexpected behavior, however the source appears upstream of CPython as mktime is part of glibc. Unless suggested otherwise, I'll open an issue with on the glibc tracker.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:46:15 2021
From: report at bugs.python.org (Daniel McDonald)
Date: Wed, 15 Dec 2021 23:46:15 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639611975.05.0.356622173841.issue44413@roundup.psfhosted.org>


Daniel McDonald <danielmcdonald at ucsd.edu> added the comment:

Thank you, Christian, I apologize for missing your reply. That is great advice, and I will do so.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 18:57:28 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Wed, 15 Dec 2021 23:57:28 +0000
Subject: [issue45829] Remove C stack use by specializing BINARY_SUBSCR,
 STORE_SUBSCR, LOAD_ATTR, and STORE_ATTR
In-Reply-To: <1637142611.15.0.521267590311.issue45829@roundup.psfhosted.org>
Message-ID: <1639612648.01.0.72515748229.issue45829@roundup.psfhosted.org>


Change by Brandt Bucher <brandtbucher at gmail.com>:


----------
pull_requests: +28348
pull_request: https://github.com/python/cpython/pull/30129

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45829>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:12:13 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 16 Dec 2021 00:12:13 +0000
Subject: [issue46092] Fix/update missing parameters in function signatures for
 Built-in Functions documentation.
In-Reply-To: <1639610832.29.0.673265280888.issue46092@roundup.psfhosted.org>
Message-ID: <1639613533.71.0.0684277988849.issue46092@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +AlexWaygood
versions: +Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46092>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:12:54 2021
From: report at bugs.python.org (Daniel McDonald)
Date: Thu, 16 Dec 2021 00:12:54 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1639613574.45.0.932039043184.issue44413@roundup.psfhosted.org>


Daniel McDonald <danielmcdonald at ucsd.edu> added the comment:

For reference, the bug reports with Debian and Ubuntu are at the following URLs:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001774
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1954963

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:25:05 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 16 Dec 2021 00:25:05 +0000
Subject: [issue46091] IndendationError from multi-line indented statements
In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org>
Message-ID: <1639614305.6.0.584239966313.issue46091@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
keywords: +patch
pull_requests: +28349
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30130

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46091>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:25:18 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 16 Dec 2021 00:25:18 +0000
Subject: [issue46091] IndendationError from multi-line indented statements
In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org>
Message-ID: <1639614318.57.0.192174993707.issue46091@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

nevermind, I am convinced is a bug. I filed a PR for it

----------
stage: patch review -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46091>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:35:36 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 16 Dec 2021 00:35:36 +0000
Subject: [issue46070] broken subinterpreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639614936.78.0.942627029205.issue46070@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

I can sometimes reproduce the crash on Windows with Python 3.9. Call stack (most recent to oldest frames):

* PyObject_GC_UnTrack() - crash on _PyGCHead_SET_NEXT(prev, next) because prev is dangling pointer (0x1fe64dd5250), Visual Studio is unable to read memory
* meth_dealloc() -- delete _sre_compile() method object
* (...)
* PyDict_SetItem() -- set "compile" to None
* _PyModule_ClearDict() -- clear the "_sre" module dict
* _PyModule_Clear()
* _PyImport_Clenaup()
* Py_EndInterpreter()
* (...)
* run_in_subinterp()
* (...)
* t_bootstrap()

The crash occurs in meth_dealloc(), when deallocating the _sre_compile() method object stored in _sre module dictionary as the attribute "compile".

The PyGC_Head.prev pointer is a dangling pointer.

On Python 3.9, the "re" module is not imported at startup, but it's imported indirectly by "import importlib.util" via "import typing". On Python 3.10, the re module is no longer imported by "import importlib.util".

The crash is random. Sometimes, I need 3 or 4 tries. Sometimes, it crash using -X dev. Sometimes, it crash immediately. When debugging in Visual Stuido, the crash seems easier to reproduce.

On Python 3.9, the _sre exetnsion uses the old API: PyModule_Create() with PyModuleDef.m_size = -1.

On Python 3.10, the _sre extension has been converted to multiphase init API: PyModuleDef_Init() with PyModuleDef.m_size = sizeof(_sremodulestate). Moreover, "import importlib.util" no longer imports indirectly the "re" module.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:40:16 2021
From: report at bugs.python.org (Jeremy)
Date: Thu, 16 Dec 2021 00:40:16 +0000
Subject: [issue46091] IndendationError from multi-line indented statements
In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org>
Message-ID: <1639615216.86.0.365843233594.issue46091@roundup.psfhosted.org>


Jeremy <ucodery at gmail.com> added the comment:

Wow, this was a fast turnaround! I was going to spin some cycles on this, but would have not seen the solution in 50m.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46091>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:40:46 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 16 Dec 2021 00:40:46 +0000
Subject: [issue46070] broken subinterpreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639615246.23.0.697309191027.issue46070@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Using attached bug.py, it's possible to trigger the crash on the main branch. I modified the reproducer to use the "_asyncio" extension which still uses the old API PyModule_Create() with PyModuleDef.m_size = -1.

----------
Added file: https://bugs.python.org/file50497/bug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:41:32 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 16 Dec 2021 00:41:32 +0000
Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a
 crash in subintepreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639615292.14.0.137360486053.issue46070@roundup.psfhosted.org>


Change by STINNER Victor <vstinner at python.org>:


----------
title: broken subinterpreters -> _PyImport_FixupExtensionObject() regression causing a crash in subintepreters

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:47:31 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 16 Dec 2021 00:47:31 +0000
Subject: [issue46091] IndendationError from multi-line indented statements
In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org>
Message-ID: <1639615651.76.0.120539479993.issue46091@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
Removed message: https://bugs.python.org/msg408657

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46091>
_______________________________________

From report at bugs.python.org  Wed Dec 15 19:53:27 2021
From: report at bugs.python.org (STINNER Victor)
Date: Thu, 16 Dec 2021 00:53:27 +0000
Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a
 crash in subintepreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1639616007.76.0.9680267924.issue46070@roundup.psfhosted.org>


STINNER Victor <vstinner at python.org> added the comment:

Hum, maybe bug.py exposes a different kind of bug. The _asyncio extension uses a non-trivial initialize code which doesn't seem to handle well concurrent "import _asyncio".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Wed Dec 15 20:10:48 2021
From: report at bugs.python.org (Eric Snow)
Date: Thu, 16 Dec 2021 01:10:48 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639617048.87.0.1715895232.issue46006@roundup.psfhosted.org>


Change by Eric Snow <ericsnowcurrently at gmail.com>:


----------
pull_requests: +28350
pull_request: https://github.com/python/cpython/pull/30131

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 20:11:44 2021
From: report at bugs.python.org (Eric Snow)
Date: Thu, 16 Dec 2021 01:11:44 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639617104.62.0.537818339012.issue46006@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

I've created a PR for moving the interned strings and identifiers to _PyRuntimeState until we are ready to move them back to the interpreter.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 20:13:09 2021
From: report at bugs.python.org (Eric Snow)
Date: Thu, 16 Dec 2021 01:13:09 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1639617189.02.0.915138118649.issue46006@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

If that seems okay, I'll work on a backport PR for 3.10.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 15 21:14:51 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Thu, 16 Dec 2021 02:14:51 +0000
Subject: [issue46068] Change use of warnings.warn to logging.warning in a few
 places
In-Reply-To: <1639435512.0.0.159079727605.issue46068@roundup.psfhosted.org>
Message-ID: <1639620891.99.0.180131818878.issue46068@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Raymond: Makes sense; I didn't know there was disagreement about this. I will keep this issue open for a week and then close.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46068>
_______________________________________

From report at bugs.python.org  Wed Dec 15 22:40:31 2021
From: report at bugs.python.org (Josh Rosenberg)
Date: Thu, 16 Dec 2021 03:40:31 +0000
Subject: [issue46082] type casting of bool
In-Reply-To: <1639567277.19.0.409904988292.issue46082@roundup.psfhosted.org>
Message-ID: <1639626031.69.0.314542556786.issue46082@roundup.psfhosted.org>


Josh Rosenberg <shadowranger+python at gmail.com> added the comment:

Agreed, this is not a bug. The behavior of the bool constructor is not a parser (unlike, say, int), it's a truthiness detector. Non-empty strings are always truthy, by design, so both "True" and "False" are truthy strings. There's no bug to address here.

----------
nosy: +josh.r
resolution:  -> not a bug
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46082>
_______________________________________

From report at bugs.python.org  Wed Dec 15 23:09:09 2021
From: report at bugs.python.org (Inada Naoki)
Date: Thu, 16 Dec 2021 04:09:09 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1639627749.94.0.633091118448.issue46085@roundup.psfhosted.org>


Inada Naoki <songofacandy at gmail.com> added the comment:

Nice catch.

>     if ((kind & _odict_ITER_KEYS) && (kind &_odict_ITER_VALUES))

You can reduce one branch by

```
#define _odict_ITER_ITEMS (_odict_ITER_KEYS|_odict_ITER_VALUES)
...
     if (kind & _odict_ITER_ITEMS == _odict_ITER_ITEMS)
```

----------
nosy: +methane

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Thu Dec 16 00:16:24 2021
From: report at bugs.python.org (Ritvik S)
Date: Thu, 16 Dec 2021 05:16:24 +0000
Subject: [issue46093] 2D array issue
Message-ID: <1639631784.52.0.780624744558.issue46093@roundup.psfhosted.org>


New submission from Ritvik S <ritviksetty at gmail.com>:

I had a problem running the following code. When I ran through what I thought python was supposed to do, I got a different answer than what python did. I think this is an error. Here is the code:



problem_ary = [['a','b','c'],['d','e','f'],['g','h','i']]
normal_ary = ['a','b','c']

print(normal_ary[:]) #should print ['a','b','c']
print(problem_ary[:][1])



The second output should be ['b','e','h'] since the print statement tells python to take [0][1],[1][1], and [2][1] from the problem_ary which is 'b','e','h'. It confused me when python instead returned ['d','e','f']. I came across this problem when I was trying to create tic-tac-toe in python. I tried coding this is Python 3.8, 3.9, and using an online interpreter, and I got the same result every time.

----------
files: 2D-Array-Problem.py
messages: 408671
nosy: ritviksetty
priority: normal
severity: normal
status: open
title: 2D array issue
type: behavior
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50498/2D-Array-Problem.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46093>
_______________________________________

From report at bugs.python.org  Thu Dec 16 01:04:30 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 16 Dec 2021 06:04:30 +0000
Subject: [issue46081] Document the msg argument for assertRaises
In-Reply-To: <1639557491.44.0.830591969979.issue46081@roundup.psfhosted.org>
Message-ID: <1639634670.63.0.384377711587.issue46081@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I concur with Eric that the current presentation is reasonable and better than adding boilerplate to every entry.  It suffices that the docs cover the *msg* argument once and that each entry includes *msg* in its signature.  

Elsewhere in the docs we also try to avoid unnecessary repetition (for example, most classes don't list all their dunder methods).  Excess repetition in the docs impairs readability.  The unittest docs are already so long that it discourages someone from reading it top to bottom.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46081>
_______________________________________

From report at bugs.python.org  Thu Dec 16 01:20:18 2021
From: report at bugs.python.org (Ram Rachum)
Date: Thu, 16 Dec 2021 06:20:18 +0000
Subject: [issue46081] Document the msg argument for assertRaises
In-Reply-To: <1639557491.44.0.830591969979.issue46081@roundup.psfhosted.org>
Message-ID: <1639635618.71.0.944560983092.issue46081@roundup.psfhosted.org>


Ram Rachum <ram at rachum.com> added the comment:

I disagree but I guess I'm in the minority here, so I'll close this issue.

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46081>
_______________________________________

From report at bugs.python.org  Thu Dec 16 01:46:05 2021
From: report at bugs.python.org (dhruv)
Date: Thu, 16 Dec 2021 06:46:05 +0000
Subject: [issue46094] Missing unit test on unittest.TestResult to check for
 required arguments
Message-ID: <1639637165.39.0.102854010232.issue46094@roundup.psfhosted.org>


New submission from dhruv <kapoor_1992 at hotmail.com>:

stream, descriptions, and verbosity seem like they aren't needed at first glance but are required to work with multiple inheritance. A simple test can clarify this.

----------
components: Tests
messages: 408674
nosy: DreamSh0t
priority: normal
severity: normal
status: open
title: Missing unit test on unittest.TestResult to check for required arguments
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46094>
_______________________________________

From report at bugs.python.org  Thu Dec 16 01:52:38 2021
From: report at bugs.python.org (dhruv)
Date: Thu, 16 Dec 2021 06:52:38 +0000
Subject: [issue46094] Missing unit test on unittest.TestResult to check for
 required arguments
In-Reply-To: <1639637165.39.0.102854010232.issue46094@roundup.psfhosted.org>
Message-ID: <1639637558.52.0.80834100875.issue46094@roundup.psfhosted.org>


Change by dhruv <kapoor_1992 at hotmail.com>:


----------
keywords: +patch
pull_requests: +28351
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30132

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46094>
_______________________________________

From report at bugs.python.org  Thu Dec 16 02:00:41 2021
From: report at bugs.python.org (dhruv)
Date: Thu, 16 Dec 2021 07:00:41 +0000
Subject: [issue46094] Missing unit test on unittest.TestResult to check for
 required arguments
In-Reply-To: <1639637165.39.0.102854010232.issue46094@roundup.psfhosted.org>
Message-ID: <1639638041.04.0.860594561543.issue46094@roundup.psfhosted.org>


Change by dhruv <kapoor_1992 at hotmail.com>:


----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46094>
_______________________________________

From report at bugs.python.org  Thu Dec 16 02:02:09 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Thu, 16 Dec 2021 07:02:09 +0000
Subject: [issue46093] 2D array issue
In-Reply-To: <1639631784.52.0.780624744558.issue46093@roundup.psfhosted.org>
Message-ID: <1639638129.26.0.561219905403.issue46093@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

problem_ary[:] creates a copy of problem_ary, so it's equal to:

>>> problem_ary[:]
[['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]

The [1] element of that is:

>>> problem_ary[:][1]
['d', 'e', 'f']

So this is working as expected.

I suggest you ask on StackOverflow or the python-list mailing list if you need more help in understanding how lists work in Python.

----------
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46093>
_______________________________________

From report at bugs.python.org  Thu Dec 16 02:04:08 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Thu, 16 Dec 2021 07:04:08 +0000
Subject: [issue46081] Document the msg argument for assertRaises
In-Reply-To: <1639557491.44.0.830591969979.issue46081@roundup.psfhosted.org>
Message-ID: <1639638248.0.0.0143847833826.issue46081@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
resolution:  -> wont fix

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46081>
_______________________________________

From report at bugs.python.org  Thu Dec 16 02:14:55 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 16 Dec 2021 07:14:55 +0000
Subject: [issue46092] Fix/update missing parameters in function signatures for
 Built-in Functions documentation.
In-Reply-To: <1639610832.29.0.673265280888.issue46092@roundup.psfhosted.org>
Message-ID: <1639638895.63.0.571745616462.issue46092@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

My understanding is that we're holding off on adding the slash notation to the main docs.  The reason is that they are mostly unintelligible to the average user.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46092>
_______________________________________

From report at bugs.python.org  Thu Dec 16 04:12:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 09:12:31 +0000
Subject: [issue28816] [doc] Clarify that zipimport does not invoke import
 hooks to load custom files from zip.
In-Reply-To: <1480326340.52.0.39566018579.issue28816@psf.upfronthosting.co.za>
Message-ID: <1639645951.66.0.947994910611.issue28816@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset a951c95a13c3555ac8fb1c8ee615ba3930ccc6f7 by Irit Katriel in branch 'main':
bpo-28816: [doc] clarify that zipimport invokes importers only for python files (GH-30060)
https://github.com/python/cpython/commit/a951c95a13c3555ac8fb1c8ee615ba3930ccc6f7


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28816>
_______________________________________

From report at bugs.python.org  Thu Dec 16 04:12:48 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 16 Dec 2021 09:12:48 +0000
Subject: [issue28816] [doc] Clarify that zipimport does not invoke import
 hooks to load custom files from zip.
In-Reply-To: <1480326340.52.0.39566018579.issue28816@psf.upfronthosting.co.za>
Message-ID: <1639645968.27.0.247414349053.issue28816@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28354
pull_request: https://github.com/python/cpython/pull/30134

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28816>
_______________________________________

From report at bugs.python.org  Thu Dec 16 04:12:43 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 16 Dec 2021 09:12:43 +0000
Subject: [issue28816] [doc] Clarify that zipimport does not invoke import
 hooks to load custom files from zip.
In-Reply-To: <1480326340.52.0.39566018579.issue28816@psf.upfronthosting.co.za>
Message-ID: <1639645963.93.0.874944614395.issue28816@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +28353
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30133

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28816>
_______________________________________

From report at bugs.python.org  Thu Dec 16 04:23:16 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 16 Dec 2021 09:23:16 +0000
Subject: [issue46092] Fix/update missing parameters in function signatures for
 Built-in Functions documentation.
In-Reply-To: <1639610832.29.0.673265280888.issue46092@roundup.psfhosted.org>
Message-ID: <1639646596.45.0.992077752182.issue46092@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

It concerns me that help() gives very different results for some of these functions than the signature you'll find in the documentation. I think a beginner would find that highly confusing. If the view is that the slash notation should not be added to this piece of documentation, since it is aimed at beginners, should help() be changed so that it does not include the slash notation for built-in functions?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46092>
_______________________________________

From report at bugs.python.org  Thu Dec 16 04:46:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 09:46:55 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1639648015.91.0.166623503977.issue22815@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

In verbose mode we do get output like the one in the code.google issue:

% cat tmp.py

import unittest

class TestStringMethods(unittest.TestCase):

    @unittest.expectedFailure
    def test_upper(self):
        self.assertEqual(2, 2)

    def test_lower(self):
        return

if __name__ == '__main__':
    unittest.main()

% ./python.exe -m tmp -v
test_lower (__main__.TestStringMethods) ... ok
test_upper (__main__.TestStringMethods) ... unexpected success

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Thu Dec 16 04:48:01 2021
From: report at bugs.python.org (=?utf-8?q?Ture_P=C3=A5lsson?=)
Date: Thu, 16 Dec 2021 09:48:01 +0000
Subject: [issue46095] Warning about iterate/modify has unwarranted detail
Message-ID: <1639648081.19.0.0569018631816.issue46095@roundup.psfhosted.org>


New submission from Ture P?lsson <ture at turepalsson.se>:

The language reference about the 'for' statement (https://docs.python.org/3/reference/compound_stmts.html#the-for-statement) has a "Note" box that states that the for statement uses an "internal counter" which is "incremented", and goes into detail about what happens when modifications happen before or after the current loop position. Surely this depends on the underlying iterator? For example, with a balanced tree an insert or a delete could completely re-jigger the tree with hard-to-predict results on an iterator.

----------
assignee: docs at python
components: Documentation
messages: 408680
nosy: docs at python, turepalsson
priority: normal
severity: normal
status: open
title: Warning about iterate/modify has unwarranted detail
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46095>
_______________________________________

From report at bugs.python.org  Thu Dec 16 04:48:42 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 09:48:42 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1639648122.72.0.258611678442.issue22815@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I don't think adding more information from the test would be helpful - when a test fails you have (and need) information about what happened. But when a test succeeds the code of the test basically tells you what happened - all the assertions passed.

I think we can close this.

----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Thu Dec 16 04:54:42 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Thu, 16 Dec 2021 09:54:42 +0000
Subject: [issue45959] Teach pprint about dict views
In-Reply-To: <1638428816.23.0.206050902249.issue45959@roundup.psfhosted.org>
Message-ID: <1639648482.81.0.221009280276.issue45959@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
keywords: +patch
nosy: +ajaksu2
nosy_count: 4.0 -> 5.0
pull_requests: +28355
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30135

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45959>
_______________________________________

From report at bugs.python.org  Thu Dec 16 05:00:31 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Thu, 16 Dec 2021 10:00:31 +0000
Subject: [issue45959] Teach pprint about dict views
In-Reply-To: <1638428816.23.0.206050902249.issue45959@roundup.psfhosted.org>
Message-ID: <1639648831.13.0.0193957467912.issue45959@roundup.psfhosted.org>


Daniel Diniz <ajaksu at gmail.com> added the comment:

I have tried to add this. The PR adds:
- PrettyPrinter._pprint_dict_view to handle dict_keys and dict_values (sorted with _safe_key).
= PrettyPrinter._pprint_dict_items_view to handle dict_items (sorted using _safe_tuple).
- Tests.

Would a NEWS entry or other form of documentation be necessary?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45959>
_______________________________________

From report at bugs.python.org  Thu Dec 16 05:15:44 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 16 Dec 2021 10:15:44 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1639649744.27.0.433751793989.issue22815@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I think the OP means that test details (test description, traceback, captured output) are printed for ERROR and FAIL in TextTestResult.printErrors(). Other possible results besides error and failure are success, skipped, expected failure and unexpected success. Success, skipped and expected failure are expected, they do not cause total failure, but unexpected success is different. Result.wasSuccessful() returns False if there are any errors, failures or unexpected successes. But unlike errors and failures we do not have any details about unexpected successes. It looks like oversight to me.

Yes, there are no traceback for unexpected success, but at least we can output the test description and captured output.

----------
assignee:  -> serhiy.storchaka
nosy: +ezio.melotti, michael.foord, serhiy.storchaka
resolution: out of date -> 
status: pending -> open
versions: +Python 3.11 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Thu Dec 16 05:33:14 2021
From: report at bugs.python.org (Dmitry)
Date: Thu, 16 Dec 2021 10:33:14 +0000
Subject: [issue46096] Support PyObject interface for global variables in local
 scope and debugger
Message-ID: <1639650794.38.0.196898311549.issue46096@roundup.psfhosted.org>


New submission from Dmitry <Dmitry_Zhamoytsin at mentor.com>:

We use the embedded Python in a multiscript environment. For example, VBS can execute Python code and vice versa. 

For that purpose we use a global context which is common for all running scripts (Python, VBS etc.) and control access to variables in that context by PyObject interface. 

But we faced with an issue:

1) Setting/deleting global variables in local scope are done outside of our control (without using PyObject interface).

2) A debugger (LOAD_NAME tag) does not see global variables in local scope.

We would like to fix that issue by adding a check for exact PyDict (PyDict_CheckExact) in STORE_GLOBAL, DELETE_GLOBAL and LOAD_NAME tags in ceval.c. 
If a global dictionary is redefined then use PyObject interface instead of direct PyDict one.

----------
components: Interpreter Core
hgrepos: 412
messages: 408684
nosy: dzhamoytsin
priority: normal
severity: normal
status: open
title: Support PyObject interface for global variables in local scope and debugger
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46096>
_______________________________________

From report at bugs.python.org  Thu Dec 16 05:56:20 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 16 Dec 2021 10:56:20 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1639652180.15.0.185372840931.issue22815@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
keywords: +patch
pull_requests: +28356
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30138

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Thu Dec 16 05:57:51 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 16 Dec 2021 10:57:51 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1639652271.66.0.56201201318.issue22815@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

There are no other details for unexpected successes, only test descriptions.

----------
type: behavior -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:06:10 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 16 Dec 2021 11:06:10 +0000
Subject: [issue46097] Split function versions into 1-0xffff and 0x1000+ regions
Message-ID: <1639652770.25.0.708221453944.issue46097@roundup.psfhosted.org>


New submission from Mark Shannon <mark at hotpy.org>:

Because functions are mutable, specifically because the __code__ attribute is mutable, we need to version functions when specializing.

However, some specializations (for special methods mainly) only have space for 16 bit versions.

It is likely that programs will have more than 2**16 functions versions, but it is much less likely that they will have more than 2**16 versions of special methods.

We should partition the version space into 1-0xffff for use by special methods and 0x1000+ for use by other methods.

See https://github.com/python/cpython/pull/30129 for an example of why this is needed.

----------
components: Interpreter Core
messages: 408686
nosy: Mark.Shannon, brandtbucher
priority: normal
severity: normal
status: open
title: Split function versions into 1-0xffff and 0x1000+ regions
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46097>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:08:35 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 16 Dec 2021 11:08:35 +0000
Subject: [issue45829] Remove C stack use by specializing BINARY_SUBSCR,
 STORE_SUBSCR, LOAD_ATTR, and STORE_ATTR
In-Reply-To: <1637142611.15.0.521267590311.issue45829@roundup.psfhosted.org>
Message-ID: <1639652915.98.0.300215174704.issue45829@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 62a8a0c5223f750e22ee381d3cfbdb718cf1cc93 by Brandt Bucher in branch 'main':
bpo-45829: Check `__getitem__`'s version for overflow before specializing (GH-30129)
https://github.com/python/cpython/commit/62a8a0c5223f750e22ee381d3cfbdb718cf1cc93


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45829>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:28:49 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 11:28:49 +0000
Subject: [issue46098] Missing test for multi-line errors in traceback
Message-ID: <1639654129.22.0.790505803608.issue46098@roundup.psfhosted.org>


New submission from Irit Katriel <iritkatriel at gmail.com>:

While reviewing a change nearby, Erlend noticed that there is no test coverage for the multi-line error case in the traceback printing code added in bpo-43914.

See https://github.com/python/cpython/pull/30073#discussion_r770114429

----------
messages: 408688
nosy: erlendaasland, iritkatriel, pablogsal
priority: normal
severity: normal
status: open
title: Missing test for multi-line errors in traceback
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46098>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:29:34 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 16 Dec 2021 11:29:34 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639654174.06.0.132950241968.issue46072@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
pull_requests: +28357
pull_request: https://github.com/python/cpython/pull/30139

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:37:25 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 11:37:25 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1639654645.64.0.863268571349.issue22815@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Yes, this is why I don?t understand the request here. When a test fails you know which assertion was violated or which line raised an exception. When a multi line test succeeds, you don?t know which line was supposed to fail.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:42:13 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 11:42:13 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1639654933.65.0.622489410379.issue22815@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I know that in unittest2 an unexpected success did not cause the test to fail (when we moved from unittest2 to unittest at work we got test failures due to unexpected successes that previously did not show up). I don't know the whole history of how unittest2 came to be, I think it was a clone of an older copy of unittest? Maybe that it the background for this issue?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:42:31 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 16 Dec 2021 11:42:31 +0000
Subject: [issue46094] Missing unit test on unittest.TestResult to check for
 required arguments
In-Reply-To: <1639637165.39.0.102854010232.issue46094@roundup.psfhosted.org>
Message-ID: <1639654951.97.0.914100778714.issue46094@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

What do you mean they are required? All parameters of TestResult() are optional.

----------
nosy: +ezio.melotti, michael.foord, rbcollins, serhiy.storchaka
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46094>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:48:16 2021
From: report at bugs.python.org (Ned Batchelder)
Date: Thu, 16 Dec 2021 11:48:16 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639655296.12.0.70866173844.issue46028@roundup.psfhosted.org>


Ned Batchelder <ned at nedbatchelder.com> added the comment:

Here's the experiment again with 3.10.1 and 3.11.0a3, and more ls's:


$ python3.10 -V
Python 3.10.1

$ python3.10 -m venv v310

$ ls -al v310/bin
total 72
drwxr-xr-x  12 nedbatchelder  wheel   384 Dec 16 06:42 ./
drwxr-xr-x   6 nedbatchelder  wheel   192 Dec 16 06:42 ../
-rw-r--r--   1 nedbatchelder  wheel  9033 Dec 16 06:42 Activate.ps1
-rw-r--r--   1 nedbatchelder  wheel  1993 Dec 16 06:42 activate
-rw-r--r--   1 nedbatchelder  wheel   919 Dec 16 06:42 activate.csh
-rw-r--r--   1 nedbatchelder  wheel  2061 Dec 16 06:42 activate.fish
-rwxr-xr-x   1 nedbatchelder  wheel   246 Dec 16 06:42 pip*
-rwxr-xr-x   1 nedbatchelder  wheel   246 Dec 16 06:42 pip3*
-rwxr-xr-x   1 nedbatchelder  wheel   246 Dec 16 06:42 pip3.10*
lrwxr-xr-x   1 nedbatchelder  wheel    10 Dec 16 06:42 python@ -> python3.10
lrwxr-xr-x   1 nedbatchelder  wheel    10 Dec 16 06:42 python3@ -> python3.10
lrwxr-xr-x   1 nedbatchelder  wheel    25 Dec 16 06:42 python3.10@ -> /usr/local/bin/python3.10

$ ls -al /usr/local/bin/python3.10
lrwxr-xr-x  1 nedbatchelder  admin  53 Dec 16 06:38 /usr/local/bin/python3.10@ -> /usr/local/pyenv/pyenv/versions/3.10.1/bin/python3.10

$ v310/bin/python -m venv v310-nested

$ v310-nested/bin/python -V
Python 3.10.1

$ ls -al v310-nested/bin
total 72
drwxr-xr-x  12 nedbatchelder  wheel   384 Dec 16 06:43 ./
drwxr-xr-x   6 nedbatchelder  wheel   192 Dec 16 06:43 ../
-rw-r--r--   1 nedbatchelder  wheel  9033 Dec 16 06:43 Activate.ps1
-rw-r--r--   1 nedbatchelder  wheel  2014 Dec 16 06:43 activate
-rw-r--r--   1 nedbatchelder  wheel   940 Dec 16 06:43 activate.csh
-rw-r--r--   1 nedbatchelder  wheel  2082 Dec 16 06:43 activate.fish
-rwxr-xr-x   1 nedbatchelder  wheel   249 Dec 16 06:43 pip*
-rwxr-xr-x   1 nedbatchelder  wheel   249 Dec 16 06:43 pip3*
-rwxr-xr-x   1 nedbatchelder  wheel   249 Dec 16 06:43 pip3.10*
lrwxr-xr-x   1 nedbatchelder  wheel    37 Dec 16 06:43 python@ -> /private/tmp/bpo46028/v310/bin/python
lrwxr-xr-x   1 nedbatchelder  wheel     6 Dec 16 06:43 python3@ -> python
lrwxr-xr-x   1 nedbatchelder  wheel     6 Dec 16 06:43 python3.10@ -> python

$ ls -al /private/tmp/bpo46028/v310/bin/python
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 06:42 /private/tmp/bpo46028/v310/bin/python@ -> python3.10


$ python3.11 -V
Python 3.11.0a3

$ python3.11 -m venv v311

$ ls -al v311/bin
total 72
drwxr-xr-x  12 nedbatchelder  wheel   384 Dec 16 06:45 ./
drwxr-xr-x   6 nedbatchelder  wheel   192 Dec 16 06:45 ../
-rw-r--r--   1 nedbatchelder  wheel  9033 Dec 16 06:45 Activate.ps1
-rw-r--r--   1 nedbatchelder  wheel  1993 Dec 16 06:45 activate
-rw-r--r--   1 nedbatchelder  wheel   919 Dec 16 06:45 activate.csh
-rw-r--r--   1 nedbatchelder  wheel  2061 Dec 16 06:45 activate.fish
-rwxr-xr-x   1 nedbatchelder  wheel   246 Dec 16 06:45 pip*
-rwxr-xr-x   1 nedbatchelder  wheel   246 Dec 16 06:45 pip3*
-rwxr-xr-x   1 nedbatchelder  wheel   246 Dec 16 06:45 pip3.11*
lrwxr-xr-x   1 nedbatchelder  wheel    10 Dec 16 06:45 python@ -> python3.11
lrwxr-xr-x   1 nedbatchelder  wheel    10 Dec 16 06:45 python3@ -> python3.11
lrwxr-xr-x   1 nedbatchelder  wheel    25 Dec 16 06:45 python3.11@ -> /usr/local/bin/python3.11

$ ls -al /usr/local/bin/python3.11
lrwxr-xr-x  1 nedbatchelder  admin  55 Dec  9 12:23 /usr/local/bin/python3.11@ -> /usr/local/pyenv/pyenv/versions/3.11.0a3/bin/python3.11

$ v311/bin/python -m venv v311-nested
Error: [Errno 2] No such file or directory: '/private/tmp/bpo46028/v311-nested/bin/python'

$ ls -al v311-nested/bin
total 0
drwxr-xr-x  5 nedbatchelder  wheel  160 Dec 16 06:45 ./
drwxr-xr-x  6 nedbatchelder  wheel  192 Dec 16 06:45 ../
lrwxr-xr-x  1 nedbatchelder  wheel   21 Dec 16 06:45 python@ -> /usr/local/bin/python
lrwxr-xr-x  1 nedbatchelder  wheel    6 Dec 16 06:45 python3@ -> python
lrwxr-xr-x  1 nedbatchelder  wheel    6 Dec 16 06:45 python3.11@ -> python

$ ls -al /usr/local/bin/python
ls: /usr/local/bin/python: No such file or directory

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:52:50 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 16 Dec 2021 11:52:50 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1639655570.26.0.231523132127.issue22815@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Unless you tun tests in verbose mode you do not know which of tests was unexpectedly successful. And even in the verbose mode it is not easy to find that test in long output.

Yes, unexpected successes considered successes in earlier versions. See issue20165.

You can find many interesting when read git logs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:54:02 2021
From: report at bugs.python.org (Jakub Kulik)
Date: Thu, 16 Dec 2021 11:54:02 +0000
Subject: [issue46099] Solaris: Fix pthread_getcpuclockid test
Message-ID: <1639655642.85.0.652795317343.issue46099@roundup.psfhosted.org>


New submission from Jakub Kulik <jakub.kulik at oracle.com>:

On Solaris, when `pthread_getcpuclockid()` is called with current thread id as an argument, it returns `CLOCK_THREAD_CPUTIME_ID`.

======================================================================
FAIL: test_pthread_getcpuclockid (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/share/buildbot-worker/default/3.9.kulikjak-solaris-sparcv9/build/Lib/test/test_time.py", line 116, in test_pthread_getcpuclockid
    self.assertNotEqual(clk_id, time.CLOCK_THREAD_CPUTIME_ID)
AssertionError: 2 == 2

Based on the test code, 32bit AIX seems to do the same thing so I added another similar code for Solaris.

----------
components: Tests
messages: 408694
nosy: kulikjak
priority: normal
severity: normal
status: open
title: Solaris: Fix pthread_getcpuclockid test
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46099>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:56:09 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 16 Dec 2021 11:56:09 +0000
Subject: [issue20165] unittest TestResult wasSuccessful returns True when
 there are unexpected successes
In-Reply-To: <1389122721.74.0.155844601606.issue20165@psf.upfronthosting.co.za>
Message-ID: <1639655769.27.0.738464646314.issue20165@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

See also issue22815.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20165>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:57:18 2021
From: report at bugs.python.org (Jakub Kulik)
Date: Thu, 16 Dec 2021 11:57:18 +0000
Subject: [issue46099] Solaris: Fix pthread_getcpuclockid test
In-Reply-To: <1639655642.85.0.652795317343.issue46099@roundup.psfhosted.org>
Message-ID: <1639655838.0.0.487010631624.issue46099@roundup.psfhosted.org>


Change by Jakub Kulik <jakub.kulik at oracle.com>:


----------
keywords: +patch
pull_requests: +28358
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30140

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46099>
_______________________________________

From report at bugs.python.org  Thu Dec 16 06:58:24 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 16 Dec 2021 11:58:24 +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: <1639655904.48.0.512953345131.issue36674@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36674>
_______________________________________

From report at bugs.python.org  Thu Dec 16 07:13:02 2021
From: report at bugs.python.org (Dmitry)
Date: Thu, 16 Dec 2021 12:13:02 +0000
Subject: [issue46096] Support PyObject interface for global variables in local
 scope and debugger
In-Reply-To: <1639650794.38.0.196898311549.issue46096@roundup.psfhosted.org>
Message-ID: <1639656782.36.0.948323528967.issue46096@roundup.psfhosted.org>


Change by Dmitry <Dmitry_Zhamoytsin at mentor.com>:


----------
keywords: +patch
pull_requests: +28359
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30141

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46096>
_______________________________________

From report at bugs.python.org  Thu Dec 16 07:15:32 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 16 Dec 2021 12:15:32 +0000
Subject: [issue12681] unittest expectedFailure could take a message argument
 like skip does
In-Reply-To: <1312285316.59.0.648531105022.issue12681@psf.upfronthosting.co.za>
Message-ID: <1639656932.13.0.426299728165.issue12681@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Such change would break a lot of existing interfaces.

* addUnexpectedSuccess() has a single parameter. The change will add the second parameter and will break subclasses of TestResult.
* addExpectedFailure() has two parameter. The change will add the third parameter and will break subclasses of TestResult.
* unexpectedSuccesses is a list of tests. The change will make it a list of 2-tuples and will break users of TestResult.
* expectedFailures is a list of 2-tuples. The change will make it a list of 3-tuples and will break users of TestResult.

It is too destructive change. I think we can live without a message argument for expectedFailure().

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12681>
_______________________________________

From report at bugs.python.org  Thu Dec 16 07:16:09 2021
From: report at bugs.python.org (John Marshall)
Date: Thu, 16 Dec 2021 12:16:09 +0000
Subject: [issue45554] multiprocessing exitcode is insufficiently documented
In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org>
Message-ID: <1639656969.12.0.314003597796.issue45554@roundup.psfhosted.org>


Change by John Marshall <jmarshall at hey.com>:


----------
keywords: +patch
pull_requests: +28360
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30142

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45554>
_______________________________________

From report at bugs.python.org  Thu Dec 16 07:23:29 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 12:23:29 +0000
Subject: [issue28816] [doc] Clarify that zipimport does not invoke import
 hooks to load custom files from zip.
In-Reply-To: <1480326340.52.0.39566018579.issue28816@psf.upfronthosting.co.za>
Message-ID: <1639657409.51.0.133860455879.issue28816@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 4c1effaaee472cc67f3186411a3df4f39af3d71a by Miss Islington (bot) in branch '3.9':
bpo-28816: [doc] clarify that zipimport invokes importers only for python files (GH-30060) (GH-30134)
https://github.com/python/cpython/commit/4c1effaaee472cc67f3186411a3df4f39af3d71a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28816>
_______________________________________

From report at bugs.python.org  Thu Dec 16 07:23:34 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Thu, 16 Dec 2021 12:23:34 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1639657414.12.0.357805023269.issue23522@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

Prompted by Guido's reopening of the ticket, I have given it some more thought, and have softened my views. Jake if you're still around, perhaps there is more to what you said than I initially thought, and I just needed fresh eyes to see it. Sorry for being so slow to come around.

People may be less likely to wrongly imagine there is a single centre location of data if we use the term "central tendency" instead of location. I think we should also drop the reference to mode(), since it only works with discrete data and is not suitable for continuous data.

"The mean is strongly affected by outliers and is not necessarily a typical example of the data points. For a more robust, although less efficient, measure of central tendency, see median()"

How do we feel about linking to Wikipedia? I'd like to link both outliers and central tendency to the appropriate Wikipedia entries.

----------
stage: resolved -> 
versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Thu Dec 16 07:23:45 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 12:23:45 +0000
Subject: [issue28816] [doc] Clarify that zipimport does not invoke import
 hooks to load custom files from zip.
In-Reply-To: <1480326340.52.0.39566018579.issue28816@psf.upfronthosting.co.za>
Message-ID: <1639657425.74.0.27192064537.issue28816@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 0194bbbee6a12264e93d3217c774e226f0a1737d by Miss Islington (bot) in branch '3.10':
bpo-28816: [doc] clarify that zipimport invokes importers only for python files (GH-30060) (GH-30133)
https://github.com/python/cpython/commit/0194bbbee6a12264e93d3217c774e226f0a1737d


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28816>
_______________________________________

From report at bugs.python.org  Thu Dec 16 07:24:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 12:24:31 +0000
Subject: [issue28816] [doc] Clarify that zipimport does not invoke import
 hooks to load custom files from zip.
In-Reply-To: <1480326340.52.0.39566018579.issue28816@psf.upfronthosting.co.za>
Message-ID: <1639657471.15.0.148243054735.issue28816@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28816>
_______________________________________

From report at bugs.python.org  Thu Dec 16 07:37:48 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 16 Dec 2021 12:37:48 +0000
Subject: [issue46100] Simplify readline / editline detection
Message-ID: <1639658268.15.0.0477908867569.issue46100@roundup.psfhosted.org>


New submission from Christian Heimes <lists at cheimes.de>:

The configure.ac code for editline/readline detection is complicated. Especially the code for linking with extra termcap libraries makes it complicated to port the check to pkg-config. The termcap checks were added by Greg in bpo-3645 and commit 188209465a966cf046ed7946589aa21767f95e68 .

I propose to simplify the checks and require a readline 4.2 compatible API. GNU readline was released in 2001 (20 years ago). NetBSD libedit editline/readline.h has RL_READLINE_VERSION 0x0402 for at least 10 years.

* drop the check for additional termcap libs
* remove the fallback to completion_matches
* replace AC_CHECK_LIB($LIBREADLINE, ...) checks with a check for RL_READLINE_VERSION >= 0x0402

What do you think?

----------
components: Build
messages: 408700
nosy: christian.heimes, erlendaasland, gregory.p.smith
priority: normal
severity: normal
status: open
title: Simplify readline / editline detection
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46100>
_______________________________________

From report at bugs.python.org  Thu Dec 16 08:07:06 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Thu, 16 Dec 2021 13:07:06 +0000
Subject: [issue46100] Simplify readline / editline detection
In-Reply-To: <1639658268.15.0.0477908867569.issue46100@roundup.psfhosted.org>
Message-ID: <1639660026.65.0.537130371748.issue46100@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

FWIW, the XCode SDKs for macOS 11 and 12 use the NetBSD editline library.


$ grep "NetBSD: readline" /Library/Developer/CommandLineTools/SDKs/MacOSX*.sdk/usr/include/readline/readline.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
$ grep RL_READLINE_VERSION /Library/Developer/CommandLineTools/SDKs/MacOSX*.sdk/usr/include/readline/readline.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402


This is what Homebrew provides:

$ PKG_CONFIG_PATH=$(brew --prefix readline)/lib/pkgconfig pkg-config readline --cflags --libs
-I/usr/local/Cellar/readline/8.1.1/include -L/usr/local/Cellar/readline/8.1.1/lib -lreadline

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46100>
_______________________________________

From report at bugs.python.org  Thu Dec 16 08:41:06 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 16 Dec 2021 13:41:06 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639662066.84.0.94381115426.issue46072@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 4506bbede1644e985991884964b43afa7ee6f609 by Mark Shannon in branch 'main':
bpo-46072: Document --enable-stats option. (GH-30139)
https://github.com/python/cpython/commit/4506bbede1644e985991884964b43afa7ee6f609


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:00:23 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 16 Dec 2021 14:00:23 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1639663223.98.0.672855406917.issue23522@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
nosy: +mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:18:52 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 16 Dec 2021 14:18:52 +0000
Subject: [issue46088] Build hangs under Visual Studio in deepfreeze stage
In-Reply-To: <1639595221.47.0.522675592351.issue46088@roundup.psfhosted.org>
Message-ID: <1639664332.77.0.318336275874.issue46088@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
pull_requests: +28361
pull_request: https://github.com/python/cpython/pull/30143

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46088>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:22:16 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 16 Dec 2021 14:22:16 +0000
Subject: [issue46088] Build hangs under Visual Studio in deepfreeze stage
In-Reply-To: <1639595221.47.0.522675592351.issue46088@roundup.psfhosted.org>
Message-ID: <1639664536.2.0.689686050491.issue46088@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

I posted a PR that shells out to the find_python script and captures its output to use during VS builds.

Theoretically, this could save us from running it in build.bat, but I like having the detection and messages up front rather than buried deep in the build logs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46088>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:24:25 2021
From: report at bugs.python.org (Ken Jin)
Date: Thu, 16 Dec 2021 14:24:25 +0000
Subject: [issue46097] Split function versions into 1-0xffff and 0x1000+ regions
In-Reply-To: <1639652770.25.0.708221453944.issue46097@roundup.psfhosted.org>
Message-ID: <1639664665.86.0.188453551363.issue46097@roundup.psfhosted.org>


Change by Ken Jin <kenjin4096 at gmail.com>:


----------
nosy: +kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46097>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:25:02 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 16 Dec 2021 14:25:02 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639664702.49.0.440239374685.issue46072@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

I just noticed that you are using hard-coded paths with /tmp for the pystats directory. That's problematic and opens the possibility of a symlink race attack.

Could please add exclusive create to _Py_PrintSpecializationStats()? The will prevent symlink attacks. fopen() mode "x" is not generally available in all libcs. You have to combine open() and fdopen():


int flags = O_WRONLY | O_CREAT | O_EXCL;
#ifdef O_NOFOLLOW
flags |= O_NOFOLLOW;
#endif
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#endif

int fd = open(path, flags);
if (fd >= 0) {
    FILE *fout = fdopen(fd, "w");
}

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:30:36 2021
From: report at bugs.python.org (Ken Jin)
Date: Thu, 16 Dec 2021 14:30:36 +0000
Subject: [issue45755] Specialized generic class does not return class
 attributes in dir
In-Reply-To: <1636399849.8.0.841580145929.issue45755@roundup.psfhosted.org>
Message-ID: <1639665036.08.0.458451406637.issue45755@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset d6e13747161d7b634b47d2d3d212ed3be4a21fab by Ken Jin in branch 'main':
bpo-45755: [typing] Reveal class attributes of generic in generic aliases in `dir()` (GH-29962)
https://github.com/python/cpython/commit/d6e13747161d7b634b47d2d3d212ed3be4a21fab


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45755>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:32:52 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 16 Dec 2021 14:32:52 +0000
Subject: [issue46088] Build hangs under Visual Studio in deepfreeze stage
In-Reply-To: <1639595221.47.0.522675592351.issue46088@roundup.psfhosted.org>
Message-ID: <1639665172.78.0.522491625997.issue46088@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

VS builds could use the bootstrap interpreter again. This will remove the need to have a Python interpreter installed to build Python on Windows.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46088>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:35:18 2021
From: report at bugs.python.org (Ken Jin)
Date: Thu, 16 Dec 2021 14:35:18 +0000
Subject: [issue45755] Specialized generic class does not return class
 attributes in dir
In-Reply-To: <1636399849.8.0.841580145929.issue45755@roundup.psfhosted.org>
Message-ID: <1639665318.25.0.708562451269.issue45755@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:

Hi, I won't be backporting this to 3.9 since I don't like having jarring behavior changes so late into the bugfix cycle of a Python version.

I'm tempted to backport to 3.10. For now, I'll be conservative and just merge it in main. Please do tell me if any of you feel that I should backport to 3.10 too.

3.6-3.8 are in security-fix only mode so they won't get any bugfixes.

Thanks Kevin for the interesting bug report, and Karthikeyan for saving me a ton of time debugging this!

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45755>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:47:13 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 16 Dec 2021 14:47:13 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639666033.57.0.696871695061.issue46072@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:

The --enable-stats option is for CPython development and shouldn't be turned on for a release version, so I'm not really concerned about people attacking their own machines.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Thu Dec 16 09:51:59 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 16 Dec 2021 14:51:59 +0000
Subject: [issue46088] Build hangs under Visual Studio in deepfreeze stage
In-Reply-To: <1639595221.47.0.522675592351.issue46088@roundup.psfhosted.org>
Message-ID: <1639666319.88.0.459433389229.issue46088@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

On Windows we automatically download a runtime if you don't have one, so this isn't such a big deal. You *do* need an internet connection to do this, of course, but that's the case for most of our external dependencies already.

Plus I don't think we're even building the bootstrap interpreter on Windows yet?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46088>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:06:43 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 16 Dec 2021 15:06:43 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639667203.51.0.098603808886.issue46028@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
keywords: +patch
pull_requests: +28362
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30144

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:08:13 2021
From: report at bugs.python.org (Steve Dower)
Date: Thu, 16 Dec 2021 15:08:13 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639667293.18.0.813555116857.issue46028@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

This PR *might* be a fix, but I think it's only partial. It isn't going to work if you've made a venv and copied "python3"->"python", for example.

It still might be best solved by writing base_executable into pyvenv.cfg, and then simply reading it out.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:21:49 2021
From: report at bugs.python.org (Mark Shannon)
Date: Thu, 16 Dec 2021 15:21:49 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639668109.12.0.0958159324866.issue46072@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
pull_requests: +28363
pull_request: https://github.com/python/cpython/pull/30145

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:29:06 2021
From: report at bugs.python.org (Lucas Cimon)
Date: Thu, 16 Dec 2021 15:29:06 +0000
Subject: [issue46101] argparse: using parents & subcommands,
 options can be ignored
Message-ID: <1639668546.2.0.488904720024.issue46101@roundup.psfhosted.org>


New submission from Lucas Cimon <lucas.cimon at gmail.com>:

Hi!

Here is some minimal code reproducing the issue:

    import argparse

    common_opts_parser = argparse.ArgumentParser(add_help=False)
    common_opts_parser.add_argument("--endpoint", choices=("prod", "dev"), default="dev")

    parser = argparse.ArgumentParser(parents=[common_opts_parser])
    subparsers = parser.add_subparsers(required=True)

    subcmd_cmd = subparsers.add_parser("subcmd", parents=[common_opts_parser])
    subcmd_cmd.add_argument("--debug", action="store_true")

    print(parser.parse_args())

Everything works fine / as expected when specifying the common optional arg last:

    $ ./bug_repro.py subcmd --endpoint=dev
    Namespace(endpoint='dev', debug=False)

However when specifying the --endpoint between the program and the subcommand, the value provided is ignored:

    $ ./bug_repro.py --endpoint=dev subcmd
    Namespace(endpoint=None, debug=False)

I have a PR ready to fix that.

----------
components: Library (Lib)
messages: 408711
nosy: Lucas Cimon
priority: normal
severity: normal
status: open
title: argparse: using parents & subcommands, options can be ignored
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46101>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:31:21 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 15:31:21 +0000
Subject: [issue22047] Deprecate unsupported nesting of argparse groups
In-Reply-To: <1406131424.14.0.0235697032218.issue22047@psf.upfronthosting.co.za>
Message-ID: <1639668681.25.0.853162962467.issue22047@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 30322c497e0b8d978f7a0de95985aac9c5daf1ac by Irit Katriel in branch 'main':
bpo-22047: [argparse] deprecate nested argument groups and mutually exclusive groups (GH-30098)
https://github.com/python/cpython/commit/30322c497e0b8d978f7a0de95985aac9c5daf1ac


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22047>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:32:13 2021
From: report at bugs.python.org (Lucas Cimon)
Date: Thu, 16 Dec 2021 15:32:13 +0000
Subject: [issue46101] argparse: using parents & subcommands,
 options can be ignored
In-Reply-To: <1639668546.2.0.488904720024.issue46101@roundup.psfhosted.org>
Message-ID: <1639668733.98.0.761427845274.issue46101@roundup.psfhosted.org>


Change by Lucas Cimon <lucas.cimon at gmail.com>:


----------
keywords: +patch
pull_requests: +28364
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30146

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46101>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:34:07 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 15:34:07 +0000
Subject: [issue46057] argparse: embedded groups may prevent options from being
 in help output
In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org>
Message-ID: <1639668847.53.0.795866727416.issue46057@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Nesting argument groups and mutually exclusive groups is now deprecated (see issue22047). Thank you for the bug report.

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46057>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:34:57 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 15:34:57 +0000
Subject: [issue22047] Deprecate unsupported nesting of argparse groups
In-Reply-To: <1406131424.14.0.0235697032218.issue22047@psf.upfronthosting.co.za>
Message-ID: <1639668897.02.0.0118933353739.issue22047@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22047>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:36:42 2021
From: report at bugs.python.org (Aidas Petryla)
Date: Thu, 16 Dec 2021 15:36:42 +0000
Subject: [issue46102] pdb can't convert dict_values to list
Message-ID: <1639669002.59.0.612026213531.issue46102@roundup.psfhosted.org>


New submission from Aidas Petryla <apetryla at redhat.com>:

Reproducing:

Running pdb shell (for example "python -m pdb <some_file.py>"

Input:
x = {'a': 1}
list(x.values())

Output:
*** Error in argument: '(x.values())'

----------
messages: 408714
nosy: apetryla
priority: normal
severity: normal
status: open
title: pdb can't convert dict_values to list
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46102>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:38:30 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 15:38:30 +0000
Subject: [issue45690] Argparse exclusive group inside required exclusive group
 displays incorrectly
In-Reply-To: <1635860360.92.0.910770346728.issue45690@roundup.psfhosted.org>
Message-ID: <1639669110.1.0.145669771525.issue45690@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Nesting argument groups and mutually exclusive groups is now deprecated (see issue22047). Thank you for the bug report.

----------
nosy: +iritkatriel
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate unsupported nesting of argparse groups

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45690>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:39:12 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 15:39:12 +0000
Subject: [issue38590] argparse unexpected behavior with argument group inside
 mutually exclusive group
In-Reply-To: <1572027184.79.0.23480523249.issue38590@roundup.psfhosted.org>
Message-ID: <1639669152.92.0.359193298541.issue38590@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Nesting argument groups and mutually exclusive groups is now deprecated (see issue22047). Thank you for the bug report.

----------
nosy: +iritkatriel
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate unsupported nesting of argparse groups

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38590>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:40:43 2021
From: report at bugs.python.org (hongweipeng)
Date: Thu, 16 Dec 2021 15:40:43 +0000
Subject: [issue46103] inspect.getmembers will call the instance __bases__
 attribute, which may cause an exception
Message-ID: <1639669243.89.0.636826061264.issue46103@roundup.psfhosted.org>


New submission from hongweipeng <hongweichen8888 at sina.com>:

root at debian:/workspace/cpython# ./python
Python 3.11.0a3+ (heads/main-dirty:b123ad8030, Dec 16 2021, 06:16:15) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> class Foo:
...   def __getattr__(self, attr):
...     return None
... 
>>> inspect.getmembers(Foo())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/workspace/cpython/Lib/inspect.py", line 488, in getmembers
    return _getmembers(object, predicate, getattr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/cpython/Lib/inspect.py", line 455, in _getmembers
    for base in object.__bases__:
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

----------
components: Library (Lib)
messages: 408717
nosy: hongweipeng
priority: normal
severity: normal
status: open
title: inspect.getmembers will call the instance __bases__ attribute, which may cause an exception
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46103>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:42:33 2021
From: report at bugs.python.org (Lucas Cimon)
Date: Thu, 16 Dec 2021 15:42:33 +0000
Subject: [issue38584] argparse: Specifying a whitespace-only help message to a
 positional arg triggers an IndexError when displaying --help
In-Reply-To: <1571928054.48.0.618310381662.issue38584@roundup.psfhosted.org>
Message-ID: <1639669353.5.0.705731721403.issue38584@roundup.psfhosted.org>


Lucas Cimon <lucas.cimon at gmail.com> added the comment:

This was resolved by https://github.com/python/cpython/pull/28050

----------
message_count: 4.0 -> 5.0
pull_requests: +28366
status: open -> closed
pull_request: https://github.com/python/cpython/pull/28050

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38584>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:43:31 2021
From: report at bugs.python.org (Jason Madden)
Date: Thu, 16 Dec 2021 15:43:31 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1639669411.36.0.972532109949.issue46090@roundup.psfhosted.org>


Change by Jason Madden <jason at nextthought.com>:


----------
nosy: +jmadden

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:45:51 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 15:45:51 +0000
Subject: [issue46058] argparse: arg groups and mutually exclusive groups
 behave inconsitently
In-Reply-To: <1639335674.28.0.221723621867.issue46058@roundup.psfhosted.org>
Message-ID: <1639669551.99.0.350028876557.issue46058@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Nesting argument groups and mutually exclusive groups is now deprecated (see issue22047). Thank you for the bug report.

Note Paul's comment about why nesting mutually exclusive groups does not give you anything in terms of semantics.

----------
nosy: +iritkatriel
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate unsupported nesting of argparse groups

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46058>
_______________________________________

From report at bugs.python.org  Thu Dec 16 10:46:53 2021
From: report at bugs.python.org (hongweipeng)
Date: Thu, 16 Dec 2021 15:46:53 +0000
Subject: [issue46103] inspect.getmembers will call the instance __bases__
 attribute, which may cause an exception
In-Reply-To: <1639669243.89.0.636826061264.issue46103@roundup.psfhosted.org>
Message-ID: <1639669613.34.0.641617905064.issue46103@roundup.psfhosted.org>


Change by hongweipeng <hongweichen8888 at sina.com>:


----------
keywords: +patch
pull_requests: +28367
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30147

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46103>
_______________________________________

From report at bugs.python.org  Thu Dec 16 11:13:28 2021
From: report at bugs.python.org (Sebastian Berg)
Date: Thu, 16 Dec 2021 16:13:28 +0000
Subject: [issue45383] PyType_FromSpec API fails to use metaclass of bases
In-Reply-To: <1633470686.49.0.00898443232155.issue45383@roundup.psfhosted.org>
Message-ID: <1639671208.64.0.319754322677.issue45383@roundup.psfhosted.org>


Sebastian Berg <sebastian at sipsolutions.net> added the comment:

Sorry, I need some time to dive back into this, so some things might be garbled :).  Yes, I do agree supporting a custom `tp_new` here seems incredibly tricky.  I have not thought about the implications of this, though.

> guess the safest option is to fail when the metaclass has a custom tp_new

That would seem OK, but I can't quite judge it.  It may mean that I have to do a custom factory to create new metaclass instances from Python, but that is probably for the better anyway.

Now, calling `tp_new` is a bit useless, since from C we don't have a dict anyway (at least not really).  So yeah, this does not make sense at all for most Python defined metaclasses...  (they may want to inspect/mutate the dict)

> But at that point, this is duplicating a lot of existing functionality, and I'm starting to wonder if this wouldn't all be better with calling the metaclass instead.

I do not think I am following :(.  My worry is that I want people to create a MetaClass instance through C (but not be locked into static types forever).

My current thought is that I would like it be possible to do something like:

    /* Create a new type object */
    type_spec = {stuff};
    newtype = PyType_FromSpec(&type_spec);
    /* Finalize the MetaClass */
    metatype_spec = {more_stuff};
    PyArray_InitDTypeFromSpec(newtype, &metatype_spec);

Of course I can move this into a single function and create the class for the user.  But I am uncertain that piping everything through `tp_new` will help?  At some point I thought that the user should create a subclass, and I create another class inheriting it.  But it also seems convoluted and complicated.

I have no idea right now, but maybe there could also be a way to make creating a metaclass-factory in C easier, rather than supporting `PyType_FromSpec` for metaclasses.
(I.e. an `PType_InitFromSpec()` doing most of what `PyType_FromSpec` does, but really meant to be only used be such metaclass factories.)

> - basicsize/itemsize could be allowed with __basicsize__/__itemsize__ in the dict.

Do we need this?  I need the basicsize of the metaclass, but that of the class seems fixed/OK?

> - flags: we could add mechanisms to set individual flags after the type is created, as needed.

Seems fine, yeah.

> - slots can usually be applied after the class is created; maybe there should be a public function for this.
> - members could theoretically be copied to individual descriptors; there doesn't seem much need for keeping tp_members around.

But a Python MetaClass (that the author may not even realize about) might need access to these to work properly?
A bit far fetched, but...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45383>
_______________________________________

From report at bugs.python.org  Thu Dec 16 11:23:54 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 16 Dec 2021 16:23:54 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
Message-ID: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>


New submission from Alex Waygood <Alex.Waygood at Gmail.com>:

There are a few places in the typing docs where old-style (pre-PEP 526) syntax is used in examples. It doesn't look like these examples have been updated since 2016; it would be good to change them so that they use the newer syntax introduced in PEP 526.

----------
assignee: docs at python
components: Documentation
messages: 408721
nosy: AlexWaygood, docs at python, gvanrossum, kj
priority: normal
severity: normal
status: open
title: Reduce use of old-style syntax in typing docs
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Thu Dec 16 11:27:20 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 16 Dec 2021 16:27:20 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639672040.92.0.229323217033.issue46104@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
keywords: +patch
pull_requests: +28368
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30148

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Thu Dec 16 11:27:30 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 16 Dec 2021 16:27:30 +0000
Subject: [issue46102] pdb can't convert dict_values to list
In-Reply-To: <1639669002.59.0.612026213531.issue46102@roundup.psfhosted.org>
Message-ID: <1639672050.96.0.453902135477.issue46102@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

list is a pdb command.

(Pdb) help list
l(ist) [first [,last] | .]

        List source code for the current file.  Without arguments,
        list 11 lines around the current line or continue the previous
        listing.  With . as argument, list 11 lines around the current
        line.  With one argument, list 11 lines starting at that line.
        With two arguments, list the given range; if the second
        argument is less than the first, it is a count.

        The current line in the current frame is indicated by "->".
        If an exception is being debugged, the line where the
        exception was originally raised or propagated is indicated by
        ">>", if it differs from the current line.

You have to use "p list(x.values())" if you want to print the output of the list function.

(Pdb) x = {'a': 1}
(Pdb) p list(x.values())
[1]

----------
nosy: +christian.heimes
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46102>
_______________________________________

From report at bugs.python.org  Thu Dec 16 12:20:02 2021
From: report at bugs.python.org (Sebastian Berg)
Date: Thu, 16 Dec 2021 17:20:02 +0000
Subject: [issue45383] PyType_FromSpec API fails to use metaclass of bases
In-Reply-To: <1633470686.49.0.00898443232155.issue45383@roundup.psfhosted.org>
Message-ID: <1639675202.53.0.0394249266258.issue45383@roundup.psfhosted.org>


Sebastian Berg <sebastian at sipsolutions.net> added the comment:

It is probably early, but I am starting to like the idea of a "C MetaClass factory" helper/indicator.

It seems to me that yes, at least `tp_new` cannot be called reasonable for a class that is created in C, it is just too confusing/awkward to try to push the C stuff _through_ the Python API.  (And the Python API is the typical one that should not be inconvenienced)

Which gives two possibilities if I want this capability?:
1. Force use of a custom class factory in Python (i.e. not through `__new__`).  But that seems hard, since I need to refuse `__new__()`!).
2. Use a class factor in C which never calls `__new__` and knows that this is OK.

This is not my turf, so I like unholy, but maybe pragmatic things :).  Would a slot/flag indicating `Py_using_metaclass_cinit_pretty_promise_please` "solve" these issues?

I mean, we have two ways to create classes (C and Python), I am not sure it is plausible to untangle this on the MetaClass level, so maybe the only way forward is to embrace it: Some Python MetaClasses just can't be instantiated from C, because we don't know it will work.  If we want to allow instantiating the MetaClass from C, we need some way to set this up.  And either we cannot use `PyType_FromSpec` then, or we need to tell it that we know what we are doing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45383>
_______________________________________

From report at bugs.python.org  Thu Dec 16 12:25:15 2021
From: report at bugs.python.org (Julien Palard)
Date: Thu, 16 Dec 2021 17:25:15 +0000
Subject: [issue42238] Deprecate suspicious.py?
In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org>
Message-ID: <1639675515.52.0.676133436295.issue42238@roundup.psfhosted.org>


Julien Palard <julien+python at palard.fr> added the comment:

Another true positive for make suspicious:

    WARNING: [c-api/apiabiversion:70] ":macro" found in "the same format as the c:macro:"

I'm working on implementing it on rstlint, in the meantime I opened:

=> https://github.com/python/cpython/pull/30149

to fix this occurrence. This show that the current version of rstlint catches two mores \o/

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42238>
_______________________________________

From report at bugs.python.org  Thu Dec 16 12:35:04 2021
From: report at bugs.python.org (Matej Cepl)
Date: Thu, 16 Dec 2021 17:35:04 +0000
Subject: [issue5004] socket.getfqdn() doesn't cope properly with purely
 DNS-based setups
In-Reply-To: <1232404142.93.0.545475464378.issue5004@psf.upfronthosting.co.za>
Message-ID: <1639676104.33.0.283052173767.issue5004@roundup.psfhosted.org>


Change by Matej Cepl <mcepl at cepl.eu>:


----------
nosy: +mcepl

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue5004>
_______________________________________

From report at bugs.python.org  Thu Dec 16 13:43:21 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Thu, 16 Dec 2021 18:43:21 +0000
Subject: [issue46097] Split function versions into 1-0xffff and 0x1000+ regions
In-Reply-To: <1639652770.25.0.708221453944.issue46097@roundup.psfhosted.org>
Message-ID: <1639680201.5.0.884248539337.issue46097@roundup.psfhosted.org>


Brandt Bucher <brandtbucher at gmail.com> added the comment:

Interesting idea!

> It is likely that programs will have more than 2**16 functions versions, but it is much less likely that they will have more than 2**16 versions of special methods.

Is it? The pyperformance suite isn't exactly representative of huge production apps, sure, but the most recent specialization stats don't seem to indicate that we ever run out of versions. Do we have reason to believe that real-world code would benefit from this?

These versions are only created for successful specializations in hot code (and we typically expect a high degree of stability thereafter), so I would think that in practice it's actually quite rare to bump the version after the first few are handed out.

> We should partition the version space into 1-0xffff for use by special methods and 0x1000+ for use by other methods.

Typo? It seems like the ranges 0x0001-0xFFFF and 0x10000-0x1FFFF are closer to what you're describing here. If so:
- Does this mean that it will now be impossible to specialize explicit calls to special methods, like "super().__init__()" or "object.__new__()"?
- Why not just maintain two separate 16-bit version counters, instead of one 17-bit counter with two distinct regions?

Or maybe you meant 0x0001-0x7FFF and 0x8000-0xFFFF? But then my concern would be that it essentially halves the number of "normal" functions that we can successfully specialize. If it's likely that more than 2**15 "normal" function versions will be used and unlikely that 2**15 special methods will be used, lots of the special method versions will remain unused long after we've exhausted the "normal" versions.

Also, just to make sure we're on the same page: when you say "other methods", are you actually referring to "other functions"? It doesn't seem like there's a reason for this versioning to only apply to method objects, but maybe I'm missing something.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46097>
_______________________________________

From report at bugs.python.org  Thu Dec 16 13:55:41 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Thu, 16 Dec 2021 18:55:41 +0000
Subject: [issue44893] importlib.metadata Entrypoint has a broken _asdict
In-Reply-To: <1628717583.56.0.19105113048.issue44893@roundup.psfhosted.org>
Message-ID: <1639680941.76.0.49004852617.issue44893@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
keywords: +patch
pull_requests: +28369
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30150

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44893>
_______________________________________

From report at bugs.python.org  Thu Dec 16 13:56:38 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Thu, 16 Dec 2021 18:56:38 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1639680998.23.0.219675680591.issue23522@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Great! I will leave it to Steven and Mark D to work out an acceptable solution.

PS. Allen Downey is a computer scientist who has written at least one book about Python.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:14:18 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Thu, 16 Dec 2021 19:14:18 +0000
Subject: [issue46105] Requirement syntax broken when extras indicated on
 url_req
Message-ID: <1639682058.29.0.323171575702.issue46105@roundup.psfhosted.org>


New submission from Jason R. Coombs <jaraco at jaraco.com>:

In https://github.com/python/importlib_metadata/issues/357, a user reported an issue where a requirement generated by importlib.metadata from egg info metadata would result in a parse error attempting to parse the error. A fix was released in importlib_metadata 4.8.3.

----------
assignee: jaraco
messages: 408727
nosy: jaraco
priority: normal
severity: normal
status: open
title: Requirement syntax broken when extras indicated on url_req
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46105>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:26:11 2021
From: report at bugs.python.org (Kevin Shweh)
Date: Thu, 16 Dec 2021 19:26:11 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1639682771.53.0.759145427435.issue46085@roundup.psfhosted.org>


Kevin Shweh <kevin.shweh at gmail.com> added the comment:

Almost - C's weird bitwise operator precedence means it has to be parenthesized as

    if ((kind & _odict_ITER_ITEMS) == _odict_ITER_ITEMS)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:28:56 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Thu, 16 Dec 2021 19:28:56 +0000
Subject: [issue45755] Specialized generic class does not return class
 attributes in dir
In-Reply-To: <1636399849.8.0.841580145929.issue45755@roundup.psfhosted.org>
Message-ID: <1639682936.35.0.802263231939.issue45755@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

I think a 3.10 backport would be appreciated.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45755>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:31:05 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Thu, 16 Dec 2021 19:31:05 +0000
Subject: [issue44893] importlib.metadata Entrypoint has a broken _asdict
In-Reply-To: <1628717583.56.0.19105113048.issue44893@roundup.psfhosted.org>
Message-ID: <1639683065.82.0.438279330703.issue44893@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
pull_requests: +28371
pull_request: https://github.com/python/cpython/pull/30151

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44893>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:31:05 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Thu, 16 Dec 2021 19:31:05 +0000
Subject: [issue46105] Requirement syntax broken when extras indicated on
 url_req
In-Reply-To: <1639682058.29.0.323171575702.issue46105@roundup.psfhosted.org>
Message-ID: <1639683065.62.0.67796474166.issue46105@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
keywords: +patch
pull_requests: +28370
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30151

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46105>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:31:43 2021
From: report at bugs.python.org (Lucas Cimon)
Date: Thu, 16 Dec 2021 19:31:43 +0000
Subject: [issue46101] argparse: using parents & subcommands,
 options can be ignored
In-Reply-To: <1639668546.2.0.488904720024.issue46101@roundup.psfhosted.org>
Message-ID: <1639683103.06.0.176040690154.issue46101@roundup.psfhosted.org>


Lucas Cimon <lucas.cimon at gmail.com> added the comment:

The GitHub PR is ready for reviewing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46101>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:34:22 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Thu, 16 Dec 2021 19:34:22 +0000
Subject: [issue46097] Split function versions into 1-0xffff and 0x1000+ regions
In-Reply-To: <1639652770.25.0.708221453944.issue46097@roundup.psfhosted.org>
Message-ID: <1639683262.62.0.582045985962.issue46097@roundup.psfhosted.org>


Brandt Bucher <brandtbucher at gmail.com> added the comment:

Ah, never mind, I think I understand what you meant. Special methods get 0x0001-0xFFFF, all other functions get 0x00010000-0xFFFFFFFF. So we use 16-bit versions for special method caches, and 32-bit versions for normal call caches. "super().__init__()" and "object.__new__()" will specialize correctly, since special method versions are also valid function versions.

This seems like a solid idea, then, provided that we're reasonably confident this will actually improve real code. I guess the case this optimizes for is a program that specializes more than 2**16 normal calls, *then* tries to specialize a 2**16 special method calls? Seems uncommon, but not impossible.

(I think there might be a weird edge-case where a function is specialized first as a normal function, *then* as a special method. I imagine we just reassign it a special method version and continue as normal in that case, though.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46097>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:35:19 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 16 Dec 2021 19:35:19 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1639683319.9.0.452176229621.issue23522@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> "The mean is strongly affected by outliers and is not necessarily a typical example of the data points. For a more robust, although less efficient, measure of central tendency, see median()"

That wording sounds fine to me. I don't think we can reasonably expect to hear from Jake again, but from my understanding of his post, this addresses his concerns.

FWIW, I share those concerns. My brain can't parse "robust estimator for central location", because the term "estimator" has a precise and well-defined meaning in (frequentist) statistics, and what I expect to see after "estimator for" is a description of a parameter of a statistical model - as in for example "estimator for the population mean", or "estimator for the Weibull shape parameter". "central location" doesn't really fit in that slot.

> How do we feel about linking to Wikipedia?

I can't think of any good reason not to. We have plenty of other external links in the docs, and the Wikipedia links are probably at lower risk of becoming stale than most of the others.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:38:14 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Thu, 16 Dec 2021 19:38:14 +0000
Subject: [issue44893] importlib.metadata Entrypoint has a broken _asdict
In-Reply-To: <1628717583.56.0.19105113048.issue44893@roundup.psfhosted.org>
Message-ID: <1639683494.44.0.537851150384.issue44893@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

The change as implemented for importlib_metadata involves refactorings that can't be backported, so the fix will only go into Python 3.11. I'll consider backporting a more selective fix for this issue if it's important, but I suspect there may not be, given that Ronny has reported that he's already migrated to a solution accessing by attribute.

----------
versions:  -Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44893>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:39:17 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Thu, 16 Dec 2021 19:39:17 +0000
Subject: [issue44893] importlib.metadata Entrypoint has a broken _asdict
In-Reply-To: <1628717583.56.0.19105113048.issue44893@roundup.psfhosted.org>
Message-ID: <1639683557.71.0.774349323379.issue44893@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
pull_requests:  -28371

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44893>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:50:06 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Thu, 16 Dec 2021 19:50:06 +0000
Subject: [issue37578] Change Glob: Allow Recursion for Hidden Files
In-Reply-To: <1562984633.23.0.0355519865943.issue37578@roundup.psfhosted.org>
Message-ID: <1639684206.33.0.806945729225.issue37578@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
keywords: +patch
nosy: +andrei.avk
nosy_count: 5.0 -> 6.0
pull_requests: +28372
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30153

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37578>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:57:47 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 16 Dec 2021 19:57:47 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639684667.99.0.128431172562.issue46044@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28373
pull_request: https://github.com/python/cpython/pull/30154

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:57:51 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 16 Dec 2021 19:57:51 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639684671.63.0.185194165829.issue46044@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset ecdc0ccede5f9ac4042ff56f295d81df2f428950 by Matthias Bussonnier in branch 'main':
bpo-46044: Annotate deprecated sdists formats (GH-30043)
https://github.com/python/cpython/commit/ecdc0ccede5f9ac4042ff56f295d81df2f428950


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Thu Dec 16 14:57:51 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 16 Dec 2021 19:57:51 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639684671.84.0.965039068262.issue46044@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28374
pull_request: https://github.com/python/cpython/pull/30155

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Thu Dec 16 15:05:11 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Thu, 16 Dec 2021 20:05:11 +0000
Subject: [issue46088] Build hangs under Visual Studio in deepfreeze stage
In-Reply-To: <1639595221.47.0.522675592351.issue46088@roundup.psfhosted.org>
Message-ID: <1639685111.87.0.267904016304.issue46088@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

I don't see a reason to go through the bootstrap python on Windows. It would increase the build time, which is already pretty slow.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46088>
_______________________________________

From report at bugs.python.org  Thu Dec 16 15:22:02 2021
From: report at bugs.python.org (Ned Deily)
Date: Thu, 16 Dec 2021 20:22:02 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
Message-ID: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>


New submission from Ned Deily <nad at python.org>:

Update Windows build, macOS installer, and Tools/multissltests.py

----------
components: Build, Windows, macOS
messages: 408736
nosy: christian.heimes, ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: OpenSSL 1.1.1m is now available
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Thu Dec 16 15:48:43 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 16 Dec 2021 20:48:43 +0000
Subject: [issue46105] Requirement syntax broken when extras indicated on
 url_req
In-Reply-To: <1639682058.29.0.323171575702.issue46105@roundup.psfhosted.org>
Message-ID: <1639687723.14.0.305440735887.issue46105@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +28375
pull_request: https://github.com/python/cpython/pull/30156

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46105>
_______________________________________

From report at bugs.python.org  Thu Dec 16 15:48:51 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Thu, 16 Dec 2021 20:48:51 +0000
Subject: [issue46105] Requirement syntax broken when extras indicated on
 url_req
In-Reply-To: <1639682058.29.0.323171575702.issue46105@roundup.psfhosted.org>
Message-ID: <1639687731.73.0.836398849899.issue46105@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:


New changeset 109d96602199a91e94eb14b8cb3720841f22ded7 by Jason R. Coombs in branch 'main':
bpo-46105: Honor spec when generating requirement specs with urls and extras. (GH-30151)
https://github.com/python/cpython/commit/109d96602199a91e94eb14b8cb3720841f22ded7


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46105>
_______________________________________

From report at bugs.python.org  Thu Dec 16 15:49:45 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Thu, 16 Dec 2021 20:49:45 +0000
Subject: [issue44893] importlib.metadata Entrypoint has a broken _asdict
In-Reply-To: <1628717583.56.0.19105113048.issue44893@roundup.psfhosted.org>
Message-ID: <1639687785.55.0.875794077613.issue44893@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:


New changeset 04deaee4c8d313717f3ea8f6a4fd70286d510d6e by Jason R. Coombs in branch 'main':
bpo-44893: Implement EntryPoint as simple class with attributes. (GH-30150)
https://github.com/python/cpython/commit/04deaee4c8d313717f3ea8f6a4fd70286d510d6e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44893>
_______________________________________

From report at bugs.python.org  Thu Dec 16 16:19:22 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 16 Dec 2021 21:19:22 +0000
Subject: [issue46105] Requirement syntax broken when extras indicated on
 url_req
In-Reply-To: <1639682058.29.0.323171575702.issue46105@roundup.psfhosted.org>
Message-ID: <1639689562.93.0.941719492853.issue46105@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 09d7319bfe0006d9aa3fc14833b69c24ccafdca6 by Miss Islington (bot) in branch '3.10':
bpo-46105: Honor spec when generating requirement specs with urls and extras. (GH-30151)
https://github.com/python/cpython/commit/09d7319bfe0006d9aa3fc14833b69c24ccafdca6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46105>
_______________________________________

From report at bugs.python.org  Thu Dec 16 16:31:13 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Thu, 16 Dec 2021 21:31:13 +0000
Subject: [issue46105] Requirement syntax broken when extras indicated on
 url_req
In-Reply-To: <1639682058.29.0.323171575702.issue46105@roundup.psfhosted.org>
Message-ID: <1639690273.49.0.962336582955.issue46105@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
pull_requests: +28376
pull_request: https://github.com/python/cpython/pull/30157

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46105>
_______________________________________

From report at bugs.python.org  Thu Dec 16 17:15:59 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 22:15:59 +0000
Subject: [issue45292] Implement PEP 654: Exception Groups
In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org>
Message-ID: <1639692959.29.0.605808399308.issue45292@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28377
pull_request: https://github.com/python/cpython/pull/30158

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45292>
_______________________________________

From report at bugs.python.org  Thu Dec 16 17:36:49 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 22:36:49 +0000
Subject: [issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to
 parts
Message-ID: <1639694209.93.0.209402666532.issue46107@roundup.psfhosted.org>


New submission from Irit Katriel <iritkatriel at gmail.com>:

>>> e = ExceptionGroup("eg", [ValueError(1), TypeError(2)])
>>> e.__note__ = "a note"
>>> e.split(ValueError)
(ExceptionGroup('eg', [ValueError(1)]), ExceptionGroup('eg', [TypeError(2)]))
>>> e.split(ValueError)[0].__note__
>>> e.subgroup(ValueError).__note__

----------
components: Interpreter Core
messages: 408740
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: ExceptionGroup.split()/subgroup() don't copy __note__ to parts
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46107>
_______________________________________

From report at bugs.python.org  Thu Dec 16 17:38:18 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 22:38:18 +0000
Subject: [issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to
 parts
In-Reply-To: <1639694209.93.0.209402666532.issue46107@roundup.psfhosted.org>
Message-ID: <1639694298.63.0.606657660892.issue46107@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
assignee:  -> iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46107>
_______________________________________

From report at bugs.python.org  Thu Dec 16 18:00:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 23:00:22 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1639695622.19.0.359240554976.issue45635@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset 8d6155ee9d1b05946f951d0ba602b9f63810fe0f by Irit Katriel in branch 'main':
bpo-45635: Do not suppress errors in functions called from _PyErr_Display (GH-30073)
https://github.com/python/cpython/commit/8d6155ee9d1b05946f951d0ba602b9f63810fe0f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Thu Dec 16 18:00:44 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 23:00:44 +0000
Subject: [issue45635] Tidy up error handling in traceback.c / python run.c
In-Reply-To: <1635370026.46.0.0220648873339.issue45635@roundup.psfhosted.org>
Message-ID: <1639695644.99.0.248636057784.issue45635@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45635>
_______________________________________

From report at bugs.python.org  Thu Dec 16 18:07:00 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Thu, 16 Dec 2021 23:07:00 +0000
Subject: [issue1062277] Pickle breakage with reduction of recursive structures
Message-ID: <1639696020.35.0.137456749981.issue1062277@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
versions: +Python 3.11 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1062277>
_______________________________________

From report at bugs.python.org  Thu Dec 16 18:18:21 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 23:18:21 +0000
Subject: [issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to
 parts
In-Reply-To: <1639694209.93.0.209402666532.issue46107@roundup.psfhosted.org>
Message-ID: <1639696701.07.0.912043218917.issue46107@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +patch
pull_requests: +28378
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30159

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46107>
_______________________________________

From report at bugs.python.org  Thu Dec 16 18:32:49 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 23:32:49 +0000
Subject: [issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to
 parts
In-Reply-To: <1639694209.93.0.209402666532.issue46107@roundup.psfhosted.org>
Message-ID: <1639697569.7.0.526447928683.issue46107@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

With the patch:

>>> e = ExceptionGroup("eg", [ValueError(1), TypeError(2)])
>>> e.__note__ = "a note"
>>> e.split(ValueError)
(ExceptionGroup('eg', [ValueError(1)]), ExceptionGroup('eg', [TypeError(2)]))
>>> e.split(ValueError)[0].__note__
'a note'
>>> e.split(ValueError)[1].__note__
'a note'
>>> e.subgroup(ValueError).__note__
'a note'
>>>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46107>
_______________________________________

From report at bugs.python.org  Thu Dec 16 18:35:10 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 16 Dec 2021 23:35:10 +0000
Subject: [issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to
 parts
In-Reply-To: <1639694209.93.0.209402666532.issue46107@roundup.psfhosted.org>
Message-ID: <1639697710.61.0.142539573201.issue46107@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46107>
_______________________________________

From report at bugs.python.org  Thu Dec 16 18:53:44 2021
From: report at bugs.python.org (Chris Roberts)
Date: Thu, 16 Dec 2021 23:53:44 +0000
Subject: [issue36225] [subinterpreters] Lingering subinterpreters should be
 implicitly cleared on shutdown
In-Reply-To: <1551964663.69.0.686712846789.issue36225@roundup.psfhosted.org>
Message-ID: <1639698824.38.0.275050450768.issue36225@roundup.psfhosted.org>


Change by Chris Roberts <randomnameftw at gmail.com>:


----------
nosy: +nasageek

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36225>
_______________________________________

From report at bugs.python.org  Thu Dec 16 19:35:29 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Fri, 17 Dec 2021 00:35:29 +0000
Subject: [issue9917] resource max value represented as signed when should be
 unsigned
In-Reply-To: <1285119777.0.0.437398080007.issue9917@psf.upfronthosting.co.za>
Message-ID: <1639701329.32.0.396926938182.issue9917@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9917>
_______________________________________

From report at bugs.python.org  Thu Dec 16 19:35:56 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Fri, 17 Dec 2021 00:35:56 +0000
Subject: [issue678264] test_resource fails when file size is limited
Message-ID: <1639701356.78.0.856152514533.issue678264@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue678264>
_______________________________________

From report at bugs.python.org  Thu Dec 16 19:38:57 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Fri, 17 Dec 2021 00:38:57 +0000
Subject: [issue37578] Change Glob: Allow Recursion for Hidden Files
In-Reply-To: <1562984633.23.0.0355519865943.issue37578@roundup.psfhosted.org>
Message-ID: <1639701537.33.0.247312263407.issue37578@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Zsh allows use of *, ? and ** to match hidden files and directories.

Bash allows the same for * and ? with `dotglob` option. There is also a `globstar` but my version of bash (on macos) is too old to have it.

By the way setting options in bash is done with `shopt -s <option>`.

I've put up a PR that enables behavior similar to Zsh and Bash (at least for ? and * chars).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37578>
_______________________________________

From report at bugs.python.org  Thu Dec 16 19:51:01 2021
From: report at bugs.python.org (Ned Batchelder)
Date: Fri, 17 Dec 2021 00:51:01 +0000
Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong
In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org>
Message-ID: <1639702261.85.0.705975324522.issue46028@roundup.psfhosted.org>


Ned Batchelder <ned at nedbatchelder.com> added the comment:

Thanks, your change looks good.  The exact symlinks in the nested venv's are different for 3.10.1 and your 3.11, but they both work:

$ python3.10 -c "import sys; print(sys.version)"
3.10.1 (main, Dec 14 2021, 08:30:13) [Clang 12.0.0 (clang-1200.0.32.29)]

$ python3.10 -m venv v310

$ ls -al v310/bin/py*
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:48 v310/bin/python@ -> python3.10
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:48 v310/bin/python3@ -> python3.10
lrwxr-xr-x  1 nedbatchelder  wheel  25 Dec 16 18:48 v310/bin/python3.10@ -> /usr/local/bin/python3.10

$ v310/bin/python -m venv v310-nested

$ ls -al v310-nested/bin/py*
lrwxr-xr-x  1 nedbatchelder  wheel  37 Dec 16 18:48 v310-nested/bin/python@ -> /private/tmp/bpo46028/v310/bin/python
lrwxr-xr-x  1 nedbatchelder  wheel   6 Dec 16 18:48 v310-nested/bin/python3@ -> python
lrwxr-xr-x  1 nedbatchelder  wheel   6 Dec 16 18:48 v310-nested/bin/python3.10@ -> python

$

$ python3.11 -c "import sys; print(sys.version)"
3.11.0a3+ (heads/pr/30144:8b260a8606, Dec 16 2021, 14:31:40) [Clang 12.0.0 (clang-1200.0.32.29)]

$ python3.11 -m venv v311

$ ls -al v311/bin/py*
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:50 v311/bin/python@ -> python3.11
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:50 v311/bin/python3@ -> python3.11
lrwxr-xr-x  1 nedbatchelder  wheel  25 Dec 16 18:50 v311/bin/python3.11@ -> /usr/local/bin/python3.11

$ v311/bin/python -m venv v311-nested

$ ls -al v311-nested/bin/py*
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:50 v311-nested/bin/python@ -> python3.11
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:50 v311-nested/bin/python3@ -> python3.11
lrwxr-xr-x  1 nedbatchelder  wheel  33 Dec 16 18:50 v311-nested/bin/python3.11@ -> /usr/local/cpython/bin/python3.11

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46028>
_______________________________________

From report at bugs.python.org  Thu Dec 16 19:58:27 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 00:58:27 +0000
Subject: [issue46105] Requirement syntax broken when extras indicated on
 url_req
In-Reply-To: <1639682058.29.0.323171575702.issue46105@roundup.psfhosted.org>
Message-ID: <1639702707.26.0.224706689267.issue46105@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:


New changeset 864ec170e14b663f999eb415a4f1a0067ec6833a by Jason R. Coombs in branch '3.9':
[3.9] bpo-46105: Honor spec when generating requirement specs with urls and extras. (GH-30151). (GH-30157)
https://github.com/python/cpython/commit/864ec170e14b663f999eb415a4f1a0067ec6833a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46105>
_______________________________________

From report at bugs.python.org  Thu Dec 16 19:58:56 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 00:58:56 +0000
Subject: [issue46105] Requirement syntax broken when extras indicated on
 url_req
In-Reply-To: <1639682058.29.0.323171575702.issue46105@roundup.psfhosted.org>
Message-ID: <1639702736.21.0.928317750696.issue46105@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46105>
_______________________________________

From report at bugs.python.org  Thu Dec 16 20:06:03 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 01:06:03 +0000
Subject: [issue44893] importlib.metadata Entrypoint has a broken _asdict
In-Reply-To: <1628717583.56.0.19105113048.issue44893@roundup.psfhosted.org>
Message-ID: <1639703163.6.0.628952301845.issue44893@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

Expect the fix in 3.11a3.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44893>
_______________________________________

From report at bugs.python.org  Thu Dec 16 20:09:42 2021
From: report at bugs.python.org (Ethan Furman)
Date: Fri, 17 Dec 2021 01:09:42 +0000
Subject: [issue46089] Problems with AF_PACKET sockets
In-Reply-To: <1639596583.53.0.533566052583.issue46089@roundup.psfhosted.org>
Message-ID: <1639703382.85.0.0486164698895.issue46089@roundup.psfhosted.org>


Ethan Furman <ethan at stoneleaf.us> added the comment:

To contribute you'll need to sign a Contributor's License Agreement [1].

After that, anything you can do to help will move this forward.  You may not be aware, but Python is developed primarily by volunteers, which unfortunately means that time is normally spent on bugs that the volunteers are interested in -- and nobody else seems interested in this one (which probably means not many people use this functionality).

If you have time, perhaps you could write some tests?  They would obviously fail at the moment, but would help when somebody wants to fix the code itself.


[1] https://www.python.org/psf/contrib/contrib-form/

----------
assignee: docs at python -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46089>
_______________________________________

From report at bugs.python.org  Thu Dec 16 20:13:16 2021
From: report at bugs.python.org (Ethan Furman)
Date: Fri, 17 Dec 2021 01:13:16 +0000
Subject: [issue46108] Enum repr() incorrect when mixed with dataclasses
Message-ID: <1639703596.51.0.989960862505.issue46108@roundup.psfhosted.org>


New submission from Ethan Furman <ethan at stoneleaf.us>:

from dataclasses import dataclass
from enum import Enum

@dataclass
class Foo:
    a: int = 0

class Entries(Foo, Enum):
    ENTRY1 = Foo(1)

repr(Entries.ENTRY1) != '<Entries.ENTRY1: Foo(a=1)>'

----------
assignee: ethan.furman
messages: 408748
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: Enum repr() incorrect when mixed with dataclasses
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46108>
_______________________________________

From report at bugs.python.org  Thu Dec 16 21:10:06 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 02:10:06 +0000
Subject: [issue46109] Separate resources and abc docs from other importlib docs
Message-ID: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>


New submission from Jason R. Coombs <jaraco at jaraco.com>:

The `importlib` documentation is fairly long and covers a number of topics. Furthermore, the `importlib.metadata` is separately documented and presents a good example of breaking out major aspects. Let's do the same with `.abc` and `.resources`.

----------
assignee: jaraco
components: Documentation
messages: 408749
nosy: jaraco
priority: normal
severity: normal
status: open
title: Separate resources and abc docs from other importlib docs
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Thu Dec 16 21:14:48 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 02:14:48 +0000
Subject: [issue46109] Separate resources and abc docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1639707288.07.0.665344921802.issue46109@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
keywords: +patch
pull_requests: +28379
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30160

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Thu Dec 16 21:25:21 2021
From: report at bugs.python.org (Isaac Muse)
Date: Fri, 17 Dec 2021 02:25:21 +0000
Subject: [issue37578] Change Glob: Allow Recursion for Hidden Files
In-Reply-To: <1562984633.23.0.0355519865943.issue37578@roundup.psfhosted.org>
Message-ID: <1639707921.02.0.217130618794.issue37578@roundup.psfhosted.org>


Isaac Muse <faceless.server1 at gmail.com> added the comment:

If this was to be done, you'd want to make sure character sequences also match hidden files: [.]. Just * and ? would be incomplete. If allowing ** to match a leading dot, it would not match . or ..

----------
nosy: +Isaac Muse

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37578>
_______________________________________

From report at bugs.python.org  Thu Dec 16 21:31:14 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Fri, 17 Dec 2021 02:31:14 +0000
Subject: [issue37578] Change Glob: Allow Recursion for Hidden Files
In-Reply-To: <1562984633.23.0.0355519865943.issue37578@roundup.psfhosted.org>
Message-ID: <1639708274.07.0.998571783019.issue37578@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Isaac: my PR does allow [.] to match. But I probably need to update the docs to note that.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37578>
_______________________________________

From report at bugs.python.org  Thu Dec 16 21:35:51 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Fri, 17 Dec 2021 02:35:51 +0000
Subject: [issue37578] Change Glob: Allow Recursion for Hidden Files
In-Reply-To: <1562984633.23.0.0355519865943.issue37578@roundup.psfhosted.org>
Message-ID: <1639708551.79.0.924616938988.issue37578@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

I want to clarify my first comment: my PR is similar to Zsh behaviour as described above; as I'm not 100% sure how bash behaves with `**` with globstar option, I can say that bash is the same as Zsh with ? and * magic characters (with dotglob option), and likely the same for `**` as well, but I can't test it (if someone can test it, please comment).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37578>
_______________________________________

From report at bugs.python.org  Fri Dec 17 00:22:07 2021
From: report at bugs.python.org (Charles McMarrow)
Date: Fri, 17 Dec 2021 05:22:07 +0000
Subject: [issue46110] `eval("-"*3000000 + "4")` in cmd causes hard crash
Message-ID: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>


New submission from Charles McMarrow <charles.mcmarrow.4 at gmail.com>:

`eval("-"*3000000 + "4")` in cmd causes hard crash

----------
components: Parser
messages: 408753
nosy: charles.mcmarrow.4, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: `eval("-"*3000000 + "4")` in cmd causes hard crash
type: crash
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 01:33:01 2021
From: report at bugs.python.org (Dale)
Date: Fri, 17 Dec 2021 06:33:01 +0000
Subject: [issue41033] readline.c: SEGFAULT on SIGWINCH when loaded twice
In-Reply-To: <1592559834.18.0.183747914407.issue41033@roundup.psfhosted.org>
Message-ID: <1639722781.26.0.908976776858.issue41033@roundup.psfhosted.org>


Dale <dale at codefu.org> added the comment:

I hit this on macOS today but I didn't get segmentation fault, at least not for as long as I cared to let Python run.  Instead I got a non-responsive Python process using 100% CPU that I had to kill with ^\.  I first hit this with GNU readline while running Python interactively under Emacs, then I reproduced it with libedit readline under a regular old terminal using the above recipe.

macOS 11.6.1, x86-64, Python 3.10.1 from MacPorts

----------
nosy: +dale

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41033>
_______________________________________

From report at bugs.python.org  Fri Dec 17 02:43:08 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 17 Dec 2021 07:43:08 +0000
Subject: [issue46111] test_unittest fails in optimized mode
Message-ID: <1639726988.61.0.440638905224.issue46111@roundup.psfhosted.org>


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

$ ./python -OO -m test -vuall test_unittest
...
======================================================================
FAIL: testShortDescriptionWhitespaceTrimming (unittest.test.test_case.Test_TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_case.py", line 639, in testShortDescriptionWhitespaceTrimming
    self.assertEqual(
    ^^^^^^^^^^^^^^^^^
AssertionError: None != 'Tests shortDescription() whitespace is trimmed, so that the first'

======================================================================
FAIL: test_Exit (unittest.test.test_program.Test_TestProgram)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 127, in test_Exit
    self.assertIn('\nFAIL: testFail ', stream.getvalue())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\nFAIL: testFail ' not found in '..\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n'

======================================================================
FAIL: test_ExitAsDefault (unittest.test.test_program.Test_TestProgram)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 139, in test_ExitAsDefault
    self.assertIn('\nFAIL: testFail ', stream.getvalue())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\nFAIL: testFail ' not found in '..\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n'

======================================================================
FAIL: test_NonExit (unittest.test.test_program.Test_TestProgram)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 114, in test_NonExit
    self.assertIn('\nFAIL: testFail ', stream.getvalue())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\nFAIL: testFail ' not found in '..\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n'

======================================================================
FAIL: test_special_attrs (unittest.test.testmock.testpatch.PatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/testmock/testpatch.py", line 1880, in test_special_attrs
    self.assertEqual(foo.__doc__, "TEST")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'TEST'

----------------------------------------------------------------------

----------
assignee: serhiy.storchaka
components: Tests
messages: 408755
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_unittest fails in optimized mode
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46111>
_______________________________________

From report at bugs.python.org  Fri Dec 17 02:44:42 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 17 Dec 2021 07:44:42 +0000
Subject: [issue46111] test_unittest fails in optimized mode
In-Reply-To: <1639726988.61.0.440638905224.issue46111@roundup.psfhosted.org>
Message-ID: <1639727082.4.0.505936920855.issue46111@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
keywords: +patch
pull_requests: +28380
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30163

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46111>
_______________________________________

From report at bugs.python.org  Fri Dec 17 02:57:00 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Fri, 17 Dec 2021 07:57:00 +0000
Subject: [issue46108] Enum repr() incorrect when mixed with dataclasses
In-Reply-To: <1639703596.51.0.989960862505.issue46108@roundup.psfhosted.org>
Message-ID: <1639727820.68.0.974855238275.issue46108@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

I know you know this, but here's a version without dataclasses, in case you want to add a test for this, too.

from enum import Enum

class Foo:
    def __init__(self, a):
        self.a = a
    def __repr__(self):
        return f'Foo(a={self.a!r})'

class Entries(Foo, Enum):
    ENTRY1 = Foo(1)

repr(Entries.ENTRY1) != '<Entries.ENTRY1: Foo(a=1)>'

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46108>
_______________________________________

From report at bugs.python.org  Fri Dec 17 03:02:13 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Fri, 17 Dec 2021 08:02:13 +0000
Subject: [issue46110] `eval("-"*3000000 + "4")` in cmd causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639728133.89.0.0705951730123.issue46110@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

In case it helps track this down. On my system I've tested these two setups:

On Windows, on the main branch, python just exists with no message when I run this from the REPL.

Also on Windows, with the Cygwin 3.8.12 version, I get MemoryError:

Python 3.8.12 (default, Nov 23 2021, 20:18:25)
[GCC 11.2.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> eval("-"*3000000 + "4")
s_push: parser stack overflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError

Those are the only two systems I have available to test with.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 03:32:06 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Fri, 17 Dec 2021 08:32:06 +0000
Subject: [issue46110] `eval("-"*3000000 + "4")` in cmd causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639729926.54.0.959467767328.issue46110@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

This is the top of the stacktrace I got on Windows in Visual Studio:

 	ucrtbased.dll!00007ff9096d8ea8()	Unknown
 	ucrtbased.dll!00007ff9096d727c()	Unknown
 	ucrtbased.dll!00007ff9096d6f69()	Unknown
 	ucrtbased.dll!00007ff9096d70b3()	Unknown
 	ucrtbased.dll!00007ff9096d72e9()	Unknown
 	ucrtbased.dll!00007ff9096cef0c()	Unknown
 	ucrtbased.dll!00007ff9096cf446()	Unknown
>	python311_d.dll!tok_get(tok_state * tok, const char * * p_start, const char * * p_end) Line 1699	C
 	python311_d.dll!_PyTokenizer_Get(tok_state * tok, const char * * p_start, const char * * p_end) Line 2061	C
 	python311_d.dll!_PyPegen_fill_token(Parser * p) Line 223	C
 	python311_d.dll!_PyPegen_is_memoized(Parser * p, int type, void * pres) Line 309	C
 	python311_d.dll!factor_rule(Parser * p) Line 12622	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
 	python311_d.dll!factor_rule(Parser * p) Line 12682	C
        ...

----------
nosy: +Dennis Sweeney

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 03:48:48 2021
From: report at bugs.python.org (Charles G.)
Date: Fri, 17 Dec 2021 08:48:48 +0000
Subject: [issue35228] Index search in CHM help crashes viewer
In-Reply-To: <1542107217.87.0.788709270274.issue35228@psf.upfronthosting.co.za>
Message-ID: <1639730928.66.0.428726999129.issue35228@roundup.psfhosted.org>


Charles G. <peacech at gmail.com> added the comment:

My previous Windows version (Win 10 1803) does not have this crashing problem. It only crashed after upgrading to 21H1. So I replaced hhctrl.ocx in system32 (Win 10 21H1) with hhctrl.ocx from Windows.old.

2019/03/19  11:45           696.320 hhctrl.ocx
2021/09/23  03:29           729.600 hhctrl.ocx.old

----------
nosy: +Charles G.

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35228>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:11:05 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 17 Dec 2021 09:11:05 +0000
Subject: [issue46111] test_unittest fails in optimized mode
In-Reply-To: <1639726988.61.0.440638905224.issue46111@roundup.psfhosted.org>
Message-ID: <1639732265.0.0.144872798616.issue46111@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 95a922b3bb3af247ec141d73fcdfbf68bb1d32a5 by Serhiy Storchaka in branch 'main':
bpo-46111: Fix unittest tests in optimized mode (GH-30163)
https://github.com/python/cpython/commit/95a922b3bb3af247ec141d73fcdfbf68bb1d32a5


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46111>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:11:05 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 17 Dec 2021 09:11:05 +0000
Subject: [issue46111] test_unittest fails in optimized mode
In-Reply-To: <1639726988.61.0.440638905224.issue46111@roundup.psfhosted.org>
Message-ID: <1639732265.93.0.415116075429.issue46111@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +28381
pull_request: https://github.com/python/cpython/pull/30164

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46111>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:11:11 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 17 Dec 2021 09:11:11 +0000
Subject: [issue46111] test_unittest fails in optimized mode
In-Reply-To: <1639726988.61.0.440638905224.issue46111@roundup.psfhosted.org>
Message-ID: <1639732271.17.0.973340425285.issue46111@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28382
pull_request: https://github.com/python/cpython/pull/30165

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46111>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:18:00 2021
From: report at bugs.python.org (Zhiyuan Chen)
Date: Fri, 17 Dec 2021 09:18:00 +0000
Subject: [issue46112] PEP 8 code format
Message-ID: <1639732680.85.0.32086966085.issue46112@roundup.psfhosted.org>


New submission from Zhiyuan Chen <this at zyc.ai>:

Current cpython code base still contains a massive amount of code that is not complied with the PEP-8 formatting. 
For example, there are 553 one line if statement (`if xxx: yyy`) in the current codebase.

----------
files: onelineif.txt
messages: 408761
nosy: ZhiyuanChen
priority: normal
severity: normal
status: open
title: PEP 8 code format
type: enhancement
Added file: https://bugs.python.org/file50499/onelineif.txt

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46112>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:29:59 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 17 Dec 2021 09:29:59 +0000
Subject: [issue46111] test_unittest fails in optimized mode
In-Reply-To: <1639726988.61.0.440638905224.issue46111@roundup.psfhosted.org>
Message-ID: <1639733399.28.0.920627431301.issue46111@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 9fe8fb74a1e21ab881c70111813266d67bfda016 by Miss Islington (bot) in branch '3.10':
bpo-46111: Fix unittest tests in optimized mode (GH-30163)
https://github.com/python/cpython/commit/9fe8fb74a1e21ab881c70111813266d67bfda016


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46111>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:33:06 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 17 Dec 2021 09:33:06 +0000
Subject: [issue46112] PEP 8 code format
In-Reply-To: <1639732680.85.0.32086966085.issue46112@roundup.psfhosted.org>
Message-ID: <1639733586.76.0.17115700005.issue46112@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

PEP 8 is a guide for writing new code. It does not require rewriting the old code. In fact, patches with mass reformatting of the stdlib code have always been rejected.

----------
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46112>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:36:20 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 17 Dec 2021 09:36:20 +0000
Subject: [issue46111] test_unittest fails in optimized mode
In-Reply-To: <1639726988.61.0.440638905224.issue46111@roundup.psfhosted.org>
Message-ID: <1639733780.21.0.26688173696.issue46111@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 72225b5bdf5d2c70307dbad0d3a1caa39c95a22a by Miss Islington (bot) in branch '3.9':
bpo-46111: Fix unittest tests in optimized mode (GH-30163)
https://github.com/python/cpython/commit/72225b5bdf5d2c70307dbad0d3a1caa39c95a22a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46111>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:41:20 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 17 Dec 2021 09:41:20 +0000
Subject: [issue45755] Specialized generic class does not return class
 attributes in dir
In-Reply-To: <1636399849.8.0.841580145929.issue45755@roundup.psfhosted.org>
Message-ID: <1639734080.21.0.862826800053.issue45755@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28383
pull_request: https://github.com/python/cpython/pull/30166

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45755>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:46:12 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 17 Dec 2021 09:46:12 +0000
Subject: [issue46111] test_unittest fails in optimized mode
In-Reply-To: <1639726988.61.0.440638905224.issue46111@roundup.psfhosted.org>
Message-ID: <1639734372.74.0.691208140375.issue46111@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46111>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:49:45 2021
From: report at bugs.python.org (Stefan Behnel)
Date: Fri, 17 Dec 2021 09:49:45 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1639734585.91.0.0740605959465.issue45711@roundup.psfhosted.org>


Change by Stefan Behnel <stefan_ml at behnel.de>:


----------
nosy: +scoder

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Fri Dec 17 04:53:10 2021
From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=)
Date: Fri, 17 Dec 2021 09:53:10 +0000
Subject: [issue22047] Deprecate unsupported nesting of argparse groups
In-Reply-To: <1406131424.14.0.0235697032218.issue22047@psf.upfronthosting.co.za>
Message-ID: <1639734790.45.0.534107840607.issue22047@roundup.psfhosted.org>


L?szl? Attila T?th <laszlo.attila.toth at gmail.com> added the comment:

Hi, according to the group update the _MutuallyExclusiveGroup should have an add_argument_group() call with the deprecation warning, but that method is missing in commit 30322c497e0b8d978f7a0de95985aac9c5daf1ac.

----------
nosy: +Laszlo.Attila.Toth

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22047>
_______________________________________

From report at bugs.python.org  Fri Dec 17 05:09:39 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Fri, 17 Dec 2021 10:09:39 +0000
Subject: [issue46113] Typos and minor fixes in built in types documentation
Message-ID: <1639735779.26.0.586060935342.issue46113@roundup.psfhosted.org>


New submission from Vivek Vashist <vivekvashist at gmail.com>:

Will raise a PR shortly.

----------
assignee: docs at python
components: Documentation
messages: 408766
nosy: docs at python, vivekvashist
priority: normal
severity: normal
status: open
title: Typos and minor fixes in built in types documentation
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46113>
_______________________________________

From report at bugs.python.org  Fri Dec 17 05:10:25 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Fri, 17 Dec 2021 10:10:25 +0000
Subject: [issue46113] Typos and minor fixes in built in types documentation
In-Reply-To: <1639735779.26.0.586060935342.issue46113@roundup.psfhosted.org>
Message-ID: <1639735825.46.0.259405767704.issue46113@roundup.psfhosted.org>


Change by Vivek Vashist <vivekvashist at gmail.com>:


----------
keywords: +patch
pull_requests: +28384
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30167

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46113>
_______________________________________

From report at bugs.python.org  Fri Dec 17 05:11:54 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Fri, 17 Dec 2021 10:11:54 +0000
Subject: [issue46113] Typos and minor fixes in built in types documentation
In-Reply-To: <1639735779.26.0.586060935342.issue46113@roundup.psfhosted.org>
Message-ID: <1639735914.48.0.432121275579.issue46113@roundup.psfhosted.org>


Vivek Vashist <vivekvashist at gmail.com> added the comment:

PR: https://github.com/python/cpython/pull/30167

Fix#1 - isidentifier() function output
Fix#2 Update the str.splitlines() function parameter
Fix#3 Removed unwanted full stop for str and bytes types double quotes examples 
Fix#4 Updated class dict from **kwarg to **kwargs

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46113>
_______________________________________

From report at bugs.python.org  Fri Dec 17 05:45:39 2021
From: report at bugs.python.org (Stefan Behnel)
Date: Fri, 17 Dec 2021 10:45:39 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1639737939.3.0.682222620359.issue45711@roundup.psfhosted.org>


Stefan Behnel <stefan_ml at behnel.de> added the comment:

FYI, we track the Cython side of this in
https://github.com/cython/cython/issues/4500

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Fri Dec 17 05:50:22 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Fri, 17 Dec 2021 10:50:22 +0000
Subject: [issue46112] PEP 8 code format
In-Reply-To: <1639732680.85.0.32086966085.issue46112@roundup.psfhosted.org>
Message-ID: <1639738222.16.0.846996425717.issue46112@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

> not complied with the PEP-8 formatting.

PEP 8 says:

"Some other good reasons to ignore a particular guideline:

3. Because the code in question predates the introduction of the guideline and there is no other reason to be modifying that code."

So PEP 8 itself tells us that legacy code that ignores the style guidelines is already compliant with PEP 8.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46112>
_______________________________________

From report at bugs.python.org  Fri Dec 17 05:51:19 2021
From: report at bugs.python.org (Alexey Stepanov)
Date: Fri, 17 Dec 2021 10:51:19 +0000
Subject: [issue46114] OpenSSL deprecated OpenSSL_version_num() since version
 3.0.0
Message-ID: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>


New submission from Alexey Stepanov <penguinolog at gmail.com>:

Documentation: https://www.openssl.org/docs/manmaster/man3/OpenSSL_version_num.html

Python build fail with OpenSSL 3.0.1
(looks like OpenSSL broken deprecated API)

----------
assignee: christian.heimes
components: SSL
messages: 408770
nosy: christian.heimes, penguinolog
priority: normal
severity: normal
status: open
title: OpenSSL deprecated OpenSSL_version_num() since version 3.0.0
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 06:07:10 2021
From: report at bugs.python.org (AnLong)
Date: Fri, 17 Dec 2021 11:07:10 +0000
Subject: [issue32339] Make the dict type used in csv.DictReader configurable
In-Reply-To: <1513364453.6.0.213398074469.issue32339@psf.upfronthosting.co.za>
Message-ID: <1639739230.81.0.389338558184.issue32339@roundup.psfhosted.org>


AnLong <aisk1988 at gmail.com> added the comment:

As https://github.com/python/cpython/pull/4904 is closed now, I think this issue should be closed now?

----------
nosy: +asaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32339>
_______________________________________

From report at bugs.python.org  Fri Dec 17 06:14:30 2021
From: report at bugs.python.org (Xinmeng Xia)
Date: Fri, 17 Dec 2021 11:14:30 +0000
Subject: [issue46115] Interrupting subprocess.popen in recursive calls by
 KeyboardInterrupt causes Fatal Python error.
Message-ID: <1639739670.52.0.854058490899.issue46115@roundup.psfhosted.org>


New submission from Xinmeng Xia <xiaxm at smail.nju.edu.cn>:

Popen works when stdio fds are available. However, when interrupting popen in a recursive function call. The Python interpreter reports a Fatal Python error.

test.py
========================================
import subprocess
import os
import sys


def test_small_errpipe_write_fd():
    new_stdout = os.dup(1)
    try:
        os.close(1)
        subprocess.Popen([sys.executable, '-c', "print('AssertionError:0:CLOEXEC failure.')"]).wait()
    finally:
        os.dup2(new_stdout, 0)
        os.dup2(new_stdout, 1)
        test_small_errpipe_write_fd()

test_small_errpipe_write_fd()
=======================================

Reported message:
---------------------------------------------
xxm at xxm:~$ 'cpython-main/python' '/home/xxm/Desktop/test/test.py' 
^CFatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
  File "/home/xxm/Desktop/compilers/cpython-main/Lib/site.py", line 73, in <module>
    import os
    ^^^^^^^^^
  File "/home/xxm/Desktop/compilers/cpython-main/Lib/os.py", line 29, in <module>
    from _collections_abc import _check_methods
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxm/Desktop/compilers/cpython-main/Lib/_collections_abc.py", line 1015, in <module>
    class Sequence(Reversible, Collection):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxm/Desktop/compilers/cpython-main/Lib/abc.py", line 106, in __new__
    cls = super().__new__(mcls, name, bases, namespace, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
-----------------------------------------------

Reproduce step:
1. run test.py in the console
2. use "Ctrl C" to interrupt the program

If typing a "Ctrl C", the program does not stop and no error is reported. Just type "Ctrl C" constantly. Sometimes, it need 5 or 6 "Ctrl C" to reproduce this bug. 



verson of Python: Python 3.11.0a2+ (main, Nov 26 2021, 18:38:48) [GCC 7.5.0] on linux (it also crashes Python 3.6.15, 3.7.12,3.8.12)

----------
components: Interpreter Core
messages: 408772
nosy: xxm
priority: normal
severity: normal
status: open
title: Interrupting subprocess.popen in recursive calls by KeyboardInterrupt causes Fatal Python error.
type: crash
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46115>
_______________________________________

From report at bugs.python.org  Fri Dec 17 06:17:38 2021
From: report at bugs.python.org (Alexey Stepanov)
Date: Fri, 17 Dec 2021 11:17:38 +0000
Subject: [issue46114] OpenSSL deprecated OpenSSL_version_num() since version
 3.0.0
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639739858.46.0.728599749636.issue46114@roundup.psfhosted.org>


Alexey Stepanov <penguinolog at gmail.com> added the comment:

Error example:
test_ssl: testing with 'OpenSSL 3.0.1 14 Dec 2021' (3, 0, 0, 1, 0)
...
AssertionError: False is not true : ('OpenSSL 3.0.1 14 Dec 2021', (3, 0, 0, 1, 0), '0x30000010')

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 06:33:23 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 17 Dec 2021 11:33:23 +0000
Subject: [issue45755] Specialized generic class does not return class
 attributes in dir
In-Reply-To: <1636399849.8.0.841580145929.issue45755@roundup.psfhosted.org>
Message-ID: <1639740803.25.0.501153163195.issue45755@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 87539cc716fab47cd4f501f2441c4ab8e80bce6f by Miss Islington (bot) in branch '3.10':
bpo-45755: [typing] Reveal class attributes of generic in generic aliases in `dir()` (GH-29962)
https://github.com/python/cpython/commit/87539cc716fab47cd4f501f2441c4ab8e80bce6f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45755>
_______________________________________

From report at bugs.python.org  Fri Dec 17 07:02:48 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Fri, 17 Dec 2021 12:02:48 +0000
Subject: [issue20369] concurrent.futures.wait() blocks forever when given
 duplicate Futures
In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za>
Message-ID: <1639742568.08.0.508018808221.issue20369@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 4.0 -> 5.0
pull_requests: +28385
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30168

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20369>
_______________________________________

From report at bugs.python.org  Fri Dec 17 08:15:01 2021
From: report at bugs.python.org (Ethan Furman)
Date: Fri, 17 Dec 2021 13:15:01 +0000
Subject: [issue46108] Enum repr() incorrect when mixed with non-__new__ data
 types
In-Reply-To: <1639703596.51.0.989960862505.issue46108@roundup.psfhosted.org>
Message-ID: <1639746901.1.0.94698491529.issue46108@roundup.psfhosted.org>


Ethan Furman <ethan at stoneleaf.us> added the comment:

Thanks, test added.  I also updated the title.

Code updated to treat any __repr__s as affecting the display of the member value instead of the member itself (i.e. the "<...: %r>" portion).  if a user actually wants to change the member repr they can assign it when creating the Enum:

    class Entries(Foo, Enum):
        ENTRY = 1
        __repr__ = Foo.__repr__

    assert repr(Entries.ENTRY1) == 'Entries(a=1)'

----------
title: Enum repr() incorrect when mixed with dataclasses -> Enum repr() incorrect when mixed with non-__new__ data types

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46108>
_______________________________________

From report at bugs.python.org  Fri Dec 17 08:26:51 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 17 Dec 2021 13:26:51 +0000
Subject: [issue46110] `eval("-"*3000000 + "4")` in cmd causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639747611.8.0.999716260996.issue46110@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
nosy:  -pablogsal

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 08:35:58 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 17 Dec 2021 13:35:58 +0000
Subject: [issue46114] OpenSSL deprecated OpenSSL_version_num() since version
 3.0.0
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639748158.95.0.873218546041.issue46114@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

The test case does not work for OpenSSL >= 3.0.1. The test assumes that the version starts with M.NN.FF, but OpenSSL 3 uses M.NN.PP. The FF (fix) part is always 00. The issue didn't show up before because fix and patch level were 0 for 3.0.0 alphas and betas.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 08:37:11 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 17 Dec 2021 13:37:11 +0000
Subject: [issue46114] OpenSSL deprecated OpenSSL_version_num() since version
 3.0.0
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639748231.46.0.602154977582.issue46114@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
assignee: christian.heimes -> 
components: +Tests
stage:  -> needs patch
type:  -> behavior
versions:  -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 08:49:46 2021
From: report at bugs.python.org (Mark Shannon)
Date: Fri, 17 Dec 2021 13:49:46 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639748986.54.0.416590409808.issue46072@roundup.psfhosted.org>


Change by Mark Shannon <mark at hotpy.org>:


----------
pull_requests: +28386
pull_request: https://github.com/python/cpython/pull/30169

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Fri Dec 17 08:52:25 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 17 Dec 2021 13:52:25 +0000
Subject: [issue46114] OpenSSL deprecated OpenSSL_version_num() since version
 3.0.0
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639749145.76.0.267377497604.issue46114@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
keywords: +patch
pull_requests: +28387
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30170

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 08:55:31 2021
From: report at bugs.python.org (Cristian Rodriguez)
Date: Fri, 17 Dec 2021 13:55:31 +0000
Subject: [issue42738] subprocess: don't close all file descriptors by default
 (close_fds=False)
In-Reply-To: <1608897183.26.0.576206535349.issue42738@roundup.psfhosted.org>
Message-ID: <1639749331.52.0.295309567675.issue42738@roundup.psfhosted.org>


Cristian Rodriguez <judas.iscariote at gmail.com> added the comment:

My 2 CLP.
On linux/glibc you do not have to do this, there is a posix_spawn_file_actions_addclosefrom_np action which is implemented using  close_range(2) which will give you the fastest way to this job without hassle.

for the not posix_spawn case, interate over /proc/self/fd and set the CLOEXEC flag using fcntl.. if close_Range is not available or returns returns different than 0

----------
nosy: +judas.iscariote

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42738>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:02:14 2021
From: report at bugs.python.org (James Lawrie)
Date: Fri, 17 Dec 2021 14:02:14 +0000
Subject: [issue46116] _asyncio_backend.py datagram_received doesn't handle
 Future cancelled, throws Exception
Message-ID: <1639749734.89.0.485816466406.issue46116@roundup.psfhosted.org>


New submission from James Lawrie <james at silvermouse.net>:

The datagram_received:

def datagram_received(self, data, addr):
    if self.recvfrom:
        self.recvfrom.set_result((data, addr))
        self.recvfrom = None

Throws an exception if self.recvfrom is a Future Cancelled:

Exception in callback _SelectorDatagramTransport._read_ready()
handle: <Handle _SelectorDatagramTransport._read_ready()>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.8/asyncio/selector_events.py", line 1021, in _read_ready
    self._protocol.datagram_received(data, addr)
  File "/usr/local/lib/python3.8/dist-packages/dns/_asyncio_backend.py", line 30, in datagram_received
    self.recvfrom.set_result((data, addr))
asyncio.exceptions.InvalidStateError: invalid state

In my test code (attached), this wasn't caught in a try: catch:

----------
components: asyncio
files: asynctest.py
messages: 408778
nosy: asvetlov, james2, yselivanov
priority: normal
severity: normal
status: open
title: _asyncio_backend.py datagram_received doesn't handle Future cancelled, throws Exception
versions: Python 3.8
Added file: https://bugs.python.org/file50500/asynctest.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46116>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:15:27 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 17 Dec 2021 14:15:27 +0000
Subject: [issue46114] OpenSSL 3.0 uses different version scheme
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639750527.7.0.117381166704.issue46114@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

FYI, OpenSSL_version_num() is not deprecated and Python does not fail to build with OpenSSL 3.0.1. One test case is failing because OpenSSL 3 changed the version scheme slightly.

----------
title: OpenSSL deprecated OpenSSL_version_num() since version 3.0.0 -> OpenSSL 3.0 uses different version scheme

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:27:10 2021
From: report at bugs.python.org (asper)
Date: Fri, 17 Dec 2021 14:27:10 +0000
Subject: [issue46117] tk could not refresh auto in mac os
Message-ID: <1639751230.51.0.11843295078.issue46117@roundup.psfhosted.org>


New submission from asper <asper at 21cn.com>:

from tkinter import *
from tkinter import ttk


def change():
    global flag
    if flag == 1:
        namelbl.grid_remove()
        namelbl2.grid(column=0, row=0)
        entry2.grid(column=1, row=0, sticky=(W, E))
        flag = 2
    elif flag == 2:
        namelbl2.grid_remove()
        namelbl.grid()
        flag = 1


root = Tk()
root.columnconfigure(1, weight=1)

namelbl = ttk.Label(root, text="Name")
namelbl2 = ttk.Label(root, text="Name2")
entry1 = ttk.Entry(root)
entry2 = ttk.Entry(root)

ok = ttk.Button(root, text="change", command=change)
ok.grid(column=1, row=1)
namelbl.grid(column=0, row=0)
entry1.grid(column=1, row=0, sticky=(W, E))
flag = 1

root.mainloop()

I run the script in mac os 12.1, use python3.10 download from python.org. when the main window show, I change it's size, and press the   "change" button, the script change the label'text from "Name" to "Name2".When press the button again, the label'text from "Name2" to "Name". but the label cannot refresh the text, it show nothing. when I move the mouse, the text showed immediately. 
The script run normally on windows system.
I use the grid_remove() and grid() to switch frame.

----------
assignee: terry.reedy
components: IDLE
messages: 408780
nosy: asper, terry.reedy
priority: normal
severity: normal
status: open
title: tk could not refresh auto in mac os
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46117>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:27:49 2021
From: report at bugs.python.org (Karthikeyan Singaravelan)
Date: Fri, 17 Dec 2021 14:27:49 +0000
Subject: [issue46110] `eval("-"*3000000 + "4")` in cmd causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639751269.35.0.118318896239.issue46110@roundup.psfhosted.org>


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

See also https://bugs.python.org/issue32758

----------
nosy: +serhiy.storchaka, xtreak

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:29:50 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 17 Dec 2021 14:29:50 +0000
Subject: [issue22047] Deprecate unsupported nesting of argparse groups
In-Reply-To: <1406131424.14.0.0235697032218.issue22047@psf.upfronthosting.co.za>
Message-ID: <1639751390.01.0.0199656078237.issue22047@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

_MutuallyExclusiveGroup inherits add_argument_group from _ArgumentGroup.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22047>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:31:22 2021
From: report at bugs.python.org (Karthikeyan Singaravelan)
Date: Fri, 17 Dec 2021 14:31:22 +0000
Subject: [issue46110] `eval("-"*3000000 + "4")` in cmd causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639751482.2.0.962348367428.issue46110@roundup.psfhosted.org>


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

https://bugs.python.org/issue42609 too

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:35:02 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Fri, 17 Dec 2021 14:35:02 +0000
Subject: [issue46116] _asyncio_backend.py datagram_received doesn't handle
 Future cancelled, throws Exception
In-Reply-To: <1639749734.89.0.485816466406.issue46116@roundup.psfhosted.org>
Message-ID: <1639751702.99.0.267213979314.issue46116@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

dns package is not a part of Python standard library.

Please file a bug in https://github.com/rthalley/dnspython/issues bugtracker.

P.S.
The fix is pretty straightforward:
if not fut.done():
    fut.set_result(...)

----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46116>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:36:48 2021
From: report at bugs.python.org (asper)
Date: Fri, 17 Dec 2021 14:36:48 +0000
Subject: [issue46117] tk could not refresh auto in mac os
In-Reply-To: <1639751230.51.0.11843295078.issue46117@roundup.psfhosted.org>
Message-ID: <1639751808.67.0.501694878093.issue46117@roundup.psfhosted.org>


asper <asper at 21cn.com> added the comment:

sorry, I update mac os to 12.1, when press "change" button, this simple sample can refresh the label'text, but have a delay. when I use grid_remove() and grid() to switch two frame, it cannot refresh auto, must move the mouse can refresh.

----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46117>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:46:33 2021
From: report at bugs.python.org (Mark Shannon)
Date: Fri, 17 Dec 2021 14:46:33 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1639752393.06.0.254103849818.issue45711@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset 396b58345f81d4c8c5a52546d2288e666a1b9b8b by Irit Katriel in branch 'main':
bpo-45711: Remove type and traceback from exc_info (GH-30122)
https://github.com/python/cpython/commit/396b58345f81d4c8c5a52546d2288e666a1b9b8b


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Fri Dec 17 09:48:11 2021
From: report at bugs.python.org (Mark Shannon)
Date: Fri, 17 Dec 2021 14:48:11 +0000
Subject: [issue46072] Unify handling of stats in the CPython VM
In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org>
Message-ID: <1639752491.3.0.601097679689.issue46072@roundup.psfhosted.org>


Mark Shannon <mark at hotpy.org> added the comment:


New changeset efd6236d36b292c2c43540132c87cf8425e8d627 by Mark Shannon in branch 'main':
bpo-46072:  Add top level stats struct (GH-30169)
https://github.com/python/cpython/commit/efd6236d36b292c2c43540132c87cf8425e8d627


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46072>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:17:39 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 17 Dec 2021 15:17:39 +0000
Subject: [issue46114] OpenSSL 3.0 uses different version scheme
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639754259.85.0.0615704319666.issue46114@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 2985feac4e02d590bb78bcce9e30864be53280ac by Christian Heimes in branch 'main':
bpo-46114: Fix OpenSSL version check for 3.0.1 (GH-30170)
https://github.com/python/cpython/commit/2985feac4e02d590bb78bcce9e30864be53280ac


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:17:42 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 17 Dec 2021 15:17:42 +0000
Subject: [issue46114] OpenSSL 3.0 uses different version scheme
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639754262.09.0.0429327896388.issue46114@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +28388
pull_request: https://github.com/python/cpython/pull/30172

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:17:59 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 17 Dec 2021 15:17:59 +0000
Subject: [issue44035] Regenerating the configure script fails even if
 dependencies are satisfied
In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org>
Message-ID: <1639754279.88.0.0582428492255.issue44035@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset da8cf8a74714f4cc34fb768345cb1caf9dcddd62 by Christian Heimes in branch 'main':
bpo-44035: Show git diff after autoreconf and regen (GH-30117)
https://github.com/python/cpython/commit/da8cf8a74714f4cc34fb768345cb1caf9dcddd62


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44035>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:18:40 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Fri, 17 Dec 2021 15:18:40 +0000
Subject: [issue45383] PyType_FromSpec API fails to use metaclass of bases
In-Reply-To: <1633470686.49.0.00898443232155.issue45383@roundup.psfhosted.org>
Message-ID: <1639754320.39.0.548730888381.issue45383@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

I don't see how instantiating a metaclass with non-default tp_new would work if you don't know some details about the specific metaclass. So IMO we can we limit ourselves to scenarios where either:
1) the metaclass uses default tp_new, or
2) the code that creates the class knows about the metaclass

For case 2), we could leave allocation to the calling code, and add an API function that does the rest of the work of applying the spec. Something like:

    /* Create a metaclass */
    metatype_spec = {stuff};
    metatype = PyType_FromSpecAndBases(&metatype_spec, &PyType_Type);
    /* Create a type */
    type_spec = {other_stuff};
    newtype = alloc_metatype();
    PyType_ApplySpec(newtype, &type_spec);

PyType_ApplySpec would assert PyType_Ready wasn't called before, and call it after filling in the name, slots, etc.
The metatype could disable its tp_new to disallow PyType_FromSpec (and Python __new__), effectively enforcing "using_metaclass_cinit_pretty_promise_please".

There could be a slot for code to run at the end of PyType_ApplySpec -- the "PyArray_InitDTypeFromSpec" in your pseudocode.


That seems better than calling the metaclass, but to answer questions on that idea:

>> - basicsize/itemsize could be allowed with __basicsize__/__itemsize__ in the dict.
>Do we need this?  I need the basicsize of the metaclass, but that of the class seems fixed/OK?

That's the size of the instance. One more level down :)

>> - members could theoretically be copied to individual descriptors; there doesn't seem much need for keeping tp_members around.
> But a Python MetaClass (that the author may not even realize about) might need access to these to work properly?
> A bit far fetched, but...

Seems very far-fetched to me. IMO these, like e.g. tp_methods, should only be used as arguments for the code that puts the descriptors in __dict__. How the descriptors got there is a detail, the class doesn't need to use tp_members (nor advertise that it does).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45383>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:33:34 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 17 Dec 2021 15:33:34 +0000
Subject: [issue46114] OpenSSL 3.0 uses different version scheme
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639755214.53.0.960499583496.issue46114@roundup.psfhosted.org>


Change by Christian Heimes <lists at cheimes.de>:


----------
pull_requests: +28389
pull_request: https://github.com/python/cpython/pull/30173

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:37:58 2021
From: report at bugs.python.org (Sebastian Berg)
Date: Fri, 17 Dec 2021 15:37:58 +0000
Subject: [issue45383] PyType_FromSpec API fails to use metaclass of bases
In-Reply-To: <1633470686.49.0.00898443232155.issue45383@roundup.psfhosted.org>
Message-ID: <1639755478.75.0.398882645491.issue45383@roundup.psfhosted.org>


Sebastian Berg <sebastian at sipsolutions.net> added the comment:

Fully, agree!  In the end, `PyType_FromSpec` replaces `type.__new__()` (and init I guess) when working in C.  In Python, we would call `type.__new__` (maybe via super) from the `metatype.__new__`, but right now, in C, the metatype cannot reliably use `PyType_FromSpec` in its own `metatype.__new__` to do the same.

I agree with the scenarios:
* If we do not have a custom `metatype.__new__` (init?) then `PyType_FromSpec` should have no reason to refuse doing the work, because nothing can go wrong.
* If we do have a custom `tp_new` the user has to provide C API to create the metaclass instance.  But they still need a way to call `type.__new__` in C (i.e. get what `PyType_FromSpec` does, and promising to do the rest).

`PyType_ApplySpec` would provide that way to create a custom `metatype.__new__` in C when `PyType_FromSpec()` would otherwise reject it to make the first scenario safe.
A flag probably can do the same.  I have no preference, `ApplySpec` seems great to me.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45383>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:38:18 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 17 Dec 2021 15:38:18 +0000
Subject: [issue46114] OpenSSL 3.0 uses different version scheme
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639755498.88.0.34049410221.issue46114@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 251d2eadc7f5b4042245709f41c38169a284e146 by Miss Islington (bot) in branch '3.10':
bpo-46114: Fix OpenSSL version check for 3.0.1 (GH-30170)
https://github.com/python/cpython/commit/251d2eadc7f5b4042245709f41c38169a284e146


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:53:28 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Fri, 17 Dec 2021 15:53:28 +0000
Subject: [issue45383] PyType_FromSpec API fails to use metaclass of bases
In-Reply-To: <1633470686.49.0.00898443232155.issue45383@roundup.psfhosted.org>
Message-ID: <1639756408.34.0.475590561323.issue45383@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

Nice! It's starting to look reasonable, I'll try an implementation when I get some focus time. (Sadly I can't promise it'll be this year.)

Just one detail:

> A flag probably can do the same.  I have no preference, `ApplySpec` seems great to me.

I didn't get what you mean here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45383>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:56:38 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 17 Dec 2021 15:56:38 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1639756598.79.0.58416546619.issue23522@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
pull_requests: +28390
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30174

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Fri Dec 17 10:58:01 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 17 Dec 2021 15:58:01 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1639756681.44.0.0891203998951.issue23522@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

Steven: I've made a PR at https://github.com/python/cpython/pull/30174. Does this match what you had in mind?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Fri Dec 17 11:02:41 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 17 Dec 2021 16:02:41 +0000
Subject: [issue46114] OpenSSL 3.0 uses different version scheme
In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org>
Message-ID: <1639756961.43.0.0706596543521.issue46114@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset a9b3edb66f2976a5895b6399ee905ac2f27718ac by Christian Heimes in branch '3.9':
[3.9] bpo-46114: Fix OpenSSL version check for 3.0.1 (GH-30170) (GH-30173)
https://github.com/python/cpython/commit/a9b3edb66f2976a5895b6399ee905ac2f27718ac


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46114>
_______________________________________

From report at bugs.python.org  Fri Dec 17 11:22:50 2021
From: report at bugs.python.org (neonene)
Date: Fri, 17 Dec 2021 16:22:50 +0000
Subject: [issue40915] multiple problems with mmap.resize()  in Windows
In-Reply-To: <1591657683.26.0.992231826575.issue40915@roundup.psfhosted.org>
Message-ID: <1639758170.01.0.218725921114.issue40915@roundup.psfhosted.org>


Change by neonene <nicesalmon at gmail.com>:


----------
nosy: +neonene
nosy_count: 6.0 -> 7.0
pull_requests: +28391
pull_request: https://github.com/python/cpython/pull/30175

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40915>
_______________________________________

From report at bugs.python.org  Fri Dec 17 11:28:41 2021
From: report at bugs.python.org (daniel hahler)
Date: Fri, 17 Dec 2021 16:28:41 +0000
Subject: [issue41033] readline.c: endless loop on SIGWINCH when loaded twice
In-Reply-To: <1592559834.18.0.183747914407.issue41033@roundup.psfhosted.org>
Message-ID: <1639758521.77.0.547102021029.issue41033@roundup.psfhosted.org>


daniel hahler <python-bugs at thequod.de> added the comment:

Yes, the example also does not segfault for me either (also with Python 3.8.12 I have now as `python3.8`), so this was likely only happening in the more complex setup, and/or maybe with some specific version of readline back then.

----------
title: readline.c: SEGFAULT on SIGWINCH when loaded twice -> readline.c: endless loop on SIGWINCH when loaded twice

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41033>
_______________________________________

From report at bugs.python.org  Fri Dec 17 11:28:50 2021
From: report at bugs.python.org (daniel hahler)
Date: Fri, 17 Dec 2021 16:28:50 +0000
Subject: [issue41033] readline.c: endless loop on SIGWINCH when loaded twice
In-Reply-To: <1592559834.18.0.183747914407.issue41033@roundup.psfhosted.org>
Message-ID: <1639758529.99.0.0345997580254.issue41033@roundup.psfhosted.org>


Change by daniel hahler <python-bugs at thequod.de>:


----------
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41033>
_______________________________________

From report at bugs.python.org  Fri Dec 17 11:34:28 2021
From: report at bugs.python.org (Sebastian Berg)
Date: Fri, 17 Dec 2021 16:34:28 +0000
Subject: [issue45383] PyType_FromSpec API fails to use metaclass of bases
In-Reply-To: <1633470686.49.0.00898443232155.issue45383@roundup.psfhosted.org>
Message-ID: <1639758868.86.0.300206982321.issue45383@roundup.psfhosted.org>


Sebastian Berg <sebastian at sipsolutions.net> added the comment:

Well, what we need is a way to say: I am calling `type.__new__` (i.e. PyType_FromSpec) on purpose from (effectively) my own `mytype.__new__`?

That is, because right now I assume we want to protect users from calling PyType_FromSpec thinking that it is equivalent to calling `class new(base)` when it may not be if base is a metaclass.  So calling `PyType_FromSpec` might refuse to work if it finds a custom `metaclass.__new__` (init?).

I don't really see that it matters if we only support effectively this from C:
```
class MyMetaClass(type):
    def __new__(cls, *args, **kwargs):
        self = type.__new__(...)  # this is PyType_FromSpec
        # more stuff
```
So, I thought telling `PyType_FromSpec` that we are "inside" a custom `__new__` is sufficient and that even as a flag passed as part of the spec could be enough.
But... I agree that I do not quite see that it would be pretty, so it probably was a bad idea :).

Plus, if you add a new method it should also solves the issue of setting the `tp_type` slot to the metaclass explicitly when it is not implicit by inheritance (which is the only thing I care about).
(PyType_FromSpec and PyType_ApplySpec will still need to do the work of resolving the metaclass from the base classes, though.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45383>
_______________________________________

From report at bugs.python.org  Fri Dec 17 11:34:58 2021
From: report at bugs.python.org (Eric Snow)
Date: Fri, 17 Dec 2021 16:34:58 +0000
Subject: [issue46109] Separate resources and abc docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1639758898.78.0.355438078796.issue46109@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

+1 to splitting out the importlib.resources docs

I'm mostly +1 for splitting out the others (.abc, .machinery, .util) too, not just .abc.

Regardless, a ToC at the top of the main page which identifies the submodules (and provides a brief summary for each) would be extra helpful.  I suppose that could be helpful regardless of whether or not we move submodule docs out.

----------
nosy: +eric.snow

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Fri Dec 17 11:35:04 2021
From: report at bugs.python.org (Eric Snow)
Date: Fri, 17 Dec 2021 16:35:04 +0000
Subject: [issue46109] Separate resources and abc docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1639758904.47.0.503710852773.issue46109@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

FWIW, one benefit to having everything in one doc (instead of one doc per submodule) is that it's a little easier to see the bigger picture.  This is particularly important for folks interested in customizing the import system (rather than just interacting with it).

However, they would probably be better served by an explicit section on how to customize the import system.  The language reference provides the info but its focus is to specify rather than to guide.  So it may make sense to have a dedicated section to at least cover the supported customization approaches (at a high level).

This would definitely be covered by a separate issue but it makes less sense if we don't move the submodules to their own docs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Fri Dec 17 11:49:58 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 17 Dec 2021 16:49:58 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1639759798.48.0.53423973029.issue45995@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
assignee:  -> mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Fri Dec 17 11:49:46 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 17 Dec 2021 16:49:46 +0000
Subject: [issue45995] string formatting: normalize negative zero
In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org>
Message-ID: <1639759786.23.0.107564553312.issue45995@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

Thanks, John. I should have time to review within the next week or so.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45995>
_______________________________________

From report at bugs.python.org  Fri Dec 17 12:19:49 2021
From: report at bugs.python.org (Sebastian Berg)
Date: Fri, 17 Dec 2021 17:19:49 +0000
Subject: [issue45383] PyType_FromSpec API fails to use metaclass of bases
In-Reply-To: <1633470686.49.0.00898443232155.issue45383@roundup.psfhosted.org>
Message-ID: <1639761589.19.0.462961386303.issue45383@roundup.psfhosted.org>


Sebastian Berg <sebastian at sipsolutions.net> added the comment:

Btw. huge thanks for looking into this!  Let me know if I can try to help out (I can make due with static metatypes, but my story seems much clearer if I could say: Well with Py 3.11 you can, and probably should, do it dynamically.).  I had lost a lot of time chasing "metaclass should just work" followed by "but I can't get it right without bad hacks".

And now the solution seems fairly clear, which is amazing :)!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45383>
_______________________________________

From report at bugs.python.org  Fri Dec 17 12:49:47 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Fri, 17 Dec 2021 17:49:47 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1639763387.27.0.135522729655.issue46090@roundup.psfhosted.org>


Brandt Bucher <brandtbucher at gmail.com> added the comment:

I'm going to take a stab at making this work today. The idea is to do something like this when setting a new frame:

- Clear and pop tstate->cframe->current_frame and all of its linked predecessors.
  - These should all belong to the same CFrame, right?
- Push copies of the new InterpreterFrame and all of its predecessors (bottom to top, of course), and update all of the PyFrameObjects to point to the new copies.
  - I'm just going to assert(f->f_owns_frame) before copying each of these (and set it to 0, after). I don't think it could ever be valid to stick a new copy of an active frame onto the top of the stack?
- Set tstate->cframe->current_frame to the new, top InterpreterFrame.
  - If my understanding of the new CFrame mechanics is correct, I don't think we'd need to touch the C stack at all? Maybe I'm missing something, though... if we do need to change the size of the C stack, this whole thing becomes a *lot* more painful.

Anyone see any obvious flaws here? I'm new to a lot of this code, so any guidance would be appreciated.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Fri Dec 17 12:54:48 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Fri, 17 Dec 2021 17:54:48 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1639763688.56.0.0321252808268.issue46090@roundup.psfhosted.org>


Brandt Bucher <brandtbucher at gmail.com> added the comment:

Also, it appears that in earlier versions of CPython, it was okay to set tstate->frame = NULL. Some of Greenlet's tests *seem* to be doing this (although it also possible that my current scaffolding has just broken Greenlet).

Does anybody know off the top of their head what it means to set a NULL frame? I can dig around through the old code and see what the interpreter does when that happens, but it seems pretty nonsensical to me. Is it something that only happens during interpreter/thread initialization/shutdown? Or maybe it keeps that thread from becoming active?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Fri Dec 17 13:17:13 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 17 Dec 2021 18:17:13 +0000
Subject: [issue20741] Documentation archives should be available also in
 tar.xz format
In-Reply-To: <1393142720.31.0.255845110134.issue20741@psf.upfronthosting.co.za>
Message-ID: <1639765033.12.0.402954940152.issue20741@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

I don?t think that consistency or standardization really applies here, it?s not like there are tools that want to process both source and doc archives and are broken by the difference in formats.

It could be useful to review the formats used and decide if they are still the best choices (maybe zip for universality, tar + modern and well-supported compression for size), but consistency for consistency?s sake is needless churn.

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20741>
_______________________________________

From report at bugs.python.org  Fri Dec 17 13:18:37 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 17 Dec 2021 18:18:37 +0000
Subject: [issue20741] Documentation archives should be available also in
 tar.xz format
In-Reply-To: <1393142720.31.0.255845110134.issue20741@psf.upfronthosting.co.za>
Message-ID: <1639765117.21.0.734471223705.issue20741@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

Oh to counter my own proposal: formats should not be removed without warnings, there are probably downstream tools that expect specific URL patterns and formats.  So adding something very modern to get the smallest size might be good, but not removing existing format without warning.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20741>
_______________________________________

From report at bugs.python.org  Fri Dec 17 13:46:19 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 17 Dec 2021 18:46:19 +0000
Subject: [issue46068] Change use of warnings.warn to logging.warning in a few
 places
In-Reply-To: <1639435512.0.0.159079727605.issue46068@roundup.psfhosted.org>
Message-ID: <1639766779.38.0.244274775238.issue46068@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

To have a discussion about this, you should open a thread on discuss.

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46068>
_______________________________________

From report at bugs.python.org  Fri Dec 17 13:49:19 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 17 Dec 2021 18:49:19 +0000
Subject: [issue46071] Graphlib documentation
In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org>
Message-ID: <1639766959.29.0.0174286836752.issue46071@roundup.psfhosted.org>


Change by ?ric Araujo <merwok at netwok.org>:


----------
assignee: docs at python -> 
components: +Library (Lib) -Documentation
nosy:  -docs at python
versions:  -Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46071>
_______________________________________

From report at bugs.python.org  Fri Dec 17 13:50:01 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 17 Dec 2021 18:50:01 +0000
Subject: [issue17005] Add a topological sort algorithm
In-Reply-To: <1358717952.33.0.209682941713.issue17005@psf.upfronthosting.co.za>
Message-ID: <1639767001.18.0.340831053481.issue17005@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

See https://bugs.python.org/issue46071 for request to change the API
(I preferred adding a note here than adding all people to nosy there)

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17005>
_______________________________________

From report at bugs.python.org  Fri Dec 17 13:54:18 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 17 Dec 2021 18:54:18 +0000
Subject: [issue46095] Warning about iterate/modify has unwarranted detail
In-Reply-To: <1639648081.19.0.0569018631816.issue46095@roundup.psfhosted.org>
Message-ID: <1639767258.09.0.54114726445.issue46095@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

The note does say it?s about mutable sequences like lists.

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46095>
_______________________________________

From report at bugs.python.org  Fri Dec 17 14:04:51 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 17 Dec 2021 19:04:51 +0000
Subject: [issue46064] Permalinks to underscored documentation entries don't
 work.
In-Reply-To: <1639401282.19.0.555190776199.issue46064@roundup.psfhosted.org>
Message-ID: <1639767891.27.0.771671389589.issue46064@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

I can reproduce.

Source code:

<dt id="debug__">
<span id="__debug__"></span><code class="sig-name descname">__debug__</code><a class="headerlink" href="#debug__" title="Permalink to this definition">?</a></dt>

HTML IDs should start with a letter, a rule which is generally ignored by browsers because of the amount of pages using numerical IDs for example.  I think the HTML5 spec does not require starting with a letter, but I haven?t found that stated clearly.

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46064>
_______________________________________

From report at bugs.python.org  Fri Dec 17 14:10:08 2021
From: report at bugs.python.org (Matthias Bussonnier)
Date: Fri, 17 Dec 2021 19:10:08 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639768208.99.0.77875099244.issue46044@roundup.psfhosted.org>


Change by Matthias Bussonnier <bussonniermatthias at gmail.com>:


----------
pull_requests: +28392
pull_request: https://github.com/python/cpython/pull/30171

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Fri Dec 17 14:15:26 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 17 Dec 2021 19:15:26 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639768526.86.0.70608083887.issue46044@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

I am not sure if this sould also be reported to https://github.com/pypa/distutils/ because I don?t know if they build and publish the docs somewhere.

----------
nosy: +eric.araujo
stage: patch review -> commit review
versions: +Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Fri Dec 17 14:21:22 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 17 Dec 2021 19:21:22 +0000
Subject: [issue46117] tk could not refresh auto in mac os
In-Reply-To: <1639751230.51.0.11843295078.issue46117@roundup.psfhosted.org>
Message-ID: <1639768882.75.0.787830378172.issue46117@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

IDLE is neither the Python it is written it, nor the tkinter module it depends on.  For this tracker, this is at most a tkinter on macOS 12 issue.  But I suspect that it is an issue of the 3rd party tcl/tk on the new macOS version.  There have been others.  Perhaps someone else can test on earlier macOS.  (I verified that the code works as intended on Win 10 with Tk 8.6.12.)

I am not sure of your intention in half-closing this issue.  But, does adding 'root.update_idletasks()' to the end of 'change' make any difference?

----------
assignee: terry.reedy -> 
components: +Tkinter, macOS -IDLE
nosy: +epaine, ned.deily, ronaldoussoren, serhiy.storchaka
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46117>
_______________________________________

From report at bugs.python.org  Fri Dec 17 15:23:24 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 17 Dec 2021 20:23:24 +0000
Subject: [issue20741] Documentation archives should be available also in
 tar.xz format
In-Reply-To: <1393142720.31.0.255845110134.issue20741@psf.upfronthosting.co.za>
Message-ID: <1639772604.61.0.968418519237.issue20741@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

https://docs.python.org/3/download.html says a) tar.bz2 can be read by the tar program, which I presume is true also of tar.xz.  So there is no issue of *needing* two separate programs.  It also claims "The .tar.bz2 archives provide the best compression and fastest download times."  This only need be true, if it is, for the doc formats, as opposed to python code.  In the absence of at least 2 requests from *nix consumers of the archives, why even think of changing?

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20741>
_______________________________________

From report at bugs.python.org  Fri Dec 17 15:39:48 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 17 Dec 2021 20:39:48 +0000
Subject: [issue20741] Documentation archives should be available also in
 tar.xz format
In-Reply-To: <1393142720.31.0.255845110134.issue20741@psf.upfronthosting.co.za>
Message-ID: <1639773588.46.0.664781603642.issue20741@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

tar is modular and depends on optional external programs to handle compression (tar itself does archival only).

gzip is still common, and xz has largely replaced bz2 these days.
I would expect it to be installed on most systems.

(For HTTP compression there are new competitors, brotli and zstd, but I haven?t seen these used to compress files.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20741>
_______________________________________

From report at bugs.python.org  Fri Dec 17 15:42:08 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 20:42:08 +0000
Subject: [issue46109] Separate resources and abc docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1639773728.21.0.447933244357.issue46109@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

My main motivation for moving `.abc` was because it contains classes exclusively relevant to `.resources` (those also present in `importlib_resources.abc`. I want to explore moving those classes to the resources documentation so they're available together and maintained independently.

Other classes in `.abc` are relevant to the import system more generally, so maybe should stay in the main docs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Fri Dec 17 15:54:28 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 20:54:28 +0000
Subject: [issue46118] Migrate importlib.resources into a package
Message-ID: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>


New submission from Jason R. Coombs <jaraco at jaraco.com>:

The importlib.resources module has several modules on which it relies (_adapters, _legacy, simple) and some classes in other modules shared by other parts of importlib (namely abc).

Because these implementations overlap, it adds difficulty in maintaining the `importlib_resources` backport, which must maintain these modules but keep them separate from the unrelated functionality in other parts of importlib.

In an earlier refactoring, `importlib.metadata` was refactored into its own package (https://github.com/python/cpython/pull/25565). This refactoring had benefits of making it clearer which functionality of importlib was related to metadata and which was not.

I'd like to do the same for importlib.resources.

The main complicate

----------
messages: 408815
nosy: jaraco
priority: normal
severity: normal
status: open
title: Migrate importlib.resources into a package
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Fri Dec 17 15:55:32 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 20:55:32 +0000
Subject: [issue46109] Separate resources and abc docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1639774532.84.0.249271379645.issue46109@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I wonder if maybe it's more important to address issue46118 first.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Fri Dec 17 16:20:50 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Fri, 17 Dec 2021 21:20:50 +0000
Subject: [issue46092] Fix/update missing parameters in function signatures for
 Built-in Functions documentation.
In-Reply-To: <1639610832.29.0.673265280888.issue46092@roundup.psfhosted.org>
Message-ID: <1639776050.68.0.540958830872.issue46092@roundup.psfhosted.org>


Vivek Vashist <vivekvashist at gmail.com> added the comment:

Noticed that new removeprefix() and removesuffix() functions that were added in 3.9 have slash notation added in Built-in Types document.

str.removeprefix(prefix, /)
str.removesuffix(suffix, /)

https://docs.python.org/3/library/stdtypes.html#str.removeprefix
https://docs.python.org/3/library/stdtypes.html#str.removesuffix

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46092>
_______________________________________

From report at bugs.python.org  Fri Dec 17 16:28:14 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 21:28:14 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1639776494.47.0.610339645497.issue46118@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
keywords: +patch
pull_requests: +28393
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30176

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Fri Dec 17 16:37:19 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 17 Dec 2021 21:37:19 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1639777039.87.0.134245043353.issue46118@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

Compatibility considerations: 

- importlib.readers and importlib.simple are public, so probably need aliases.
- Same abc classes.

Should we embark on an effort to migrate users to the new names in `importlib.resources`, or simply leave the `importlib.{mod}` names as preferred? My instinct is to do the former, mainly because then the names would be congruent between `importlib.resources` and `importlib_resources`. But I'm also reluctant to introduce a deprecation (even deferred) comparable to what happened with `collections.abc`.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Fri Dec 17 16:38:16 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Fri, 17 Dec 2021 21:38:16 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1639777096.32.0.177897467653.issue46090@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

A thread without a frame looks like a natural end case when you consider the frames as a linked list. Could it be that exec()/eval() run in the current frame, and if there isn't a frame, they refuse to run? (Sorry, I don't recall anything more specific without going hunting through old code.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Fri Dec 17 17:21:11 2021
From: report at bugs.python.org (Brett Cannon)
Date: Fri, 17 Dec 2021 22:21:11 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639779671.85.0.716185456734.issue46044@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:

Nah, I don't think setuptools cares about this doc update.

----------
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Fri Dec 17 18:32:25 2021
From: report at bugs.python.org (Brett Cannon)
Date: Fri, 17 Dec 2021 23:32:25 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639783945.99.0.458585816949.issue46044@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:


New changeset 8202a7e3dd55d551906390742fc748d0747256b8 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-46044: Annotate deprecated sdists formats (GH-30043) (GH-30155)
https://github.com/python/cpython/commit/8202a7e3dd55d551906390742fc748d0747256b8


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Fri Dec 17 18:32:26 2021
From: report at bugs.python.org (Brett Cannon)
Date: Fri, 17 Dec 2021 23:32:26 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639783945.99.0.458585816949.issue46044@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:


New changeset 8202a7e3dd55d551906390742fc748d0747256b8 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-46044: Annotate deprecated sdists formats (GH-30043) (GH-30155)
https://github.com/python/cpython/commit/8202a7e3dd55d551906390742fc748d0747256b8


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Fri Dec 17 18:32:26 2021
From: report at bugs.python.org (Brett Cannon)
Date: Fri, 17 Dec 2021 23:32:26 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639783946.14.0.109181910142.issue46044@roundup.psfhosted.org>


Brett Cannon <brett at python.org> added the comment:


New changeset dbd1dc23f60a6883adf1d18e660f163fa76b8ba9 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46044: Annotate deprecated sdists formats (GH-30043) (#30154)
https://github.com/python/cpython/commit/dbd1dc23f60a6883adf1d18e660f163fa76b8ba9


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Fri Dec 17 18:38:01 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 17 Dec 2021 23:38:01 +0000
Subject: [issue46051] Make @atexit.register work for functions with arguments
In-Reply-To: <1639243621.71.0.144294694671.issue46051@roundup.psfhosted.org>
Message-ID: <1639784281.71.0.888143367192.issue46051@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

You might post on python-ideas list to get comments from other possible users.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46051>
_______________________________________

From report at bugs.python.org  Fri Dec 17 18:50:34 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 17 Dec 2021 23:50:34 +0000
Subject: [issue44896] AttributeError in ast.unparse
In-Reply-To: <1628731580.95.0.847749574283.issue44896@roundup.psfhosted.org>
Message-ID: <1639785034.43.0.756483466895.issue44896@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

#46073 may be a duplicate of this and perhaps should have the same resolution.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44896>
_______________________________________

From report at bugs.python.org  Fri Dec 17 19:14:41 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 18 Dec 2021 00:14:41 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1639786481.24.0.162432184744.issue46090@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

That is weird, but can happen for example if some pthread of some c extensi?n for example picks up the Gil, causing a new PyThreadState to be created and linked but has not called into Python yet.

Basically, an external native thread that calls 
PyGILState_Ensure leaves a thread state with these characteristics.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Fri Dec 17 19:16:43 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 18 Dec 2021 00:16:43 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1639786603.5.0.128712506708.issue46090@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Relevant section:

 https://docs.python.org/3/c-api/init.html#non-python-created-threads

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Fri Dec 17 19:20:00 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 18 Dec 2021 00:20:00 +0000
Subject: [issue46103] inspect.getmembers will call the instance __bases__
 attribute, which may cause an exception
In-Reply-To: <1639669243.89.0.636826061264.issue46103@roundup.psfhosted.org>
Message-ID: <1639786800.59.0.849563332897.issue46103@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

PR edits inspect._getmembers. I nosied people who have edited it previously.

----------
nosy: +ethan.furman, ping, pitrou, terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46103>
_______________________________________

From report at bugs.python.org  Fri Dec 17 19:20:58 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 18 Dec 2021 00:20:58 +0000
Subject: [issue46103] inspect.getmembers will call the instance __bases__
 attribute, which may cause an exception
In-Reply-To: <1639669243.89.0.636826061264.issue46103@roundup.psfhosted.org>
Message-ID: <1639786858.77.0.776832301743.issue46103@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
nosy: +yselivanov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46103>
_______________________________________

From report at bugs.python.org  Fri Dec 17 19:41:34 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 18 Dec 2021 00:41:34 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639788094.69.0.236167803257.issue46110@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Windows, IDLE, 3.10.1: compile("-"*3000000 + "4", '', mode) crashes execution process for any of 'exec', 'eval', 'single'.

#42609 is also about 'too high' string multiplication with new compilet, though the exact breaking point in crash dumps seems different.

----------
nosy: +pablogsal, terry.reedy
title: `eval("-"*3000000 + "4")` in cmd causes hard crash -> compile("-"*3000000 + "4", '', mode) causes hard crash

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 21:04:17 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 18 Dec 2021 02:04:17 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639793057.58.0.331471043137.issue46110@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

This is a stack overflow in the parser, unfortunately, which unfortunately is very difficult to defend against.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 21:05:23 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 18 Dec 2021 02:05:23 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639793123.85.0.741200174087.issue46110@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

This is a known issue for recursive descendent parsers. The only thing we can do here is somehow limit the maximum stack depth of the C stack, but that can:

* Slow down the parser.
* Limit valid expressions that otherwise won't segfault.
* Still don't work in certain systems.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 21:10:24 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 18 Dec 2021 02:10:24 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639793424.24.0.470886389469.issue46110@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I worked in the past in a refactor of the math based rules (https://github.com/python/cpython/pull/20696/files) that could prevent **this** particular example, but others could still make the parser crash by stack overflow

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 21:13:24 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 18 Dec 2021 02:13:24 +0000
Subject: [issue46095] Warning about iterate/modify has unwarranted detail
In-Reply-To: <1639648081.19.0.0569018631816.issue46095@roundup.psfhosted.org>
Message-ID: <1639793604.67.0.898324248225.issue46095@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I think this note can be removed.  The tutorial now has coverage of mutating while iterating.  That is the correct place for discussion of looping techniques.

The part about the "internal counter" needs to be rewritten and moved to stdtypes.rst section on Sequence types.  Here is a first draft:

"Forward and reversed iterators over sequences access values using an index.  That index will continue to march forward (or backward) even if the underlying sequence is mutated.  The iterator terminates only when an IndexError or StopIteration is encountered (or when the index drops below zero)."

Sequence iterators are roughly equivalent to:

    def seqiter(seq):
        i = 0
        while True:
            try:
                yield seq[i]
            except (IndexError, StopIteration):
                break
            i += 1

----------
assignee: docs at python -> rhettinger
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46095>
_______________________________________

From report at bugs.python.org  Fri Dec 17 21:14:21 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 18 Dec 2021 02:14:21 +0000
Subject: [issue46095] Improve SeqIter documentation
In-Reply-To: <1639648081.19.0.0569018631816.issue46095@roundup.psfhosted.org>
Message-ID: <1639793661.94.0.740134177792.issue46095@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
title: Warning about iterate/modify has unwarranted detail -> Improve SeqIter documentation
type: enhancement -> 
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46095>
_______________________________________

From report at bugs.python.org  Fri Dec 17 21:37:49 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 18 Dec 2021 02:37:49 +0000
Subject: [issue6110] IDLE has two "Preferences..." menu's on OSX
In-Reply-To: <1243320712.83.0.629462070436.issue6110@psf.upfronthosting.co.za>
Message-ID: <1639795069.01.0.90649468073.issue6110@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
nosy: +pablogsal
nosy_count: 2.0 -> 3.0
pull_requests: +28394
pull_request: https://github.com/python/cpython/pull/30177

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue6110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 21:38:27 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 18 Dec 2021 02:38:27 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639795107.72.0.0513075638186.issue46110@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I made a draft PR here:

https://github.com/python/cpython/pull/30177

to fix the issue. But we should benchmark and evaluate it before deciding anything.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 23:02:27 2021
From: report at bugs.python.org (Ned Deily)
Date: Sat, 18 Dec 2021 04:02:27 +0000
Subject: [issue6110] IDLE has two "Preferences..." menu's on OSX
In-Reply-To: <1243320712.83.0.629462070436.issue6110@psf.upfronthosting.co.za>
Message-ID: <1639800147.15.0.168004881522.issue6110@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
pull_requests:  -28394

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue6110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 23:02:54 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 18 Dec 2021 04:02:54 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1639800174.02.0.226234780515.issue46110@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
keywords: +patch
pull_requests: +28395
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30177

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 23:02:54 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Sat, 18 Dec 2021 04:02:54 +0000
Subject: [issue6110] IDLE has two "Preferences..." menu's on OSX
In-Reply-To: <1243320712.83.0.629462070436.issue6110@psf.upfronthosting.co.za>
Message-ID: <1639800174.16.0.357611753462.issue6110@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
pull_requests: +28396
pull_request: https://github.com/python/cpython/pull/30177

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue6110>
_______________________________________

From report at bugs.python.org  Fri Dec 17 23:05:03 2021
From: report at bugs.python.org (Ned Deily)
Date: Sat, 18 Dec 2021 04:05:03 +0000
Subject: [issue6110] IDLE has two "Preferences..." menu's on OSX
In-Reply-To: <1243320712.83.0.629462070436.issue6110@psf.upfronthosting.co.za>
Message-ID: <1639800303.28.0.712875611784.issue6110@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
pull_requests:  -28396

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue6110>
_______________________________________

From report at bugs.python.org  Sat Dec 18 01:42:55 2021
From: report at bugs.python.org (asper)
Date: Sat, 18 Dec 2021 06:42:55 +0000
Subject: [issue46117] tk could not refresh auto in mac os
In-Reply-To: <1639751230.51.0.11843295078.issue46117@roundup.psfhosted.org>
Message-ID: <1639809775.9.0.593805111331.issue46117@roundup.psfhosted.org>


asper <asper at 21cn.com> added the comment:

Thank you for your reply. The phenomenon is still exist on mac os, when I add 'root.update_idletasks()'. The version of tk on mac os is 8.5.9, the version of tk is show 8.6.12 from the enviroment of python3.10.
Now, I use lower() and lift() to switch two frame in tkinter, it works well.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46117>
_______________________________________

From report at bugs.python.org  Sat Dec 18 01:55:49 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 18 Dec 2021 06:55:49 +0000
Subject: [issue46117] tk could not refresh auto in mac os
In-Reply-To: <1639751230.51.0.11843295078.issue46117@roundup.psfhosted.org>
Message-ID: <1639810549.89.0.571689971645.issue46117@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

The macOS system tk, 8.5.9, is over a decade old and buggy.  python.org python now always uses the recent 8.6 version included with the installer.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46117>
_______________________________________

From report at bugs.python.org  Sat Dec 18 02:02:43 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Sat, 18 Dec 2021 07:02:43 +0000
Subject: [issue46119] Update bundled pip to 21.3.1 and setuptools to 59.7.0
Message-ID: <1639810963.48.0.453440530558.issue46119@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
components: Distutils
nosy: dstufft, eric.araujo, kumaraditya303, pablogsal
priority: normal
severity: normal
status: open
title: Update bundled pip to 21.3.1 and setuptools to 59.7.0
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46119>
_______________________________________

From report at bugs.python.org  Sat Dec 18 02:04:13 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Sat, 18 Dec 2021 07:04:13 +0000
Subject: [issue46119] Update bundled pip to 21.3.1 and setuptools to 59.7.0
Message-ID: <1639811053.18.0.228245252796.issue46119@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
pull_requests: +28397
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30178

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46119>
_______________________________________

From report at bugs.python.org  Sat Dec 18 03:20:39 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sat, 18 Dec 2021 08:20:39 +0000
Subject: [issue46120] Add note to `typing.Union` that it is recommended to use
 `|` instead
Message-ID: <1639815639.46.0.989122263928.issue46120@roundup.psfhosted.org>


New submission from Nikita Sobolev <mail at sobolevn.me>:

As discussed in https://mail.python.org/archives/list/typing-sig at python.org/thread/TW5M6XDN7DO346RXMADKBAAGNSZPC4ZQ/

> we could probably stick a huge notice in the typing.Union docs saying `|` is preferred for readability in most cases, and not deprecate it for now.

I will send a PR to `Union` and `Optional` docs with this note today.

----------
assignee: docs at python
components: Documentation
messages: 408836
nosy: docs at python, sobolevn
priority: normal
severity: normal
status: open
title: Add note to `typing.Union` that it is recommended to use `|` instead
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46120>
_______________________________________

From report at bugs.python.org  Sat Dec 18 03:21:16 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sat, 18 Dec 2021 08:21:16 +0000
Subject: [issue46120] Add note to `typing.Union` that it is recommended to use
 `|` instead
In-Reply-To: <1639815639.46.0.989122263928.issue46120@roundup.psfhosted.org>
Message-ID: <1639815676.44.0.89266183869.issue46120@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
nosy: +asvetlov, kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46120>
_______________________________________

From report at bugs.python.org  Sat Dec 18 03:43:33 2021
From: report at bugs.python.org (Hinrich Mahler)
Date: Sat, 18 Dec 2021 08:43:33 +0000
Subject: [issue28206] signal.Signals not documented
In-Reply-To: <1474297204.47.0.613989661481.issue28206@psf.upfronthosting.co.za>
Message-ID: <1639817013.76.0.387460969912.issue28206@roundup.psfhosted.org>


Hinrich Mahler <hinrich.mahler at freenet.de> added the comment:

I think this can be closed now.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28206>
_______________________________________

From report at bugs.python.org  Sat Dec 18 04:07:00 2021
From: report at bugs.python.org (dmitry-bychkov)
Date: Sat, 18 Dec 2021 09:07:00 +0000
Subject: [issue46121] Add a note to QueueListener documentation saying that
 SimpleQueue instances can't be used in multiprocessing scenarios
Message-ID: <1639818420.43.0.822761446674.issue46121@roundup.psfhosted.org>


New submission from dmitry-bychkov <iamdbychkov at gmail.com>:

Currently, documentation for QueueListener (https://docs.python.org/3/library/logging.handlers.html#queuelistener) says:
"""
supports receiving logging messages from a queue, such as those implemented in the queue or multiprocessing modules.
"""

While also saying that we can use queue.SimpleQueue as an underlying queue:

"""
The queue is not required to have the task tracking API, which means that you can use queue.SimpleQueue instances for queue.
"""

I think it should also say that neither queue.SimpleQueue nor multiprocessing.SimpleQueue instances will work if your intended use of QueueListener is to receive logging messages from processes spawned by multiprocessing module. One should use multiprocessing.Queue instance.

usage of queue.SimpleQueue will result in pickle exception.
multiprocessing.SimpleQueue lacks the API QueueListener expects from queue.

English is not my first language so I'll step aside from PR's in documentation :)

----------
assignee: docs at python
components: Documentation
messages: 408838
nosy: docs at python, iamdbychkov
priority: normal
severity: normal
status: open
title: Add a note to QueueListener documentation saying that SimpleQueue instances can't be used in multiprocessing scenarios
type: enhancement
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46121>
_______________________________________

From report at bugs.python.org  Sat Dec 18 05:13:24 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Sat, 18 Dec 2021 10:13:24 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <1639822404.38.0.892130506534.issue46106@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
nosy: +corona10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Sat Dec 18 05:15:32 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Sat, 18 Dec 2021 10:15:32 +0000
Subject: [issue46122] Update/fix types.UnionType to types.Union in Built-in
 Types documentation
Message-ID: <1639822532.89.0.201363038797.issue46122@roundup.psfhosted.org>


New submission from Vivek Vashist <vivekvashist at gmail.com>:

There is an error in https://docs.python.org/3/library/stdtypes.html#types-union example.

Looks like there is no types.UnionType

BROKEN:

>>> import types
>>> isinstance(int | str, types.UnionType)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'types' has no attribute 'UnionType'. Did you mean: 'FunctionType'?
>>> [att for att in dir(types) if 'Union' in att]
['Union']
>>>

WORKING:

>>> import types
>>>
>>> isinstance(int | str, types.Union)
True
>>>

I'll raise a PR shortly.

----------
assignee: docs at python
components: Documentation
messages: 408839
nosy: docs at python, vivekvashist
priority: normal
severity: normal
status: open
title: Update/fix types.UnionType to types.Union in Built-in Types documentation
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46122>
_______________________________________

From report at bugs.python.org  Sat Dec 18 05:24:00 2021
From: report at bugs.python.org (Ken Jin)
Date: Sat, 18 Dec 2021 10:24:00 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639823040.04.0.706446231597.issue46104@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset 6ada013df170b0afb6b61a0d942388c6fd81cbc9 by Alex Waygood in branch 'main':
bpo-46104: Reduce use of pre-PEP 526 syntax in typing docs (GH-30148)
https://github.com/python/cpython/commit/6ada013df170b0afb6b61a0d942388c6fd81cbc9


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sat Dec 18 05:24:12 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 10:24:12 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639823052.22.0.669492271821.issue46104@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28398
pull_request: https://github.com/python/cpython/pull/30179

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sat Dec 18 05:24:16 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 10:24:16 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639823056.12.0.856175504591.issue46104@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28399
pull_request: https://github.com/python/cpython/pull/30180

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sat Dec 18 06:50:48 2021
From: report at bugs.python.org (neonene)
Date: Sat, 18 Dec 2021 11:50:48 +0000
Subject: [issue46123] _freeze_module on Windows can be built faster with no
 optimization
Message-ID: <1639828248.15.0.819206839809.issue46123@roundup.psfhosted.org>


New submission from neonene <nicesalmon at gmail.com>:

In Makefile.pre.in, LTO is disabled when building _freeze_module. MSVC can also cut the build time of _freeze_module.exe in half without the optimization.

----------
components: Build, Windows
messages: 408841
nosy: neonene, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: _freeze_module on Windows can be built faster with no optimization
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46123>
_______________________________________

From report at bugs.python.org  Sat Dec 18 06:55:09 2021
From: report at bugs.python.org (neonene)
Date: Sat, 18 Dec 2021 11:55:09 +0000
Subject: [issue46123] _freeze_module on Windows can be built faster with no
 optimization
In-Reply-To: <1639828248.15.0.819206839809.issue46123@roundup.psfhosted.org>
Message-ID: <1639828509.64.0.222087796434.issue46123@roundup.psfhosted.org>


Change by neonene <nicesalmon at gmail.com>:


----------
keywords: +patch
pull_requests: +28400
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30181

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46123>
_______________________________________

From report at bugs.python.org  Sat Dec 18 07:14:22 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 12:14:22 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639829662.33.0.149679252979.issue46104@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 43cb8f483b9f815abf9801e05ec70ae55ca3c5a5 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-46104: Reduce use of pre-PEP 526 syntax in typing docs (GH-30148) (GH-30180)
https://github.com/python/cpython/commit/43cb8f483b9f815abf9801e05ec70ae55ca3c5a5


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sat Dec 18 07:14:28 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 12:14:28 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639829668.81.0.647299444697.issue46104@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset a66be9185c6e0299293a06e21a6f599dfe6c3f60 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46104: Reduce use of pre-PEP 526 syntax in typing docs (GH-30148) (GH-30179)
https://github.com/python/cpython/commit/a66be9185c6e0299293a06e21a6f599dfe6c3f60


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sat Dec 18 07:18:44 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 18 Dec 2021 12:18:44 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639829924.07.0.614535147454.issue46104@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:01:28 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Sat, 18 Dec 2021 13:01:28 +0000
Subject: [issue46122] Update/fix types.UnionType to types.Union in Built-in
 Types documentation
In-Reply-To: <1639822532.89.0.201363038797.issue46122@roundup.psfhosted.org>
Message-ID: <1639832488.88.0.976180206793.issue46122@roundup.psfhosted.org>


Change by Vivek Vashist <vivekvashist at gmail.com>:


----------
keywords: +patch
pull_requests: +28401
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30182

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46122>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:03:46 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 18 Dec 2021 13:03:46 +0000
Subject: [issue40915] multiple problems with mmap.resize()  in Windows
In-Reply-To: <1591657683.26.0.992231826575.issue40915@roundup.psfhosted.org>
Message-ID: <1639832626.85.0.376021924251.issue40915@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset 6214caafbe66e34e84c1809abf0b7aab6791956b by neonene in branch 'main':
bpo-40915: Avoid compiler warnings by fixing mmapmodule conversion from LARGE_INTEGER to Py_ssize_t (GH-30175)
https://github.com/python/cpython/commit/6214caafbe66e34e84c1809abf0b7aab6791956b


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40915>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:05:49 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 18 Dec 2021 13:05:49 +0000
Subject: [issue46088] Build hangs under Visual Studio in deepfreeze stage
In-Reply-To: <1639595221.47.0.522675592351.issue46088@roundup.psfhosted.org>
Message-ID: <1639832749.34.0.932672502633.issue46088@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset 6fc91daf730c60b08b4b32cdce28ff26505a0622 by Steve Dower in branch 'main':
bpo-46088: Automatically detect or install bootstrap Python runtime when building from Visual Studio (GH-30143)
https://github.com/python/cpython/commit/6fc91daf730c60b08b4b32cdce28ff26505a0622


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46088>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:09:13 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 18 Dec 2021 13:09:13 +0000
Subject: [issue46088] Build hangs under Visual Studio in deepfreeze stage
In-Reply-To: <1639595221.47.0.522675592351.issue46088@roundup.psfhosted.org>
Message-ID: <1639832953.0.0.911887985678.issue46088@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46088>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:11:08 2021
From: report at bugs.python.org (Steve Dower)
Date: Sat, 18 Dec 2021 13:11:08 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <cbcf6ca2-657c-0710-7783-dfa133d02b58@python.org>


Steve Dower <steve.dower at python.org> added the comment:

Are we going to have to rush security releases for this one? Or can it 
wait (for me) until Monday?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:26:31 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 13:26:31 +0000
Subject: [issue46099] Solaris: Fix pthread_getcpuclockid test
In-Reply-To: <1639655642.85.0.652795317343.issue46099@roundup.psfhosted.org>
Message-ID: <1639833991.9.0.814303951936.issue46099@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +28403
pull_request: https://github.com/python/cpython/pull/30183

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46099>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:26:35 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 13:26:35 +0000
Subject: [issue46099] Solaris: Fix pthread_getcpuclockid test
In-Reply-To: <1639655642.85.0.652795317343.issue46099@roundup.psfhosted.org>
Message-ID: <1639833995.66.0.933012359881.issue46099@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28404
pull_request: https://github.com/python/cpython/pull/30184

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46099>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:26:38 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sat, 18 Dec 2021 13:26:38 +0000
Subject: [issue46099] Solaris: Fix pthread_getcpuclockid test
In-Reply-To: <1639655642.85.0.652795317343.issue46099@roundup.psfhosted.org>
Message-ID: <1639833998.08.0.0916946480704.issue46099@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset 427a490c495cde8a152e938c6f02be65620e3e59 by Jakub Kul?k in branch 'main':
bpo-46099: Fix pthread_getcpuclockid test on Solaris (GH-30140)
https://github.com/python/cpython/commit/427a490c495cde8a152e938c6f02be65620e3e59


----------
nosy: +asvetlov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46099>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:30:10 2021
From: report at bugs.python.org (E. Paine)
Date: Sat, 18 Dec 2021 13:30:10 +0000
Subject: [issue45496] Tkinter: test_winfo_rgb failure
In-Reply-To: <1634401740.26.0.645054867141.issue45496@roundup.psfhosted.org>
Message-ID: <1639834210.69.0.610986912616.issue45496@roundup.psfhosted.org>


Change by E. Paine <xepaine13 at gmail.com>:


----------
keywords: +patch
pull_requests: +28405
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30185

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45496>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:49:09 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sat, 18 Dec 2021 13:49:09 +0000
Subject: [issue46099] Solaris: Fix pthread_getcpuclockid test
In-Reply-To: <1639655642.85.0.652795317343.issue46099@roundup.psfhosted.org>
Message-ID: <1639835349.11.0.752767681411.issue46099@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset 4f945ad7a510ad6dde13353784e45239edcdc14e by Miss Islington (bot) in branch '3.10':
bpo-46099: Fix pthread_getcpuclockid test on Solaris (GH-30140) (GH-30183)
https://github.com/python/cpython/commit/4f945ad7a510ad6dde13353784e45239edcdc14e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46099>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:52:57 2021
From: report at bugs.python.org (Ken Jin)
Date: Sat, 18 Dec 2021 13:52:57 +0000
Subject: [issue46113] Typos and minor fixes in built in types documentation
In-Reply-To: <1639735779.26.0.586060935342.issue46113@roundup.psfhosted.org>
Message-ID: <1639835577.27.0.590028321267.issue46113@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset 6f2df4295123f8b961d49474b7668f7564a534a4 by Vivek Vashist in branch 'main':
bpo-46113: Minor fixes in stdtypes documentation (GH-30167)
https://github.com/python/cpython/commit/6f2df4295123f8b961d49474b7668f7564a534a4


----------
nosy: +kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46113>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:52:58 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 13:52:58 +0000
Subject: [issue46113] Typos and minor fixes in built in types documentation
In-Reply-To: <1639735779.26.0.586060935342.issue46113@roundup.psfhosted.org>
Message-ID: <1639835578.61.0.863297726047.issue46113@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28406
pull_request: https://github.com/python/cpython/pull/30186

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46113>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:53:02 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 13:53:02 +0000
Subject: [issue46113] Typos and minor fixes in built in types documentation
In-Reply-To: <1639735779.26.0.586060935342.issue46113@roundup.psfhosted.org>
Message-ID: <1639835582.6.0.0804848729029.issue46113@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28407
pull_request: https://github.com/python/cpython/pull/30187

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46113>
_______________________________________

From report at bugs.python.org  Sat Dec 18 08:59:29 2021
From: report at bugs.python.org (Ken Jin)
Date: Sat, 18 Dec 2021 13:59:29 +0000
Subject: [issue46122] Update/fix types.UnionType to types.Union in Built-in
 Types documentation
In-Reply-To: <1639822532.89.0.201363038797.issue46122@roundup.psfhosted.org>
Message-ID: <1639835969.81.0.328506188636.issue46122@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:

Thanks for the PR Vivek. Can you please tell me the exact 3.10 version you're running? In earlier 3.10 versions (alpha, beta etc.) types.Union existed, but somewhere later (rc1,rc2) it became types.UnionType.

The final 3.10.0 release has types.UnionType, not types.Union. I suspect you might be running an earlier iteration of 3.10.

----------
nosy: +kj
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46122>
_______________________________________

From report at bugs.python.org  Sat Dec 18 09:04:22 2021
From: report at bugs.python.org (Karthikeyan Singaravelan)
Date: Sat, 18 Dec 2021 14:04:22 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
Message-ID: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>


New submission from Karthikeyan Singaravelan <tir.karthi at gmail.com>:

zoneinfo module currently emits deprecation warnings due to API changes in importlib.resources

./python -Wonce -m test test_zoneinfo
0:00:00 load avg: 0.73 Run tests sequentially
0:00:00 load avg: 0.73 [1/1] test_zoneinfo
/home/karthikeyan/stuff/python/cpython/Lib/zoneinfo/_tzpath.py:121: DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  with resources.open_text("tzdata", "zones") as f:
/home/karthikeyan/stuff/python/cpython/Lib/zoneinfo/_common.py:12: DeprecationWarning: open_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  return importlib.resources.open_binary(package_name, resource_name)
/home/karthikeyan/stuff/python/cpython/Lib/zoneinfo/_tzpath.py:121: DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  with resources.open_text("tzdata", "zones") as f:
/home/karthikeyan/stuff/python/cpython/Lib/zoneinfo/_common.py:12: DeprecationWarning: open_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  return importlib.resources.open_binary(package_name, resource_name)

== Tests result: SUCCESS ==

1 test OK.

Total duration: 376 ms
Tests result: SUCCESS

A fix would be to adapt the _legacy module changes inline like below patch though normalize_path is not public API and need to be inlined too.

diff --git a/Lib/zoneinfo/_common.py b/Lib/zoneinfo/_common.py
index 4c24f01bd7..bfe3fe4c3c 100644
--- a/Lib/zoneinfo/_common.py
+++ b/Lib/zoneinfo/_common.py
@@ -2,14 +2,15 @@
 
 
 def load_tzdata(key):
-    import importlib.resources
+    from importlib.resources import files
+    from importlib._common import normalize_path
 
     components = key.split("/")
     package_name = ".".join(["tzdata.zoneinfo"] + components[:-1])
     resource_name = components[-1]
 
     try:
-        return importlib.resources.open_binary(package_name, resource_name)
+        return (files(package_name) / normalize_path(resource_name)).open('rb')
     except (ImportError, FileNotFoundError, UnicodeEncodeError):
         # There are three types of exception that can be raised that all amount
         # to "we cannot find this key":
diff --git a/Lib/zoneinfo/_tzpath.py b/Lib/zoneinfo/_tzpath.py
index 672560b951..b1efe5d99e 100644
--- a/Lib/zoneinfo/_tzpath.py
+++ b/Lib/zoneinfo/_tzpath.py
@@ -111,14 +111,15 @@ def available_timezones():
         determine if a given file on the time zone search path is to open it
         and check for the "magic string" at the beginning.
     """
-    from importlib import resources
+    from importlib.resources import files
+    from importlib._common import normalize_path
 
     valid_zones = set()
 
     # Start with loading from the tzdata package if it exists: this has a
     # pre-assembled list of zones that only requires opening one file.
     try:
-        with resources.open_text("tzdata", "zones") as f:
+        with (files("tzdata") / normalize_path("zones")).open('r') as f:
             for zone in f:
                 zone = zone.strip()
                 if zone:

----------
components: Library (Lib)
messages: 408851
nosy: jaraco, p-ganssle, xtreak
priority: normal
severity: normal
status: open
title: Deprecation warning in zoneinfo module
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Sat Dec 18 09:05:23 2021
From: report at bugs.python.org (Karthikeyan Singaravelan)
Date: Sat, 18 Dec 2021 14:05:23 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1639836323.06.0.256682166549.issue46118@roundup.psfhosted.org>


Change by Karthikeyan Singaravelan <tir.karthi at gmail.com>:


----------
nosy: +xtreak

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Sat Dec 18 09:12:35 2021
From: report at bugs.python.org (Ken Jin)
Date: Sat, 18 Dec 2021 14:12:35 +0000
Subject: [issue46113] Typos and minor fixes in built in types documentation
In-Reply-To: <1639735779.26.0.586060935342.issue46113@roundup.psfhosted.org>
Message-ID: <1639836755.56.0.771449381903.issue46113@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset bb286d45afa6740384bab97d0da68fe571efb6ec by Miss Islington (bot) in branch '3.10':
bpo-46113: Minor fixes in stdtypes documentation (GH-30167) (GH-30186)
https://github.com/python/cpython/commit/bb286d45afa6740384bab97d0da68fe571efb6ec


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46113>
_______________________________________

From report at bugs.python.org  Sat Dec 18 09:23:42 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 14:23:42 +0000
Subject: [issue37578] Change Glob: Allow Recursion for Hidden Files
In-Reply-To: <1562984633.23.0.0355519865943.issue37578@roundup.psfhosted.org>
Message-ID: <1639837422.92.0.0124391956313.issue37578@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset ae36cd1e792db9d6db4c6847ec2a7d50a71f2b68 by andrei kulakov in branch 'main':
bpo-37578: glob.glob -- added include_hidden parameter (GH-30153)
https://github.com/python/cpython/commit/ae36cd1e792db9d6db4c6847ec2a7d50a71f2b68


----------
nosy: +miss-islington

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37578>
_______________________________________

From report at bugs.python.org  Sat Dec 18 09:26:19 2021
From: report at bugs.python.org (Ken Jin)
Date: Sat, 18 Dec 2021 14:26:19 +0000
Subject: [issue46113] Typos and minor fixes in built in types documentation
In-Reply-To: <1639735779.26.0.586060935342.issue46113@roundup.psfhosted.org>
Message-ID: <1639837579.28.0.814582697541.issue46113@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset 0da17eb06943a66fcd826ff591d47c22c2c0595a by Miss Islington (bot) in branch '3.9':
bpo-46113: Minor fixes in stdtypes documentation (GH-30167) (GH-30187)
https://github.com/python/cpython/commit/0da17eb06943a66fcd826ff591d47c22c2c0595a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46113>
_______________________________________

From report at bugs.python.org  Sat Dec 18 09:26:56 2021
From: report at bugs.python.org (Ken Jin)
Date: Sat, 18 Dec 2021 14:26:56 +0000
Subject: [issue46113] Typos and minor fixes in built in types documentation
In-Reply-To: <1639735779.26.0.586060935342.issue46113@roundup.psfhosted.org>
Message-ID: <1639837616.05.0.644532782461.issue46113@roundup.psfhosted.org>


Change by Ken Jin <kenjin4096 at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46113>
_______________________________________

From report at bugs.python.org  Sat Dec 18 09:54:05 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sat, 18 Dec 2021 14:54:05 +0000
Subject: [issue40280] Consider supporting emscripten/webassembly as a build
 target
In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org>
Message-ID: <1639839245.88.0.792773740857.issue40280@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:


New changeset 0339434835aa74dc78a38ae12ea7d2973c144eb1 by Christian Heimes in branch 'main':
bpo-40280: Add Tools/wasm with helpers for cross building (GH-29984)
https://github.com/python/cpython/commit/0339434835aa74dc78a38ae12ea7d2973c144eb1


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40280>
_______________________________________

From report at bugs.python.org  Sat Dec 18 10:01:46 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 18 Dec 2021 15:01:46 +0000
Subject: [issue37578] Change Glob: Allow Recursion for Hidden Files
In-Reply-To: <1562984633.23.0.0355519865943.issue37578@roundup.psfhosted.org>
Message-ID: <1639839706.29.0.985022259377.issue37578@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37578>
_______________________________________

From report at bugs.python.org  Sat Dec 18 10:34:16 2021
From: report at bugs.python.org (hongweipeng)
Date: Sat, 18 Dec 2021 15:34:16 +0000
Subject: [issue26577] inspect.getclosurevars returns incorrect variable when
 using class member with the same name as other variable
In-Reply-To: <1458200430.96.0.916440482942.issue26577@psf.upfronthosting.co.za>
Message-ID: <1639841656.53.0.581755796553.issue26577@roundup.psfhosted.org>


hongweipeng <hongweichen8888 at sina.com> added the comment:

Why is expected that 'x' would not exist in cv.globals? I think it works normally, you can see `x` in `func.__globals__`.

----------
nosy: +hongweipeng

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26577>
_______________________________________

From report at bugs.python.org  Sat Dec 18 10:41:31 2021
From: report at bugs.python.org (Bar Harel)
Date: Sat, 18 Dec 2021 15:41:31 +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: <1639842091.07.0.546491701139.issue39320@roundup.psfhosted.org>


Bar Harel <bzvi7919 at gmail.com> added the comment:

Does this count as a regression or as an unintended bugfix for evaluation order?

https://stackoverflow.com/a/70404659/1658617

----------
nosy: +bar.harel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39320>
_______________________________________

From report at bugs.python.org  Sat Dec 18 10:51:42 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sat, 18 Dec 2021 15:51:42 +0000
Subject: [issue46099] Solaris: Fix pthread_getcpuclockid test
In-Reply-To: <1639655642.85.0.652795317343.issue46099@roundup.psfhosted.org>
Message-ID: <1639842702.15.0.653811151162.issue46099@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset a328ad7f9a9b6cd624da5efcc76daf88e0d22312 by Miss Islington (bot) in branch '3.9':
bpo-46099: Fix pthread_getcpuclockid test on Solaris (GH-30140) (#30184)
https://github.com/python/cpython/commit/a328ad7f9a9b6cd624da5efcc76daf88e0d22312


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46099>
_______________________________________

From report at bugs.python.org  Sat Dec 18 11:09:10 2021
From: report at bugs.python.org (Gareth Rees)
Date: Sat, 18 Dec 2021 16:09:10 +0000
Subject: [issue15443] datetime module has no support for nanoseconds
In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za>
Message-ID: <1639843750.36.0.0799620979309.issue15443@roundup.psfhosted.org>


Gareth Rees <gdr at garethrees.org> added the comment:

I also have a use case that would benefit from nanosecond resolution in Python's datetime objects, that is, representing and querying the results of clock_gettime() in a program trace.

On modern Linuxes with a vDSO, clock_gettime() does not require a system call and completes within a few nanoseconds. So Python's datetime objects do not have sufficient resolution to distinguish between adjacent calls to clock_gettime().

This means that, like Mark Dickinson above, I have to choose between using datetime for queries (which would be convenient) and accepting that nearby events in the trace may be indistinguishable, or implementing my own datetime-like data structure.

----------
nosy: +gdr at garethrees.org

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15443>
_______________________________________

From report at bugs.python.org  Sat Dec 18 11:27:13 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 18 Dec 2021 16:27:13 +0000
Subject: [issue46099] Solaris: Fix pthread_getcpuclockid test
In-Reply-To: <1639655642.85.0.652795317343.issue46099@roundup.psfhosted.org>
Message-ID: <1639844833.49.0.0920724161064.issue46099@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46099>
_______________________________________

From report at bugs.python.org  Sat Dec 18 11:46:27 2021
From: report at bugs.python.org (Charalampos Tsimpouris)
Date: Sat, 18 Dec 2021 16:46:27 +0000
Subject: [issue917120] imaplib: incorrect quoting in commands
Message-ID: <1639845987.03.0.773062991867.issue917120@roundup.psfhosted.org>


Charalampos Tsimpouris <xtsimpouris at 1024.gr> added the comment:

As far as I can see I have the same problem from a different perspective. Selecting folders that include a space result in broken use of API, as server responds with "folder is not dound" (which is valid as part of the folder name is never sent). To circumvent the problem I suggest using a patched version of _command, where if name is "select" or "examine", check if arg startswith ", and if not wrap it - locally this seems to fix my problem. A different approach would be to force user use _quote function when needed (also fixes my problem locally).

----------
nosy: +xtsimpouris

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue917120>
_______________________________________

From report at bugs.python.org  Sat Dec 18 11:52:19 2021
From: report at bugs.python.org (Ned Deily)
Date: Sat, 18 Dec 2021 16:52:19 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <1639846339.68.0.224474081811.issue46106@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

>From the release notes, there didn?t seem to be anything super critical. I wasn?t contemplating any special releases: just update for the next scheduled releases.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Sat Dec 18 12:25:18 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 18 Dec 2021 17:25:18 +0000
Subject: [issue31914] Document Pool.(star)map return type
In-Reply-To: <1509482713.68.0.213398074469.issue31914@psf.upfronthosting.co.za>
Message-ID: <1639848318.86.0.832388374732.issue31914@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

This appears to have been fixed in PR 26560 in the main branch, but it might be nice to backport it to 3.10 and 3.9

----------
nosy: +AlexWaygood, mdk
stage:  -> backport needed
type: enhancement -> behavior
versions: +Python 3.10, Python 3.9 -Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31914>
_______________________________________

From report at bugs.python.org  Sat Dec 18 12:45:18 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 18 Dec 2021 17:45:18 +0000
Subject: [issue46068] Change use of warnings.warn to logging.warning in a few
 places
In-Reply-To: <1639435512.0.0.159079727605.issue46068@roundup.psfhosted.org>
Message-ID: <1639849518.75.0.157652045299.issue46068@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

https://discuss.python.org/t/logging-warning-vs-warnings-warn/12625/2

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46068>
_______________________________________

From report at bugs.python.org  Sat Dec 18 12:59:20 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 18 Dec 2021 17:59:20 +0000
Subject: [issue34643] How to build Release Version of Python in Windows?
In-Reply-To: <1536723765.14.0.956365154283.issue34643@psf.upfronthosting.co.za>
Message-ID: <1639850360.17.0.464450359353.issue34643@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Given that there has been no activity on this issue for over three years, I am closing this as "rejected".

----------
nosy: +AlexWaygood
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34643>
_______________________________________

From report at bugs.python.org  Sat Dec 18 14:32:33 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 18 Dec 2021 19:32:33 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1639855953.3.0.555730267212.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

For the small cases (say n < 50), we can get faster code by using a small (3Kb) table of factorial logarithms:

   double lf[50] = [log2(factorial(n)) for n in range(50)];

Then comb() and perm() can be computed quickly and in constant time using the C99 math functions:

   result = PyLong_FromDouble(round(exp2(lf[n] - (lf[r] + lf[n-r]))));

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Sat Dec 18 15:30:07 2021
From: report at bugs.python.org (Ryan Fox)
Date: Sat, 18 Dec 2021 20:30:07 +0000
Subject: [issue26577] inspect.getclosurevars returns incorrect variable when
 using class member with the same name as other variable
In-Reply-To: <1639841656.53.0.581755796553.issue26577@roundup.psfhosted.org>
Message-ID: <CAGqH21LOtw-NeDsfd7D6hOU4Hc9NY5j_TzPO3RSgSQp0dsit=w@mail.gmail.com>


Ryan Fox <foxryan at gmail.com> added the comment:

If you change the class member 'x' to a different name like 'y', then cv
doesn't include 'x', but does include an unbound 'y'.

In both cases, the function isn't referring to a global variable, just the
class member of that name. Besides the function itself, no other globals
are included in cv.globals.

On Sat, Dec 18, 2021 at 10:34 AM hongweipeng <report at bugs.python.org> wrote:

>
> hongweipeng <hongweichen8888 at sina.com> added the comment:
>
> Why is expected that 'x' would not exist in cv.globals? I think it works
> normally, you can see `x` in `func.__globals__`.
>
> ----------
> nosy: +hongweipeng
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue26577>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26577>
_______________________________________

From report at bugs.python.org  Sat Dec 18 15:37:17 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 18 Dec 2021 20:37:17 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1639859837.87.0.871486594259.issue37295@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
Removed message: https://bugs.python.org/msg408865

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Sat Dec 18 15:40:55 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 18 Dec 2021 20:40:55 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1639860055.45.0.097167485904.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

For the small cases (say n < 50), we can get faster code by using a small (3Kb) table of factorial logarithms:

   double lf[50] = [log2(factorial(n)) for n in range(50)];

Then comb() and perm() function can be computed quickly and in constant time using the C99 math functions:

   result = PyLong_FromDouble(round(exp2(lf[n] - (lf[r] + lf[n-r]))));

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Sat Dec 18 15:49:04 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Sat, 18 Dec 2021 20:49:04 +0000
Subject: [issue46122] Update/fix types.UnionType to types.Union in Built-in
 Types documentation
In-Reply-To: <1639822532.89.0.201363038797.issue46122@roundup.psfhosted.org>
Message-ID: <1639860544.05.0.614192733239.issue46122@roundup.psfhosted.org>


Vivek Vashist <vivekvashist at gmail.com> added the comment:

Thanks Ken. 

You are right I'm using 3.10.0b4. I just tested it on 3.10.0 and it works fine.

>>> import types
>>> isinstance(int | str, types.UnionType)
True

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46122>
_______________________________________

From report at bugs.python.org  Sat Dec 18 15:49:25 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Sat, 18 Dec 2021 20:49:25 +0000
Subject: [issue46122] Update/fix types.UnionType to types.Union in Built-in
 Types documentation
In-Reply-To: <1639822532.89.0.201363038797.issue46122@roundup.psfhosted.org>
Message-ID: <1639860565.28.0.706247675289.issue46122@roundup.psfhosted.org>


Change by Vivek Vashist <vivekvashist at gmail.com>:


----------
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46122>
_______________________________________

From report at bugs.python.org  Sat Dec 18 16:19:15 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 18 Dec 2021 21:19:15 +0000
Subject: [issue46044] Update distutils documentation to say PyPI only accepts
 tar.gz and zip.
In-Reply-To: <1639183321.87.0.60010365673.issue46044@roundup.psfhosted.org>
Message-ID: <1639862355.41.0.147973953099.issue46044@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset fe68486197cb26a69ecce9353271d91adf885cb5 by Matthias Bussonnier in branch 'main':
bpo-46044: Fix doc typo introduced in GH-30043 (GH-30171)
https://github.com/python/cpython/commit/fe68486197cb26a69ecce9353271d91adf885cb5


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46044>
_______________________________________

From report at bugs.python.org  Sat Dec 18 16:41:46 2021
From: report at bugs.python.org (Roundup Robot)
Date: Sat, 18 Dec 2021 21:41:46 +0000
Subject: [issue45321] Module xml.parsers.expat.errors misses error code
 constants of libexpat >=2.0
In-Reply-To: <1632919785.51.0.148853477081.issue45321@roundup.psfhosted.org>
Message-ID: <1639863706.96.0.793682292615.issue45321@roundup.psfhosted.org>


Change by Roundup Robot <devnull at psf.upfronthosting.co.za>:


----------
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +28408
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30188

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45321>
_______________________________________

From report at bugs.python.org  Sat Dec 18 16:50:03 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Sat, 18 Dec 2021 21:50:03 +0000
Subject: [issue46119] Update bundled pip to 21.3.1 and setuptools to 59.7.0
Message-ID: <1639864203.35.0.18168315718.issue46119@roundup.psfhosted.org>


Change by ?ric Araujo <merwok at netwok.org>:


----------
components: +Library (Lib) -Distutils
nosy: +ncoghlan, pradyunsg -eric.araujo
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46119>
_______________________________________

From report at bugs.python.org  Sat Dec 18 17:22:16 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 22:22:16 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1639866136.63.0.206611308341.issue46124@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I would hope that normalize_path would not be needed. It might be for drop-in compatibility. If it's needed for zoneinfo, I'd like to consider why and what implications that has for the deprecation of the legacy API.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Sat Dec 18 17:22:25 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 22:22:25 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1639866145.61.0.195896558147.issue46124@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
assignee:  -> jaraco

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Sat Dec 18 17:25:22 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 22:25:22 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1639866322.19.0.731251317287.issue46124@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I just confirmed, and `normalize_path` has been moved to the _legacy module for importlib_resources, so I'd expect that change to land in CPython soon too.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Sat Dec 18 17:30:51 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 22:30:51 +0000
Subject: [issue46125] Test the preferred API instead of relying on legacy for
 coverage
Message-ID: <1639866651.22.0.383271924508.issue46125@roundup.psfhosted.org>


New submission from Jason R. Coombs <jaraco at jaraco.com>:

importlib_resources 5.4 did some refactoring to ensure that the preferred traversable API was tested (https://github.com/python/importlib_resources/pull/239). Let's incorporate those changes for importlib.resources.

----------
messages: 408872
nosy: jaraco
priority: normal
severity: normal
status: open
title: Test the preferred API instead of relying on legacy for coverage

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46125>
_______________________________________

From report at bugs.python.org  Sat Dec 18 17:31:06 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 22:31:06 +0000
Subject: [issue46125] Test the preferred API instead of relying on legacy for
 coverage
In-Reply-To: <1639866651.22.0.383271924508.issue46125@roundup.psfhosted.org>
Message-ID: <1639866666.82.0.172137171891.issue46125@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
components: +Library (Lib)
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46125>
_______________________________________

From report at bugs.python.org  Sat Dec 18 17:31:18 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 22:31:18 +0000
Subject: [issue46125] Test the preferred API instead of relying on legacy for
 coverage
In-Reply-To: <1639866651.22.0.383271924508.issue46125@roundup.psfhosted.org>
Message-ID: <1639866678.06.0.777571818438.issue46125@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
assignee:  -> jaraco

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46125>
_______________________________________

From report at bugs.python.org  Sat Dec 18 17:31:48 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 22:31:48 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1639866708.65.0.695987699059.issue46124@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I filed issue46125 to track that issue separately.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Sat Dec 18 17:40:14 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Sat, 18 Dec 2021 22:40:14 +0000
Subject: [issue45978] deepfreeze opaquely fails on Windows when building from
 Visual Studio
In-Reply-To: <1638611229.31.0.384123662554.issue45978@roundup.psfhosted.org>
Message-ID: <1639867214.42.0.461976178315.issue45978@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

This was fixed by https://github.com/python/cpython/pull/30143

----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45978>
_______________________________________

From report at bugs.python.org  Sat Dec 18 17:53:06 2021
From: report at bugs.python.org (dhruv)
Date: Sat, 18 Dec 2021 22:53:06 +0000
Subject: [issue46094] Missing unit test on unittest.TestResult to check for
 required arguments
In-Reply-To: <1639637165.39.0.102854010232.issue46094@roundup.psfhosted.org>
Message-ID: <1639867986.25.0.74109958896.issue46094@roundup.psfhosted.org>


dhruv <kapoor_1992 at hotmail.com> added the comment:

"Required" meaning that we cannot remove them from the constructor signature even though they aren't used within it. Hope that clears it up!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46094>
_______________________________________

From report at bugs.python.org  Sat Dec 18 18:08:24 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 23:08:24 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
Message-ID: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>


New submission from Jason R. Coombs <jaraco at jaraco.com>:

In https://github.com/python/importlib_metadata/issues/302, I learned that the way unittest reports failures in tests is incentivizing the replacement of docstrings with comments in order not to make resolution of the relevant failing test more difficult to locate.

I presume I don't need to explain why docstrings are nice and preferable over comments.

Better would be for unittest to provide an option to ignore the docstrings or to emit the test path regardless of whether a docstring was present and to employ that option in CPython, allowing for docstrings in tests.

----------
components: Tests
messages: 408876
nosy: jaraco
priority: normal
severity: normal
status: open
title: Unittest output drives developers to avoid docstrings
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 18 18:29:44 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 23:29:44 +0000
Subject: [issue46125] Test the preferred API instead of relying on legacy for
 coverage
In-Reply-To: <1639866651.22.0.383271924508.issue46125@roundup.psfhosted.org>
Message-ID: <1639870184.8.0.0334976913002.issue46125@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
keywords: +patch
pull_requests: +28409
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30189

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46125>
_______________________________________

From report at bugs.python.org  Sat Dec 18 18:41:42 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sat, 18 Dec 2021 23:41:42 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1639870902.29.0.93621620436.issue46124@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
keywords: +patch
pull_requests: +28410
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30190

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Sat Dec 18 19:15:23 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 00:15:23 +0000
Subject: [issue31914] Document Pool.(star)map return type
In-Reply-To: <1509482713.68.0.213398074469.issue31914@psf.upfronthosting.co.za>
Message-ID: <1639872923.19.0.788316407015.issue31914@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

PR 30191 and PR 30192 are backports

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31914>
_______________________________________

From report at bugs.python.org  Sat Dec 18 19:16:14 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 19 Dec 2021 00:16:14 +0000
Subject: [issue31914] Document Pool.(star)map return type
In-Reply-To: <1509482713.68.0.213398074469.issue31914@psf.upfronthosting.co.za>
Message-ID: <1639872974.16.0.756366542249.issue31914@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
keywords: +patch
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28411
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/30191

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31914>
_______________________________________

From report at bugs.python.org  Sat Dec 18 19:16:18 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 19 Dec 2021 00:16:18 +0000
Subject: [issue31914] Document Pool.(star)map return type
In-Reply-To: <1509482713.68.0.213398074469.issue31914@psf.upfronthosting.co.za>
Message-ID: <1639872978.61.0.812673051042.issue31914@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
keywords: +patch, patch
nosy: +miss-islington, miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28411, 28412
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/30191

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31914>
_______________________________________

From report at bugs.python.org  Sat Dec 18 19:16:43 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 19 Dec 2021 00:16:43 +0000
Subject: [issue31914] Document Pool.(star)map return type
In-Reply-To: <1509482713.68.0.213398074469.issue31914@psf.upfronthosting.co.za>
Message-ID: <1639873003.38.0.533195455882.issue31914@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28413
pull_request: https://github.com/python/cpython/pull/30192

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31914>
_______________________________________

From report at bugs.python.org  Sat Dec 18 19:38:41 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 00:38:41 +0000
Subject: [issue33567] Explicitly mention bytes and other buffers in the
 documentation for float()
In-Reply-To: <1526640101.14.0.682650639539.issue33567@psf.upfronthosting.co.za>
Message-ID: <1639874321.82.0.0668184134114.issue33567@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
assignee:  -> docs at python
components: +Documentation
nosy: +docs at python
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33567>
_______________________________________

From report at bugs.python.org  Sat Dec 18 19:41:56 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 00:41:56 +0000
Subject: [issue33449] Documentation for email.charset confusing about the
 location of constants
In-Reply-To: <1525887538.2.0.682650639539.issue33449@psf.upfronthosting.co.za>
Message-ID: <1639874516.41.0.633991839545.issue33449@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33449>
_______________________________________

From report at bugs.python.org  Sat Dec 18 20:01:38 2021
From: report at bugs.python.org (Ethan Furman)
Date: Sun, 19 Dec 2021 01:01:38 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1639875698.67.0.784815360157.issue46126@roundup.psfhosted.org>


Ethan Furman <ethan at stoneleaf.us> added the comment:

Could you give a couple examples for those of us not familiar with the problem?

----------
nosy: +ethan.furman

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 18 21:29:21 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 02:29:21 +0000
Subject: [issue46125] Test the preferred API instead of relying on legacy for
 coverage
In-Reply-To: <1639866651.22.0.383271924508.issue46125@roundup.psfhosted.org>
Message-ID: <1639880961.1.0.125478715936.issue46125@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:


New changeset 9b52920173735ac609664c6a3a3021d24a95a092 by Jason R. Coombs in branch 'main':
bpo-46125: Refactor tests to test traversable API directly. Includes changes from importlib_resources 5.4.0. (GH-30189)
https://github.com/python/cpython/commit/9b52920173735ac609664c6a3a3021d24a95a092


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46125>
_______________________________________

From report at bugs.python.org  Sat Dec 18 21:31:03 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 02:31:03 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1639881063.85.0.37636273773.issue46126@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

Absolutely. I was thinking to do just that.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 18 21:36:31 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 02:36:31 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1639881391.74.0.330967726669.issue46126@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I created this diff:

```diff
diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py
index e16773a7e8..92aacd5ad5 100644
--- a/Lib/test/test_importlib/test_metadata_api.py
+++ b/Lib/test/test_importlib/test_metadata_api.py
@@ -90,8 +90,11 @@ def test_entry_points_distribution(self):
             self.assertEqual(ep.dist.version, "1.0.0")
 
     def test_entry_points_unique_packages(self):
-        # Entry points should only be exposed for the first package
-        # on sys.path with a given name.
+        """
+        Entry points should only be exposed for the first package
+        on sys.path with a given name.
+        """
+        raise ValueError("Failing on purpose")
         alt_site_dir = self.fixtures.enter_context(fixtures.tempdir())
         self.fixtures.enter_context(self.add_sys_path(alt_site_dir))
         alt_pkg = {
```

And then ran the tests, but the output is easy to totally scrutable:

```
cpython bpo-46126/bad-error-message $ ./python.exe -m test.test_importlib
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................s............................E.................................................x......................................................................................................s....................................................................................................................................................................Trying 20 threads ... 44.7 ms OK.
Trying 50 threads ... 36.8 ms OK.
Trying 20 threads ... 27.7 ms OK.
Trying 50 threads ... 28.0 ms OK.
Trying 20 threads ... 27.9 ms OK.
Trying 50 threads ... 31.1 ms OK.
.Trying 20 threads ... 7.1 ms OK.
Trying 50 threads ... 7.6 ms OK.
Trying 20 threads ... 3.2 ms OK.
Trying 50 threads ... 8.5 ms OK.
Trying 20 threads ... 3.4 ms OK.
Trying 50 threads ... 8.7 ms OK.
.Trying 20 threads ... 40.3 ms OK.
Trying 50 threads ... 8.7 ms OK.
Trying 20 threads ... 3.5 ms OK.
Trying 50 threads ... 6.5 ms OK.
Trying 20 threads ... 3.2 ms OK.
Trying 50 threads ... 6.5 ms OK.
..................................................s............................s................................................s............................s...............
======================================================================
ERROR: test_entry_points_unique_packages (test.test_importlib.test_metadata_api.APITests)
Entry points should only be exposed for the first package
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jaraco/code/public/cpython/Lib/test/test_importlib/test_metadata_api.py", line 97, in test_entry_points_unique_packages
    raise ValueError("Failing on purpose")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Failing on purpose

----------------------------------------------------------------------
Ran 1426 tests in 2.377s

FAILED (errors=1, skipped=6, expected failures=1)
```

So there must be some other test invocation that doesn't provide the clarity of which test is failing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 18 21:37:49 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Sun, 19 Dec 2021 02:37:49 +0000
Subject: [issue45609] Specialize STORE_SUBSCR
In-Reply-To: <1635208946.04.0.990921573614.issue45609@roundup.psfhosted.org>
Message-ID: <1639881469.62.0.191944591318.issue45609@roundup.psfhosted.org>


Change by Dennis Sweeney <sweeney.dennis650 at gmail.com>:


----------
pull_requests: +28414
pull_request: https://github.com/python/cpython/pull/30193

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45609>
_______________________________________

From report at bugs.python.org  Sat Dec 18 21:43:30 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 02:43:30 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1639881810.88.0.0943072618415.issue46126@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

My guess is the tests were run with something like this:

```
./python.exe -E -We -m test -v test_importlib | grep '... ERROR'
Entry points should only be exposed for the first package ... ERROR
test test_importlib failed
```

In that case, the location of the test is replaced with the first line of the docstring. If there's no docstring, however, the location of the failure is easier to detect:

```
$ ./python.exe -E -We -m test -v test_importlib | grep '... ERROR'
test_entry_points_unique_packages (test.test_importlib.test_metadata_api.APITests) ... ERROR
test test_importlib failed
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 18 21:53:06 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 02:53:06 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1639882386.75.0.399844464647.issue46126@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

Looks like the code, I believe here's where the reporting happens: https://github.com/python/cpython/blob/9b52920173735ac609664c6a3a3021d24a95a092/Lib/unittest/runner.py#L48-L51

I see a "description" property there that may already provide the feature.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 18 21:59:04 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 02:59:04 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1639882744.23.0.221885465696.issue46126@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

It looks like that 'descriptions' attribute is passed through from TextTestRunner, which sets it to True by default (https://github.com/python/cpython/blob/9b52920173735ac609664c6a3a3021d24a95a092/Lib/unittest/runner.py#L163). It seems that behavior isn't controllable through any command-line options or environment variables.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 18 22:22:25 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 03:22:25 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1639884145.45.0.0329927063339.issue46126@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

After some investigation (and tracing calls through a dozen or more layers), I found that Python's own regression tests can disable this behavior thus:

```
diff --git a/Lib/test/support/testresult.py b/Lib/test/support/testresult.py
index 2cd1366cd8..328ca8760e 100644
--- a/Lib/test/support/testresult.py
+++ b/Lib/test/support/testresult.py
@@ -145,7 +145,8 @@ def get_test_runner_class(verbosity, buffer=False):
         return functools.partial(unittest.TextTestRunner,
                                  resultclass=RegressionTestResult,
                                  buffer=buffer,
-                                 verbosity=verbosity)
+                                 verbosity=verbosity,
+                                 descriptions=False,)
     return functools.partial(QuietRegressionTestRunner, buffer=buffer)
 
 def get_test_runner(stream, verbosity, capture_output=False):
```

Combined with the above diff (with a docstring), the output is now as desired:

```
$ ./python.exe -m test -v test_importlib | grep '... ERROR'
test_entry_points_unique_packages (test.test_importlib.test_metadata_api.APITests) ... ERROR
test test_importlib failed
```

It seems it would be wise to enable this setting by default, given that without it, every test module is forced to replace docstrings with comments.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 18 22:24:05 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 03:24:05 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1639884245.11.0.368795658454.issue46126@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
keywords: +patch
pull_requests: +28415
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30194

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 18 22:41:41 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 03:41:41 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1639885301.54.0.763129806098.issue46124@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
assignee: jaraco -> p-ganssle

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Sat Dec 18 23:18:07 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 04:18:07 +0000
Subject: [issue33567] Explicitly mention bytes and other buffers in the
 documentation for float()
In-Reply-To: <1526640101.14.0.682650639539.issue33567@psf.upfronthosting.co.za>
Message-ID: <1639887487.72.0.994954040654.issue33567@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33567>
_______________________________________

From report at bugs.python.org  Sun Dec 19 02:07:18 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Sun, 19 Dec 2021 07:07:18 +0000
Subject: [issue46127] Missing HTML span element in exceptions.html
Message-ID: <1639897638.32.0.841511577932.issue46127@roundup.psfhosted.org>


New submission from Vivek Vashist <vivekvashist at gmail.com>:

Link:
https://docs.python.org/3/library/exceptions.html#exception-hierarchy

Looking at EncodingWarning under exception-hierarchy is displaying BLACK color instead of RED. 

Digging into HTML looks like it is missing the appropriate span class element.

Working:

<span class="o">+--</span> <span class="ne">BytesWarning</span>

Broken:

<span class="o">+--</span> <span class="n">EncodingWarning</span>

See attached screenshot. 

I"m not too familiar with Sphinx but I'm happy to create a PR for this issue if someone could point me in right direction on how to fix this.

----------
assignee: docs at python
components: Documentation
files: Screen Shot 2021-12-19 at 5.29.54 pm.png
messages: 408886
nosy: docs at python, vivekvashist
priority: normal
severity: normal
status: open
title: Missing HTML span element in exceptions.html
versions: Python 3.10
Added file: https://bugs.python.org/file50501/Screen Shot 2021-12-19 at 5.29.54 pm.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46127>
_______________________________________

From report at bugs.python.org  Sun Dec 19 03:42:45 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Sun, 19 Dec 2021 08:42:45 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1639903365.88.0.00610930649145.issue23819@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
pull_requests: +28416
pull_request: https://github.com/python/cpython/pull/30195

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Sun Dec 19 03:45:55 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 08:45:55 +0000
Subject: [issue46128] Strip IsolatedAsyncioTestCase frames from reported
 stacktraces
Message-ID: <1639903555.79.0.958192231992.issue46128@roundup.psfhosted.org>


New submission from Andrew Svetlov <andrew.svetlov at gmail.com>:

#7815 supports `__unittest = True` module globals to stripping unittest framework calls from a stacktrace reported by a test failure.

IsolatedAsyncioTestCase missed this setup.

----------
components: Library (Lib)
messages: 408887
nosy: asvetlov
priority: normal
severity: normal
status: open
title: Strip IsolatedAsyncioTestCase frames from reported stacktraces
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46128>
_______________________________________

From report at bugs.python.org  Sun Dec 19 03:48:58 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 08:48:58 +0000
Subject: [issue46128] Strip IsolatedAsyncioTestCase frames from reported
 stacktraces
In-Reply-To: <1639903555.79.0.958192231992.issue46128@roundup.psfhosted.org>
Message-ID: <1639903738.63.0.062300969785.issue46128@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
keywords: +patch
pull_requests: +28417
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30196

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46128>
_______________________________________

From report at bugs.python.org  Sun Dec 19 03:57:28 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Sun, 19 Dec 2021 08:57:28 +0000
Subject: [issue42413] Replace custom exceptions for timeouts with TimeoutError
In-Reply-To: <1605813042.63.0.217434537297.issue42413@roundup.psfhosted.org>
Message-ID: <1639904248.87.0.321905211562.issue42413@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
nosy: +kumaraditya303
nosy_count: 13.0 -> 14.0
pull_requests: +28418
pull_request: https://github.com/python/cpython/pull/30197

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42413>
_______________________________________

From report at bugs.python.org  Sun Dec 19 05:16:11 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 10:16:11 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
Message-ID: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>


New submission from Andrew Svetlov <andrew.svetlov at gmail.com>:

The change makes tests much better readable.

----------
components: Tests, asyncio
messages: 408888
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 05:17:46 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 10:17:46 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
In-Reply-To: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>
Message-ID: <1639909066.56.0.284117928444.issue46129@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
keywords: +patch
pull_requests: +28419
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30198

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 05:21:58 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 10:21:58 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
In-Reply-To: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>
Message-ID: <1639909318.95.0.694195580481.issue46129@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
versions: +Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 05:22:01 2021
From: report at bugs.python.org (Rafael Fontenelle)
Date: Sun, 19 Dec 2021 10:22:01 +0000
Subject: [issue46130] Untranslatable link text in whatsnew/3.10
Message-ID: <1639909321.54.0.519282001136.issue46130@roundup.psfhosted.org>


New submission from Rafael Fontenelle <rffontenelle at gmail.com>:

The following string can be found in What's New in Python 3.10 source file (Doc/whatsnew/3.10.rst):

> For major changes, see `New Features Related to Type Hints`_.

where "`New Features Related to Type Hints`_" is a link to a section in the very same page with this name.

The issue with this link text is that translators should translate it (in python-doc organization in Transifex) but warning as errors will pop up if translated. For example, in Portuguese:

> Para mais altera??es, veja `Novos recrusos relacionados a dicas de tipo`_

or to

> Para mais altera??es, veja `Novos recrusos relacionados a dicas de tipo <New Features Related to Type Hints>`_

Sphinx would complain with:

Doc/whatsnew/3.10.rst:1432: WARNING: inconsistent references in translated message. original: ['`New Features Related to Type Hints`_'], translated: []

To solve this issue, I see two solutions:

1- Create an anchor for "New Features Related to Type Hints" section in this page (let's say, "new-feat-related-type-hints") and then call it like :ref:`new-feat-related-type-hints` so that it gets the section title name automatically. Translators won't need to edit it in order to get translated title name. (recommended)

2- Rewrite the source string adding the internal link to the paragraph using `New Features Related to Type Hints <#new-features-related-to-type-hints>`_, so that it can be translated without popping up the warning message.

----------
assignee: docs at python
components: Documentation
messages: 408889
nosy: docs at python, rffontenelle
priority: normal
severity: normal
status: open
title: Untranslatable link text in whatsnew/3.10
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46130>
_______________________________________

From report at bugs.python.org  Sun Dec 19 05:29:44 2021
From: report at bugs.python.org (Rafael Fontenelle)
Date: Sun, 19 Dec 2021 10:29:44 +0000
Subject: [issue46130] Untranslatable link text in whatsnew/3.10
In-Reply-To: <1639909321.54.0.519282001136.issue46130@roundup.psfhosted.org>
Message-ID: <1639909784.13.0.163132435927.issue46130@roundup.psfhosted.org>


Change by Rafael Fontenelle <rffontenelle at gmail.com>:


----------
keywords: +patch
pull_requests: +28420
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30199

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46130>
_______________________________________

From report at bugs.python.org  Sun Dec 19 05:38:20 2021
From: report at bugs.python.org (mattip)
Date: Sun, 19 Dec 2021 10:38:20 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
Message-ID: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>


New submission from mattip <matti.picus at gmail.com>:

The basic classes int, dict, list, tuple ... all have a fast path for Py_*Check(obj):

#define PyLong_Check(op) \
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)


except for float. I propose to add a Py_TPFLAGS_FLOAT_SUBCLASS enum and use it to implement PyType_FastSubclass for float.

----------
components: C API
messages: 408890
nosy: mattip
priority: normal
severity: normal
status: open
title: Add PyType_FastSubclass for float

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 05:55:06 2021
From: report at bugs.python.org (mattip)
Date: Sun, 19 Dec 2021 10:55:06 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
In-Reply-To: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>
Message-ID: <1639911306.03.0.108326992193.issue46131@roundup.psfhosted.org>


mattip <matti.picus at gmail.com> added the comment:

"complex" is also missing a fast path

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 05:57:42 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 19 Dec 2021 10:57:42 +0000
Subject: [issue46128] Strip IsolatedAsyncioTestCase frames from reported
 stacktraces
In-Reply-To: <1639903555.79.0.958192231992.issue46128@roundup.psfhosted.org>
Message-ID: <1639911462.9.0.690881802034.issue46128@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Thank you. I knew about this issue but forgot to fix it.

I think it is also needed in _log.py. Not sure about mock.py.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46128>
_______________________________________

From report at bugs.python.org  Sun Dec 19 05:57:57 2021
From: report at bugs.python.org (mattip)
Date: Sun, 19 Dec 2021 10:57:57 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
In-Reply-To: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>
Message-ID: <1639911477.3.0.134501239973.issue46131@roundup.psfhosted.org>


Change by mattip <matti.picus at gmail.com>:


----------
keywords: +patch
pull_requests: +28421
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30200

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 06:11:59 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 11:11:59 +0000
Subject: [issue46130] Untranslatable link text in whatsnew/3.10
In-Reply-To: <1639909321.54.0.519282001136.issue46130@roundup.psfhosted.org>
Message-ID: <1639912319.8.0.96667195143.issue46130@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +mdk
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46130>
_______________________________________

From report at bugs.python.org  Sun Dec 19 06:23:04 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 11:23:04 +0000
Subject: [issue42413] Replace custom exceptions for timeouts with TimeoutError
In-Reply-To: <1605813042.63.0.217434537297.issue42413@roundup.psfhosted.org>
Message-ID: <1639912984.27.0.572180073382.issue42413@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset da4b214304df38cf1831071804a2b83938f95923 by Kumar Aditya in branch 'main':
bpo-42413: Replace `concurrent.futures.TimeoutError` and `asyncio.TimeoutError` with builtin `TimeoutError` (GH-30197)
https://github.com/python/cpython/commit/da4b214304df38cf1831071804a2b83938f95923


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42413>
_______________________________________

From report at bugs.python.org  Sun Dec 19 06:38:06 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 11:38:06 +0000
Subject: [issue42413] Replace custom exceptions for timeouts with TimeoutError
In-Reply-To: <1605813042.63.0.217434537297.issue42413@roundup.psfhosted.org>
Message-ID: <1639913886.33.0.196141300128.issue42413@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

Done.
Thanks, Kumar!

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42413>
_______________________________________

From report at bugs.python.org  Sun Dec 19 06:43:26 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 11:43:26 +0000
Subject: [issue46128] Strip IsolatedAsyncioTestCase frames from reported
 stacktraces
In-Reply-To: <1639903555.79.0.958192231992.issue46128@roundup.psfhosted.org>
Message-ID: <1639914206.64.0.826413549939.issue46128@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

`__unittest = True` flag doesn't work smoothly with async functions, unfortunately.

Need to investigate why.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46128>
_______________________________________

From report at bugs.python.org  Sun Dec 19 07:51:36 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 19 Dec 2021 12:51:36 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
In-Reply-To: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>
Message-ID: <1639918296.14.0.379261581112.issue46131@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It is because PyFloat_Check() and PyComplex_Check() are rarely used in comparison with checks for integers, strings, etc. The flags space is limited, so it is better to use it for something more important.

There were reasons for not adding such flags at first place and I think that they are still valid.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 08:12:28 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 19 Dec 2021 13:12:28 +0000
Subject: [issue46094] Missing unit test on unittest.TestResult to check for
 required arguments
In-Reply-To: <1639637165.39.0.102854010232.issue46094@roundup.psfhosted.org>
Message-ID: <1639919548.01.0.276237565842.issue46094@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

These parameters were added in d99ef9a9df093d3443996725cd9dcac5f113f176, but they were not tested nor documented. An indirect test was added later in issue12376.

If it is an official feature it needs documentation and tests. Otherwise we can remove these parameters and revert issue12376 changes. Michael?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46094>
_______________________________________

From report at bugs.python.org  Sun Dec 19 08:47:18 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 13:47:18 +0000
Subject: [issue46132] Attempting to create an enum with slots silently fails
Message-ID: <1639921638.91.0.283272496595.issue46132@roundup.psfhosted.org>


New submission from Alex Waygood <Alex.Waygood at Gmail.com>:

Attempting to create an enum with __slots__ silently fails. No error is raised if __slots__ are specified, but the usual behaviour of __slots__ does not work as expected. Attributes that are not specified in __slots__ can be freely set:


>>> from enum import Enum
>>> class Color(Enum):
...     __slots__ = ()
...     RED = 0
...     BLUE = 1
...
>>> Color.RED.foo = 'bar'
>>>


Given that enums are rather special, I didn't exactly *expect* this to work -- but it might be good to raise some kind of error if a user attempts to specify __slots__, instead of having it fail silently.

----------
messages: 408898
nosy: AlexWaygood, ethan.furman
priority: normal
severity: normal
status: open
title: Attempting to create an enum with slots silently fails
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46132>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:06:50 2021
From: report at bugs.python.org (Ken Jin)
Date: Sun, 19 Dec 2021 14:06:50 +0000
Subject: [issue46130] Untranslatable link text in whatsnew/3.10
In-Reply-To: <1639909321.54.0.519282001136.issue46130@roundup.psfhosted.org>
Message-ID: <1639922810.35.0.673462094068.issue46130@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset 3d3615f41f4ea73fe6707eb3673dfab482cb6a2b by Rafael Fontenelle in branch 'main':
bpo-46130: [docs] Add anchor for whatsnew/3.10 type hint section (GH-30199)
https://github.com/python/cpython/commit/3d3615f41f4ea73fe6707eb3673dfab482cb6a2b


----------
nosy: +kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46130>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:06:53 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 19 Dec 2021 14:06:53 +0000
Subject: [issue46130] Untranslatable link text in whatsnew/3.10
In-Reply-To: <1639909321.54.0.519282001136.issue46130@roundup.psfhosted.org>
Message-ID: <1639922813.77.0.633086655891.issue46130@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28422
pull_request: https://github.com/python/cpython/pull/30201

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46130>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:23:41 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Sun, 19 Dec 2021 14:23:41 +0000
Subject: [issue46127] Missing HTML span element in exceptions.html
In-Reply-To: <1639897638.32.0.841511577932.issue46127@roundup.psfhosted.org>
Message-ID: <1639923821.12.0.281876499416.issue46127@roundup.psfhosted.org>


Daniel Diniz <ajaksu at gmail.com> added the comment:

That happens because EncodingWarning isn't highlighted as an Exception by Pygments[0]. The doc page gets its exceptions diagram by:
".. literalinclude:: ../../Lib/test/exception_hierarchy.txt"
and all other entries are recognized by Pygments, so we get the "ne" class for them.

A PR for Pygments adding EncodingWarning could be interesting, but I'm not sure the doc build process would pick it up and fix the 3.10 docs issue.

For 3.11, the diagram drawing was changed so no highlighting happens anymore, which fixes the issue for us in the long run.

[0] https://github.com/pygments/pygments/blob/8630e033313647d9579e314f3e8e2882f4558933/pygments/lexers/python.py#L225

----------
nosy: +ajaksu2

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46127>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:33:10 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 19 Dec 2021 14:33:10 +0000
Subject: [issue46130] Untranslatable link text in whatsnew/3.10
In-Reply-To: <1639909321.54.0.519282001136.issue46130@roundup.psfhosted.org>
Message-ID: <1639924390.47.0.510878870265.issue46130@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 9a28cf19b5d5f79eb072afc582f7baa9e7bd3ac2 by Miss Islington (bot) in branch '3.10':
bpo-46130: [docs] Add anchor for whatsnew/3.10 type hint section (GH-30199)
https://github.com/python/cpython/commit/9a28cf19b5d5f79eb072afc582f7baa9e7bd3ac2


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46130>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:36:06 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 14:36:06 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
In-Reply-To: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>
Message-ID: <1639924566.64.0.840124146579.issue46129@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset 9c06fd89514a9a2865e2adcc472095f6949cecb2 by Andrew Svetlov in branch 'main':
bpo-46129: Rewrite asyncio.locks tests with IsolatedAsyncioTestCase (GH-30198)
https://github.com/python/cpython/commit/9c06fd89514a9a2865e2adcc472095f6949cecb2


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:49:01 2021
From: report at bugs.python.org (Ken Jin)
Date: Sun, 19 Dec 2021 14:49:01 +0000
Subject: [issue46130] Untranslatable link text in whatsnew/3.10
In-Reply-To: <1639909321.54.0.519282001136.issue46130@roundup.psfhosted.org>
Message-ID: <1639925341.83.0.612257338191.issue46130@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:

Thanks Rafael for your efforts in docs translations.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46130>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:51:42 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 14:51:42 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
In-Reply-To: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>
Message-ID: <1639925502.17.0.099163737267.issue46129@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
pull_requests: +28423
pull_request: https://github.com/python/cpython/pull/30202

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:55:17 2021
From: report at bugs.python.org (Steve Dower)
Date: Sun, 19 Dec 2021 14:55:17 +0000
Subject: [issue46123] _freeze_module on Windows can be built faster with no
 optimization
In-Reply-To: <1639828248.15.0.819206839809.issue46123@roundup.psfhosted.org>
Message-ID: <1639925717.08.0.106839704891.issue46123@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:


New changeset 0b582a4a1b24472a35ed7fc973728ac9d595f123 by neonene in branch 'main':
bpo-46123: Disable optimizations for _freeze_module.exe on MSVC for faster building (GH-30181)
https://github.com/python/cpython/commit/0b582a4a1b24472a35ed7fc973728ac9d595f123


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46123>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:55:29 2021
From: report at bugs.python.org (Steve Dower)
Date: Sun, 19 Dec 2021 14:55:29 +0000
Subject: [issue46123] _freeze_module on Windows can be built faster with no
 optimization
In-Reply-To: <1639828248.15.0.819206839809.issue46123@roundup.psfhosted.org>
Message-ID: <1639925729.59.0.676913377735.issue46123@roundup.psfhosted.org>


Change by Steve Dower <steve.dower at python.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46123>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:56:32 2021
From: report at bugs.python.org (Steve Dower)
Date: Sun, 19 Dec 2021 14:56:32 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639846339.68.0.224474081811.issue46106@roundup.psfhosted.org>
Message-ID: <7699c50e-8abf-a35d-1667-8f41d01e866b@python.org>


Steve Dower <steve.dower at python.org> added the comment:

I've put up the builds for 1.1.1m (and double checked everything after 
last time - it's definitely "m" :) ), so anyone can do the PR to change 
Python itself. Otherwise I'll probably get time this week.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Sun Dec 19 09:57:17 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Sun, 19 Dec 2021 14:57:17 +0000
Subject: [issue23224] bz2/lzma: Compressor/Decompressor objects are only
 initialized in __init__
In-Reply-To: <1421024308.33.0.868171678499.issue23224@psf.upfronthosting.co.za>
Message-ID: <1639925837.88.0.380800208741.issue23224@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23224>
_______________________________________

From report at bugs.python.org  Sun Dec 19 10:17:44 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 15:17:44 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
In-Reply-To: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>
Message-ID: <1639927064.63.0.349452971543.issue46129@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset cdb4579607ad5e0a3978ec29b8407bea4d19b4fa by Andrew Svetlov in branch '3.10':
[3.10] bpo-46129: Rewrite asyncio.locks tests with IsolatedAsyncioTestCase (GH-30198) (GH-30202)
https://github.com/python/cpython/commit/cdb4579607ad5e0a3978ec29b8407bea4d19b4fa


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 10:21:14 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 15:21:14 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639927274.63.0.919689740618.issue46104@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
pull_requests: +28424
pull_request: https://github.com/python/cpython/pull/30203

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sun Dec 19 10:24:23 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 15:24:23 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639927463.97.0.0412851534487.issue46104@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
resolution: fixed -> 
stage: resolved -> patch review
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sun Dec 19 10:43:04 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 15:43:04 +0000
Subject: [issue29971] threading.Lock.acquire() not interruptible on Windows
In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za>
Message-ID: <1639928584.29.0.440738358313.issue29971@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
stage:  -> needs patch
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29971>
_______________________________________

From report at bugs.python.org  Sun Dec 19 10:58:11 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 15:58:11 +0000
Subject: [issue10789] Lock.acquire documentation is misleading
In-Reply-To: <1293644478.45.0.40426107256.issue10789@psf.upfronthosting.co.za>
Message-ID: <1639929491.93.0.409568961448.issue10789@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

I am closing this issue. The original topic of discussion (Lock.acquire documentation) has been resolved, and there were other issues opened to discuss the more general issue. There has also been no real activity in this issue thread for a decade.

----------
dependencies:  -Document lack of support for keyword arguments in C functions
nosy: +AlexWaygood
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10789>
_______________________________________

From report at bugs.python.org  Sun Dec 19 11:10:44 2021
From: report at bugs.python.org (Gareth Rees)
Date: Sun, 19 Dec 2021 16:10:44 +0000
Subject: [issue46065] re.findall takes forever and never ends
In-Reply-To: <1639401988.73.0.733937004071.issue46065@roundup.psfhosted.org>
Message-ID: <1639930244.48.0.146443461221.issue46065@roundup.psfhosted.org>


Gareth Rees <gdr at garethrees.org> added the comment:

The way to avoid this behaviour is to disallow the attempts at matching that you know are going to fail. As Serhiy described above, if the search fails starting at the first character of the string, it will move forward and try again starting at the second character. But you know that this new attempt must fail, so you can force the regular expression engine to discard the attempt immediately.

Here's an illustration in a simpler setting, where we are looking for all strings of 'a' followed by 'b':

    >>> import re
    >>> from timeit import timeit
    >>> text = 'a' * 100000
    >>> timeit(lambda:re.findall(r'a+b', text), number=1)
    6.643531181000014

We know that any successful match must be preceded by a character other than 'a' (or the beginning of the string), so we can reject many unsuccessful matches like this:

    >>> timeit(lambda:re.findall(r'(?:^|[^a])(a+b)', text), number=1)
    0.003743481000014981

In your case, a successful match must be preceded by [^a-zA-Z0-9_.+-] (or the beginning of the string).

----------
nosy: +gdr at garethrees.org

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46065>
_______________________________________

From report at bugs.python.org  Sun Dec 19 11:17:53 2021
From: report at bugs.python.org (Matt B)
Date: Sun, 19 Dec 2021 16:17:53 +0000
Subject: [issue46133] Unclear whether one can (or how to) provide source to
 exec-generated code
Message-ID: <1639930673.95.0.69918856393.issue46133@roundup.psfhosted.org>


New submission from Matt B <eb3f73+python+org at yaymail.com>:

Unless I missed it, looking at https://github.com/python/cpython/blob/main/Lib/pdb.py, https://github.com/python/cpython/blob/main/Lib/inspect.py, and https://docs.python.org/3/library/pdb.html doesn't give much of a clue how to provide sources to exec-generated code.

I may have misread, but pdb *seems* to lean on inspect.findsource which eventually excludes sources that match `^<.*>$` (like `<string>`).

Running attached test_case.py:

% python test_case.py
> <string>(4)foo()
(Pdb) l
[EOF]
(Pdb) c
inspect.getfile(<function foo at 0x10b735160>): <string>
calling inspect.findsource(<function foo at 0x10b735160>) ...
Traceback (most recent call last):
  File "/Users/matt/Documents/dev/numerary/test_case.py", line 12, in <module>
    foo()
  File "/Library/Frameworks/MacPorts-20200907/Python.framework/Versions/3.9/lib/python3.9/inspect.py", line 835, in findsource
    raise OSError('could not get source code')
OSError: could not get source code

----------
files: test_case.py
messages: 408910
nosy: posita
priority: normal
severity: normal
status: open
title: Unclear whether one can (or how to) provide source to exec-generated code
Added file: https://bugs.python.org/file50502/test_case.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46133>
_______________________________________

From report at bugs.python.org  Sun Dec 19 11:18:36 2021
From: report at bugs.python.org (Matt B)
Date: Sun, 19 Dec 2021 16:18:36 +0000
Subject: [issue46133] Unclear whether one can (or how to) provide source to
 exec-generated code
In-Reply-To: <1639930673.95.0.69918856393.issue46133@roundup.psfhosted.org>
Message-ID: <1639930716.3.0.0294212905629.issue46133@roundup.psfhosted.org>


Change by Matt B <eb3f73+python+org at yaymail.com>:


----------
components: +Library (Lib)
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46133>
_______________________________________

From report at bugs.python.org  Sun Dec 19 11:33:11 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 16:33:11 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
In-Reply-To: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>
Message-ID: <1639931591.03.0.0652053097889.issue46129@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
pull_requests: +28425
pull_request: https://github.com/python/cpython/pull/30204

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 11:42:38 2021
From: report at bugs.python.org (Gareth Rees)
Date: Sun, 19 Dec 2021 16:42:38 +0000
Subject: [issue46065] re.findall takes forever and never ends
In-Reply-To: <1639401988.73.0.733937004071.issue46065@roundup.psfhosted.org>
Message-ID: <1639932158.03.0.537712860777.issue46065@roundup.psfhosted.org>


Gareth Rees <gdr at garethrees.org> added the comment:

This kind of question is frequently asked (#3128, #29977, #28690, #30973, #1737127, etc.), and so maybe it deserves an answer somewhere in the Python documentation.

----------
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46065>
_______________________________________

From report at bugs.python.org  Sun Dec 19 11:59:41 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 16:59:41 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
In-Reply-To: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>
Message-ID: <1639933181.65.0.121433127099.issue46129@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset f8fce5e4e4338fbe49e5e7a5a856101f69081a08 by Andrew Svetlov in branch '3.9':
[3.9] bpo-46129: Rewrite asyncio.locks tests with IsolatedAsyncioTestCase (GH-30198) (GH-30204)
https://github.com/python/cpython/commit/f8fce5e4e4338fbe49e5e7a5a856101f69081a08


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:02:57 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 17:02:57 +0000
Subject: [issue46109] Separate resources and abc docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1639933377.6.0.231497068332.issue46109@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

The reason I wanted to consider issue46118 first was because I wanted to explore whether the ABCs from `importlib_resources.abc` should be _documented_ as `importlib.resources.abc` or `importlib.abc` (as they are now).

After filing the issue and exploring the concerns (namely, should users be directed _away_ from `importlib.abc` for these classes), I'm uncertain whether it's worth the effort to make that transition, and certainly not in haste, so this effort can proceed to document the status quo (ABCs presented primarily in `importlib.abc`).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:04:20 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 17:04:20 +0000
Subject: [issue46109] Separate resources and abc docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1639933460.41.0.657626254776.issue46109@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

> a ToC at the top of the main page which identifies the submodules (and provides a brief summary for each) would be extra helpful. 

I've added this in the latest commit (1adefaf552).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:08:40 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 17:08:40 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
In-Reply-To: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>
Message-ID: <1639933720.27.0.19042850668.issue46129@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:16:00 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 17:16:00 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1639934160.07.0.44934938515.issue45996@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:19:47 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 17:19:47 +0000
Subject: [issue46109] Separate resources and abc docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1639934387.33.0.162828075736.issue46109@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

As I'm exploring this issue, I notice that currently, the docs refer to :class:`importlib.resources.abc.Traversable` (even though that doesn't currently exist) (https://github.com/python/cpython/blame/main/Doc/library/importlib.rst#L948).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:21:17 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 17:21:17 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1639934477.91.0.966997718696.issue46118@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I recently noticed that some docs already refer to `importlib.resources.abc` even though it doesn't currently exist (https://github.com/python/cpython/blame/main/Doc/library/importlib.rst#L948). That finding leads me to adjust my expectation that perhaps exposing those classes from that module would be preferable (since that was the expectation from the start).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:22:43 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 17:22:43 +0000
Subject: [issue29328] struct module should support variable-length strings
In-Reply-To: <1484850272.25.0.472309940141.issue29328@psf.upfronthosting.co.za>
Message-ID: <1639934563.94.0.352575339975.issue29328@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

I am closing this issue as "rejected", given the consensus that writing a patch could be a major undertaking, the lack of such a patch, and the fact that there has been no activity on the issue thread (or the python-ideas mailing list) for nearly 5 years.

----------
nosy: +AlexWaygood
resolution:  -> rejected
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29328>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:29:23 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Sun, 19 Dec 2021 17:29:23 +0000
Subject: [issue46109] Separate resources docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1639934963.29.0.270918782721.issue46109@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I realize, I can limit the scope of this issue to address 'resources' alone, leaving ABCs where they are except for resource-related ones, allowing us to defer a larger refactoring to a separate issue/effort.

----------
title: Separate resources and abc docs from other importlib docs -> Separate resources docs from other importlib docs

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:39:21 2021
From: report at bugs.python.org (Ethan Furman)
Date: Sun, 19 Dec 2021 17:39:21 +0000
Subject: [issue46132] Attempting to create an enum with slots silently fails
In-Reply-To: <1639921638.91.0.283272496595.issue46132@roundup.psfhosted.org>
Message-ID: <1639935561.58.0.0855186385902.issue46132@roundup.psfhosted.org>


Change by Ethan Furman <ethan at stoneleaf.us>:


----------
assignee:  -> ethan.furman

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46132>
_______________________________________

From report at bugs.python.org  Sun Dec 19 12:46:00 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Sun, 19 Dec 2021 17:46:00 +0000
Subject: [issue46129] Rewrite asyncio.locks tests with IsolatedAsyncioTestCase
In-Reply-To: <1639908971.72.0.170814605108.issue46129@roundup.psfhosted.org>
Message-ID: <1639935960.19.0.442959797957.issue46129@roundup.psfhosted.org>


Change by Andrew Svetlov <andrew.svetlov at gmail.com>:


----------
pull_requests: +28426
pull_request: https://github.com/python/cpython/pull/30205

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46129>
_______________________________________

From report at bugs.python.org  Sun Dec 19 13:15:09 2021
From: report at bugs.python.org (Landon Ginn)
Date: Sun, 19 Dec 2021 18:15:09 +0000
Subject: [issue46134] Dataclass Suggestion reversed: sortindex / sort_index
Message-ID: <1639937709.73.0.49042724739.issue46134@roundup.psfhosted.org>


New submission from Landon Ginn <landonjpginn at gmail.com>:

from dataclasses import dataclass, field

@dataclass(order=True, frozen=True)
class Character:
    sort_index: int = field(init=False, repr=False)
    name: str
    job: str
    age: int
    intelligence: int = 50

    def __post_init__(self):
        object.__setattr__(self, 'sortindex', self.intelligence)

Description:
using sortindex instead of sort_index gave the following suggestion: 

Current:
AttributeError: 'Character' object has no attribute 'sort_index'. Did you mean: 'sortindex'?


Expected: 
AttributeError: 'Character' object has no attribute 'sortindex'. Did you mean: 'sort_index'?

----------
components: Library (Lib)
messages: 408919
nosy: landonjpginn
priority: normal
severity: normal
status: open
title: Dataclass Suggestion reversed: sortindex / sort_index
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46134>
_______________________________________

From report at bugs.python.org  Sun Dec 19 14:07:33 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 19:07:33 +0000
Subject: [issue46134] Confusing error message for AttributeError with
 dataclasses
In-Reply-To: <1639937709.73.0.49042724739.issue46134@roundup.psfhosted.org>
Message-ID: <1639940853.69.0.67230788767.issue46134@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Thanks for the bug report, Landon! I think I can reproduce this with a slightly shorter code snippet, but I don't think this is a bug:

```
>>> from dataclasses import dataclass, field
>>> @dataclass
... class Character:
...     sort_index: int = field(init=False, repr=False)
...     intelligence: int
...     def __post_init__(self):
...         self.sortindex = self.intelligence
... 
>>> c = Character(intelligence=50)
>>> c
Character(intelligence=50)
>>> c.sortindex
50
>>> c.sort_index
AttributeError: 'Character' object has no attribute 'sort_index'. Did you mean: 'sortindex'?
```

This seems like the correct error message to me.

The issue is that your "Character" class has a field named "sort_index", but that field is never assigned to. Instead, you assign an attribute named "sortindex" in your __post_init__ method. So the error message is correct: an instance of your Character class has no attribute "sort_index" (it only has a field named "sort_index"), but it *does* have an attribute "sortindex".

----------
nosy: +AlexWaygood, eric.smith
status: open -> pending
title: Dataclass Suggestion reversed: sortindex / sort_index -> Confusing error message for AttributeError with dataclasses

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46134>
_______________________________________

From report at bugs.python.org  Sun Dec 19 15:20:19 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 19 Dec 2021 20:20:19 +0000
Subject: [issue46076] Document using __slots__ to provide per-attribute
 docstrings
In-Reply-To: <1639520711.47.0.591169978723.issue46076@roundup.psfhosted.org>
Message-ID: <1639945219.81.0.119880122463.issue46076@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28427
pull_request: https://github.com/python/cpython/pull/30206

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46076>
_______________________________________

From report at bugs.python.org  Sun Dec 19 15:20:23 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 19 Dec 2021 20:20:23 +0000
Subject: [issue46076] Document using __slots__ to provide per-attribute
 docstrings
In-Reply-To: <1639520711.47.0.591169978723.issue46076@roundup.psfhosted.org>
Message-ID: <1639945223.44.0.265905983244.issue46076@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28428
pull_request: https://github.com/python/cpython/pull/30207

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46076>
_______________________________________

From report at bugs.python.org  Sun Dec 19 15:20:38 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 20:20:38 +0000
Subject: [issue46076] Document using __slots__ to provide per-attribute
 docstrings
In-Reply-To: <1639520711.47.0.591169978723.issue46076@roundup.psfhosted.org>
Message-ID: <1639945238.97.0.144068438684.issue46076@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:


New changeset aeb9ef4c7287fe367b6e9adcf1c5f994d5bc1a09 by Alex Waygood in branch 'main':
bpo-46076: Improve documentation for per-attribute docstrings with `__slots__` (GH-30109)
https://github.com/python/cpython/commit/aeb9ef4c7287fe367b6e9adcf1c5f994d5bc1a09


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46076>
_______________________________________

From report at bugs.python.org  Sun Dec 19 15:22:59 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 20:22:59 +0000
Subject: [issue46076] Document using __slots__ to provide per-attribute
 docstrings
In-Reply-To: <1639520711.47.0.591169978723.issue46076@roundup.psfhosted.org>
Message-ID: <1639945379.0.0.27312239781.issue46076@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Thanks for the PR.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46076>
_______________________________________

From report at bugs.python.org  Sun Dec 19 15:24:14 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 20:24:14 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
In-Reply-To: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>
Message-ID: <1639945454.74.0.14335806657.issue46131@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Thanks for the suggestion, but I also concur with Serhiy.

----------
nosy: +rhettinger
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 15:24:38 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 20:24:38 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
In-Reply-To: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>
Message-ID: <1639945478.85.0.263457127926.issue46131@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:


New changeset 2ef06d412531d1163dbc72877c88aedf3ed82a25 by Matti Picus in branch 'main':
bpo-46131: add fastpath for PyFloat_Check() (#30200)
https://github.com/python/cpython/commit/2ef06d412531d1163dbc72877c88aedf3ed82a25


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 15:26:42 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 20:26:42 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
In-Reply-To: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>
Message-ID: <1639945602.49.0.893756110364.issue46131@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
pull_requests: +28429
pull_request: https://github.com/python/cpython/pull/30208

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 15:53:03 2021
From: report at bugs.python.org (mattip)
Date: Sun, 19 Dec 2021 20:53:03 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
In-Reply-To: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>
Message-ID: <1639947183.82.0.97706904867.issue46131@roundup.psfhosted.org>


mattip <matti.picus at gmail.com> added the comment:

What do ya'all think of widen the flags field to int64_t so that there is more room for optimizations like this?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 16:05:54 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 21:05:54 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
In-Reply-To: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>
Message-ID: <1639947954.73.0.831381628716.issue46131@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:


New changeset 29ea68bd1dcf30842c2ed908a6d815bc1d90f484 by Raymond Hettinger in branch 'main':
Revert "bpo-46131: add fastpath for PyFloat_Check() (GH-30200)" (GH-30208)
https://github.com/python/cpython/commit/29ea68bd1dcf30842c2ed908a6d815bc1d90f484


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 16:07:50 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 21:07:50 +0000
Subject: [issue46131] Add PyType_FastSubclass for float
In-Reply-To: <1639910300.33.0.186780284433.issue46131@roundup.psfhosted.org>
Message-ID: <1639948070.53.0.234947782225.issue46131@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

That would not change that slot space is at a premium and that we prefer to use that space for high payoff optimizations.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46131>
_______________________________________

From report at bugs.python.org  Sun Dec 19 16:11:20 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 21:11:20 +0000
Subject: [issue46076] Document using __slots__ to provide per-attribute
 docstrings
In-Reply-To: <1639520711.47.0.591169978723.issue46076@roundup.psfhosted.org>
Message-ID: <1639948280.27.0.405349657259.issue46076@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:


New changeset d7537ac8e3a3ef15d2c5f3fe90e998618b6a97b9 by Miss Islington (bot) in branch '3.10':
bpo-46076: Improve documentation for per-attribute docstrings with `__slots__` (GH-30109) (GH-30206)
https://github.com/python/cpython/commit/d7537ac8e3a3ef15d2c5f3fe90e998618b6a97b9


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46076>
_______________________________________

From report at bugs.python.org  Sun Dec 19 16:11:41 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 19 Dec 2021 21:11:41 +0000
Subject: [issue46076] Document using __slots__ to provide per-attribute
 docstrings
In-Reply-To: <1639520711.47.0.591169978723.issue46076@roundup.psfhosted.org>
Message-ID: <1639948301.0.0.239952268106.issue46076@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:


New changeset 8bfb11a791679a33024c9857e082afed0d71e0b4 by Miss Islington (bot) in branch '3.9':
bpo-46076: Improve documentation for per-attribute docstrings with `__slots__` (GH-30109) (GH-30207)
https://github.com/python/cpython/commit/8bfb11a791679a33024c9857e082afed0d71e0b4


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46076>
_______________________________________

From report at bugs.python.org  Sun Dec 19 16:12:58 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 21:12:58 +0000
Subject: [issue46076] Document using __slots__ to provide per-attribute
 docstrings
In-Reply-To: <1639520711.47.0.591169978723.issue46076@roundup.psfhosted.org>
Message-ID: <1639948378.47.0.61728710813.issue46076@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Thanks for taking the time to review and merge :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46076>
_______________________________________

From report at bugs.python.org  Sun Dec 19 16:23:41 2021
From: report at bugs.python.org (MB SANTALU)
Date: Sun, 19 Dec 2021 21:23:41 +0000
Subject: [issue46135] Changing a label's text is not working properly on
 transparent widgets
Message-ID: <1639949021.69.0.959451743673.issue46135@roundup.psfhosted.org>


New submission from MB SANTALU <mbsantalu at gmail.com>:

Updating a label's text on a transparent widget in MacOS behaves strangely, previous text remains partially visible (see screenshot)

System Specs: MacOS Monterey 12.0.1 and Python 3.10

Code:

import sys
from PyQt6 import QtWidgets, QtCore
from PyQt6.QtCore import QTimer
from PyQt6.QtGui import QFont
from PyQt6.QtWidgets import QLabel, QFrame
def update_label():
    l1.setText("Bye!")
    l1.update()
    window.repaint()
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
window.setAttribute(QtCore.Qt.WidgetAttribute.WA_TranslucentBackground)
window.setWindowFlag(QtCore.Qt.WindowType.FramelessWindowHint)
window.setFixedSize(800, 600)
font = QFont()
font.setPointSize(72)
l1 = QLabel(window)
l1.setText("Hello World")
l1.setFont(font)
l1.setStyleSheet("color:red")
window.show()
timer = QTimer()
timer.setInterval(1000)
timer.timeout.connect(update_label)
timer.start()
app.exec()

----------
components: macOS
files: sof.png
messages: 408931
nosy: mbsantalu, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Changing a label's text is not working properly on transparent widgets
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50503/sof.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46135>
_______________________________________

From report at bugs.python.org  Sun Dec 19 16:33:32 2021
From: report at bugs.python.org (Ned Deily)
Date: Sun, 19 Dec 2021 21:33:32 +0000
Subject: [issue46135] Changing a label's text is not working properly on
 transparent widgets
In-Reply-To: <1639949021.69.0.959451743673.issue46135@roundup.psfhosted.org>
Message-ID: <1639949612.88.0.391554244125.issue46135@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

PyQT is a third-party product and not part of Python or the Python Standard Library. Suggest you contact that project and/or ask on one of the general assistance forums, like Stack Overflow. Good luck!

https://riverbankcomputing.com/software/pyqt/
https://www.python.org/about/help/

----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46135>
_______________________________________

From report at bugs.python.org  Sun Dec 19 17:00:16 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sun, 19 Dec 2021 22:00:16 +0000
Subject: [issue46134] Confusing error message for AttributeError with
 dataclasses
In-Reply-To: <1639937709.73.0.49042724739.issue46134@roundup.psfhosted.org>
Message-ID: <1639951216.9.0.315213021228.issue46134@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

Please show the error you're getting, including the traceback.

----------
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46134>
_______________________________________

From report at bugs.python.org  Sun Dec 19 17:56:12 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Sun, 19 Dec 2021 22:56:12 +0000
Subject: [issue46100] Simplify readline / editline detection
In-Reply-To: <1639658268.15.0.0477908867569.issue46100@roundup.psfhosted.org>
Message-ID: <1639954572.46.0.965987954871.issue46100@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

> I propose to simplify the checks and require a readline 4.2 compatible API.
+1


BTW:
> GNU readline was released in 2001 (20 years ago).

FTR, GNU Readline _4.2_ was released in 2001  ;)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46100>
_______________________________________

From report at bugs.python.org  Sun Dec 19 17:57:17 2021
From: report at bugs.python.org (Christian Heimes)
Date: Sun, 19 Dec 2021 22:57:17 +0000
Subject: [issue46132] Attempting to create an enum with slots silently fails
In-Reply-To: <1639921638.91.0.283272496595.issue46132@roundup.psfhosted.org>
Message-ID: <1639954637.03.0.671463781046.issue46132@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

The primary purpose of __slots__ is not to limit attribute assignment. Slots are useful to define types that have a smaller memory footprint than types.

You are getting the expected behavior. Enum parent class does not have __slots__ and therefore automatically has a __dict__. You could make an argument to add __slots__ to Enum, but that would be a new feature for 3.11.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46132>
_______________________________________

From report at bugs.python.org  Sun Dec 19 18:14:50 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 19 Dec 2021 23:14:50 +0000
Subject: [issue46132] Consider adding __slots__ to enums?
In-Reply-To: <1639921638.91.0.283272496595.issue46132@roundup.psfhosted.org>
Message-ID: <1639955690.83.0.506477542036.issue46132@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Ah, of course, I'm an idiot ? I forgot that a class could not prevent the creation of __dict__ unless the parent class also had __slots__. Thanks, Christian.

In which case: consider this a feature request to consider adding __slots__ to enum.Enum: for faster attribute access, lower memory footprint, and the ability to define __slots__ in custom Enum classes.

----------
title: Attempting to create an enum with slots silently fails -> Consider adding __slots__ to enums?
type: behavior -> enhancement
versions:  -Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46132>
_______________________________________

From report at bugs.python.org  Sun Dec 19 19:58:31 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Mon, 20 Dec 2021 00:58:31 +0000
Subject: [issue46132] Consider adding __slots__ to enums?
In-Reply-To: <1639921638.91.0.283272496595.issue46132@roundup.psfhosted.org>
Message-ID: <1639961911.7.0.941469329363.issue46132@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> In which case: consider this a feature request to 
> consider adding __slots__ ...

A few thoughts:
* Enumerations tend to be small, so a space savings likely isn't relevant.
* In Python 3.11, the speed advantage of slots is now much smaller.
* The code for Enum is already complex and has a lot of magic.  Adding slots to the equation may make it even harder to reason about the internals.
* It not even clear that __slots__ would or could play nice with existing code.  Even if it does, it may tie our hands for other avenues of development such as a custom a __getattribute__ or use of @cached_property.

Please consider a more use case driven development approach to working on the core.  We have no known problems with Enum at this point that need to be solved.  A general notion that __slots__ should be used in more places is a reasonable topic for python-ideas.  The tracker is more suitable for targeted proposals like, "my company needs enums to work with tool x but it won't unless slot support is added", "my real-world app must support enormous enumerations that lead to memory problems unless slots are added", "i tried adding slots to Enum and found it was easy, didn't cause problems, and sped-up common cases by 22%".

I mostly agree with Christian except that limiting attribute access is a legitimate reason to use slots.  However, in the case of Enums that isn't a known issue.  Also, it is something that would need to done when a tool is first released.  Generally, we can't add it afterwards because that would be a breaking change (some applications may be legitimately adding additional attributes).

For now, I'll close this.  If Ethan thinks there is some fruit on this tree, he can reopen it.  Also if a specific real world use case arises, it can be reopened.

----------
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46132>
_______________________________________

From report at bugs.python.org  Sun Dec 19 20:22:16 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Mon, 20 Dec 2021 01:22:16 +0000
Subject: [issue46127] Missing HTML span element in exceptions.html
In-Reply-To: <1639897638.32.0.841511577932.issue46127@roundup.psfhosted.org>
Message-ID: <1639963336.18.0.225825558553.issue46127@roundup.psfhosted.org>


Vivek Vashist <vivekvashist at gmail.com> added the comment:

Thanks for the information Daniel.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46127>
_______________________________________

From report at bugs.python.org  Sun Dec 19 20:55:03 2021
From: report at bugs.python.org (Dima Tisnek)
Date: Mon, 20 Dec 2021 01:55:03 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1639965303.1.0.0286947167558.issue45996@roundup.psfhosted.org>


Dima Tisnek <dimaqq at gmail.com> added the comment:

Andrew, I see that you've closed this issue as "fixed".

I'm a little confused by that.

If you mean that 3.10 behaviour is better than 3.9, than perhaps "not a bug / rejected / wont fix" would make more sense.

Actually I don't agree with Thomas's logic... his argument feels like consistency for its own sake.

I agree with the intention of the change for the arguments to be released (https://bugs.python.org/issue30306) but I disagree with the cryptic error.

I'm sure we could have both argument release and readable exception, e.g.:


try:
    del self.args, ...
except AttributeError:
    raise RuntimeError("anext(): asynchronous generator is already running")

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Sun Dec 19 21:04:04 2021
From: report at bugs.python.org (Thomas Grainger)
Date: Mon, 20 Dec 2021 02:04:04 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1639965844.89.0.311315607752.issue45996@roundup.psfhosted.org>


Thomas Grainger <tagrain at gmail.com> added the comment:

> Actually I don't agree with Thomas's logic... his argument feels like consistency for its own sake.

Do you expect sync and async contextmanagers to act differently?

Why would sync contextmanagers raise AttributeError and async contextmanagers raise a RuntimeError?

If it's sensible to guard against invalid re-entry for async contextmanagers then I think it's sensible to apply the same guard to sync contextmanagers.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Sun Dec 19 21:15:19 2021
From: report at bugs.python.org (Dima Tisnek)
Date: Mon, 20 Dec 2021 02:15:19 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1639966519.05.0.752841936448.issue45996@roundup.psfhosted.org>


Dima Tisnek <dimaqq at gmail.com> added the comment:

I'm fine with guarding both.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Sun Dec 19 22:23:36 2021
From: report at bugs.python.org (Ma Lin)
Date: Mon, 20 Dec 2021 03:23:36 +0000
Subject: [issue23224] bz2/lzma: Compressor/Decompressor objects are only
 initialized in __init__
In-Reply-To: <1421024308.33.0.868171678499.issue23224@psf.upfronthosting.co.za>
Message-ID: <1639970616.9.0.290451040703.issue23224@roundup.psfhosted.org>


Ma Lin <malincns at 163.com> added the comment:

These can be done in .__new__() method:
- create thread lock
- create (de)?compression context
- initialize (de)?compressor states

In .__init__() method, only set (de)?compression parameters. And prevent .__init__() method from being called multiple times. 

This mode works fine in my pyzstd module (A Python bindings to zstd library).
But I think very few people will encounter this problem, we can leave it.

----------
nosy: +malin

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23224>
_______________________________________

From report at bugs.python.org  Sun Dec 19 23:48:51 2021
From: report at bugs.python.org (Ken Jin)
Date: Mon, 20 Dec 2021 04:48:51 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639975731.49.0.917125829874.issue46104@roundup.psfhosted.org>


Ken Jin <kenjin4096 at gmail.com> added the comment:


New changeset 7c5c3f7254d78babcaf7a2ec187fd6ec53b8403c by Alex Waygood in branch 'main':
bpo-46104: Fix example broken by GH-30148 (GH-30203)
https://github.com/python/cpython/commit/7c5c3f7254d78babcaf7a2ec187fd6ec53b8403c


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sun Dec 19 23:48:56 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 20 Dec 2021 04:48:56 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639975736.48.0.632003474171.issue46104@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28430
pull_request: https://github.com/python/cpython/pull/30209

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Sun Dec 19 23:49:00 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 20 Dec 2021 04:49:00 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639975740.43.0.245821305367.issue46104@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28431
pull_request: https://github.com/python/cpython/pull/30210

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Mon Dec 20 00:33:36 2021
From: report at bugs.python.org (Ethan Furman)
Date: Mon, 20 Dec 2021 05:33:36 +0000
Subject: [issue46132] Consider adding __slots__ to enums?
In-Reply-To: <1639921638.91.0.283272496595.issue46132@roundup.psfhosted.org>
Message-ID: <1639978416.75.0.846310437602.issue46132@roundup.psfhosted.org>


Ethan Furman <ethan at stoneleaf.us> added the comment:

Some testing reveals that `__slots__` is not a good option for Enum -- it makes it impossible to mix in in other types such as `int`.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46132>
_______________________________________

From report at bugs.python.org  Mon Dec 20 01:02:13 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 20 Dec 2021 06:02:13 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639980133.17.0.316643530937.issue46104@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 8e4564d14ae0fc97cfea4de9e271468d4c28a6fe by Miss Islington (bot) in branch '3.9':
[3.9] bpo-46104: Fix example broken by GH-30148 (GH-30203) (GH-30210)
https://github.com/python/cpython/commit/8e4564d14ae0fc97cfea4de9e271468d4c28a6fe


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Mon Dec 20 01:02:13 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 20 Dec 2021 06:02:13 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639980133.3.0.459753695644.issue46104@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 0c0bd78ccf8e1eb1d8ecfce423daf2a2f8ca6d3b by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46104: Fix example broken by GH-30148 (GH-30203) (GH-30209)
https://github.com/python/cpython/commit/0c0bd78ccf8e1eb1d8ecfce423daf2a2f8ca6d3b


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Mon Dec 20 01:03:43 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 20 Dec 2021 06:03:43 +0000
Subject: [issue46104] Reduce use of old-style syntax in typing docs
In-Reply-To: <1639671834.7.0.734699107107.issue46104@roundup.psfhosted.org>
Message-ID: <1639980223.53.0.342000322681.issue46104@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46104>
_______________________________________

From report at bugs.python.org  Mon Dec 20 02:09:33 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Mon, 20 Dec 2021 07:09:33 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <1639984173.22.0.057153041854.issue46106@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 8.0 -> 9.0
pull_requests: +28432
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30211

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Mon Dec 20 02:22:12 2021
From: report at bugs.python.org (Ajith MsM)
Date: Mon, 20 Dec 2021 07:22:12 +0000
Subject: [issue46136] "dh low key " issue when try to connect mysql
Message-ID: <1639984932.4.0.143068456396.issue46136@roundup.psfhosted.org>


New submission from Ajith MsM <ajithmsm555 at gmail.com>:

i have tried to connect my db using python 3.10. 
import module is mysql.connector.
db has installed in AWS. while excuting pycharm able to connect the db to get the output. 
using CMD prompt in windows not able to execute facing error like "dh low key" error code 2055. 


But able to connect and execute on python 3.9.9 verision could you please fix the 3.10 and above versions.

----------
assignee: christian.heimes
components: SSL
files: issue.txt
messages: 408947
nosy: ajithmsm555, christian.heimes
priority: normal
severity: normal
status: open
title: "dh low key " issue when try to connect mysql
type: resource usage
versions: Python 3.10
Added file: https://bugs.python.org/file50504/issue.txt

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46136>
_______________________________________

From report at bugs.python.org  Mon Dec 20 03:04:18 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Mon, 20 Dec 2021 08:04:18 +0000
Subject: [issue45996] Worse error from asynccontextmanager in Python 3.10
In-Reply-To: <1638797059.87.0.372415243632.issue45996@roundup.psfhosted.org>
Message-ID: <1639987458.87.0.421718022828.issue45996@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

Sorry, I closed it because async behavior reflects sync version now.

If you want to improve both -- you are welcome! Perhaps it is worth another issue with another problem description.

----------
resolution: fixed -> wont fix

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45996>
_______________________________________

From report at bugs.python.org  Mon Dec 20 03:50:56 2021
From: report at bugs.python.org (quapka)
Date: Mon, 20 Dec 2021 08:50:56 +0000
Subject: [issue46051] Make @atexit.register work for functions with arguments
In-Reply-To: <1639243621.71.0.144294694671.issue46051@roundup.psfhosted.org>
Message-ID: <1639990256.67.0.44369669897.issue46051@roundup.psfhosted.org>


quapka <quapka at gmail.com> added the comment:

Hi @terry.reedy,
are you talking about this
https://mail.python.org/mailman3/lists/python-ideas.python.org/
mailing list? Thanks for the tip. However, I don't understand why this isn't just buggy/unexpected behavior, because the 3) example seems to work without any (observed) issues.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46051>
_______________________________________

From report at bugs.python.org  Mon Dec 20 04:09:14 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 20 Dec 2021 09:09:14 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1639991354.02.0.674313564843.issue23819@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
nosy: +serhiy.storchaka
nosy_count: 5.0 -> 6.0
pull_requests: +28433
pull_request: https://github.com/python/cpython/pull/30212

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Mon Dec 20 05:23:14 2021
From: report at bugs.python.org (miss-islington)
Date: Mon, 20 Dec 2021 10:23:14 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1639995794.58.0.11770214387.issue23819@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +28434
pull_request: https://github.com/python/cpython/pull/30213

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Mon Dec 20 05:23:39 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 20 Dec 2021 10:23:39 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1639995819.06.0.237863866732.issue23819@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 6ca78affc8023bc5023189d64d8050857662042a by Serhiy Storchaka in branch 'main':
bpo-23819: Get rid of assert statements in test_asyncio (GH-30212)
https://github.com/python/cpython/commit/6ca78affc8023bc5023189d64d8050857662042a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Mon Dec 20 05:40:08 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Mon, 20 Dec 2021 10:40:08 +0000
Subject: [issue46137] Update/change built-in keyword type used in RE example
Message-ID: <1639996808.31.0.346495346407.issue46137@roundup.psfhosted.org>


New submission from Vivek Vashist <vivekvashist at gmail.com>:

Link: https://docs.python.org/3/library/re.html#writing-a-tokenizer

Noticed that built-in type() class is being used inside the Tokenizer example:

class Token(NamedTuple):
    type: str
    value: str
    line: int
    column: int

Should this attribute be updated/renamed to kind or name perhaps ? 

Happy to submit a PR once the change/replacement is confirmed.

----------
assignee: docs at python
components: Documentation
messages: 408951
nosy: docs at python, vivekvashist
priority: normal
severity: normal
status: open
title: Update/change built-in keyword type used in RE example
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46137>
_______________________________________

From report at bugs.python.org  Mon Dec 20 05:56:22 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Mon, 20 Dec 2021 10:56:22 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1639997782.13.0.266731772465.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> we can get faster code by using a small (3Kb) table of factorial logarithms

The problem here is that C gives no guarantees about accuracy of either log2 or exp2, so we'd be playing a guessing game about how far we can go before the calculation becomes unsafe (in the sense of the `round` operation potentially giving the wrong answer). I think it would be better to stick to integer-only arithmetic.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Mon Dec 20 06:09:32 2021
From: report at bugs.python.org (Petr Viktorin)
Date: Mon, 20 Dec 2021 11:09:32 +0000
Subject: [issue40421] [C API] Add getter functions for PyFrameObject and maybe
 move PyFrameObject to the internal C API
In-Reply-To: <1588079870.34.0.984904607646.issue40421@roundup.psfhosted.org>
Message-ID: <1639998572.23.0.0608571313175.issue40421@roundup.psfhosted.org>


Petr Viktorin <encukou at gmail.com> added the comment:

The docs for PyFrame_GetCode say it's returning an "int". 
https://docs.python.org/3/c-api/reflection.html#c.PyFrame_GetCode
Same for PyFrame_GetBack. Are there more?

"Get the frame code." is not very clear. Could this link to https://docs.python.org/3/c-api/code.html ?

----------
nosy: +petr.viktorin

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40421>
_______________________________________

From report at bugs.python.org  Mon Dec 20 06:36:16 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 20 Dec 2021 11:36:16 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640000176.72.0.303177673104.issue37295@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

factorial(49) has 163 significant binary digits. It cannot be represented in floating-point without losses. And C functions log2() and exp2() can add additional errors, depending on platform. We rely on the assumption that all errors will be compensated, but there are no guaranties of this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Mon Dec 20 06:53:32 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Mon, 20 Dec 2021 11:53:32 +0000
Subject: [issue46137] Update/change built-in keyword type used in RE example
In-Reply-To: <1639996808.31.0.346495346407.issue46137@roundup.psfhosted.org>
Message-ID: <1640001212.65.0.984605132429.issue46137@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

"type" is a natural name to use in this example, and isn't causing any problems. I suggest not changing anything.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46137>
_______________________________________

From report at bugs.python.org  Mon Dec 20 07:15:37 2021
From: report at bugs.python.org (flvn.dev)
Date: Mon, 20 Dec 2021 12:15:37 +0000
Subject: [issue46024] Different behaviour with zipfile
In-Reply-To: <1639045155.54.0.671926991121.issue46024@roundup.psfhosted.org>
Message-ID: <1640002537.17.0.333269833806.issue46024@roundup.psfhosted.org>


flvn.dev <flvn.dev at protonmail.com> added the comment:

The output of:

```python
print(repr(path), repr(ZipPath(path)))

```

gives this in both versions:

```
PosixPath('logs/2020/2020101.zip') Path('logs/2020/2020101.zip', '')
PosixPath('logs/2021/2021101.zip') Path('logs/2021/2021101.zip', '')
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46024>
_______________________________________

From report at bugs.python.org  Mon Dec 20 07:51:22 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 20 Dec 2021 12:51:22 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1640004682.42.0.744181975415.issue23819@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 95948169d75bed3936284ea2225e83e07ec5fe20 by Miss Islington (bot) in branch '3.10':
bpo-23819: Get rid of assert statements in test_asyncio (GH-30212) (GH-30213)
https://github.com/python/cpython/commit/95948169d75bed3936284ea2225e83e07ec5fe20


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Mon Dec 20 07:58:35 2021
From: report at bugs.python.org (Christian Heimes)
Date: Mon, 20 Dec 2021 12:58:35 +0000
Subject: [issue46136] "dh low key " issue when try to connect mysql
In-Reply-To: <1639984932.4.0.143068456396.issue46136@roundup.psfhosted.org>
Message-ID: <1640005115.44.0.136389503176.issue46136@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

DH_KEY_TOO_SMALL means that you are using weak and easy to break keys for your connections. Recent versions of OpenSSL prevent insecure connections. You can lower the security setting for a context with:

>>> import ssl
>>> context = ssl.create_default_context()
>>> context.set_ciphers("DEFAULT at SECLEVEL=1")

You need to figure out yourself how to pass an insecure context to your database connector.

----------
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46136>
_______________________________________

From report at bugs.python.org  Mon Dec 20 08:04:27 2021
From: report at bugs.python.org (=?utf-8?b?VGhvbWFzIEdsw6TDn2xl?=)
Date: Mon, 20 Dec 2021 13:04:27 +0000
Subject: [issue34624] -W option and PYTHONWARNINGS env variable does not
 accept module regexes
In-Reply-To: <1536622594.77.0.0269046726804.issue34624@psf.upfronthosting.co.za>
Message-ID: <1640005467.18.0.527128462738.issue34624@roundup.psfhosted.org>


Thomas Gl??le <thomas at coldfix.de> added the comment:

Ok, it seems at least the incorrect documentation has been fixed in the mean time.

I'm going to close this as there seems to be no capacity to deal with this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34624>
_______________________________________

From report at bugs.python.org  Mon Dec 20 08:04:35 2021
From: report at bugs.python.org (=?utf-8?b?VGhvbWFzIEdsw6TDn2xl?=)
Date: Mon, 20 Dec 2021 13:04:35 +0000
Subject: [issue34624] -W option and PYTHONWARNINGS env variable does not
 accept module regexes
In-Reply-To: <1536622594.77.0.0269046726804.issue34624@psf.upfronthosting.co.za>
Message-ID: <1640005475.49.0.151409747071.issue34624@roundup.psfhosted.org>


Change by Thomas Gl??le <thomas at coldfix.de>:


----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34624>
_______________________________________

From report at bugs.python.org  Mon Dec 20 08:28:02 2021
From: report at bugs.python.org (Daniel Frey)
Date: Mon, 20 Dec 2021 13:28:02 +0000
Subject: [issue46138] Strange behavior with lists
Message-ID: <1640006882.67.0.618077108937.issue46138@roundup.psfhosted.org>


New submission from Daniel Frey <daniel.frey at unibe.ch>:

Hi

I found a strange behavior with lists. When I want to save the list {3,1,8}, it saves the 8 at the first entry. Only when I add the integers 7 and 9, the 8 is placed correctly. (See the attached picture)

Can anyone help me understand what is going on here?

Thanks in advance!

----------
files: python_strange_behavior.png
messages: 408960
nosy: daniel.frey
priority: normal
severity: normal
status: open
title: Strange behavior with lists
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50505/python_strange_behavior.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46138>
_______________________________________

From report at bugs.python.org  Mon Dec 20 08:30:27 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Mon, 20 Dec 2021 13:30:27 +0000
Subject: [issue46138] Strange behavior with lists
In-Reply-To: <1640006882.67.0.618077108937.issue46138@roundup.psfhosted.org>
Message-ID: <1640007027.89.0.768560931735.issue46138@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

You're using a set (with {}), not a list (with []).

I'd give you a working example, but since you posted a picture I can't copy, paste, and edit your example. In the future, please post text, not pictures.

----------
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46138>
_______________________________________

From report at bugs.python.org  Mon Dec 20 09:43:55 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Mon, 20 Dec 2021 14:43:55 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640011435.57.0.278266290759.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> The problem here is that C gives no guarantees about accuracy of either log2 or exp2

* The input table has hard-wired constants so there is no dependency on log2().  The inputs can be as exact as pi, tau, and e.

* The C library's exp2() function doesn't have to be perfect. Just being good would suffice.  Our test suite already requires that exp2() be within 5 ulp:

    self.ftest('exp2(2.3)', math.exp2(2.3), 4.924577653379665)

* With a perfect exp2(), the first failure is at C(50, 22).  With a forced error of 5 ulp, it happens at C(48, 24).  So keeping n <= 47 that would let exp2() be off substantially and still give correct answers.

* Since exp2() is deterministic, it is easy to write a test that covers all C(n, r) where 0 <= r <= n <= 47.  If there were to be a problem, we would know right away and early during the release cycle.

* Also, it is easy to prove that C(n, r) always gives the correct result for a given ulp error bound on exp2() and a given limit on n.

* The speed-up is substantial, so this is worth consideration.



> factorial(49) has 163 significant binary digits.

Exact factorials aren't needed.  The important fact (no pun intended) is that comb(47, 23).bit_length() == 44.  For this to work, we need one addition and one subtraction of 53 bit approximations to come within 44 bits of the true answer.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Mon Dec 20 10:23:39 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Mon, 20 Dec 2021 15:23:39 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640013819.5.0.603568745263.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Stand by.  I think I can implement this using only bit integer arithmetic. Will post tomorrow.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Mon Dec 20 10:25:28 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Mon, 20 Dec 2021 15:25:28 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640013928.83.0.717685508198.issue37295@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
Removed message: https://bugs.python.org/msg408963

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Mon Dec 20 10:43:40 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Mon, 20 Dec 2021 15:43:40 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1640015020.33.0.92952856371.issue46110@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset e9898bf153d26059261ffef11f7643ae991e2a4c by Pablo Galindo Salgado in branch 'main':
bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177)
https://github.com/python/cpython/commit/e9898bf153d26059261ffef11f7643ae991e2a4c


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Mon Dec 20 10:48:07 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Mon, 20 Dec 2021 15:48:07 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1640015287.42.0.0403744849541.issue46110@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
pull_requests: +28435
pull_request: https://github.com/python/cpython/pull/30214

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Mon Dec 20 10:50:54 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Mon, 20 Dec 2021 15:50:54 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1640015454.7.0.887837144244.issue46110@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
pull_requests: +28436
pull_request: https://github.com/python/cpython/pull/30215

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Mon Dec 20 11:23:48 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Mon, 20 Dec 2021 16:23:48 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1640017428.3.0.586193802501.issue46110@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset dc73199a212a44553578eb4952631e5ba9e5f292 by Pablo Galindo Salgado in branch '3.10':
[3.10] bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177) (GH-30214)
https://github.com/python/cpython/commit/dc73199a212a44553578eb4952631e5ba9e5f292


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Mon Dec 20 11:25:43 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Mon, 20 Dec 2021 16:25:43 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1640017543.07.0.204843334911.issue46110@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Mon Dec 20 11:29:58 2021
From: report at bugs.python.org (Smith129)
Date: Mon, 20 Dec 2021 16:29:58 +0000
Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with
 FORMAT_RAW
In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org>
Message-ID: <1640017798.56.0.648757344928.issue41210@roundup.psfhosted.org>


Smith129 <werodi6744 at veb27.com> added the comment:

https://hackemtu.com/mediaflix-plus-apk-mod/ Plus Apk Mod ? sua fonte n?mero um de filmes e s?ries gratuitas. Desfrute de milh?es de filmes e s?ries gratuitamente e sem login. Aqui, oferecemos Mediaflix Plus Apk Mod gratuitamente. Ent?o, vamos come?ar com uma vis?o geral r?pida.

----------
nosy: +Smith129

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41210>
_______________________________________

From report at bugs.python.org  Mon Dec 20 11:42:03 2021
From: report at bugs.python.org (mike mcleod)
Date: Mon, 20 Dec 2021 16:42:03 +0000
Subject: [issue10483] http.server - what is executable on Windows
In-Reply-To: <1290324390.55.0.445837984524.issue10483@psf.upfronthosting.co.za>
Message-ID: <1640018523.92.0.511386330891.issue10483@roundup.psfhosted.org>


Change by mike mcleod <mikecmcleod at gmail.com>:


----------
pull_requests: +28437
pull_request: https://github.com/python/cpython/pull/30216

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10483>
_______________________________________

From report at bugs.python.org  Mon Dec 20 12:18:21 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Mon, 20 Dec 2021 17:18:21 +0000
Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash
In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org>
Message-ID: <1640020700.99.0.48029421068.issue46110@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:


New changeset e5cf31d3c2b30d12f238c6ab26d15855eefb2a8a by Pablo Galindo Salgado in branch '3.9':
[3.9] bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177) (#30215)
https://github.com/python/cpython/commit/e5cf31d3c2b30d12f238c6ab26d15855eefb2a8a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46110>
_______________________________________

From report at bugs.python.org  Mon Dec 20 12:50:26 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 20 Dec 2021 17:50:26 +0000
Subject: [issue46051] Make @atexit.register work for functions with arguments
In-Reply-To: <1639243621.71.0.144294694671.issue46051@roundup.psfhosted.org>
Message-ID: <1640022626.57.0.900771296689.issue46051@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Yes, that is the list.

Serhiy, can you comment on using atexit.register and classmethod decorators together?  Or suggest someone else?

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46051>
_______________________________________

From report at bugs.python.org  Mon Dec 20 13:27:46 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 20 Dec 2021 18:27:46 +0000
Subject: [issue46051] Make @atexit.register work for functions with arguments
In-Reply-To: <1639243621.71.0.144294694671.issue46051@roundup.psfhosted.org>
Message-ID: <1640024866.95.0.391271511093.issue46051@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It cannot work this way.

atexit.register() as a function allows you to specify arguments which will be passed to the registered function, but if it is used as a decorator, only one argument (the function itself) is passed to atexit.register() (it is how decorators work). When used as a decorator it can only register functions without parameters.

On other hand, the function corresponding to a class method requires the class argument. There is no magic to determine it at the decoration time, because the class does not exist yet. It will be created only after the class definition body be executed.

It is possible to create a decorator which work the way you want. The simplest method perhaps to create a classmethod subclass with __set_name__() method. __set_name__() will be called after creating the class.

class mydecorator(classmethod):
    def __set_name__(self, type, name):
        atexit.register(self.__func__, type)

class Program:
    @mydecorator
    def clean_up(cls):
        ...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46051>
_______________________________________

From report at bugs.python.org  Mon Dec 20 14:44:50 2021
From: report at bugs.python.org (Tim Peters)
Date: Mon, 20 Dec 2021 19:44:50 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640029490.18.0.774283727105.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

Just curious about why the focus on the newer exp2 and log2? Logs are logs, and the "natural" `exp()` and `log()` should work just as well. On Windows, exp2() is particularly poor for now (I've seen dozens of cases of errors over 2 ulp, with exp2(x) very much worse than the Windows pow(2, x)).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Mon Dec 20 14:56:17 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Mon, 20 Dec 2021 19:56:17 +0000
Subject: [issue46024] Different behaviour with zipfile
In-Reply-To: <1639045155.54.0.671926991121.issue46024@roundup.psfhosted.org>
Message-ID: <1640030177.78.0.480631531386.issue46024@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

It looks like this was changed in https://bugs.python.org/issue42043

@jaraco might have some insights.

----------
nosy: +jaraco

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46024>
_______________________________________

From report at bugs.python.org  Mon Dec 20 16:20:25 2021
From: report at bugs.python.org (Abri Vincent)
Date: Mon, 20 Dec 2021 21:20:25 +0000
Subject: [issue46139] Boolean Logic Check - Built-in Types Documentation page
Message-ID: <1640035225.46.0.0193110772528.issue46139@roundup.psfhosted.org>


New submission from Abri Vincent <abriabrisham at gmail.com>:

On the documentation page https://docs.python.org/3/library/stdtypes.html the header 'Boolean Operations ? and, or, not' provides a table (attached as an image). 

It states: 

a.1) x OR y - if x is false, then y, else x **
a.2) x AND y - if x is false, then x, else y **

When I read this i intuit the following

b.1) x OR y - if x is false, then x, else y
b.2) x AND y - if x is false, then y, else x

Providing an example with a.1 which is currently listed in the documentation

If x is false -> else x = False (we don't check if Y=True which is the definition of an OR operator). 

** This is a short-circuit operator, so it only evaluates the second argument if the first one is false.

I would appreciate clarification on this and if others see an issue with the documentation after reading my description able then movement on consensus to correct the documentation

----------
assignee: docs at python
components: Documentation
messages: 408972
nosy: abriabrisham, docs at python
priority: normal
severity: normal
status: open
title: Boolean Logic Check - Built-in Types Documentation page

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46139>
_______________________________________

From report at bugs.python.org  Mon Dec 20 16:35:28 2021
From: report at bugs.python.org (Abri Vincent)
Date: Mon, 20 Dec 2021 21:35:28 +0000
Subject: [issue46139] Boolean Logic Check - Built-in Types Documentation page
In-Reply-To: <1640035225.46.0.0193110772528.issue46139@roundup.psfhosted.org>
Message-ID: <1640036128.25.0.755363884319.issue46139@roundup.psfhosted.org>


Change by Abri Vincent <abriabrisham at gmail.com>:


----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46139>
_______________________________________

From report at bugs.python.org  Mon Dec 20 16:40:15 2021
From: report at bugs.python.org (Abri Vincent)
Date: Mon, 20 Dec 2021 21:40:15 +0000
Subject: [issue46139] Boolean Logic Check - Built-in Types Documentation page
In-Reply-To: <1640035225.46.0.0193110772528.issue46139@roundup.psfhosted.org>
Message-ID: <1640036415.84.0.642236442318.issue46139@roundup.psfhosted.org>


Abri Vincent <abriabrisham at gmail.com> added the comment:

A short circuit operator. 

x OR y - if x is false, then y, else x (1). 

(1) This is a short-circuit operator, so it only evaluates the second argument if the first one is false.

The first argument is 'if'
The second argument is 'then'
The third argument is 'else'

Move to the second argument if the first is false. 
Evaluate the first argument 'if x is false' - look at the second argument if the first argument is false - 'then y'.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46139>
_______________________________________

From report at bugs.python.org  Mon Dec 20 16:48:00 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Mon, 20 Dec 2021 21:48:00 +0000
Subject: [issue46137] Update/change built-in keyword type used in RE example
In-Reply-To: <1639996808.31.0.346495346407.issue46137@roundup.psfhosted.org>
Message-ID: <1640036880.1.0.709082991033.issue46137@roundup.psfhosted.org>


Vivek Vashist <vivekvashist at gmail.com> added the comment:

Thanks Eric.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46137>
_______________________________________

From report at bugs.python.org  Mon Dec 20 16:48:17 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Mon, 20 Dec 2021 21:48:17 +0000
Subject: [issue46137] Update/change built-in keyword type used in RE example
In-Reply-To: <1639996808.31.0.346495346407.issue46137@roundup.psfhosted.org>
Message-ID: <1640036897.38.0.481780150491.issue46137@roundup.psfhosted.org>


Change by Vivek Vashist <vivekvashist at gmail.com>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46137>
_______________________________________

From report at bugs.python.org  Mon Dec 20 17:14:11 2021
From: report at bugs.python.org (C.A.M. Gerlach)
Date: Mon, 20 Dec 2021 22:14:11 +0000
Subject: [issue5993] python produces zombie in webbrowser.open
In-Reply-To: <1242014278.58.0.774883846907.issue5993@psf.upfronthosting.co.za>
Message-ID: <1640038451.92.0.89405541919.issue5993@roundup.psfhosted.org>


C.A.M. Gerlach <CAM.Gerlach at Gerlach.CAM> added the comment:

I can verify that this still occurs on Linux under an up to date Python 3.9 env (unknown browser; I can inquire), while on my Windows machine running an essentially identical Python 3.9 env, I don't get the warning. The practical problem arises when we are using `-X dev`/`-W error` and/or strict `filterwarnings` with Pytest, and the user passes a custom `--open-browser` flag to our test suite to open the resulting output in their web browser to inspect it for themselves. See [spyder-ide/docrepr#33](https://github.com/spyder-ide/docrepr/pull/33#discussion_r772164817) for details. I'm concerned this is going to be difficult to work around without doing over-broad silencing of warnings on the Pytest, because the warning is raised when the object is GC'ed, which may happen at a non-deterministic time or even after or even Python invocation level, and I can't reproduce it on my machine to test it.

----------
nosy: +CAM-Gerlach
status: pending -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue5993>
_______________________________________

From report at bugs.python.org  Mon Dec 20 17:26:56 2021
From: report at bugs.python.org (David Hewitt)
Date: Mon, 20 Dec 2021 22:26:56 +0000
Subject: [issue46140] Some API methods could take const Py_buffer* instead of
 Py_buffer *
Message-ID: <1640039216.66.0.26119941091.issue46140@roundup.psfhosted.org>


New submission from David Hewitt <david at hewitt.tech>:

The limited api methods `PyBuffer_GetPointer`, `PyBuffer_FromContiguous`, `PyBuffer_ToContiguous` and `PyMemoryView_FromBuffer` take buffer arguments as `Py_buffer *`.

They do not mutate the buffer info, so could simply take `const Py_buffer *`.

There is already precedent to take `const Py_buffer *` argument in `PyBuffer_IsContiguous`.

I'm going to submit a PR to fix.

----------
messages: 408976
nosy: davidhewitt
priority: normal
severity: normal
status: open
title: Some API methods could take const Py_buffer* instead of Py_buffer *
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46140>
_______________________________________

From report at bugs.python.org  Mon Dec 20 17:32:30 2021
From: report at bugs.python.org (Daniel McDonald)
Date: Mon, 20 Dec 2021 22:32:30 +0000
Subject: [issue44413] OverflowError: mktime argument out of range after 2019
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1640039550.38.0.0472135878595.issue44413@roundup.psfhosted.org>


Daniel McDonald <danielmcdonald at ucsd.edu> added the comment:

A definitive assessment was obtained by Aurelien with Debian:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001774

In brief, the OverflowError is expected and correct. 

Two factors contribute to the difference in observed behavior. First, the production of the -1 from mktime which Python uses to raise OverflowError depends on whether timezone is or is not set (e.g. "Etc/UTC"). This was confirmed on the Github Actions 20.04 ubuntu instance independent of Python directly with the mktime() function from C. Second, mktime returning -1 to indicate overflow is dependent on glibc >= 2.29, and versions prior "do not report any error if the date is not representable." This second factor is supported by testing the lack of the -1 (and subsequent OverflowError) on Github Actions ubuntu 18.04, which uses an older version of glibc.

The full thread with Debian is here:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001774

With regards to CPython, a possible change to consider would be to test if tm_isdst < 0 prior to the mktime call, and if that evaluates true to provide an error indicating use requires a timezone being set. I think that change would make Python's behavior consistent with glibc >= 2.29, and smooth over a potential platform dependency, while also providing an informative error message. However, I have limited knowledge of how timezones are implemented and am unsure if more than "Etc/UTC" would result in tm_isdst being < 0. 

If that change makes sense, I'd be happy to submit a pull request to that effect. However, I recognize there may be considerations not accounted for here particularly as this is a central module, so I'll hold off issuing a pull request until hearing back from on this matter.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Mon Dec 20 17:34:57 2021
From: report at bugs.python.org (David Hewitt)
Date: Mon, 20 Dec 2021 22:34:57 +0000
Subject: [issue46140] Some API methods could take const Py_buffer* instead of
 Py_buffer *
In-Reply-To: <1640039216.66.0.26119941091.issue46140@roundup.psfhosted.org>
Message-ID: <1640039697.51.0.754920589917.issue46140@roundup.psfhosted.org>


Change by David Hewitt <david at hewitt.tech>:


----------
keywords: +patch
pull_requests: +28438
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30217

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46140>
_______________________________________

From report at bugs.python.org  Mon Dec 20 17:42:24 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Mon, 20 Dec 2021 22:42:24 +0000
Subject: [issue44413] Improvement mktime error reporting
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1640040144.32.0.42218607157.issue44413@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Daniel, I believe your proposal is an enhancement request that could only be implemented in a future version.  I changed headers accordingly.  I leave it to Christian or someone else to evaluate the request itself.

----------
title: OverflowError: mktime argument out of range after 2019 -> Improvement mktime error reporting
type: behavior -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Mon Dec 20 17:45:30 2021
From: report at bugs.python.org (Daniel McDonald)
Date: Mon, 20 Dec 2021 22:45:30 +0000
Subject: [issue44413] Improvement mktime error reporting
In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org>
Message-ID: <1640040330.46.0.64722512428.issue44413@roundup.psfhosted.org>


Daniel McDonald <danielmcdonald at ucsd.edu> added the comment:

Sounds good, thank you, Terry

----------
type: enhancement -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________

From report at bugs.python.org  Mon Dec 20 17:49:04 2021
From: report at bugs.python.org (Bar Harel)
Date: Mon, 20 Dec 2021 22:49:04 +0000
Subject: [issue46141] Fix ipaddress.ip_network TypeErrors
Message-ID: <1640040544.01.0.288057218729.issue46141@roundup.psfhosted.org>


New submission from Bar Harel <bzvi7919 at gmail.com>:

IPv4Network accepts a tuple.

If you send a tuple to ip_network instead, it throws a TypeError while attempting to format the ValueError message.

----------
components: Library (Lib)
messages: 408980
nosy: bar.harel
priority: normal
pull_requests: 28439
severity: normal
status: open
title: Fix ipaddress.ip_network TypeErrors
type: behavior
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46141>
_______________________________________

From report at bugs.python.org  Mon Dec 20 18:00:21 2021
From: report at bugs.python.org (Bar Harel)
Date: Mon, 20 Dec 2021 23:00:21 +0000
Subject: [issue46141] Fix ipaddress.ip_network TypeErrors
In-Reply-To: <1640040544.01.0.288057218729.issue46141@roundup.psfhosted.org>
Message-ID: <1640041221.7.0.0883939568584.issue46141@roundup.psfhosted.org>


Change by Bar Harel <bzvi7919 at gmail.com>:


----------
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46141>
_______________________________________

From report at bugs.python.org  Mon Dec 20 18:43:16 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Mon, 20 Dec 2021 23:43:16 +0000
Subject: [issue46142] python --help output is too long
Message-ID: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org>


New submission from ?ric Araujo <merwok at netwok.org>:

>From Serhiy in https://mail.python.org/archives/list/python-dev at python.org/thread/QUUBM7DGSXYWBOLZNWOSCQUDALWJIYZF/ :

    The output of "python -h" is 104 lines long now. It was only 51 lines in
    3.6. 35% of it is about the -X option, and 30% about environment
    variables. Also some lines in the -X option description are too long
    (102 columns). Both topics are "advanced" and mostly interested for
    debugging. I suggest to move them out of the main help output.  [?]

Guido:

    -X opt : implementation-specific option; use -X help to list options.

    We could also see if we can put the help text for each of the supported -X
    flags in the table defining these flags [?]

GvR again:

    --help-env [?] prints info about env vars (new flag)


I would enjoy trying to make a patch around next week!

----------
messages: 408981
nosy: eric.araujo, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: python --help output is too long
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46142>
_______________________________________

From report at bugs.python.org  Mon Dec 20 18:44:11 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Mon, 20 Dec 2021 23:44:11 +0000
Subject: [issue46142] python --help output is too long
In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org>
Message-ID: <1640043851.34.0.558460121641.issue46142@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

Forgot to quote  -X help  to print help about X options.

----------
components: +Interpreter Core

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46142>
_______________________________________

From report at bugs.python.org  Mon Dec 20 18:57:51 2021
From: report at bugs.python.org (Jack Wong)
Date: Mon, 20 Dec 2021 23:57:51 +0000
Subject: [issue36906] Compile time textwrap.dedent() equivalent for str or
 bytes literals
In-Reply-To: <1557772831.22.0.440689390024.issue36906@roundup.psfhosted.org>
Message-ID: <1640044671.97.0.956799963666.issue36906@roundup.psfhosted.org>


Change by Jack Wong <ajackwong at gmail.com>:


----------
nosy: +iforapsy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36906>
_______________________________________

From report at bugs.python.org  Mon Dec 20 19:24:46 2021
From: report at bugs.python.org (Barry A. Warsaw)
Date: Tue, 21 Dec 2021 00:24:46 +0000
Subject: [issue46142] python --help output is too long
In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org>
Message-ID: <1640046286.56.0.0799347237915.issue46142@roundup.psfhosted.org>


Change by Barry A. Warsaw <barry at python.org>:


----------
nosy: +barry

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46142>
_______________________________________

From report at bugs.python.org  Mon Dec 20 19:33:35 2021
From: report at bugs.python.org (Vivek Vashist)
Date: Tue, 21 Dec 2021 00:33:35 +0000
Subject: [issue46127] Missing HTML span element in exceptions.html
In-Reply-To: <1639897638.32.0.841511577932.issue46127@roundup.psfhosted.org>
Message-ID: <1640046815.91.0.217978733376.issue46127@roundup.psfhosted.org>


Change by Vivek Vashist <vivekvashist at gmail.com>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46127>
_______________________________________

From report at bugs.python.org  Mon Dec 20 23:42:18 2021
From: report at bugs.python.org (David Gilbertson)
Date: Tue, 21 Dec 2021 04:42:18 +0000
Subject: [issue46143] [docs] IO > Text Encoding info outdated
Message-ID: <1640061737.92.0.106243605034.issue46143@roundup.psfhosted.org>


New submission from David Gilbertson <gilbertson.david at gmail.com>:

On this page: https://docs.python.org/3/library/io.html#text-encoding it says "there is no concrete plan as of yet, Python may change the default text file encoding to UTF-8 in the future".

On this page https://docs.python.org/3/library/os.html#utf8-mode is says that from 3.7 onwards UTF-8 will be selected by default.

Does that mean that the text in the first section is now outdated, as it was addressed by PEP 540?

I'm a newbie, so apologies if I'm missing something obvious or filing this in the wrong spot.

----------
assignee: docs at python
components: Documentation
messages: 408983
nosy: docs at python, gilbertson.david
priority: normal
severity: normal
status: open
title: [docs] IO > Text Encoding info outdated
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46143>
_______________________________________

From report at bugs.python.org  Tue Dec 21 01:22:37 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Tue, 21 Dec 2021 06:22:37 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640067757.52.0.0726626571616.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> Just curious about why the focus on the newer exp2 and log2?

No particular reason, those happened to give slighy best results on macOS.  Across compilers, plain exp() is likely the most mature.

The quality of log() is irrelevant because it isn't used.  The table of log factorials can be precomputed to arbitrary exactness using tools other than the C math libraries.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 21 01:27:47 2021
From: report at bugs.python.org (Inada Naoki)
Date: Tue, 21 Dec 2021 06:27:47 +0000
Subject: [issue46143] [docs] IO > Text Encoding info outdated
In-Reply-To: <1640061737.92.0.106243605034.issue46143@roundup.psfhosted.org>
Message-ID: <1640068067.53.0.588243535112.issue46143@roundup.psfhosted.org>


Inada Naoki <songofacandy at gmail.com> added the comment:

UTF-8 mode is not enabled by default. So locale encoding is still the default encoding.

----------
nosy: +methane

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46143>
_______________________________________

From report at bugs.python.org  Tue Dec 21 01:59:34 2021
From: report at bugs.python.org (Joshua Insel)
Date: Tue, 21 Dec 2021 06:59:34 +0000
Subject: [issue46144] math.log() returns improper output
Message-ID: <1640069974.07.0.0953618961908.issue46144@roundup.psfhosted.org>


New submission from Joshua Insel <joshinsel63 at gmail.com>:

math.log(536870912, 2) should return 29.0, because 2^29 = 536870912. However, it instead returns 29.000000000000004.

----------
messages: 408986
nosy: joshinsel
priority: normal
severity: normal
status: open
title: math.log() returns improper output
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46144>
_______________________________________

From report at bugs.python.org  Tue Dec 21 02:13:42 2021
From: report at bugs.python.org (Filmy Talkies 24*7)
Date: Tue, 21 Dec 2021 07:13:42 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640070822.81.0.586323980078.issue43424@roundup.psfhosted.org>


Filmy Talkies 24*7 <gaurawgoshwami at gmail.com> added the comment:

?? ?? ??? ???? ?? 1 ???? ????? 
oaya

----------
components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, Cross-Build, Demos and Tools, Distutils, Extension Modules, FreeBSD, IDLE, IO, Installation, Interpreter Core, Parser, Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, macOS
hgrepos: +413
keywords: +patch
message_count: 1.0 -> 2.0
nosy: +Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, gaurawgoshwami, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, tim.golden, vstinner, yselivanov, zach.ware
nosy_count: 2.0 -> 24.0
pull_requests: +28440
stage:  -> patch review
type: enhancement -> security
pull_request: https://github.com/python/cpython/pull/544
Added file: https://bugs.python.org/file50506/images (5).jpeg

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 02:20:48 2021
From: report at bugs.python.org (Joshua Insel)
Date: Tue, 21 Dec 2021 07:20:48 +0000
Subject: [issue46144] math.log() returns improper output
In-Reply-To: <1640069974.07.0.0953618961908.issue46144@roundup.psfhosted.org>
Message-ID: <1640071248.81.0.406887392104.issue46144@roundup.psfhosted.org>


Joshua Insel <joshinsel63 at gmail.com> added the comment:

The same problem occurs with the log function from the C standard library, which Python uses to implement its same-named function.

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46144>
_______________________________________

From report at bugs.python.org  Tue Dec 21 02:45:50 2021
From: report at bugs.python.org (Larry Hastings)
Date: Tue, 21 Dec 2021 07:45:50 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640072750.2.0.928403517993.issue43424@roundup.psfhosted.org>


Change by Larry Hastings <larry at hastings.org>:


----------
components:  -2to3 (2.x to 3.x conversion tool), Build, C API, Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, FreeBSD, IDLE, IO, Installation, Interpreter Core, Library (Lib), Parser, Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, macOS

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 02:46:09 2021
From: report at bugs.python.org (Larry Hastings)
Date: Tue, 21 Dec 2021 07:46:09 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640072769.0.0.719322139734.issue43424@roundup.psfhosted.org>


Change by Larry Hastings <larry at hastings.org>:


----------
components: +Library (Lib) -Argument Clinic

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 02:46:43 2021
From: report at bugs.python.org (Larry Hastings)
Date: Tue, 21 Dec 2021 07:46:43 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640072803.23.0.850693382191.issue43424@roundup.psfhosted.org>


Change by Larry Hastings <larry at hastings.org>:


----------
components: +Documentation
nosy:  -larry

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 03:26:43 2021
From: report at bugs.python.org (Alex Willmer)
Date: Tue, 21 Dec 2021 08:26:43 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640075203.77.0.075953992247.issue43424@roundup.psfhosted.org>


Change by Alex Willmer <alex at moreati.org.uk>:


----------
nosy:  -Alex.Willmer

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 03:33:11 2021
From: report at bugs.python.org (Frost Ming)
Date: Tue, 21 Dec 2021 08:33:11 +0000
Subject: [issue45235] argparse does not preserve namespace with subparser
 defaults
In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org>
Message-ID: <1640075591.48.0.524110128363.issue45235@roundup.psfhosted.org>


Change by Frost Ming <mianghong at gmail.com>:


----------
pull_requests: +28441
pull_request: https://github.com/python/cpython/pull/30219

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45235>
_______________________________________

From report at bugs.python.org  Tue Dec 21 03:42:17 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Tue, 21 Dec 2021 08:42:17 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640076137.31.0.0213484115566.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

One approach that avoids the use of floating-point arithmetic is to precompute the odd part of the factorial of n modulo 2**64, for all small n. If we also precompute the inverses, then three lookups and two 64x64->64 unsigned integer multiplications gets us the odd part of the combinations modulo 2**64, hence for small enough n and k gets us the actual odd part of the combinations.

Then a shift by a suitable amount gives comb(n, k).

Here's what that looks like in Python. The "% 2**64" operation obviously wouldn't be needed in C: we'd just do the computation with uint64_t and rely on the normal wrapping semantics. We could also precompute the bit_count values if that's faster.


import math

# Max n to compute comb(n, k) for.
Nmax = 67

# Precomputation

def factorial_odd_part(n):
    f = math.factorial(n)
    return f // (f & -f)

F = [factorial_odd_part(n) % 2**64 for n in range(Nmax+1)]
Finv = [pow(f, -1, 2**64) for f in F]
PC = [n.bit_count() for n in range(Nmax+1)]

# Fast comb for small values.

def comb_small(n, k):
    if not 0 <= k <= n <= Nmax:
        raise ValueError("k or n out of range")
    return (F[n] * Finv[k] * Finv[n-k] % 2**64) << k.bit_count() + (n-k).bit_count() - n.bit_count()


# Exhaustive test

for n in range(Nmax+1):
    for k in range(0, n+1):
        assert comb_small(n, k) == math.comb(n, k)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 21 03:47:50 2021
From: report at bugs.python.org (Frost Ming)
Date: Tue, 21 Dec 2021 08:47:50 +0000
Subject: [issue45235] argparse does not preserve namespace with subparser
 defaults
In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org>
Message-ID: <1640076470.67.0.884745278748.issue45235@roundup.psfhosted.org>


Frost Ming <mianghong at gmail.com> added the comment:

Per the review comments of @jiasli, I worked out a second PR to fix this issue.

This fix has less side-effect and better backward compatibility. I will leave the two PRs open. Any feedback is welcome.

- Frost

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45235>
_______________________________________

From report at bugs.python.org  Tue Dec 21 03:54:04 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Tue, 21 Dec 2021 08:54:04 +0000
Subject: [issue46144] math.log() returns improper output
In-Reply-To: <1640069974.07.0.0953618961908.issue46144@roundup.psfhosted.org>
Message-ID: <1640076844.55.0.733119353282.issue46144@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

Yes, confirmed that this is not a bug, but just one of the many consequences of approximating real numbers by floating-point numbers.

You may be interested in math.log2 and/or int.bit_length. math.log2(x) *may*  give you more accurate results than math.log(x, 2) when x is a power of two, but there are no guarantees - we're at the mercy of the C math library here.

----------
nosy: +mark.dickinson
resolution:  -> not a bug

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46144>
_______________________________________

From report at bugs.python.org  Tue Dec 21 04:07:08 2021
From: report at bugs.python.org (Eryk Sun)
Date: Tue, 21 Dec 2021 09:07:08 +0000
Subject: [issue46143] [docs] IO > Text Encoding info outdated
In-Reply-To: <1640061737.92.0.106243605034.issue46143@roundup.psfhosted.org>
Message-ID: <1640077628.23.0.975820777714.issue46143@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

The rare circumstance in which UTF-8 mode gets enabled automatically is described in the following paragraph [1]:

    If the PYTHONUTF8 environment variable is not set at all, then the
    interpreter defaults to using the current locale settings, unless the
    current locale is identified as a legacy ASCII-based locale (as
    described for PYTHONCOERCECLOCALE), and locale coercion is either 
    disabled or fails. In such legacy locales, the interpreter will
    default to enabling UTF-8 mode unless explicitly instructed not to do
    so.

Note that UTF-8 mode is never enabled automatically in Windows. In contrast to POSIX, the locale encoding in Windows is unrelated to the current LC_CTYPE locale. Instead, the locale encoding gets set to the process code page, which is based on the system locale by default and never changes while a process is running. The system locale may be incompatible with the current LC_CTYPE locale, Windows user locale, and preferred UI language (e.g. for text resources such as error messages), so try to explicitly use UTF-8 for text files whenever possible.

---
[1] https://docs.python.org/3/library/os.html#utf8-mode

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46143>
_______________________________________

From report at bugs.python.org  Tue Dec 21 04:15:25 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Tue, 21 Dec 2021 09:15:25 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640078125.64.0.95495357946.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

That computation of the shift can be simplified to require only one popcount operation. With F and Finv as before:


def comb_small(n, k):
    assert 0 <= k <= n <= Nmax
    return (F[n] * Finv[k] * Finv[n-k] % 2**64) << (k ^ n ^ (n-k)).bit_count()

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 21 04:36:00 2021
From: report at bugs.python.org (kdrb)
Date: Tue, 21 Dec 2021 09:36:00 +0000
Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with
 FORMAT_RAW
In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org>
Message-ID: <1640079360.12.0.0401767032792.issue41210@roundup.psfhosted.org>


kdrb <kdrb.links at gmail.com> added the comment:

If you are a developer and looking for a job that suits your profession then please follow https://kdrb.org for latest job alerts

----------
nosy: +kdrb

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41210>
_______________________________________

From report at bugs.python.org  Tue Dec 21 04:47:09 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Tue, 21 Dec 2021 09:47:09 +0000
Subject: [issue46120] Add note to `typing.Union` that it is recommended to use
 `|` instead
In-Reply-To: <1639815639.46.0.989122263928.issue46120@roundup.psfhosted.org>
Message-ID: <1640080029.09.0.890449833582.issue46120@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
pull_requests: +28443
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30222

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46120>
_______________________________________

From report at bugs.python.org  Tue Dec 21 04:52:04 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Tue, 21 Dec 2021 09:52:04 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640080324.16.0.956937004279.issue43424@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
Removed message: https://bugs.python.org/msg408987

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 04:54:08 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Tue, 21 Dec 2021 09:54:08 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640080448.12.0.983895792257.issue43424@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


Removed file: https://bugs.python.org/file50506/images (5).jpeg

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 04:56:04 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Tue, 21 Dec 2021 09:56:04 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640080564.88.0.057599287613.issue43424@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
pull_requests:  -28440

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 04:59:44 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Tue, 21 Dec 2021 09:59:44 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640080784.29.0.715984106684.issue43424@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Zach, gaurawgoshwami is a spammer. Deleted added nosy, unlinked spam file and unrelated PR.  I have no idea what 'repository containing patch' means or how g. created link to non-existent? file.

----------
nosy:  -asvetlov, barry, dstufft, eric.araujo, ezio.melotti, gaurawgoshwami, koobs, lys.nikolaou, mrabarnett, ned.deily, pablogsal, paul.moore, r.david.murray, ronaldoussoren, steve.dower, tim.golden, vstinner, yselivanov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 05:12:34 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 21 Dec 2021 10:12:34 +0000
Subject: [issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to
 parts
In-Reply-To: <1639694209.93.0.209402666532.issue46107@roundup.psfhosted.org>
Message-ID: <1640081554.02.0.429945050025.issue46107@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:


New changeset c66fc0fb53b5316dc325fde3bc738890515d38a4 by Irit Katriel in branch 'main':
bpo-46107: ExceptionGroup.subgroup()/split() should copy __note__ to the parts (GH-30159)
https://github.com/python/cpython/commit/c66fc0fb53b5316dc325fde3bc738890515d38a4


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46107>
_______________________________________

From report at bugs.python.org  Tue Dec 21 05:17:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 21 Dec 2021 10:17:55 +0000
Subject: [issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to
 parts
In-Reply-To: <1639694209.93.0.209402666532.issue46107@roundup.psfhosted.org>
Message-ID: <1640081875.47.0.936943308212.issue46107@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46107>
_______________________________________

From report at bugs.python.org  Tue Dec 21 07:43:46 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 21 Dec 2021 12:43:46 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1640090626.7.0.897845815834.issue23522@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +28444
pull_request: https://github.com/python/cpython/pull/30221

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Tue Dec 21 07:46:29 2021
From: report at bugs.python.org (miss-islington)
Date: Tue, 21 Dec 2021 12:46:29 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1640090789.12.0.621977578958.issue23522@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28445
pull_request: https://github.com/python/cpython/pull/30220

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Tue Dec 21 08:49:02 2021
From: report at bugs.python.org (Zachary Ware)
Date: Tue, 21 Dec 2021 13:49:02 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640094542.4.0.752657113965.issue43424@roundup.psfhosted.org>


Change by Zachary Ware <zachary.ware at gmail.com>:


----------
hgrepos:  -413

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Tue Dec 21 09:16:24 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Tue, 21 Dec 2021 14:16:24 +0000
Subject: [issue23522] Misleading note in Statistics module documentation
In-Reply-To: <1424889646.1.0.160219400081.issue23522@psf.upfronthosting.co.za>
Message-ID: <1640096184.0.0.955464252524.issue23522@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23522>
_______________________________________

From report at bugs.python.org  Tue Dec 21 10:00:56 2021
From: report at bugs.python.org (David Mc Dougall)
Date: Tue, 21 Dec 2021 15:00:56 +0000
Subject: [issue46071] Graphlib documentation
In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org>
Message-ID: <1640098856.35.0.790775151429.issue46071@roundup.psfhosted.org>


Change by David Mc Dougall <dam1784 at g.rit.edu>:


----------
pull_requests: +28446
pull_request: https://github.com/python/cpython/pull/30223

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46071>
_______________________________________

From report at bugs.python.org  Tue Dec 21 12:24:45 2021
From: report at bugs.python.org (Antara)
Date: Tue, 21 Dec 2021 17:24:45 +0000
Subject: [issue46145] List reference not working properly
Message-ID: <1640107485.01.0.343364222268.issue46145@roundup.psfhosted.org>


New submission from Antara <antara.data at gmail.com>:

o= [1,2,3,3]
print('o:',id(o))
d= o
print('d:',id(d))
d= [1,2,3,4]
dd= o
print('dd:',id(dd))
dd[3]= 5

print('o:',o)
print('d:',d)
print('dd:',dd)

=======================
Output:
o: 1976210449032
d: 1976210449032
dd: 1976210449032
o: [1, 2, 3, 5]
d: [1, 2, 3, 4]
dd: [1, 2, 3, 5]

Though o,d and dd points to the same memory pointer but d has different value. How can same memory location points to 2 different values?

----------
messages: 408998
nosy: antarab
priority: normal
severity: normal
status: open
title: List reference not working properly
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46145>
_______________________________________

From report at bugs.python.org  Tue Dec 21 12:46:47 2021
From: report at bugs.python.org (Antara)
Date: Tue, 21 Dec 2021 17:46:47 +0000
Subject: [issue46145] List reference not working properly
In-Reply-To: <1640107485.01.0.343364222268.issue46145@roundup.psfhosted.org>
Message-ID: <1640108807.37.0.37323205367.issue46145@roundup.psfhosted.org>


Antara <antara.data at gmail.com> added the comment:

Not an issue

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46145>
_______________________________________

From report at bugs.python.org  Tue Dec 21 14:32:57 2021
From: report at bugs.python.org (Tim Peters)
Date: Tue, 21 Dec 2021 19:32:57 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640115177.84.0.643458509671.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

Clever, Mark! Very nice.

The justification for the shift count isn't self-evident, and appears to me to be an instance of the generalization of Kummer's theorem to multinomial coefficients. I think it would be clearer at first sight to rely instead on that 2**i/(2**j * 2**k) = 2**(i-j-k), which is shallow.

So here's a minor rewrite doing that instead; it would add 68 bytes to the precomputed static data.

    import math
    # Largest n such that comb(n, k) fits in 64 bits for all k.
    Nmax = 67

    # Express n! % 2**64 as Fodd[n] << Fntz[n] where Fodd[n] is odd.
    Fodd = [] # unsigned 8-byte ints
    Fntz = [] # unsigned 1-byte ints
    for i in range(Nmax + 1):
        f = math.factorial(i)
        lsb = f & -f # isolate least-significant 1 bit
        Fntz.append(lsb.bit_length() - 1)
        Fodd.append((f >> Fntz[-1]) % 2**64)

    Finv = [pow(fodd, -1, 2**64) for fodd in Fodd]

    # All of the above is meant to be precomputed; just static tables in C.

    # Fast comb for small values.
    def comb_small(n, k):
        if not 0 <= k <= n <= Nmax:
            raise ValueError("k or n out of range")
        return ((Fodd[n] * Finv[k] * Finv[n-k] % 2**64)
                << (Fntz[n] - Fntz[k] - Fntz[n-k]))

    # Exhaustive test
    for n in range(Nmax+1):
        for k in range(0, n+1):
            assert comb_small(n, k) == math.comb(n, k)

Since 99.86% of comb() calls in real life are applied to a deck of cards ;-) , it's valuable that Nmax be >= 52.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 21 14:52:18 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Tue, 21 Dec 2021 19:52:18 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640116338.03.0.771638328749.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

>  Finv = [pow(fodd, -1, 2**64) for fodd in Fodd]

This is a good trick.  I had already experimented with separating factorials into an odd component and a shift count, but failed to get a speed-up because the divisions were slow.  Having a table of multiplicative inverses and working mod 2**64 bypasses that problem nicely.  Division-free is the way to go :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 21 14:58:38 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Tue, 21 Dec 2021 19:58:38 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640116718.26.0.338581699769.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Am I correct in my understanding the 64 bits are always available, that 128 bit ints aren't universal, and that #ifdefs would be needed to extend the range of the table for systems that support it?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 21 17:52:48 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 21 Dec 2021 22:52:48 +0000
Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with
 FORMAT_RAW
In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org>
Message-ID: <1640127168.37.0.467807559176.issue41210@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
Removed message: https://bugs.python.org/msg407902

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41210>
_______________________________________

From report at bugs.python.org  Tue Dec 21 17:53:08 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 21 Dec 2021 22:53:08 +0000
Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with
 FORMAT_RAW
In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org>
Message-ID: <1640127188.36.0.525438173145.issue41210@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
Removed message: https://bugs.python.org/msg408966

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41210>
_______________________________________

From report at bugs.python.org  Tue Dec 21 17:53:22 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 21 Dec 2021 22:53:22 +0000
Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with
 FORMAT_RAW
In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org>
Message-ID: <1640127202.53.0.156576666229.issue41210@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
Removed message: https://bugs.python.org/msg408995

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41210>
_______________________________________

From report at bugs.python.org  Tue Dec 21 17:54:29 2021
From: report at bugs.python.org (Ned Deily)
Date: Tue, 21 Dec 2021 22:54:29 +0000
Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with
 FORMAT_RAW
In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org>
Message-ID: <1640127269.4.0.176280090755.issue41210@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
nosy:  -Smith129, kdrb, sakaranata

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41210>
_______________________________________

From report at bugs.python.org  Tue Dec 21 18:39:11 2021
From: report at bugs.python.org (Matej Cepl)
Date: Tue, 21 Dec 2021 23:39:11 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
Message-ID: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>


New submission from Matej Cepl <mcepl at cepl.eu>:

(originally filed as https://bugzilla.suse.com/1193409)

When trying to start "idle3.8", I get a ZeroDivisionError in
editor.py. Trying to patch it, I noticed that the complete UI of
IDLE shows no text. Since the same also happens with "idle3.9",
I guess it is a bug in tk.

The error happens also with a fresh user account.

The complete error message is as follows:

> idle3.8
Traceback (most recent call last):
  File "/usr/bin/idle3.8", line 5, in <module>
    main()
  File "/usr/lib64/python3.8/idlelib/pyshell.py", line 1522, in main
    shell = flist.open_shell()
  File "/usr/lib64/python3.8/idlelib/pyshell.py", line 329, in open_shell
    self.pyshell = PyShell(self)
  File "/usr/lib64/python3.8/idlelib/pyshell.py", line 874, in __init__
    OutputWindow.__init__(self, flist, None, None)
  File "/usr/lib64/python3.8/idlelib/outwin.py", line 79, in __init__
    EditorWindow.__init__(self, *args)
  File "/usr/lib64/python3.8/idlelib/editor.py", line 218, in __init__
    self.set_width()
  File "/usr/lib64/python3.8/idlelib/editor.py", line 366, in set_width
    self.width = pixel_width // zero_char_width
ZeroDivisionError: integer division or modulo by zero
>

----------
assignee: terry.reedy
components: IDLE
messages: 409003
nosy: mcepl, terry.reedy
priority: normal
severity: normal
status: open
title: Python IDLE fails to start (tk font issue?)
type: crash
versions: Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Tue Dec 21 19:32:00 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Wed, 22 Dec 2021 00:32:00 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
In-Reply-To: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>
Message-ID: <1640133120.5.0.773675438632.issue46146@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

(This is behavior, not crash issue, as the latter is when there is no traceback.)

The editor code was added 3 years ago in #37929, PR-15452, to correct using the configured char width after font and window size changes make that invalid.  It is based on 
https://www.tcl.tk/man/tcl8.6/TkCmd/text.html#M21
"If the font does not have a uniform width then the width of the character ?0? [zero] is used in translating from character units to screen units."  The implies that said char width is non-zero.  It would seem like a font bug if not.  This is first report I know of where width is 0.

The current code implements this as
       zero_char_width = \
            Font(text, font=text.cget('font')).measure('0')

Matej, what OS and font gives this error?  Please run the following, also uploaded, with the offending font, replacing the name I used.

import tkinter as tk
from tkinter.font import Font
r = tk.Tk()
t = tk.Text(r, font=('Source Code Pro', 10, 'normal'))
t.pack()
s = '0oO !*}'
t.insert('1.0', s) # Only to check that all above is valid.
for c in s:
    print(Font(t, font=t['font']).measure(c))

For fixed 10 pitch Source Code Pro, all widths are 8.
---

We could, of course, catch ZeroDivisionError, but when then?  This is why I want to know what OS, font, and a test with multiple characters.

On possibility is to check whenever font is set, but still, what then?

----------
nosy: +taleinat
type: crash -> behavior
versions: +Python 3.11 -Python 3.8
Added file: https://bugs.python.org/file50507/tem.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Tue Dec 21 19:34:22 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Wed, 22 Dec 2021 00:34:22 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1640133262.38.0.267215996133.issue46090@roundup.psfhosted.org>


Brandt Bucher <brandtbucher at gmail.com> added the comment:

Fixing this actually ended up being a lot simpler than I anticipated (and it requires no changes on our end). All that's really required is saving and restoring:
- tstate->cframe->current_frame
- tstate->datastack_chunk
- tstate->datastack_top
- tstate->datastack_limit

You can see my proposed fix for Greenlet here (this PR also contains some other 3.11-related fixes):

https://github.com/python-greenlet/greenlet/pull/280

There is one weird edge case in Greenlet's use that I don't *entirely* understand, where it sometimes needs to update a thread with a NULL frame (as discussed above). We need to replace the thread's datastack with *something* in this case: setting it to NULL crashes the interpreter when it tries to allocate frames later, but leaving it as-is puts us in a situation where two threads are sharing the same datastack (also a recipe for crashes). My solution is to set it to a statically allocated zero-size "dummy chunk" in this case. It seems to work fine, since the zero-size forces the interpreter to allocate a "real" chunk on the next frame push.

If this solution seems too hack-y, a very simple change on our end could be to start treating NULL as a valid datastack value, and have the thread state check for it when pushing new chunks. That would make for a relatively clean upgrade path for libraries like Greenlet, and doesn't require adding any new APIs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Tue Dec 21 19:39:46 2021
From: report at bugs.python.org (anthony shaw)
Date: Wed, 22 Dec 2021 00:39:46 +0000
Subject: [issue46147] Support AddressSanitizer in Windows build
Message-ID: <1640133586.41.0.76812451287.issue46147@roundup.psfhosted.org>


New submission from anthony shaw <anthonyshaw at apache.org>:

I'd like to compile my C-extensions with ASAN for testing in Windows, but they cannot be loaded as the host python.exe process needs to be compiled with ASAN. 

https://docs.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-170#ide-msbuild

The EnableASAN flag would be a setting in vcxproj files within the PCBuild solution, and a flag in the build.bat to enable it.

----------
components: Build, Windows
messages: 409006
nosy: anthonypjshaw, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Support AddressSanitizer in Windows build
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46147>
_______________________________________

From report at bugs.python.org  Tue Dec 21 20:03:59 2021
From: report at bugs.python.org (Matej Cepl)
Date: Wed, 22 Dec 2021 01:03:59 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
In-Reply-To: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>
Message-ID: <1640135039.3.0.284768417833.issue46146@roundup.psfhosted.org>


Matej Cepl <mcepl at cepl.eu> added the comment:

> Matej, what OS and font gives this error?  Please run the
> following, also uploaded, with the offending font, replacing the
> name I used.

I am a packager at SUSE maintaining Python packages both for
openSUSE and SLE (our commercial offering), even though
unfortunately cannot reproduce the issue myself. GUI programming is
just part of the Python libraries where I am really lost, so I filed
this bug (which was originally filed by somebody else at our
Bugzilla) here asking for help.

I will ask our reporter for testing your suggested reproducer.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Tue Dec 21 20:32:25 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Wed, 22 Dec 2021 01:32:25 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
In-Reply-To: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>
Message-ID: <1640136745.21.0.77706055398.issue46146@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

On a system where IDLE will not start, the code has to be run directly with 'python3', however that is done there.  One will need to add the line 'r.mainloop()' at the end of the script to see the tk window.  However, this is not needed to see the printed width results.

What tcl/tk version do you distribute?  Is the person seeing the bug using that?  Add "print(tk.call('info', 'patchlevel'))" to see.

I presume that when IDLE worked for you, you used the default font.  Specific tests to run:
python3 -m test -ugui test_tk test_tcl test_ttk_guionly test_ttk_textonly test_idle

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Tue Dec 21 21:20:30 2021
From: report at bugs.python.org (Ned Deily)
Date: Wed, 22 Dec 2021 02:20:30 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <1640139630.17.0.827669338877.issue46106@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:


New changeset fc54e722a2e66971f1a8e16cff24c844bf9c5ac4 by Kumar Aditya in branch 'main':
bpo-46106: Update OpenSSL to 1.1.1m (GH-30211)
https://github.com/python/cpython/commit/fc54e722a2e66971f1a8e16cff24c844bf9c5ac4


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Tue Dec 21 21:38:19 2021
From: report at bugs.python.org (Ned Deily)
Date: Wed, 22 Dec 2021 02:38:19 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <1640140699.35.0.871086778138.issue46106@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
pull_requests: +28447
pull_request: https://github.com/python/cpython/pull/30224

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Tue Dec 21 21:45:02 2021
From: report at bugs.python.org (Ned Deily)
Date: Wed, 22 Dec 2021 02:45:02 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <1640141102.59.0.819163722035.issue46106@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
pull_requests: +28448
pull_request: https://github.com/python/cpython/pull/30225

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Tue Dec 21 21:52:16 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Wed, 22 Dec 2021 02:52:16 +0000
Subject: [issue41222] POpen bufsize=0 ignored with universal_newlines=True
In-Reply-To: <1594065242.21.0.841046846995.issue41222@roundup.psfhosted.org>
Message-ID: <1640141536.33.0.166494605401.issue41222@roundup.psfhosted.org>


Change by Gregory P. Smith <greg at krypto.org>:


----------
nosy: +gregory.p.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41222>
_______________________________________

From report at bugs.python.org  Tue Dec 21 22:37:10 2021
From: report at bugs.python.org (Tim Peters)
Date: Wed, 22 Dec 2021 03:37:10 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640144230.48.0.491068598788.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

I see no use of 128-bit ints in the CPython core. Advice: forget it. 

int64_t and uint64_t are required by C99, and are used many places in the core. Advice: use freely.

Note that if tables of "odd part mod 2**64" and "number of trailing zeroes" are used up through 67, then factorials up through 25! are trivially computed via

Fodd[i] << Fntz[i]


(at 26, the odd part no longer fits in 64 bits)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 21 23:24:10 2021
From: report at bugs.python.org (Ned Deily)
Date: Wed, 22 Dec 2021 04:24:10 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <1640147050.86.0.168550010934.issue46106@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:


New changeset cf96c279ac960f2a5025e2ac887f9b932a4f1474 by Ned Deily in branch '3.10':
bpo-46106: Update OpenSSL to 1.1.1m (GH-30211) (GH-30224)
https://github.com/python/cpython/commit/cf96c279ac960f2a5025e2ac887f9b932a4f1474


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Tue Dec 21 23:25:12 2021
From: report at bugs.python.org (Ned Deily)
Date: Wed, 22 Dec 2021 04:25:12 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <1640147112.96.0.200213623087.issue46106@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:


New changeset 5c4d11fe755a7adeaee6b838bc8faceadc29ed7d by Ned Deily in branch '3.9':
bpo-46106: Update OpenSSL to 1.1.1m (GH-30211) (GH-30225)
https://github.com/python/cpython/commit/5c4d11fe755a7adeaee6b838bc8faceadc29ed7d


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Tue Dec 21 23:28:21 2021
From: report at bugs.python.org (Ned Deily)
Date: Wed, 22 Dec 2021 04:28:21 +0000
Subject: [issue46106] OpenSSL 1.1.1m is now available
In-Reply-To: <1639686122.34.0.476872418462.issue46106@roundup.psfhosted.org>
Message-ID: <1640147301.4.0.864909669148.issue46106@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

Thanks for the PR, Kumar!  Merged, with a few minor changes, to main (for 3.11.0a4), 3.10 (3.10.2), and 3.9 (3.9.10).

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46106>
_______________________________________

From report at bugs.python.org  Wed Dec 22 01:24:08 2021
From: report at bugs.python.org (anthony shaw)
Date: Wed, 22 Dec 2021 06:24:08 +0000
Subject: [issue46147] Support AddressSanitizer in Windows build
In-Reply-To: <1640133586.41.0.76812451287.issue46147@roundup.psfhosted.org>
Message-ID: <1640154248.92.0.748641405143.issue46147@roundup.psfhosted.org>


anthony shaw <anthonyshaw at apache.org> added the comment:

After some experimentation, this can be done if you enable ASAN in all projects except python3dll.vcxproj

I think it would make sense (if this were supported) to have a flag in build.bat like there is for pgo

`build.bat --asan`

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46147>
_______________________________________

From report at bugs.python.org  Wed Dec 22 02:50:48 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Wed, 22 Dec 2021 07:50:48 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640159448.01.0.361159640728.issue37295@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
nosy:  -pablogsal

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 22 03:20:05 2021
From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=)
Date: Wed, 22 Dec 2021 08:20:05 +0000
Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a
 crash in subintepreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1640161205.83.0.914310159692.issue46070@roundup.psfhosted.org>


Change by Miro Hron?ok <miro at hroncok.cz>:


----------
nosy: +hroncok

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Wed Dec 22 04:00:01 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 22 Dec 2021 09:00:01 +0000
Subject: [issue46148] Optimize pathlib
Message-ID: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>


New submission from Kumar Aditya <rahuladitya303 at gmail.com>:

Issue for tracking improving performance of pathlib module.

----------
components: Library (Lib)
messages: 409015
nosy: gvanrossum, kumaraditya303
priority: normal
severity: normal
status: open
title: Optimize pathlib
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Wed Dec 22 04:01:22 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 22 Dec 2021 09:01:22 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640163682.36.0.792893913682.issue46148@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
pull_requests: +28449
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30226

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Wed Dec 22 04:45:17 2021
From: report at bugs.python.org (Antoine Pitrou)
Date: Wed, 22 Dec 2021 09:45:17 +0000
Subject: [issue41222] POpen bufsize=0 ignored with universal_newlines=True
In-Reply-To: <1594065242.21.0.841046846995.issue41222@roundup.psfhosted.org>
Message-ID: <1640166317.18.0.703604154279.issue41222@roundup.psfhosted.org>


Antoine Pitrou <pitrou at free.fr> added the comment:

Hmm, sorry for not responding earlier.

Buffering is necessary for implementing the universal_newlines behaviour (I don't know how we could do otherwise?). This has the unavoidable side effect that the Python buffered file object is not in sync with the underlying file descriptor, so that using `p.stdout` in a `select` call will give you inaccurate information.

So it seems like this is perhaps a documentation issue. What do you think?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41222>
_______________________________________

From report at bugs.python.org  Wed Dec 22 05:32:08 2021
From: report at bugs.python.org (=?utf-8?q?Florin_Sp=C4=83tar?=)
Date: Wed, 22 Dec 2021 10:32:08 +0000
Subject: [issue46149] FIPS usedforsecurity flag is no longer functional with
 OpenSSL 3.0.0
Message-ID: <1640169128.02.0.712227783585.issue46149@roundup.psfhosted.org>


New submission from Florin Sp?tar <florin.spatar at gmail.com>:

I added christian.heimes to the nosy list; I hope that's OK

usedforsecurity flag is based on setting the EVP_MD_CTX_FLAG_NON_FIPS_ALLOW flag. However this flag has no effect in OpenSSL 3.0.0.

    [root at lambada ~]# /opt/opsware/bin/python3
    Python 3.10.0 (default, Dec  8 2021, 17:05:23) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux-x86_64
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import _hashlib                                        
    >>> _hashlib.get_fips_mode()                               
    1
    >>> import hashlib
    >>> hashlib.md5(b'ceva', usedforsecurity=False).hexdigest()
    '970c7956028654ac329b12c10b112058'
    >>> hashlib.md5(b'ceva', usedforsecurity=True).hexdigest()
    '970c7956028654ac329b12c10b112058'

The last call, when usedforsecurity is True, should fail because MD5 is not allowed in FIPS mode.

I will add a GitHub pull request for this issue.

----------
assignee: christian.heimes
components: SSL
messages: 409017
nosy: christian.heimes, florinspatar
priority: normal
severity: normal
status: open
title: FIPS usedforsecurity flag is no longer functional with OpenSSL 3.0.0
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46149>
_______________________________________

From report at bugs.python.org  Wed Dec 22 05:42:51 2021
From: report at bugs.python.org (Matej Cepl)
Date: Wed, 22 Dec 2021 10:42:51 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
In-Reply-To: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>
Message-ID: <1640169771.24.0.292530341671.issue46146@roundup.psfhosted.org>


Matej Cepl <mcepl at cepl.eu> added the comment:

$ rpm -qR python38-idle
/usr/bin/python3
/usr/bin/python3.8
config(python38-idle) = 3.8.12-3.1
python(abi) = 3.8
python38 = 3.8.12
python38-tk
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1
$ rpm -qR python38-tk
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libtcl8.6.so()(64bit)
libtk8.6.so()(64bit)
python(abi) = 3.8
python38 = 3.8.12
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1
$ rpm -q tk
tk-8.6.12-1.1.x86_64
$

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Wed Dec 22 05:43:40 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 22 Dec 2021 10:43:40 +0000
Subject: [issue46149] FIPS usedforsecurity flag is no longer functional with
 OpenSSL 3.0.0
In-Reply-To: <1640169128.02.0.712227783585.issue46149@roundup.psfhosted.org>
Message-ID: <1640169820.19.0.00746238880676.issue46149@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

This is a known issue, see #40479. OpenSSL 3.0.0 new provider system requires a major redesign of hashlib module's internals. It's not a trivial change. My first attempt GH-19878 has some flaws and introduces a performance regression.

----------
superseder:  -> Port _hashlib to OpenSSL 3.0.0

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46149>
_______________________________________

From report at bugs.python.org  Wed Dec 22 05:44:04 2021
From: report at bugs.python.org (Matej Cepl)
Date: Wed, 22 Dec 2021 10:44:04 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
In-Reply-To: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>
Message-ID: <1640169844.89.0.179864069168.issue46146@roundup.psfhosted.org>


Matej Cepl <mcepl at cepl.eu> added the comment:

And I am not sure what?s going on, but when I run the test suite you
indicated, it kills my Wayland session immediately. How is Tk doing
with X11->Wayland switch?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Wed Dec 22 05:45:25 2021
From: report at bugs.python.org (Matej Cepl)
Date: Wed, 22 Dec 2021 10:45:25 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
In-Reply-To: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>
Message-ID: <1640169925.28.0.964398233411.issue46146@roundup.psfhosted.org>


Matej Cepl <mcepl at cepl.eu> added the comment:

And yes, idle (both with 3.10 and 3.8) works for me just fine all the time (it doesn't for my reporter, but that's another point).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Wed Dec 22 05:46:17 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 22 Dec 2021 10:46:17 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640169977.55.0.472209926132.issue46148@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Please provide benchmarks and reasons in the ticket. A BPO issue should contain all relevant information for a change.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Wed Dec 22 06:25:43 2021
From: report at bugs.python.org (mike mcleod)
Date: Wed, 22 Dec 2021 11:25:43 +0000
Subject: [issue1284670] Allow to restrict ModuleFinder to get "direct"
 dependencies
Message-ID: <1640172343.02.0.897287183003.issue1284670@roundup.psfhosted.org>


Change by mike mcleod <mikecmcleod at gmail.com>:


----------
pull_requests: +28450
pull_request: https://github.com/python/cpython/pull/30228

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1284670>
_______________________________________

From report at bugs.python.org  Wed Dec 22 06:39:37 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 22 Dec 2021 11:39:37 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640173177.96.0.0955014702919.issue37295@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

long long is at least 64 bit, so we can safely use PyLong_FromLongLong() for int64_t.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 22 06:43:16 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 22 Dec 2021 11:43:16 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640173396.29.0.175369748353.issue46148@roundup.psfhosted.org>


Kumar Aditya <rahuladitya303 at gmail.com> added the comment:

Optimizations include:

- Remove redundant check for functools lru_cache
- Replace attrgetter as it is slower than direct access

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Wed Dec 22 06:44:25 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 22 Dec 2021 11:44:25 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640173465.13.0.0301662954153.issue46148@roundup.psfhosted.org>


Kumar Aditya <rahuladitya303 at gmail.com> added the comment:

Benchmarks for attrgetter is provided in the PR.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Wed Dec 22 07:00:39 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 22 Dec 2021 12:00:39 +0000
Subject: [issue20392] Inconsistency with uppercase file extensions in
 MimeTypes.guess_type
In-Reply-To: <1390670268.05.0.579524422182.issue20392@psf.upfronthosting.co.za>
Message-ID: <1640174439.35.0.954508122077.issue20392@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 4.0 -> 5.0
pull_requests: +28451
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30229

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20392>
_______________________________________

From report at bugs.python.org  Wed Dec 22 07:06:39 2021
From: report at bugs.python.org (=?utf-8?q?Florin_Sp=C4=83tar?=)
Date: Wed, 22 Dec 2021 12:06:39 +0000
Subject: [issue46149] FIPS usedforsecurity flag is no longer functional with
 OpenSSL 3.0.0
In-Reply-To: <1640169128.02.0.712227783585.issue46149@roundup.psfhosted.org>
Message-ID: <1640174799.63.0.334949361903.issue46149@roundup.psfhosted.org>


Florin Sp?tar <florin.spatar at gmail.com> added the comment:

I was able to get past this issue with minimal changes: https://github.com/florinspatar/cpython/commit/3b16c65eb3e54c0be40413ebabf504356e303e8a
I see the issue you linked, handles multiple OpenSSL 3.0.0 problems.

AFAIK, python 3 no longer supports OpenSSL 1.0.2. Minimum OpenSSL version is 1.1.1, which has no FIPS module, so usedforsecurity flag can only be used with OpenSSL 3. I'm wondering if the issue you linked is still an enhancement or should be treated as an actual bug.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46149>
_______________________________________

From report at bugs.python.org  Wed Dec 22 07:08:45 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 22 Dec 2021 12:08:45 +0000
Subject: [issue20823] [doc] Clarify copyreg.pickle() documentation
In-Reply-To: <1393749966.08.0.529137298895.issue20823@psf.upfronthosting.co.za>
Message-ID: <1640174925.11.0.335901671739.issue20823@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 3.0 -> 4.0
pull_requests: +28452
pull_request: https://github.com/python/cpython/pull/30230

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20823>
_______________________________________

From report at bugs.python.org  Wed Dec 22 07:12:58 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 22 Dec 2021 12:12:58 +0000
Subject: [issue7262] [doc] codecs.open() + eol (windows)
In-Reply-To: <1257344010.52.0.739143662559.issue7262@psf.upfronthosting.co.za>
Message-ID: <1640175178.25.0.657783596345.issue7262@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
versions:  -Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue7262>
_______________________________________

From report at bugs.python.org  Wed Dec 22 07:13:46 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 22 Dec 2021 12:13:46 +0000
Subject: [issue7262] [doc] codecs.open() + eol (windows)
In-Reply-To: <1257344010.52.0.739143662559.issue7262@psf.upfronthosting.co.za>
Message-ID: <1640175226.91.0.167278704382.issue7262@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
versions: +Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue7262>
_______________________________________

From report at bugs.python.org  Wed Dec 22 07:25:06 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 22 Dec 2021 12:25:06 +0000
Subject: [issue7262] [doc] codecs.open() + eol (windows)
In-Reply-To: <1257344010.52.0.739143662559.issue7262@psf.upfronthosting.co.za>
Message-ID: <1640175906.16.0.897542795972.issue7262@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
nosy: +kumaraditya303
nosy_count: 5.0 -> 6.0
pull_requests: +28453
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30231

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue7262>
_______________________________________

From report at bugs.python.org  Wed Dec 22 07:45:55 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Wed, 22 Dec 2021 12:45:55 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640177155.27.0.387620700966.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

[Tim]

> The justification for the shift count isn't self-evident, and
> appears to me to be an instance of the generalization of Kummer's
> theorem to multinomial coefficients.

Not sure there's any generalisation here: I think it *is* just Kummer's theorem. Though I confess I wasn't aware that this was a named theorem - I was working directly from what I now discover is called [Legendre's formula](https://en.wikipedia.org/wiki/Legendre%27s_formula), which I originally learned from "Concrete Mathematics" by Knuth et. al., where they also didn't mention any particular names. It's equation 4.24 in my edition; it may have a different number in the 2nd edition.

Kummer's theorem says that the 2-valuation of n-choose-k is the number of carries when k is added to n-k in binary.

Notation: write `bit(x, i)` for the bit at position `i` of `x` - i.e., `(x >> i) & 1`

In the absence of carries when adding `k` to `n-k`, `bit(n, i) = bit(k, i) ^ bit(n-k, i)`. We have an incoming carry whenever `bit(n, i) != bit(k, i) ^ bit(n-k, i)`; i.e., whenever `bit(n ^ k ^ (n-k), i)` is `1`. So the number of carries is the population count of `n ^ k ^ (n-k)`.

> I think it would be clearer at first sight to rely instead on that 2**i/(2**j * 2**k) = 2**(i-j-k), which is shallow.

Sounds fine to me, especially if it makes little performance difference.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 22 07:51:41 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 22 Dec 2021 12:51:41 +0000
Subject: [issue46149] FIPS usedforsecurity flag is no longer functional with
 OpenSSL 3.0.0
In-Reply-To: <1640169128.02.0.712227783585.issue46149@roundup.psfhosted.org>
Message-ID: <1640177501.52.0.273290523116.issue46149@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Your patch gets the work done, but it's even slower than my WIP patch set. Hashing is a performance critical path. The new fetch() API in OpenSSL 3.0.0 is substantially slower than the old OpenSSL 1.1.1 APIs.

Python 3.9 and earlier still support OpenSSL 1.0.2. I removed support for OpenSSL < 1.1.1 for Python 3.10. There are approvied FIPS providers for OpenSSL 1.1.1, e.g. RHEL 8 has a certified FIPS module for OpenSSL 1.1.1.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46149>
_______________________________________

From report at bugs.python.org  Wed Dec 22 07:58:48 2021
From: report at bugs.python.org (Thomas Wouters)
Date: Wed, 22 Dec 2021 12:58:48 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
Message-ID: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>


New submission from Thomas Wouters <thomas at python.org>:

test_pathlib contains, in PosixPathTest.test_expanduser, a check that expanduser on a nonexistent user will raise RuntimeError. Leaving aside the question why that's a RuntimeError (which is probably too late to fix anyway), the test performs this check by assuming 'fakeuser' is a nonexistent user. This test will fail when such a user does exist. (The test already uses the pwd module for other reasons, so it certainly could check that first.)

----------
components: Tests
messages: 409030
nosy: twouters
priority: normal
severity: normal
status: open
title: test_pathlib assumes "fakeuser" does not exist as user
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Wed Dec 22 08:01:55 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 22 Dec 2021 13:01:55 +0000
Subject: [issue41222] POpen bufsize=0 ignored with universal_newlines=True
In-Reply-To: <1594065242.21.0.841046846995.issue41222@roundup.psfhosted.org>
Message-ID: <1640178115.09.0.996105957875.issue41222@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> Buffering is necessary for implementing the universal_newlines 

Why is that? I can see that it requires newline state tracking, and the allowance to make two read(fd, &c, 1) system calls for a single read(1) method call, in case a "\n" has to be ignored.

testproc-unbuffered.py runs to completion in 3.11 if the following statement that changes the text wrapper's chunk size is added right after creating the Popen() instance:

    if sys.version_info[0] > 2:
        process.stdout._CHUNK_SIZE = 1

The initial chunk size for a text wrapper is hard coded as 8192 bytes. For some reason the constructor has no parameter for it.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41222>
_______________________________________

From report at bugs.python.org  Wed Dec 22 08:08:02 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 22 Dec 2021 13:08:02 +0000
Subject: [issue46140] Some API methods could take const Py_buffer* instead of
 Py_buffer *
In-Reply-To: <1640039216.66.0.26119941091.issue46140@roundup.psfhosted.org>
Message-ID: <1640178482.17.0.723412183198.issue46140@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 31ff96712e8f89ac1056c2da880b44650002219f by David Hewitt in branch 'main':
bpo-46140: take more Py_buffer arguments as const * (GH-30217)
https://github.com/python/cpython/commit/31ff96712e8f89ac1056c2da880b44650002219f


----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46140>
_______________________________________

From report at bugs.python.org  Wed Dec 22 08:08:49 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 22 Dec 2021 13:08:49 +0000
Subject: [issue46140] Some API methods could take const Py_buffer* instead of
 Py_buffer *
In-Reply-To: <1640039216.66.0.26119941091.issue46140@roundup.psfhosted.org>
Message-ID: <1640178529.72.0.601540736497.issue46140@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Thank you for your contribution David.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46140>
_______________________________________

From report at bugs.python.org  Wed Dec 22 08:16:07 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Wed, 22 Dec 2021 13:16:07 +0000
Subject: [issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC
In-Reply-To: <1540110172.83.0.788709270274.issue35037@psf.upfronthosting.co.za>
Message-ID: <1640178967.82.0.0656312989713.issue35037@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> This should probably be a separate issue,

Specifically, issue 45569.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35037>
_______________________________________

From report at bugs.python.org  Wed Dec 22 08:19:04 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Wed, 22 Dec 2021 13:19:04 +0000
Subject: [issue20369] concurrent.futures.wait() blocks forever when given
 duplicate Futures
In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za>
Message-ID: <1640179144.5.0.71199795148.issue20369@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
nosy:  -mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20369>
_______________________________________

From report at bugs.python.org  Wed Dec 22 08:26:50 2021
From: report at bugs.python.org (Trung Pham)
Date: Wed, 22 Dec 2021 13:26:50 +0000
Subject: [issue46151] SimpleCookie.js_output is vulnerable to HTML injection
Message-ID: <1640179610.51.0.982763035039.issue46151@roundup.psfhosted.org>


New submission from Trung Pham <trungpaaa at gmail.com>:

In /Lib/http/cookies.py, the output from SimpleCookie.js_output might be parsed as HTML if it contained < and >.

```
from http import cookies
c = cookies.SimpleCookie()
c["fig"] = "newton</script><script>alert(document.domain)</script>";

// c.js_output()

<script type="text/javascript">
<!-- begin hiding
document.cookie = "fig=\"newton</script><script>alert(document.domain)</script>\"";
// end hiding -->
</script>
```

We can't simply escape all the special characters because the encoding method is treated differently depending on the document types. For example, the following snippet (from The Tangled Web) is safe in HTML but not in XHTML:

```
<script type="text/javascript">
    var tmp = 'I am harmless! &#x27;+alert(1);// Or am I?';
</script>
```

To avoid messing with the encoding methods, we could encode the cookie string in base64 and let the browser decode it.

```
// c.js_output()
<script type="text/javascript">
document.cookie = base64decode(<ENCODED>);
</script>

```

After searching around on Github, I think this function is rarely used so making it deprecated is also an option.

----------
components: Library (Lib)
messages: 409035
nosy: trungpaaa
priority: normal
severity: normal
status: open
title: SimpleCookie.js_output is vulnerable to HTML injection
type: security
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46151>
_______________________________________

From report at bugs.python.org  Wed Dec 22 08:35:24 2021
From: report at bugs.python.org (=?utf-8?b?5riF6ICF6Ieq5riF?=)
Date: Wed, 22 Dec 2021 13:35:24 +0000
Subject: [issue46152] rename wave.py class nane
Message-ID: <1640180124.46.0.483716784216.issue46152@roundup.psfhosted.org>


New submission from ???? <a1025952421 at gmail.com>:

Wave_read/Wave_write is ugly, change to WaveReader/WaveWriter?

----------
messages: 409036
nosy: a1025952421
priority: normal
severity: normal
status: open
title: rename wave.py class nane
type: performance
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46152>
_______________________________________

From report at bugs.python.org  Wed Dec 22 08:36:46 2021
From: report at bugs.python.org (=?utf-8?b?5riF6ICF6Ieq5riF?=)
Date: Wed, 22 Dec 2021 13:36:46 +0000
Subject: [issue46152] rename wave.py class nane
In-Reply-To: <1640180124.46.0.483716784216.issue46152@roundup.psfhosted.org>
Message-ID: <1640180206.84.0.764505850676.issue46152@roundup.psfhosted.org>


Change by ???? <a1025952421 at gmail.com>:


----------
components: +Library (Lib)

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46152>
_______________________________________

From report at bugs.python.org  Wed Dec 22 08:46:52 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 22 Dec 2021 13:46:52 +0000
Subject: [issue46152] rename wave.py class nane
In-Reply-To: <1640180124.46.0.483716784216.issue46152@roundup.psfhosted.org>
Message-ID: <1640180812.49.0.786967224322.issue46152@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

Backwards incompatible changes are out of scope.

----------
nosy: +christian.heimes
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46152>
_______________________________________

From report at bugs.python.org  Wed Dec 22 10:38:00 2021
From: report at bugs.python.org (Quentin Peter)
Date: Wed, 22 Dec 2021 15:38:00 +0000
Subject: [issue46153] closure fails in exec when locals is given
Message-ID: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>


New submission from Quentin Peter <qpeter at bluewin.ch>:

When both namespace arguments are given to exec, function definitions fail to capture closure. See below:
```
Python 3.8.6 (default, Oct  8 2020, 14:06:32) 
[Clang 12.0.0 (clang-1200.0.32.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exec("a = 1\ndef f(): return a\nprint(f())")
1
>>> exec("a = 1\ndef f(): return a\nprint(f())", {})
1
>>> exec("a = 1\ndef f(): return a\nprint(f())", {}, {})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 3, in <module>
  File "<string>", line 2, in f
NameError: name 'a' is not defined
>>> 
```

----------
messages: 409038
nosy: qpeter
priority: normal
severity: normal
status: open
title: closure fails in exec when locals is given
type: crash
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Wed Dec 22 11:29:33 2021
From: report at bugs.python.org (Quentin Peter)
Date: Wed, 22 Dec 2021 16:29:33 +0000
Subject: [issue46153] closure fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640190573.32.0.848980435653.issue46153@roundup.psfhosted.org>


Quentin Peter <qpeter at bluewin.ch> added the comment:

This might be related to https://bugs.python.org/issue41918

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Wed Dec 22 11:35:22 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Wed, 22 Dec 2021 16:35:22 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640190922.96.0.228794929531.issue46153@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

The function you use in exec is not a closure. The function:

    def f():
        return a

does not capture the top-level variable "a", it does a normal name lookup for a. You can check this yourself by looking at f.__closure__ which you will see is None. Or you can use the dis module to look at the disassembled bytecode.

To be a closure, you have to insert both the "a" and the `def f()` inside another function, and then run that:

code = """
def outer():
    a = 1
    def f():
        return a
    return f

f = outer()
print(f())
"""
exec(code, {}, {})


prints 1 as expected.

----------
components: +Interpreter Core
nosy: +steven.daprano
title: closure fails in exec when locals is given -> function fails in exec when locals is given
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Wed Dec 22 11:36:56 2021
From: report at bugs.python.org (Sophonet)
Date: Wed, 22 Dec 2021 16:36:56 +0000
Subject: [issue46154] MIMEMultipart enforces line endings also for binary
 subparts
Message-ID: <1640191016.18.0.569343304951.issue46154@roundup.psfhosted.org>


New submission from Sophonet <pythonbugtracker at kant.sophonet.de>:

For an activity with fastapi, I am preparing a Response object with the content of a email.mime.multipart MIMEMultipart object. Adhering to the standards (RFC), a MIMEMultipart response uses CRLF line endings (policy=HTTP). However, the binary attachment I am adding with MIMEApplication() and multipart.attach() in that case gets corrupted since all bytes corresponding to newlines (LF) are replaces with CRLF.

Am I doing something wrong or is this a bug that needs to be fixed?

What I would like to achieve is building a RFC-compliant MIMEMultipart payload in which the subparts do not get altered (in case of application/octet-stream).

Thanks, Sophonet

----------
components: email
messages: 409041
nosy: barry, r.david.murray, sophonet
priority: normal
severity: normal
status: open
title: MIMEMultipart enforces line endings also for binary subparts
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46154>
_______________________________________

From report at bugs.python.org  Wed Dec 22 11:45:39 2021
From: report at bugs.python.org (Quentin Peter)
Date: Wed, 22 Dec 2021 16:45:39 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640191539.39.0.785381430041.issue46153@roundup.psfhosted.org>


Quentin Peter <qpeter at bluewin.ch> added the comment:

The reason I am asking is that I am working on a debugger. The debugger stops on a frame which is inside a function. Let's say the locals is:
locals() == {"a": 1}
I now want to define a closure with exec. I might want to do something like:
exec("def f(): return a", globals(), locals())
But this doesn't work because of the issue I describe.I would expect f() to look for a in the locals().

Even more surprising is that if I use the second argument of exec, the code in the above comment starts to fail.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Wed Dec 22 11:58:09 2021
From: report at bugs.python.org (Sebastian Rittau)
Date: Wed, 22 Dec 2021 16:58:09 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1640192289.86.0.00399428334175.issue46006@roundup.psfhosted.org>


Change by Sebastian Rittau <srittau at rittau.biz>:


----------
nosy: +srittau

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Wed Dec 22 12:05:56 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Wed, 22 Dec 2021 17:05:56 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640192756.24.0.434073489729.issue46153@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

Here is the key phrase in the docs:

"If exec gets two separate objects as globals and locals, the code will be executed as if it were embedded in a class definition."

https://docs.python.org/3/library/functions.html#exec

And sure enough:

>>> class C:
...     a = 1
...     def f():
...             return a  # This looks for global a, not C.a
...     print(f())
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 5, in C
  File "<stdin>", line 4, in f
NameError: name 'a' is not defined

which is intentional behaviour. Functions defined inside a class do not have direct access to the variables inside the class. I thought there was a FAQ about this but I can't find it now.

So there is no bug here. By passing two distinct dicts as the globals and locals to exec, the interpreter treats the code as if it were being executed inside the body of a class statement. Both the a and the f get created in the locals dict, not the globals dict:

>>> g = {'__builtins__': None}
>>> l = {}
>>> exec("""a = 1
... def f():
...     return a
... """, g, l)
>>> g
{'__builtins__': None}
>>> l
{'a': 1, 'f': <function f at 0x7fa07b83e0e0>}

But when you call f(), it is looking for a in the globals dict.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Wed Dec 22 12:29:31 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Wed, 22 Dec 2021 17:29:31 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640194171.98.0.908164130549.issue46153@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

> I now want to define a closure with exec. I might want to do something like:
> exec("def f(): return a", globals(), locals())

That doesn't create a closure.


> I would expect f() to look for a in the locals().

I'm sorry, but your expectation that f() will look for a in the locals dict is not correct. That's not how name resolution in Python works. a is looked up as a global. You can't turn it into a local variable just by providing locals.

The names of the parameters are unfortunately confusing. The globals parameter is always the global namespace. But locals is *never* the function's local namespace. Nor is it a surrounding scope (nested functions), but it may be treated as a surrounding *class* scope.

I agree that the behaviour is surprising and complex, but if you work through the documentation carefully, it is behaving as designed.

What we need to realise is that locals describes the namespace where the *def statement* runs, not the namespace used by the body of the function. The function body's locals is always created when the function is called, it is inaccessible from outside the function, and it most certainly does not use the so-called "locals" parameter given to exec().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Wed Dec 22 12:49:50 2021
From: report at bugs.python.org (Quentin Peter)
Date: Wed, 22 Dec 2021 17:49:50 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640195390.47.0.508223546064.issue46153@roundup.psfhosted.org>


Quentin Peter <qpeter at bluewin.ch> added the comment:

Thank you for your explaination. Just to be sure, it is expected that:

exec("a = 1\ndef f(): return a\nprint(f())", {})

Runs successfully but

exec("a = 1\ndef f(): return a\nprint(f())", {}, {})

Doesn't?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Wed Dec 22 13:19:19 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Wed, 22 Dec 2021 18:19:19 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640195390.47.0.508223546064.issue46153@roundup.psfhosted.org>
Message-ID: <20211222181552.GP6272@ando.pearwood.info>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

"Expected" is a strong word. It took me a lot of careful reading of the 
documentation and experimentation to decide that, yes, I expect the 
second case to fail when the first case succeeds.

Which reminds me of a common anecdote from mathematics:

https://hsm.stackexchange.com/questions/7247/in-a-popular-anecdote-who-took-20-minutes-to-decide-that-a-thing-was-obvious

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Wed Dec 22 13:42:01 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 22 Dec 2021 18:42:01 +0000
Subject: [issue46155] Implement ExceptionGroup __new__
Message-ID: <1640198521.38.0.169703954813.issue46155@roundup.psfhosted.org>


New submission from Irit Katriel <iritkatriel at gmail.com>:

Currently ExceptionGroup inherits __new__ from BaseExceptionGroup, it should have its own __new__ implementation which raises a TypeError if any contained exception is not an Exception subclass.

----------
messages: 409047
nosy: gvanrossum, iritkatriel, yselivanov
priority: normal
severity: normal
status: open
title: Implement ExceptionGroup __new__
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46155>
_______________________________________

From report at bugs.python.org  Wed Dec 22 13:42:14 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 22 Dec 2021 18:42:14 +0000
Subject: [issue46155] Implement ExceptionGroup __new__
In-Reply-To: <1640198521.38.0.169703954813.issue46155@roundup.psfhosted.org>
Message-ID: <1640198534.62.0.283878675183.issue46155@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
assignee:  -> iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46155>
_______________________________________

From report at bugs.python.org  Wed Dec 22 13:43:48 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 22 Dec 2021 18:43:48 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640198628.62.0.166973126092.issue46148@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

I presume https://github.com/faster-cpython/ideas/discussions/194 is also relevant.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Wed Dec 22 13:48:31 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 22 Dec 2021 18:48:31 +0000
Subject: [issue46155] Implement ExceptionGroup __new__
In-Reply-To: <1640198521.38.0.169703954813.issue46155@roundup.psfhosted.org>
Message-ID: <1640198911.29.0.740208878197.issue46155@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

False alarm, this is already as it should be. Me needs a couple of weeks offline is all it is.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46155>
_______________________________________

From report at bugs.python.org  Wed Dec 22 14:02:14 2021
From: report at bugs.python.org (lkraav)
Date: Wed, 22 Dec 2021 19:02:14 +0000
Subject: [issue46156] 3.9.9: python built-in SSL module unable to connect to
 an IIS server (104 Connection reset by peer), but pyopenssl works fine
Message-ID: <1640199734.31.0.675782620401.issue46156@roundup.psfhosted.org>


New submission from lkraav <leho at kraav.com>:

Problems emerged when Requests phased out PyOpenSSL as their default backend https://github.com/psf/requests/blob/main/HISTORY.md#2240-2020-06-17

Suddenly my script wasn't able to connect to a remote server that it had been working with for years.

All connection attempts with Python built-in SSL module, with various certificate or TLS configurations tested, result in a blunt ConnectionResetError during `do_handshake()`

This leads me to believe Python SSL module is maybe incompatible [with some IIS thing] in some perhaps fixable way, because going with PyOpenSSL backend via `urllib3.contrib.pyopenssl.inject_into_urllib3()`

I can provide the real server name in a private email if any maintainers is interested in doing a debug run in some more thorough way that I'm unable to, let me know.

Example test:

```
$ ipython
Python 3.9.9 (main, Dec 21 2021, 17:21:49) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.29.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import ssl

In [2]: context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

In [3]: import socket

In [4]: context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT, verify_mode=ssl.CERT_NONE)

In [5]: conn = context.wrap_socket(socket.socket(socket.AF_INET), server_hostname="webapi.remote")

In [6]: conn.connect(("webapi.remote", 52100))
---------------------------------------------------------------------------
ConnectionResetError                      Traceback (most recent call last)
<ipython-input-6-f778062c5e51> in <module>
----> 1 conn.connect(("webapi.remote", 52100))

/usr/lib/python3.9/ssl.py in connect(self, addr)
   1340         """Connects to remote ADDR, and then wraps the connection in
   1341         an SSL channel."""
-> 1342         self._real_connect(addr, False)
   1343 
   1344     def connect_ex(self, addr):

/usr/lib/python3.9/ssl.py in _real_connect(self, addr, connect_ex)
   1331                 self._connected = True
   1332                 if self.do_handshake_on_connect:
-> 1333                     self.do_handshake()
   1334             return rc
   1335         except (OSError, ValueError):

/usr/lib/python3.9/ssl.py in do_handshake(self, block)
   1307             if timeout == 0.0 and block:
   1308                 self.settimeout(None)
-> 1309             self._sslobj.do_handshake()
   1310         finally:
   1311             self.settimeout(timeout)

ConnectionResetError: [Errno 104] Connection reset by peer
```

----------
assignee: christian.heimes
components: SSL
messages: 409050
nosy: christian.heimes, lkraav
priority: normal
severity: normal
status: open
title: 3.9.9: python built-in SSL module unable to connect to an IIS server (104 Connection reset by peer), but pyopenssl works fine
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46156>
_______________________________________

From report at bugs.python.org  Wed Dec 22 14:12:06 2021
From: report at bugs.python.org (Jordan Bonecutter)
Date: Wed, 22 Dec 2021 19:12:06 +0000
Subject: [issue46157] Typo in JSON documentation
Message-ID: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>


New submission from Jordan Bonecutter <jordanbonecutter at gmail.com>:

In this doc: https://docs.python.org/3/library/json.html#json.dump

The section on check_circular has a typo:

...a circular reference will result in an RecursionError => a RecursionError

----------
assignee: docs at python
components: Documentation
messages: 409051
nosy: docs at python, jordan-bonecutter
priority: normal
severity: normal
status: open
title: Typo in JSON documentation
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Wed Dec 22 14:20:37 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 22 Dec 2021 19:20:37 +0000
Subject: [issue45235] argparse does not preserve namespace with subparser
 defaults
In-Reply-To: <1631890734.12.0.701463144819.issue45235@roundup.psfhosted.org>
Message-ID: <1640200837.78.0.699461592596.issue45235@roundup.psfhosted.org>


Change by Guido van Rossum <guido at python.org>:


----------
nosy:  -gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45235>
_______________________________________

From report at bugs.python.org  Wed Dec 22 15:03:13 2021
From: report at bugs.python.org (Christian Heimes)
Date: Wed, 22 Dec 2021 20:03:13 +0000
Subject: [issue46156] 3.9.9: python built-in SSL module unable to connect to
 an IIS server (104 Connection reset by peer), but pyopenssl works fine
In-Reply-To: <1640199734.31.0.675782620401.issue46156@roundup.psfhosted.org>
Message-ID: <1640203393.3.0.328081429824.issue46156@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

I need more information to diagnose the issue. Could you please provide:

- your operating system and vendor/distribution
- your OpenSSL version (ssl.OPENSSL_VERSION)
- how did you install Python (self-compiled, pyenv, system Python)?
- how did you install PyOpenSSL and cryptography?
- the full output of: openssl s_client -connect webapi.remote:52100

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46156>
_______________________________________

From report at bugs.python.org  Wed Dec 22 17:08:50 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 22 Dec 2021 22:08:50 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640210930.5.0.320881596952.issue46148@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Wed Dec 22 17:21:25 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Wed, 22 Dec 2021 22:21:25 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
In-Reply-To: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>
Message-ID: <1640211685.64.0.182092739803.issue46146@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Serhiy: Matej Cepl (SUSE) asks about tk and Wayland switch.  Do you know anything?

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Wed Dec 22 17:28:28 2021
From: report at bugs.python.org (Christoph Feck)
Date: Wed, 22 Dec 2021 22:28:28 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
In-Reply-To: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>
Message-ID: <1640212108.3.0.0732953256823.issue46146@roundup.psfhosted.org>


Christoph Feck <cfeck at kde.org> added the comment:

(original bug reporter replying, thanks Matej for pointing me here!)

> what OS and font gives this error?

OS is openSUSE Tumbleweed 20211202, which has these versions:
- python 3.8.12
- tcl/tk 8.6.12
- fontconfig 2.13.1
- adobe-sourcecodepro-fonts 2.030

Previously installed (working) version was 20210114, which had:
- python 3.8.6
- tcl/tk 8.6.10
- fontconfig 2.13.1
- adobe-sourcecodepro-fonts 2.030

I am not sure if tk uses fontconfig or what other libraries tk uses to load fonts. I can give versions for all packages.

> Please run the following, also uploaded, with the offending font, replacing the name I used.

Result: 7 lines with "0" (zero)

(regardless of which font name I use, either installed, such as 'Cousine', 'Source Code Pro', or not installed, such as 'XYZ')

> print(tk.call('info', 'patchlevel'))

Result: "8.6.12"

> add the line 'r.mainloop()' at the end of the script

Result: A tiny window without text

I also tested Python version 3.9.9 on the updated system, which had the same issue.

----------
nosy: +cfeck -serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Wed Dec 22 19:15:29 2021
From: report at bugs.python.org (Eryk Sun)
Date: Thu, 23 Dec 2021 00:15:29 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640218529.25.0.509294318437.issue46153@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> If exec gets two separate objects as globals and locals, 
> the code will be executed as if it were embedded in a 
> class definition.

That's a misleading comparison because a class definition intentionally supports nonlocal closures, which exec() doesn't support and shouldn't support. For example:

    a = 1

    def f():
        a = 2
        class C:
            print(a)

    def g():
        a = 2
        class C:
            nonlocal a
            a = 3
        print(a)

    >>> f()
    2
    >>> g()
    3

exec() executes as module code. Using separate globals and locals mappings doesn't magically change how the code is compiled and executed to make it equivalent to a class definition. To understand the case of separate globals and locals, just remember that assigning to a variable by default makes it a local variable, unless it's declared as a global. Also, class and function definitions are implicitly an assignment, which by default will be local.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Wed Dec 22 19:55:34 2021
From: report at bugs.python.org (Thomas Grainger)
Date: Thu, 23 Dec 2021 00:55:34 +0000
Subject: [issue38415] @asynccontextmanager decorated functions are not
 callable like @contextmanager
In-Reply-To: <1570567549.28.0.993731185011.issue38415@roundup.psfhosted.org>
Message-ID: <1640220934.76.0.975664121649.issue38415@roundup.psfhosted.org>


Change by Thomas Grainger <tagrain at gmail.com>:


----------
nosy: +graingert
nosy_count: 3.0 -> 4.0
pull_requests: +28454
pull_request: https://github.com/python/cpython/pull/30233

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38415>
_______________________________________

From report at bugs.python.org  Wed Dec 22 19:57:23 2021
From: report at bugs.python.org (Thomas Grainger)
Date: Thu, 23 Dec 2021 00:57:23 +0000
Subject: [issue38415] @asynccontextmanager decorated functions are not
 callable like @contextmanager
In-Reply-To: <1570567549.28.0.993731185011.issue38415@roundup.psfhosted.org>
Message-ID: <1640221043.48.0.284882177306.issue38415@roundup.psfhosted.org>


Thomas Grainger <tagrain at gmail.com> added the comment:

actually it was already done in 13 months!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38415>
_______________________________________

From report at bugs.python.org  Wed Dec 22 19:58:43 2021
From: report at bugs.python.org (Aditya Kumar)
Date: Thu, 23 Dec 2021 00:58:43 +0000
Subject: [issue46158] Hardcoded sysroot path, to MacOSX11.sdk,
 in python sysconfig
Message-ID: <1640221123.65.0.639100397925.issue46158@roundup.psfhosted.org>


New submission from Aditya Kumar <akumar9 at snapchat.com>:

$ python3.9
Python 3.9.7 (default, Sep  3 2021, 12:37:55) 
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin

>>> import sysconfig
>>> cflags = sysconfig.get_config_var('CFLAGS')
>>> cflags
'-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk'


Because of hardcoded 'MacOSX11.sdk', installation of python dependencies that are built from source fails when MacOSX11.sdk is not present on the system.

----------
components: macOS
messages: 409057
nosy: akumar9, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Hardcoded sysroot path, to MacOSX11.sdk, in python sysconfig
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46158>
_______________________________________

From report at bugs.python.org  Wed Dec 22 20:06:51 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Thu, 23 Dec 2021 01:06:51 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1640221611.64.0.581158416731.issue46090@roundup.psfhosted.org>


Brandt Bucher <brandtbucher at gmail.com> added the comment:

After further discussion with the team this morning, we decided that the proposed "dummy chunk" workaround is unacceptable (the interpreter may end up trying free it when shutting down a thread).

Allowing the tstate->datastack_* members to be NULL is very easy on our end, and even simplifies thread creation a tad (since we can defer the allocation of the datastack until the first frame is actually needed).

I'll have a PR up in a few minutes.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Wed Dec 22 20:14:14 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Thu, 23 Dec 2021 01:14:14 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1640222054.02.0.355146559306.issue46090@roundup.psfhosted.org>


Change by Brandt Bucher <brandtbucher at gmail.com>:


----------
keywords: +patch
pull_requests: +28455
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30234

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Wed Dec 22 20:41:57 2021
From: report at bugs.python.org (Josh Rosenberg)
Date: Thu, 23 Dec 2021 01:41:57 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640223717.71.0.991909185756.issue46148@roundup.psfhosted.org>


Josh Rosenberg <shadowranger+python at gmail.com> added the comment:

Note: attrgetter could easily be made faster by migrating it to use vectorcall.

----------
nosy: +josh.r

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Wed Dec 22 20:48:03 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Thu, 23 Dec 2021 01:48:03 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640224083.97.0.524508205131.issue46148@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

> Note: attrgetter could easily be made faster by migrating it to use vectorcall.

Sure, though code that *doesn't* use attrgetter is usually easier to read -- attrgetter is rare enough in my experience that I usually have to look it up. So making attrgetter unnecessary in most cases would also be welcome.

(The exception is when you have many trivial pass-through properties, or when the attribute name is a variable to begin with.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Wed Dec 22 21:39:33 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Thu, 23 Dec 2021 02:39:33 +0000
Subject: [issue46146] Python IDLE fails to start (tk font issue?)
In-Reply-To: <1640129951.0.0.532007272156.issue46146@roundup.psfhosted.org>
Message-ID: <1640227173.08.0.0982423205615.issue46146@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
nosy: +epaine, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46146>
_______________________________________

From report at bugs.python.org  Wed Dec 22 22:07:26 2021
From: report at bugs.python.org (Paul Kehrer)
Date: Thu, 23 Dec 2021 03:07:26 +0000
Subject: [issue46159] Segfault
Message-ID: <1640228846.77.0.888301890747.issue46159@roundup.psfhosted.org>


New submission from Paul Kehrer <paul.l.kehrer at gmail.com>:

In Python 3.11a3 on Linux/x86_64 (failed to replicate on macOS, not attempted on Windows) the interpreter non-deterministically segfaults when running some code under coverage. This did not occur under 3.11a2. Looking at the backtrace from a core dump I see:

#0  _PyFrame_FastToLocalsWithError (frame=0x7fedf9e1f608) at Objects/frameobject.c:903
#1  0x00007fedfa15f593 in call_trampoline (tstate=0x55b767a44080, callback=0x7fedf8bbd9c0, 

This is the trace received if I use pure Python coverage (sys.settrace) while I get one inside coverage's ctracer if I use the native library. However, at the moment I don't believe the bug resides within coverage.

Since stack frame optimization has been a focus in 3.11 could something have changed that is causing issues with sys.settrace/PyEval_SetTrace?

I haven't managed to reduce this test case much but here's a somewhat messy dockerfile that can demonstrate it:

FROM ubuntu:focal
RUN apt-get update && apt-get install -y build-essential git cargo libffi-dev libssl-dev libsqlite3-dev zlib1g-dev curl
RUN curl -OL https://www.python.org/ftp/python/3.11.0/Python-3.11.0a3.tgz && \
    tar zxf Python-3.11* && \
    cd Python-3.11* && \
    ./configure --prefix=/opt && \
    make -j4 && make install
RUN /opt/bin/pip3 install tox && git clone https://github.com/pyca/cryptography
RUN cd cryptography && /opt/bin/tox -e py311

----------
messages: 409061
nosy: reaperhulk
priority: normal
severity: normal
status: open
title: Segfault
type: crash
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46159>
_______________________________________

From report at bugs.python.org  Wed Dec 22 22:07:56 2021
From: report at bugs.python.org (Paul Kehrer)
Date: Thu, 23 Dec 2021 03:07:56 +0000
Subject: [issue46159] Segfault when using trace functions in 3.11a3
In-Reply-To: <1640228846.77.0.888301890747.issue46159@roundup.psfhosted.org>
Message-ID: <1640228876.73.0.0486339632889.issue46159@roundup.psfhosted.org>


Change by Paul Kehrer <paul.l.kehrer at gmail.com>:


----------
title: Segfault -> Segfault when using trace functions in 3.11a3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46159>
_______________________________________

From report at bugs.python.org  Wed Dec 22 22:11:18 2021
From: report at bugs.python.org (Alex Gaynor)
Date: Thu, 23 Dec 2021 03:11:18 +0000
Subject: [issue46159] Segfault when using trace functions in 3.11a3
In-Reply-To: <1640228846.77.0.888301890747.issue46159@roundup.psfhosted.org>
Message-ID: <1640229078.88.0.446774417371.issue46159@roundup.psfhosted.org>


Change by Alex Gaynor <alex.gaynor at gmail.com>:


----------
components: +Interpreter Core
nosy: +Mark.Shannon, alex

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46159>
_______________________________________

From report at bugs.python.org  Wed Dec 22 22:36:19 2021
From: report at bugs.python.org (Tim Peters)
Date: Thu, 23 Dec 2021 03:36:19 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640230579.9.0.878353503678.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

No problem, Mark! I just prefer the shallowest approaches that are "good enough". If it's materially faster to use xors and a popcount instead, fine by me, just provided a comment points to a clue about why that works.

BTW, the later xor version was clearer to me at first glance than what it replaced, the older

    k.bit_count() + (n-k).bit_count() - n.bit_count()

The connection to "carries" is quite obscured there. Instead it's a straightforward coding of one statement of Kummer's theorem for multinomial coefficients:  the highest power of a prime p dividing the multinomial coefficient M(n; k1, k2, k3, ...), where sum(k_i)=n, is the sum of the digits of k1, k2, ... when expressed in base p, less n, then divided by p-1. So, for p=2 and M(n; k, n-k), that's exactly the same (and leaving out the no-op of dividing by p-1=1 in the p=2 case).

Which in turn is, I think, easiest derived not from thinking about carries, but from mechanically plugging in 3 instances of that the highest power of p dividing i! is i minus the sum of the digits of i in base p, then divided by p-1. That in turn is easy to show by considering what Legendre's formula does in each digit position (and "carries" don't come up in that line of proof).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 22 23:33:59 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Thu, 23 Dec 2021 04:33:59 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640218529.25.0.509294318437.issue46153@roundup.psfhosted.org>
Message-ID: <20211223043030.GQ6272@ando.pearwood.info>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

On Thu, Dec 23, 2021 at 12:15:29AM +0000, Eryk Sun wrote:
> 
> Eryk Sun <eryksun at gmail.com> added the comment:
> 
> > If exec gets two separate objects as globals and locals, 
> > the code will be executed as if it were embedded in a 
> > class definition.
> 
> That's a misleading comparison 

That's taken straight out of the documentation.

I don't think it is misleading, it is the opposite of misleading. Until 
I understood that exec with two different mapping objects as globals and 
locals behaves as if the code where embedded inside a class, I found the 
reported behaviour totally perplexing.

If you think it is wrong, how would you explain the observed behaviour, 
and how would you word the documentation?

> because a class definition intentionally supports nonlocal closures, 

I don't know what you mean by that. Classes are never closures. Only 
functions can be closures. (*Be* closures? *Have* a closure? The 
terminology is ambiguous.)

>>> def f():
...     a = 1
...     class C:
...             nonlocal a
...             a = 999
...     print(a)
...     return C
... 
>>> C = f()
999
>>> C.__closure__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'C' has no attribute '__closure__'. Did you mean: '__module__'?

I don't know what terminology is appropriate here, but "closure" is 
surely not it.

> which exec() doesn't support and shouldn't support. For example:
[snip examples]

Neither of those cases are relevant to the example here.

> exec() executes as module code. Using separate globals and locals 
> mappings doesn't magically change how the code is compiled and 
> executed to make it equivalent to a class definition.

Neither I nor the documentation said it was equivalent to a class 
definition. It is equivalent to code executed inside a class scope.

> To understand 
> the case of separate globals and locals, just remember that assigning 
> to a variable by default makes it a local variable, unless it's 
> declared as a global. Also, class and function definitions are 
> implicitly an assignment, which by default will be local.

Neither of those facts explain why the example code

    """a = 1
    def f():
        return a
    print(f())
    """

behaves differently when given two distinct dicts as the globals and 
locals parameters, versus all the other cases (no arguments provided, or 
one argument, or the same dict repeated twice).

Only the case where the provided globals and locals dicts are distinct 
behaves differently, and it behaves exactly the same as if you embedded 
that chunk of code inside a class definition and then executed it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Thu Dec 23 00:11:15 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Thu, 23 Dec 2021 05:11:15 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640236275.5.0.0709511095648.issue46148@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

I have https://github.com/python/cpython/pull/27828 open already to add vectorcall to itemgetter and attrgetter

----------
nosy: +Dennis Sweeney

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Thu Dec 23 00:16:40 2021
From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=)
Date: Thu, 23 Dec 2021 05:16:40 +0000
Subject: [issue46148] Optimize pathlib
In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org>
Message-ID: <1640236600.58.0.0401364469933.issue46148@roundup.psfhosted.org>


Change by Filipe La?ns <lains at riseup.net>:


----------
nosy: +FFY00

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46148>
_______________________________________

From report at bugs.python.org  Thu Dec 23 00:40:52 2021
From: report at bugs.python.org (Ned Deily)
Date: Thu, 23 Dec 2021 05:40:52 +0000
Subject: [issue46158] Hardcoded sysroot path, to MacOSX11.sdk,
 in python sysconfig
In-Reply-To: <1640221123.65.0.639100397925.issue46158@roundup.psfhosted.org>
Message-ID: <1640238052.96.0.0133790859169.issue46158@roundup.psfhosted.org>


Ned Deily <nad at python.org> added the comment:

Whether or not a macOS sysroot path is included in CFLAGS depends on how the Python build was configured and built. For instance, the macOS Python binaries provided on python.org do not include a sysroot path in CFLAGS; from the version info provided, you are using a Python from some other source. But, even if there is one there, there is code in the standard library helper function _osx_support.py to remove a sysroot from CFLAGS at runtime if the file is not present. That is used by distutils and *should* be being used by setuptools as well but it's possible that other build systems aren't using it or there might be a bug there. Can you give a reproducible test case showing a build failure including from where you got the Python 3.9.7 you are using?

https://github.com/python/cpython/blob/3.9/Lib/_osx_support.py#L331

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46158>
_______________________________________

From report at bugs.python.org  Thu Dec 23 00:47:33 2021
From: report at bugs.python.org (Eryk Sun)
Date: Thu, 23 Dec 2021 05:47:33 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640238453.32.0.417281119585.issue46153@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> That's taken straight out of the documentation.

Yes, but it's still a misleading comparison.

> Until I understood that exec with two different mapping objects as 
> globals and locals behaves as if the code where embedded inside a 
> class, I found the reported behaviour totally perplexing.

The basic execution model of Python is that a frame that executes with non-optimized locals -- in module and class definitions -- can use the same mapping for globals and locals. Indeed, that's how the interpreter executes modules. However, exec() is generalized to allow executing module code with separate globals and locals. 

Saying that code will be "executed as if it were embedded in a class definition" is correct only so far as the fact that globals and locals are different in this case. But it's also misleading because the code gets compiled as module-level code, not as class code.

It should be pretty obvious why the following fails:

    exec("a = 1\ndef f(): return a\nprint(f())", {}, {})

Assignment is local by default, unless otherwise declared. Function f() has no access to the local scope where `a` is defined because Python doesn't support closures over non-optimized locals, particularly because we emphatically do not want that behavior for class definitions. 

It should be equally clear why the following succeeds:

    exec("global a\na = 1\ndef f(): return a\nprint(f())", {}, {})

> because a class definition intentionally supports nonlocal closures, 
>
>I don't know what you mean by that. Classes are never closures. Only 
>functions can be closures.

I didn't say that a class can be a closure. That's never the case because a class uses non-optimized locals. But a class definition does support free variables that are bound to an enclosing scope. exec() does not support this, so the exact same code can execute differently in the context of a class definition.

> It is equivalent to code executed inside a class scope.

That depends on the code and the context. Please refer to my first example in comparison to the following:

    a = 1
    def f():
        a = 2
        exec('print(a)', globals(), {})

    >>> f()
    1

It's different behavior for print(a) because both exec() and compile(source, filename, 'exec') produce module code, not class code. The free variable `a` gets bound to the global scope for the exec() example, while for the class definition free variable `a` is bound to the local `a` in the frame of the function call.

To implement this different behavior, the code object for a class definition uses bytecode operations such as COPY_FREE_VARS and LOAD_CLASSDEREF, which are never used for module-level code. For example, from the original example, here's the class definition code:

    >>> dis.dis(f.__code__.co_consts[2])
                  0 COPY_FREE_VARS           1
                  2 LOAD_NAME                0 (__name__)
                  4 STORE_NAME               1 (__module__)
                  6 LOAD_CONST               0 ('f.<locals>.C')
                  8 STORE_NAME               2 (__qualname__)
    
      4          10 LOAD_NAME                3 (print)
                 12 LOAD_CLASSDEREF          0 (a)
                 14 CALL_FUNCTION            1
                 16 POP_TOP
                 18 LOAD_CONST               1 (None)
                 20 RETURN_VALUE

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Thu Dec 23 01:54:43 2021
From: report at bugs.python.org (Aditya Kumar)
Date: Thu, 23 Dec 2021 06:54:43 +0000
Subject: [issue46158] Hardcoded sysroot path, to MacOSX11.sdk,
 in python sysconfig
In-Reply-To: <1640221123.65.0.639100397925.issue46158@roundup.psfhosted.org>
Message-ID: <1640242483.88.0.559423452237.issue46158@roundup.psfhosted.org>


Aditya Kumar <akumar9 at snapchat.com> added the comment:

while installing pycryptodome, the package is built from source. Because no toolchain is found build fails with the following error. To work around this issue temporarily i created a symlink MacOSX11.1.sdk -> MacOSX.sdk but it is not possible to do this on all machines.


```
 Compiling with an SDK that doesn't seem to exist: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
  Please check your Xcode installation
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fPIC -I/var/folders/z1/xsh33bjd5d75qltcvxqy1gmm0000gp/T/tmpn5yvyhzp/tools/deps/include -I/var/folders/z1/xsh33bjd5d75qltcvxqy1gmm0000gp/T/tmpn5yvyhzp/tools/deps/include/ncursesw -I/var/folders/z1/xsh33bjd5d75qltcvxqy1gmm0000gp/T/tmpn5yvyhzp/tools/deps/include/uuid -Werror=unguarded-availability-new -g0 -DLTC_NO_ASM -DHAVE_UINT128 -DHAVE_CPUID_H -Isrc/ -I/Users/foo/.cache/_bazel_root/c7ac193d3d155e3d99f7f1334482aa2d/external/py39/dist/include/python3.9 -c src/MD2.c -o build/temp.macosx-10.9-x86_64-3.9/src/MD2.o
  clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' [-Wmissing-sysroot]
  In file included from src/MD2.c:28:
  src/pycrypto_common.h:58:10: fatal error: 'stdlib.h' file not found
  #include <stdlib.h>
           ^~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/clang'
~                                 
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46158>
_______________________________________

From report at bugs.python.org  Thu Dec 23 02:01:38 2021
From: report at bugs.python.org (dafu-wu)
Date: Thu, 23 Dec 2021 07:01:38 +0000
Subject: [issue46160] IPy->IPSet AttributeError: module 'collections' has no
 attribute 'MutableSet'
Message-ID: <1640242898.84.0.73991251786.issue46160@roundup.psfhosted.org>


New submission from dafu-wu <wucy4328 at gmail.com>:

Traceback (most recent call last):
  File "/Users/jackwu/zhiyun/mygit/webgw/manage.py", line 5, in <module>
    from webgw.settings import DEBUG
  File "/Users/jackwu/zhiyun/mygit/webgw/webgw/__init__.py", line 1, in <module>
    from .app import app
  File "/Users/jackwu/zhiyun/mygit/webgw/webgw/app.py", line 14, in <module>
    from .route_config import Route
  File "/Users/jackwu/zhiyun/mygit/webgw/webgw/route_config.py", line 4, in <module>
    from IPy import IP
  File "/Users/jackwu/zhiyun/mygit/webgw/venv/zhiyun/mygit/my_venv/lib/python3.10/site-packages/IPy.py", line 1025, in <module>
    class IPSet(collections.MutableSet):
AttributeError: module 'collections' has no attribute 'MutableSet'

I'm not sure it's a bug, could someone look at it for me?

----------
components: Library (Lib)
messages: 409068
nosy: dafu-wu
priority: normal
severity: normal
status: open
title: IPy->IPSet AttributeError: module 'collections' has no attribute 'MutableSet'
type: crash
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46160>
_______________________________________

From report at bugs.python.org  Thu Dec 23 02:03:06 2021
From: report at bugs.python.org (zq)
Date: Thu, 23 Dec 2021 07:03:06 +0000
Subject: [issue46161] Incorrect bytecpde compilation for class
Message-ID: <1640242986.51.0.0809941364169.issue46161@roundup.psfhosted.org>


New submission from zq <email2zq at gmail.com>:

Please refer to https://github.com/python/cpython/pull/30235

----------
messages: 409069
nosy: zq1997
priority: normal
pull_requests: 28456
severity: normal
status: open
title: Incorrect bytecpde compilation for class
type: compile error

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46161>
_______________________________________

From report at bugs.python.org  Thu Dec 23 03:19:09 2021
From: report at bugs.python.org (Rafael Fontenelle)
Date: Thu, 23 Dec 2021 08:19:09 +0000
Subject: [issue46130] Untranslatable link text in whatsnew/3.10
In-Reply-To: <1639909321.54.0.519282001136.issue46130@roundup.psfhosted.org>
Message-ID: <1640247549.65.0.138454870644.issue46130@roundup.psfhosted.org>


Change by Rafael Fontenelle <rffontenelle at gmail.com>:


----------
pull_requests: +28457
pull_request: https://github.com/python/cpython/pull/30236

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46130>
_______________________________________

From report at bugs.python.org  Thu Dec 23 03:34:01 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 23 Dec 2021 08:34:01 +0000
Subject: [issue46160] IPy->IPSet AttributeError: module 'collections' has no
 attribute 'MutableSet'
In-Reply-To: <1640242898.84.0.73991251786.issue46160@roundup.psfhosted.org>
Message-ID: <1640248441.98.0.269438971653.issue46160@roundup.psfhosted.org>


Kumar Aditya <rahuladitya303 at gmail.com> added the comment:

In Python 3.10 these deprecated aliases where removed from collections module.
To fix it you can change `collections.MutableSet` to `collections.abc.MutableSet`.

See https://docs.python.org/3/whatsnew/3.9.html#you-should-check-for-deprecationwarning-in-your-code

----------
nosy: +kumaraditya303

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46160>
_______________________________________

From report at bugs.python.org  Thu Dec 23 03:39:42 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 23 Dec 2021 08:39:42 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640248782.33.0.206416146143.issue46157@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 2.0 -> 3.0
pull_requests: +28458
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30237

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 03:42:51 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 23 Dec 2021 08:42:51 +0000
Subject: [issue46160] IPy->IPSet AttributeError: module 'collections' has no
 attribute 'MutableSet'
In-Reply-To: <1640242898.84.0.73991251786.issue46160@roundup.psfhosted.org>
Message-ID: <1640248971.65.0.090681809341.issue46160@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46160>
_______________________________________

From report at bugs.python.org  Thu Dec 23 03:43:01 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 23 Dec 2021 08:43:01 +0000
Subject: [issue26897] [doc] Clarify Popen stdin, stdout, stderr
In-Reply-To: <1462077137.11.0.0338937138998.issue26897@psf.upfronthosting.co.za>
Message-ID: <1640248981.78.0.791831316044.issue26897@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 3.0 -> 4.0
pull_requests: +28459
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30231

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26897>
_______________________________________

From report at bugs.python.org  Thu Dec 23 03:50:03 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 23 Dec 2021 08:50:03 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640249403.95.0.410715268656.issue46157@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

There are other similar errors:

Doc/library/json.rst:162:   will result in an :exc:`RecursionError` (or worse).
Doc/library/json.rst:435:   prevent an infinite recursion (which would cause an :exc:`RecursionError`).
Doc/library/tarfile.rst:66:   |                  | Raise an :exc:`FileExistsError` exception   |
Doc/library/tarfile.rst:70:   |                  | Raise an :exc:`FileExistsError` exception   |
Doc/library/tarfile.rst:74:   |                  | Raise an :exc:`FileExistsError` exception   |
Doc/library/tarfile.rst:78:   |                  | Raise an :exc:`FileExistsError` exception   |
Doc/library/poplib.rst:124:An :class:`POP3` instance has the following methods:
Doc/library/urllib.request.rst:1112:   implementation will raise an :exc:`ValueError` in that case.
Doc/library/enum.rst:180:      Returns the Enum member in *cls* matching *name*, or raises an :exc:`KeyError`::
Doc/library/os.rst:2084:   If *exist_ok* is ``False`` (the default), an :exc:`FileExistsError` is
Doc/library/os.rst:2360:   not empty, an :exc:`FileNotFoundError` or an :exc:`OSError` is raised
Doc/library/asyncio-eventloop.rst:900:      method, before Python 3.7 it returned an :class:`Future`.
Doc/library/asyncio-eventloop.rst:1085:   The *executor* argument should be an :class:`concurrent.futures.Executor`
Doc/whatsnew/3.9.rst:700::pep:`593` introduced an :data:`typing.Annotated` type to decorate existing

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 03:51:32 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 23 Dec 2021 08:51:32 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640249492.28.0.929893294024.issue46157@roundup.psfhosted.org>


Kumar Aditya <rahuladitya303 at gmail.com> added the comment:

I'll fix them all :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 03:53:06 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Thu, 23 Dec 2021 08:53:06 +0000
Subject: [issue46161] `class A(1, 2, 3, **d): pass` gives bad bytecode
In-Reply-To: <1640242986.51.0.0809941364169.issue46161@roundup.psfhosted.org>
Message-ID: <1640249586.33.0.776066099979.issue46161@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

Bisected to here:


13bc13960cc83dbd1cb5701d9a59ac9b9144b205 is the first bad commit
commit 13bc13960cc83dbd1cb5701d9a59ac9b9144b205
Author: Mark Shannon <mark at hotpy.org>
Date:   Thu Jan 23 09:25:17 2020 +0000

    bpo-39320: Handle unpacking of *values in compiler (GH-17984)

    * Add three new bytecodes: LIST_TO_TUPLE, LIST_EXTEND, SET_UPDATE. Use them to implement star unpacking expressions.

    * Remove four bytecodes BUILD_LIST_UNPACK, BUILD_TUPLE_UNPACK, BUILD_SET_UNPACK and  BUILD_TUPLE_UNPACK_WITH_CALL opcodes as they are now unused.

    * Update magic number and dis.rst for new bytecodes.



In debug mode, the following code gives fails a C-level assertion:

d = {'metaclass': type}
for _ in [1]:
    class A(1, 2, 3, **d):
        pass

Assertion failed: b->b_startdepth < 0 || b->b_startdepth == depth, file compile.c, line 6959

----------
nosy: +Dennis Sweeney, Mark.Shannon
title: Incorrect bytecpde compilation for class -> `class A(1, 2, 3, **d): pass` gives bad bytecode
type: compile error -> crash
versions: +Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46161>
_______________________________________

From report at bugs.python.org  Thu Dec 23 03:57:21 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 23 Dec 2021 08:57:21 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640249841.95.0.266246903711.issue46157@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Doc/using/cmdline.rst:474:   * ``-X warn_default_encoding`` issues a :class:`EncodingWarning` when the
Doc/c-api/init_config.rst:601:      If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper`
Doc/library/fractions.rst:90:      and *denominator*. :func:`math.gcd` always return a :class:`int` type.
Doc/library/asyncio-future.rst:122:      a :exc:`InvalidStateError` exception.
Doc/library/asyncio-future.rst:128:      Raises a :exc:`InvalidStateError` error if the Future is
Doc/library/asyncio-future.rst:135:      Raises a :exc:`InvalidStateError` error if the Future is
Doc/library/inspect.rst:402:      wrapped function is a :term:`asynchronous generator` function.
Doc/library/importlib.rst:881:       Returns a :class:`importlib.abc.Traversable` object for the loaded
Doc/library/importlib.rst:960:    Given a :class:`importlib.resources.abc.Traversable` object representing
Doc/library/pathlib.rst:721:   Return a :class:`os.stat_result` object containing information about this path, like :func:`os.stat`.
Doc/library/os.rst:3412:   Provide semaphore-like semantics for reads from a :func:`eventfd` file
Doc/library/asyncio-task.rst:947:      a :exc:`InvalidStateError` exception.
Doc/library/ast.rst:782:   be a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`.
Doc/library/ast.rst:1772:   must be wrapped in a :class:`Expr` node if the value sent back is not used.
Doc/library/asyncio-eventloop.rst:116:   is implicitly scheduled to run as a :class:`asyncio.Task`.
Doc/library/asyncio-eventloop.rst:357:   must return a :class:`asyncio.Future`-compatible object.
Doc/library/asyncio-eventloop.rst:1129:   This method returns a :class:`asyncio.Future` object.
Doc/glossary.rst:113:      An object created by a :term:`asynchronous generator` function.
Doc/reference/expressions.rst:216:clause may be used to iterate over a :term:`asynchronous iterator`.
Doc/reference/expressions.rst:710:   This method is normally called implicitly by a :keyword:`async for` loop.
Doc/whatsnew/3.7.rst:607:a :class:`importlib.abc.ResourceReader` instance to support this
Misc/NEWS.d/3.10.0a1.rst:825:``True``, ``False`` and ``None`` are used within a :class:`ast.Name` node.
Misc/NEWS.d/3.9.0a4.rst:407:always return a :class:`int` type. Previously, the GCD type depended on
Misc/NEWS.d/3.9.0b1.rst:394:When a :class:`asyncio.Task` is cancelled, the exception traceback now

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:11:33 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 23 Dec 2021 09:11:33 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640250693.0.0.900358418159.issue46157@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Thank you Kumar.

These errors were found with the following one-liners:

$ find -name '*.rst' -exec egrep --color -i '\ban +:[a-z:]+:`[qwrtpsdfghjklzxcvbnm]' '{}' +
$ find -name '*.rst' -exec egrep --color -i '\ba +:[a-z:]+:`[eyuioa]' '{}' +

They produce a lot of false positive results because of signatures and different reading of initial "y" and "u" (and "o", but there are no such cases here).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:14:04 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 23 Dec 2021 09:14:04 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640250844.65.0.253085334038.issue46157@roundup.psfhosted.org>


Kumar Aditya <rahuladitya303 at gmail.com> added the comment:

I have fixed most of them in the PR which I found correct, rest can be fixed later on.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:16:41 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 23 Dec 2021 09:16:41 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640251001.36.0.00891101256928.issue46157@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

And more errors can be found with:

$ find -name '*.rst' -exec egrep --color -i '\ban +[qwrtpsdfghjklzxcvbnm]' '{}' +
$ find -name '*.rst' -exec egrep --color -i '\ba +[eioa]' '{}' +

It is worth to check also:

$ find -name '*.rst' -exec egrep --color -i '\ban +[yu]' '{}' +
$ find -name '*.rst' -exec egrep --color -i '\ba +[yu]' '{}' +

Most of them should be correct, but there may be some new errors.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:16:53 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 23 Dec 2021 09:16:53 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640251013.05.0.629193771518.issue46157@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:17:47 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Thu, 23 Dec 2021 09:17:47 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640251067.49.0.270311785946.issue46157@roundup.psfhosted.org>


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:


New changeset 71ef0b4c2b77195bb1adc42602549284f7ee9566 by Kumar Aditya in branch 'main':
bpo-46157: fix typo in docs (GH-30237)
https://github.com/python/cpython/commit/71ef0b4c2b77195bb1adc42602549284f7ee9566


----------
nosy: +asvetlov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:37:03 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Thu, 23 Dec 2021 09:37:03 +0000
Subject: [issue46161] `class A(1, 2, 3, **d): pass` gives bad bytecode
In-Reply-To: <1640242986.51.0.0809941364169.issue46161@roundup.psfhosted.org>
Message-ID: <1640252223.74.0.665552401922.issue46161@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

I was trying to figure out how code like this could ever *not* raise an exception, and here is one case that runs to completion on 3.6--3.8, but it raises `TypeError: 'str' object is not callable` on 3.9--3.11.


class I(int):
    def __init__(*args, **kwargs): pass
    def __new__(*args, **kwargs): pass

d = {'metaclass': I}
class A(1, 2, 3, **d):
    pass

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46161>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:50:25 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 23 Dec 2021 09:50:25 +0000
Subject: [issue46162] Make `builtins.property` generic
Message-ID: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org>


New submission from Nikita Sobolev <mail at sobolevn.me>:

Original discussion in `typing` bug tracker: https://github.com/python/typing/issues/985

Short description:
- `property[GetType, SetType]` is required for us to remove a lot of special casing from type-checkers and just use the primitive type
- In runtime it copies the same behavior `list` / `dict` / other primitive types have under PEP585

Open questions:
- I think that it is too late to backport this in 3.10. Am I right?
- I hope that `from __future__ import annotations` will just work for this new change. Is there anything I should do in scope of this PR? Is my assumption about `__future__` import is even correct in this context? Do I need to test that it works with `__future__ annotations`?

----------
components: Library (Lib)
messages: 409080
nosy: gvanrossum, kj, sobolevn
priority: normal
severity: normal
status: open
title: Make `builtins.property` generic
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46162>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:54:02 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 23 Dec 2021 09:54:02 +0000
Subject: [issue46162] Make `builtins.property` generic
In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org>
Message-ID: <1640253242.44.0.441744146299.issue46162@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

One more question about PEP585: it does not specify `property`. Do we need to update it?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46162>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:55:14 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 23 Dec 2021 09:55:14 +0000
Subject: [issue46162] Make `builtins.property` generic
In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org>
Message-ID: <1640253314.97.0.558057964534.issue46162@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
pull_requests: +28460
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30238

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46162>
_______________________________________

From report at bugs.python.org  Thu Dec 23 04:55:32 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 23 Dec 2021 09:55:32 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640253332.92.0.958625116034.issue46157@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

PR 30237 introduced few new errors.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:05:59 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 23 Dec 2021 10:05:59 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640253959.38.0.157457597648.issue46157@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
pull_requests: +28461
pull_request: https://github.com/python/cpython/pull/30239

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:09:00 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Thu, 23 Dec 2021 10:09:00 +0000
Subject: [issue46157] Typo in JSON documentation
In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org>
Message-ID: <1640254140.18.0.430975485069.issue46157@roundup.psfhosted.org>


Kumar Aditya <rahuladitya303 at gmail.com> added the comment:

Fixed in a new PR @Serhiy

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46157>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:43:38 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 23 Dec 2021 10:43:38 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640256218.32.0.19130227031.issue46150@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
nosy: +sobolevn
nosy_count: 1.0 -> 2.0
pull_requests: +28462
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30240

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:49:47 2021
From: report at bugs.python.org (tongxiaoge)
Date: Thu, 23 Dec 2021 10:49:47 +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: <1640256587.23.0.718036549462.issue44598@roundup.psfhosted.org>


tongxiaoge <shixuantong at huawei.com> added the comment:

Today, I upgraded my version of Python3 to 3.9.9. When running test_ ssl,It has a segment error again. The version of OpenSSL I use is 1.1.1l, here is part of the stack information (the complete one is too long):

```
(gdb) bt
#0  0x0000ffff9e563830 in raise () from /lib64/libpthread.so.0
#1  <signal handler called>
#2  SSL_CTX_new (meth=0xffffffff9076cc30) at ssl/ssl_lib.c:3046
#3  0x0000ffff90799f38 in _ssl__SSLContext_impl () from /home/abuild/rpmbuild/BUILD/Python-3.9.9/build/debug/build/lib.linux-aarch64-3.9-pydebug/_ssl.cpython-39d-aarch64-linux-gnu.so
#4  0x0000ffff9079a3ac in _ssl__SSLContext () from /home/abuild/rpmbuild/BUILD/Python-3.9.9/build/debug/build/lib.linux-aarch64-3.9-pydebug/_ssl.cpython-39d-aarch64-linux-gnu.so
#5  0x0000ffff9e76d034 in tp_new_wrapper (self=0xffff907c0510 <PySSLContext_Type>, args=0xffff8ff4db90, kwds=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/typeobject.c:6247
#6  0x0000ffff9e748ae8 in cfunction_call (func=0xffff907d60b0, args=<optimized out>, kwargs=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/methodobject.c:543
#7  0x0000ffff9e6f18a8 in _PyObject_MakeTpCall (tstate=tstate at entry=0xaaadd8db33b0, callable=callable at entry=0xffff907d60b0, args=args at entry=0xffff8fcb45b0, nargs=nargs at entry=2, keywords=keywords at entry=0x0)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:191
#8  0x0000ffff9e670fd8 in _PyObject_VectorcallTstate (kwnames=<optimized out>, nargsf=<optimized out>, args=<optimized out>, callable=<optimized out>, tstate=<optimized out>)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:116
#9  PyObject_Vectorcall (kwnames=<optimized out>, nargsf=<optimized out>, args=<optimized out>, callable=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:127
#10 call_function (tstate=0xaaadd8db33b0, pp_stack=0xffffc5ebf240, oparg=<optimized out>, kwnames=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:5075
#11 0x0000ffff9e67a7e8 in _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:3487
#12 0x0000ffff9e80c52c in _PyEval_EvalFrame (throwflag=0, f=0xffff8fcb4410, tstate=0xffff903e2050) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/internal/pycore_ceval.h:40
#13 _PyEval_EvalCode (tstate=0xffff903e2050, _co=0xffff908b3110, globals=<optimized out>, locals=locals at entry=0x0, args=<optimized out>, argcount=281473096927744, kwnames=0xaaadd8db33b0,
    kwargs=0xffffc5ebf4a0, kwcount=281473343352832, kwstep=kwstep at entry=1, defs=0xffff903dd798, defcount=<optimized out>, kwdefs=0x0, closure=<optimized out>, name=<optimized out>, qualname=<optimized out>)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:4327
#14 0x0000ffff9e6f13f0 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>, kwnames=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:396
#15 0x0000ffff9e6f1c5c in _PyObject_FastCallDictTstate (tstate=tstate at entry=0xaaadd8db33b0, callable=callable at entry=0xffff903e2050, args=args at entry=0xffffc5ebf4a0, nargsf=nargsf at entry=2,
    kwargs=kwargs at entry=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:118
#16 0x0000ffff9e6f2004 in _PyObject_Call_Prepend (tstate=tstate at entry=0xaaadd8db33b0, callable=callable at entry=0xffff903e2050, obj=obj at entry=0xaaadd8f8fe00, args=args at entry=0xffff8ff4ca00,
    kwargs=kwargs at entry=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:489
#17 0x0000ffff9e769960 in slot_tp_new (type=0xaaadd8f8fe00, args=0xffff8ff4ca00, kwds=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/typeobject.c:6994
#18 0x0000ffff9e76d438 in type_call (type=0xaaadd8f8fe00, args=0xffff8ff4ca00, kwds=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/typeobject.c:1014
#19 0x0000ffff9e6f18a8 in _PyObject_MakeTpCall (tstate=tstate at entry=0xaaadd8db33b0, callable=callable at entry=0xaaadd8f8fe00, args=args at entry=0xffff8fcf7f08, nargs=nargs at entry=1, keywords=keywords at entry=0x0)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:191
#20 0x0000ffff9e670fd8 in _PyObject_VectorcallTstate (kwnames=<optimized out>, nargsf=<optimized out>, args=<optimized out>, callable=<optimized out>, tstate=<optimized out>)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:116
#21 PyObject_Vectorcall (kwnames=<optimized out>, nargsf=<optimized out>, args=<optimized out>, callable=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:127
#22 call_function (tstate=0xaaadd8db33b0, pp_stack=0xffffc5ebf730, oparg=<optimized out>, kwnames=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:5075
#23 0x0000ffff9e67a7e8 in _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:3487
#24 0x0000ffff9e66f024 in _PyEval_EvalFrame (throwflag=0, f=0xffff8fcf7d70, tstate=0xaaadd8db33b0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/internal/pycore_ceval.h:40
#25 function_code_fastcall (tstate=0xaaadd8db33b0, co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:330
#26 0x0000ffff9e6f55f0 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=1, args=0xffff8fcc6f48, callable=<optimized out>, tstate=<optimized out>)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:118
#27 method_vectorcall (method=<optimized out>, args=0xffff8fcc6f50, nargsf=<optimized out>, kwnames=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/classobject.c:53
#28 0x0000ffff9e670be4 in _PyObject_VectorcallTstate (kwnames=<optimized out>, nargsf=<optimized out>, args=<optimized out>, callable=<optimized out>, tstate=<optimized out>)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:118
#29 PyObject_Vectorcall (kwnames=<optimized out>, nargsf=<optimized out>, args=<optimized out>, callable=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:127
#30 call_function (tstate=0xaaadd8db33b0, pp_stack=0xffffc5ebfa28, oparg=<optimized out>, kwnames=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:5075
#31 0x0000ffff9e6783f0 in _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:3518
#32 0x0000ffff9e66f024 in _PyEval_EvalFrame (throwflag=0, f=0xffff8fcc6dd0, tstate=0xaaadd8db33b0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/internal/pycore_ceval.h:40
#33 function_code_fastcall (tstate=0xaaadd8db33b0, co=<optimized out>, args=<optimized out>, nargs=2, globals=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:330
#34 0x0000ffff9e670be4 in _PyObject_VectorcallTstate (kwnames=<optimized out>, nargsf=<optimized out>, args=<optimized out>, callable=<optimized out>, tstate=<optimized out>)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:118
#35 PyObject_Vectorcall (kwnames=<optimized out>, nargsf=<optimized out>, args=<optimized out>, callable=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:127
#36 call_function (tstate=0xaaadd8db33b0, pp_stack=0xffffc5ebfc70, oparg=<optimized out>, kwnames=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:5075
#37 0x0000ffff9e677238 in _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:3504
#38 0x0000ffff9e80c52c in _PyEval_EvalFrame (throwflag=0, f=0xaaadd90b9cd0, tstate=0xffff90e395f0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/internal/pycore_ceval.h:40
#39 _PyEval_EvalCode (tstate=0xffff90e395f0, _co=0xffff90e39380, globals=<optimized out>, locals=locals at entry=0x0, args=<optimized out>, argcount=281473093368048, kwnames=0xaaadd8db33b0, kwargs=0x1,
    kwcount=281473343352832, kwstep=kwstep at entry=1, defs=0xffff9106d108, defcount=<optimized out>, kwdefs=0x0, closure=<optimized out>, name=<optimized out>, qualname=<optimized out>)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:4327
#40 0x0000ffff9e6f13f0 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>, kwnames=<optimized out>) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:396
#41 0x0000ffff9e6f5468 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=2, args=0xffffc5ebfe70, callable=<optimized out>, tstate=<optimized out>)
    at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:118
```

The attachment is the OpenSSL source file I use.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:52:46 2021
From: report at bugs.python.org (tongxiaoge)
Date: Thu, 23 Dec 2021 10:52:46 +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: <1640256766.88.0.889776736175.issue44598@roundup.psfhosted.org>


tongxiaoge <shixuantong at huawei.com> added the comment:

Other information:
```
(gdb) f 2
#2  SSL_CTX_new (meth=0xffffffffe222cc30) at ssl/ssl_lib.c:3046
warning: Source file is more recent than executable.
3046        ret->session_timeout = meth->get_timeout();
(gdb) l
3041        ret->max_proto_version = 0;
3042        ret->mode = SSL_MODE_AUTO_RETRY;
3043        ret->session_cache_mode = SSL_SESS_CACHE_SERVER;
3044        ret->session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT;
3045        /* We take the system default. */
3046        ret->session_timeout = meth->get_timeout();
3047        ret->references = 1;
3048        ret->lock = CRYPTO_THREAD_lock_new();
3049        if (ret->lock == NULL) {
3050            SSLerr(SSL_F_SSL_CTX_NEW, ERR_R_MALLOC_FAILURE);
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:53:54 2021
From: report at bugs.python.org (tongxiaoge)
Date: Thu, 23 Dec 2021 10:53:54 +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: <1640256834.43.0.993404486278.issue44598@roundup.psfhosted.org>


Change by tongxiaoge <shixuantong at huawei.com>:


Added file: https://bugs.python.org/file50508/Makefile.certificate

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:54:03 2021
From: report at bugs.python.org (tongxiaoge)
Date: Thu, 23 Dec 2021 10:54:03 +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: <1640256843.47.0.825393396349.issue44598@roundup.psfhosted.org>


Change by tongxiaoge <shixuantong at huawei.com>:


Added file: https://bugs.python.org/file50509/openssl.spec

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:54:18 2021
From: report at bugs.python.org (tongxiaoge)
Date: Thu, 23 Dec 2021 10:54:18 +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: <1640256858.37.0.90709848034.issue44598@roundup.psfhosted.org>


Change by tongxiaoge <shixuantong at huawei.com>:


----------
keywords: +patch
Added file: https://bugs.python.org/file50510/openssl-1.1.1-fips.patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:54:28 2021
From: report at bugs.python.org (tongxiaoge)
Date: Thu, 23 Dec 2021 10:54:28 +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: <1640256868.6.0.537818220107.issue44598@roundup.psfhosted.org>


Change by tongxiaoge <shixuantong at huawei.com>:


Added file: https://bugs.python.org/file50511/openssl-1.1.1-build.patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Thu Dec 23 05:59:42 2021
From: report at bugs.python.org (tongxiaoge)
Date: Thu, 23 Dec 2021 10:59:42 +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: <1640257182.36.0.756964734771.issue44598@roundup.psfhosted.org>


tongxiaoge <shixuantong at huawei.com> added the comment:

I want to know whether this is an OpenSSL problem or a python 3 problem, and how to fix it? Thanks.
(The OpenSSL source package is large and has not been uploaded successfully. We can download it from the OpenSSL official website)

----------
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Thu Dec 23 06:10:40 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 23 Dec 2021 11:10:40 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640257840.1.0.676227007412.issue43424@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Hm, looks like `.name` does not exist for `MacOSXOSAScript`:

```
Python 3.11.0a3+ (heads/main-dirty:71ef0b4c2b, Dec 23 2021, 12:38:09) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.get()
<webbrowser.MacOSXOSAScript object at 0x105a75500>
>>> a = webbrowser.get()
>>> dir(a)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_name', 'args', 'open', 'open_new', 'open_new_tab']
>>> a.name
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'MacOSXOSAScript' object has no attribute 'name'. Did you mean: '_name'?
```

This happens because `MacOSXOSAScript` does not call `super().__init__()` in any way, nor it defines `name` and `basename` attributes.

It has this API for 12 years now: https://github.com/python/cpython/commit/4d39f6e09a5c0a0e09eb51d678bacd1adaa3f2ca

So, I see two possible ways to solve this:
1. Ensure all subtypes of `BaseBrowser` to have `name` and `basename` (because they are defined in `BaseBrowser`) and document them
2. Add a code comment that they are just implementation details and not a part of the public API

----------
nosy: +sobolevn

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Thu Dec 23 06:25:06 2021
From: report at bugs.python.org (tongxiaoge)
Date: Thu, 23 Dec 2021 11:25:06 +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: <1640258706.14.0.000607399540265.issue44598@roundup.psfhosted.org>


Change by tongxiaoge <shixuantong at huawei.com>:


----------
nosy:  -christian.heimes, sxt1001, thatiparthy, vstinner
Added file: https://bugs.python.org/file50512/python3.spec

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Thu Dec 23 06:41:02 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 23 Dec 2021 11:41:02 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640259662.83.0.114269381428.issue43424@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
pull_requests: +28463
pull_request: https://github.com/python/cpython/pull/30241

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Thu Dec 23 07:00:07 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 23 Dec 2021 12:00:07 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640260807.45.0.65577544665.issue43424@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
type: security -> enhancement
versions: +Python 3.11 -Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Thu Dec 23 08:12:46 2021
From: report at bugs.python.org (dmitry-bychkov)
Date: Thu, 23 Dec 2021 13:12:46 +0000
Subject: [issue46163] multiprocessing logger deadlocks if used with
 logging.handlers.QueueHandler
Message-ID: <1640265166.09.0.322257892524.issue46163@roundup.psfhosted.org>


New submission from dmitry-bychkov <iamdbychkov at gmail.com>:

Hello!
If you use multiprocessing logger with logging.handlers.QueueHandler it will deadlock on first attempt at logging.

First attempt will initialize queue's background thread, which uses multiprocessing logger itself which will result in something what looks like deadlock :) 

There are workarounds and I'm not sure if it can be classified as a bug, prehaps a little note in documentation about this behaviour will do? 

I've attached example script.

----------
files: logger_deadlock.py
messages: 409088
nosy: iamdbychkov
priority: normal
severity: normal
status: open
title: multiprocessing logger deadlocks if used with logging.handlers.QueueHandler
versions: Python 3.9
Added file: https://bugs.python.org/file50513/logger_deadlock.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46163>
_______________________________________

From report at bugs.python.org  Thu Dec 23 08:17:48 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Thu, 23 Dec 2021 13:17:48 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640238453.32.0.417281119585.issue46153@roundup.psfhosted.org>
Message-ID: <20211223131418.GR6272@ando.pearwood.info>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

On Thu, Dec 23, 2021 at 05:47:33AM +0000, Eryk Sun wrote:
> 
> Eryk Sun <eryksun at gmail.com> added the comment:
> 
> > That's taken straight out of the documentation.
> 
> Yes, but it's still a misleading comparison.

I asked how you would re-word the docs, but you haven't responded.

The description given in the docs exactly explains the observed 
behaviour. Without recognising that, the observed behaviour is 
perplexing to the point that it suggested to at least one person that it 
was a bug in the language.

If you're not prepared to suggest an improvement to the documentation, 
then I don't think that this conversation is going anywhere and maybe 
we should just let the discussion die.

But for the record, in case you, or anyone else, does want to continue 
the discussion in the hope of reaching additional insight to the 
problem, my further comments are below.

[...]
> Saying that code will be "executed as if it were embedded in a class 
> definition" is correct only so far as the fact that globals and locals 
> are different in this case. 

So it's correct in all the ways that matter:

- different globals and locals;
- and the behaviour is different.

and incorrect in no ways at all (see below). I don't think that supports 
a charge of "misleading".

The bottom line here is that the description in the docs that you call 
"misleading" did not mislead me, but lead me directly to the solution of 
why the code behaved as it did, and why that was the intentional 
behaviour rather than a bug.

So un-misleading, if you will.

> But it's also misleading because the code 
> gets compiled as module-level code, not as class code.

Obviously there is no actual "class code" involved. That is why the 
description says that it is executed *as if* it were embedded inside a 
class statement, rather than by having an actual class statement added 
to your source string.

I don't understand your comment about "compiled as module-level ... not 
as class code". What's class code? (Aside from the actual class 
statement itself, which is a red herring.)

If you look at the disassembly of the following two snippets:

    dis.dis("""
    a = 1
    def f():
        return a
    print(f())
    """)

and 

    dis.dis("""
    class C:
        a = 1
        def f():
            return a
        print(f())
    """)

the generated bytecode for the lines `a = 1` etc is the same, putting 
aside the code for the actual class statement part. You get the same 
code for `a = 1`

    LOAD_CONST                (1)
    STORE_NAME                (a)

the same code for both the body of the function:

    LOAD_GLOBAL               (a)
    RETURN_VALUE

and the `def f()` statement:

    LOAD_CONST                (<code object ...>)
    LOAD_CONST                ('f')
    MAKE_FUNCTION
    STORE_NAME

and the same code for the call to print:

     LOAD_NAME                (print)
     LOAD_NAME                (f)
     CALL_FUNCTION
     CALL_FUNCTION
     POP_TOP
     LOAD_CONST               (None)
     RETURN_VALUE

Obviously the offsets and locations of constants will be different, but 
aside from those incidental details, the code generated for the block is 
the same whether it is inside a class statement or not.

So I don't understand what you consider to be the difference between 
code compiled at module-level and code compiled at class-level. They 
seem to me to be identical (aside from the incidentals).

The visible difference in behaviour relates to the *execution* of the 
code, not to whether (quote):

"the code gets compiled as module-level code [or] as class code".

There is no distinct "class code". The difference in behaviour is in the 
execution, not to the compilation.

> It should be pretty obvious why the following fails:
> 
>     exec("a = 1\ndef f(): return a\nprint(f())", {}, {})

Yes, it is obvious why it fails, in the same sense as the maths joke 
about the professor who stares at the equations on the blackboard for 
twenty minutes before exclaiming "Yes, it is obvious!".

It takes a sophisticated understanding of Python's scoping rules to 
understand why that fails when the other cases succeed.

> Assignment is local by default, unless otherwise declared. Function 
> f() has no access to the local scope where `a` is defined

With the same dict used for globals and locals, execution runs the 
statements `a = 1`, the `def f` and the print in the same scope, which 
is *both* global and local. This is what happens when you run code at 
the module level: locals is globals.

Consequently, the statement `a = 1` assigns a to the local namespace, 
which is the global namespace. And the call to f() retrieves a from the 
global namespace, which is the local namespace.

This is what happens when you execute the code at module-level.

With different dicts, the three statements still run in the same scope, 
the local scope, but the call to f() attempts to retrieve a from the 
global namespace, which is distinct from local namespace.

This is what happens when you execute code inside a class body, just as 
the docs suggest.

> > because a class definition intentionally supports nonlocal closures, 
> >
> >I don't know what you mean by that. Classes are never closures. Only 
> >functions can be closures.
> 
> I didn't say that a class can be a closure. That's never the case 
> because a class uses non-optimized locals. But a class definition does 
> support free variables that are bound to an enclosing scope.

Right -- but that's not the same as a closure.

A class with free variables bound to an enclosing scope is not a 
closure, nor is it a class with a closure. I don't think we have 
terminology for it, other than the mouthful "a class with free variables 
bound to an enclosing scope", or perhaps "a class with nonlocal 
variables".

In any case, whatever we want to call it, it has nothing to do with this 
bug report. Its a distraction.

> To implement this different behavior, the code object for a class 
> definition uses bytecode operations such as COPY_FREE_VARS and 
> LOAD_CLASSDEREF, which are never used for module-level code. For 
> example, from the original example, here's the class definition code:

None of this is relevant to the original examples in this bug report, 
which does not involve a class statement, let alone a class statement 
involving nonlocals.

You seem to be arguing that a description in the docs is "misleading", 
not because it misleads, but because it don't describe a situation which 
has nothing to do with the situation that the docs are describing.

Anyway, if anyone is still reading this far, I think that the 
documentation is correct, but if anyone wants to suggest an improvement 
which doesn't over-complicate the description by involving scenarios 
which are irrelevant to exec(), please do so.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Thu Dec 23 09:07:54 2021
From: report at bugs.python.org (Quentin Peter)
Date: Thu, 23 Dec 2021 14:07:54 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640268474.81.0.0668232231038.issue46153@roundup.psfhosted.org>


Quentin Peter <qpeter at bluewin.ch> added the comment:

Maybe a note could be added to https://docs.python.org/3/library/functions.html#exec

Something along the lines of:

Note: If exec gets two separate objects as `globals` and `locals`, the code will not be executed as if it were embedded in a function definition. For example, any function or comprehension defined at the top level will not have access to the `locals` scope.

PS: It would be nice for my usecase to have a way around this, maybe a flag in `compile` or `exec` that would produce "function code" instead of "module code". My workaround for this problem consist in wrapping my code in a function definition.

I think this means https://bugs.python.org/issue41918 should be closed as well?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Thu Dec 23 09:16:56 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 23 Dec 2021 14:16:56 +0000
Subject: [issue46055] Speed up binary shifting operators
In-Reply-To: <1639287218.01.0.821172330488.issue46055@roundup.psfhosted.org>
Message-ID: <1640269016.52.0.487998144716.issue46055@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
nosy: +mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46055>
_______________________________________

From report at bugs.python.org  Thu Dec 23 09:22:03 2021
From: report at bugs.python.org (Billy)
Date: Thu, 23 Dec 2021 14:22:03 +0000
Subject: [issue46164] New `both()` operator for matching multiple variables to
 one
Message-ID: <1640269323.26.0.968410653987.issue46164@roundup.psfhosted.org>


New submission from Billy <billydevbusiness at gmail.com>:

A new `both()` operator for matching multiple variables to one at the same time.

Currently,
```py
if a == 1 and b == 1:
    ...
```

With a `both()` operator, it can be done as follows (concept):
```py
if both(a, b) == 1:
    ...
```

Why? 
-> With the increasing number of variables, it may be hard to compare each of them at once, hence this operator can help a lot in such situations. 
Of course, using lists appropriately can solve this issue easily, but a general-direct method for achieving this would be a lot helpful. This also makes the code more simplistic and easily readable and understandable.



*Sorry for the bad formatting if markdown is not supported for this comment section, I couldn't find it mentioned anywhere in the python developer's guide. Hence I'm assuming it is supported since it's a common and highly needed feature nowadays.

----------
messages: 409091
nosy: billyeatcookies
priority: normal
severity: normal
status: open
title: New `both()` operator for matching multiple variables to one
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46164>
_______________________________________

From report at bugs.python.org  Thu Dec 23 09:28:33 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Thu, 23 Dec 2021 14:28:33 +0000
Subject: [issue46164] New `both()` operator for matching multiple variables to
 one
In-Reply-To: <1640269323.26.0.968410653987.issue46164@roundup.psfhosted.org>
Message-ID: <1640269713.64.0.655262302306.issue46164@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

I think this is a rarely needed operation. I looked through a few tens of thousand lines of my code and couldn't find anywhere it would be used.

Plus, you could write it yourself, so I don't see the advantage of it being part of the language or standard library.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46164>
_______________________________________

From report at bugs.python.org  Thu Dec 23 09:29:12 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 23 Dec 2021 14:29:12 +0000
Subject: [issue46055] Speed up binary shifting operators
In-Reply-To: <1639287218.01.0.821172330488.issue46055@roundup.psfhosted.org>
Message-ID: <1640269752.97.0.770136424453.issue46055@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
keywords: +patch
pull_requests: +28464
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30243

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46055>
_______________________________________

From report at bugs.python.org  Thu Dec 23 10:04:27 2021
From: report at bugs.python.org (Eryk Sun)
Date: Thu, 23 Dec 2021 15:04:27 +0000
Subject: [issue46153] function fails in exec when locals is given
In-Reply-To: <1640187480.74.0.946037624707.issue46153@roundup.psfhosted.org>
Message-ID: <1640271867.48.0.436788691542.issue46153@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> You seem to be arguing that a description in the docs is "misleading", 
> not because it misleads, but because it don't describe a situation 
> which has nothing to do with the situation that the docs are describing.

To me it's misleading to say "the code will be executed as if it were embedded in a class definition" because that is not always the case. The example with print(a) shows that. One can take it another level to compare function definitions in a class definition compared to exec(). A function defined in an exec() is not compiled to bind its free variables to the outer lexical scope in the context of the exec() call, while a function defined in a class definition does. For example:

class:

    def f():
       a = 2
       class C:
           def g(): print(a)
       return C.g

    >>> a = 1
    >>> g = f()
    >>> g()
    2

exec():

    def f():
       a = 2
       l = {}
       exec('def g(): print(a)', globals(), l)
       return l['g']

    >>> a = 1
    >>> g = f()
    >>> g()
    1

You asked what I would say in its place, but I don't have a simple answer that can take the place of the one-liner in the docs. Here's something, but I'm sure you won't be happy with it:

The code will be executed in a manner that's similar to a class definition with regard to the use of separate locals and globals scopes. However, there can be significant differences in certain contexts with regard to how the same code is compiled for an exec() call compared to a class definition. In particular, code in a class definition is compiled to bind its free variables to the lexical scopes of outer function calls in the defining context, which isn't possible with exec(). Also, the top-level code in a class definition supports `nonlocal` declarations, which is a syntax error with exec().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46153>
_______________________________________

From report at bugs.python.org  Thu Dec 23 10:24:17 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 23 Dec 2021 15:24:17 +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: <1640273057.93.0.0879047462029.issue44598@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

You are using a OpenSSL build with custom, additional patches and your code is crashing somewhere in OpenSSL. It is likely that your patches are causing issue. I'm not going to provide free service for custom builds.

----------
assignee: christian.heimes -> 
nosy: +christian.heimes
resolution:  -> third party
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Thu Dec 23 10:32:13 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 23 Dec 2021 15:32:13 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640273533.26.0.74116741595.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

Raymond: how do you want to proceed on this? Should I code up my suggestion in a PR, or are you already working on it?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 23 10:35:30 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Thu, 23 Dec 2021 15:35:30 +0000
Subject: [issue46164] New `both()` operator for matching multiple variables to
 one
In-Reply-To: <1640269323.26.0.968410653987.issue46164@roundup.psfhosted.org>
Message-ID: <1640273730.98.0.257228495893.issue46164@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

Just use

    if a == b == 1:

Comparisons can be chained arbitrarily.

https://docs.python.org/3/reference/expressions.html#comparisons

----------
nosy: +steven.daprano
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46164>
_______________________________________

From report at bugs.python.org  Thu Dec 23 12:02:50 2021
From: report at bugs.python.org (dafu-wu)
Date: Thu, 23 Dec 2021 17:02:50 +0000
Subject: [issue46160] IPy->IPSet AttributeError: module 'collections' has no
 attribute 'MutableSet'
In-Reply-To: <1640242898.84.0.73991251786.issue46160@roundup.psfhosted.org>
Message-ID: <1640278970.05.0.775118563608.issue46160@roundup.psfhosted.org>


dafu-wu <wucy4328 at gmail.com> added the comment:

Many thanks?You help me to solve the problem?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46160>
_______________________________________

From report at bugs.python.org  Thu Dec 23 13:53:27 2021
From: report at bugs.python.org (Tomasz Kloczko)
Date: Thu, 23 Dec 2021 18:53:27 +0000
Subject: [issue46165] pythin is core dumping with SIGILL in pytest of the
 jupyter-server
Message-ID: <1640285607.3.0.100411347335.issue46165@roundup.psfhosted.org>


New submission from Tomasz Kloczko <kloczko.tomasz at gmail.com>:

I;m packaging python modules as rpm packages and just found that package jupyter-server (1.13.1) when pytest was executed python crashed with call trace

+ /usr/bin/pytest -ra jupyter_server
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/jupyter_server-1.13.1, configfile: pyproject.toml
plugins: cov-3.0.0, console-scripts-1.2.0, mock-3.6.1, tornasync-0.6.0.post2, anyio-3.3.4
collected 581 items

jupyter_server/auth/security.py Fatal Python error: Illegal instruction

Current thread 0x00007f480bd08740 (most recent call first):
  File "/usr/lib64/python3.8/site-packages/argon2/low_level.py", line 112 in hash_secret
  File "/usr/lib64/python3.8/site-packages/argon2/_password_hasher.py", line 133 in hash
  File "/home/tkloczko/rpmbuild/BUILD/jupyter_server-1.13.1/jupyter_server/auth/security.py", line 73 in passwd
  File "<doctest jupyter_server.auth.security.passwd[0]>", line 1 in <module>
  File "/usr/lib64/python3.8/doctest.py", line 1336 in __run
  File "/usr/lib64/python3.8/doctest.py", line 1483 in run
  File "/usr/lib64/python3.8/doctest.py", line 1844 in run
  File "/usr/lib/python3.8/site-packages/_pytest/doctest.py", line 287 in runtest
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 162 in pytest_runtest_call
  File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 255 in <lambda>
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 311 in from_call
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 254 in call_runtest_hook
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 215 in call_and_report
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 126 in runtestprotocol
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 109 in pytest_runtest_protocol
  File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 348 in pytest_runtestloop
  File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 323 in _main
  File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 269 in wrap_session
  File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 316 in pytest_cmdline_main
  File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 162 in main
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 185 in console_main
  File "/usr/bin/pytest", line 33 in <module>
/var/tmp/rpm-tmp.WmHwan: line 49: 2150294 Illegal instruction     (core dumped) PATH="/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-server-1.13.1-2.fc35.x86_64/usr/bin:$PATH" PYTHONDONTWRITEBYTECODE=1 SETUPTOOLS_SCM_PRETEND_VERSION=1.13.1 PYTHONPATH="${PYTHONPATH:-/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-server-1.13.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-server-1.13.1-2.fc35.x86_64/usr/lib/python3.8/site-packages}" /usr/bin/pytest -ra jupyter_server

I'm using my own Linux distribution (which I';m supporting for may clients) and I'm still using python 3.8.12.

Here is list of modules installed in build env
[tkloczko at ss-desktop SPECS]$ pip list
Package                       Version
----------------------------- -------------------
alabaster                     0.7.12
anyio                         3.3.4
appdirs                       1.4.4
argon2-cffi                   21.1.0
attrs                         21.2.0
Babel                         2.9.1
backcall                      0.2.0
bleach                        4.0.0
build                         0.7.0
cffi                          1.15.0
chardet                       4.0.0
charset-normalizer            2.0.9
coverage                      6.2
cycler                        0.11.0
dbus-python                   1.2.18
decorator                     5.1.0
defusedxml                    0.7.1
distro                        1.6.0
docutils                      0.17.1
entrypoints                   0.3
extras                        1.0.0
fixtures                      3.0.0
fonttools                     4.28.5
gpg                           1.16.0-unknown
html5lib                      1.1
idna                          3.3
imagesize                     1.2.0
importlib-metadata            4.10.0
importlib-resources           5.4.0
iniconfig                     1.1.1
ipykernel                     6.6.0
ipython                       7.30.1
ipython_genutils              0.2.0
ipywidgets                    7.6.4
jedi                          0.18.1
Jinja2                        3.0.3
jsonschema                    4.3.2
jupyter-client                7.1.0
jupyter-core                  4.9.1
jupyterlab-pygments           0.1.2
kiwisolver                    1.3.2
libcomps                      0.1.18
lxml                          4.7.1
m2r                           0.2.1
Mako                          1.1.6.dev0
Markdown                      3.3.6
markdown-it-py                1.1.0
MarkupSafe                    2.0.1
matplotlib                    3.5.1
matplotlib-inline             0.1.2
mdit-py-plugins               0.3.0
meson                         0.60.2
mistune                       0.8.4
mock                          4.0.3
myst-parser                   0.16.1
nbclient                      0.5.9
nbconvert                     6.1.0
nbformat                      5.1.3
nest-asyncio                  1.5.1
notebook                      6.4.2
numpy                         1.21.4
olefile                       0.46
packaging                     21.3
pandocfilters                 1.5.0
parso                         0.8.3
pbr                           5.6.0
pep517                        0.12.0
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        8.4.0
pip                           21.3.1
pluggy                        1.0.0
ply                           3.11
prometheus-client             0.12.0
prompt-toolkit                3.0.24
ptyprocess                    0.7.0
py                            1.11.0
pycparser                     2.21
Pygments                      2.10.0
PyGObject                     3.42.0
pyparsing                     3.0.6
pyrsistent                    0.18.0
pytest                        6.2.5
pytest-console-scripts        1.2.0
pytest-cov                    3.0.0
pytest-mock                   3.6.1
pytest-tornasync              0.6.0.post2
python-dateutil               2.8.2
pytz                          2021.1
PyYAML                        6.0
pyzmq                         22.2.1
requests                      2.26.0
requests-unixsocket           0.2.0
rpm                           4.17.0
scour                         0.38.2
Send2Trash                    1.8.0
setuptools                    60.0.0.post20211220
six                           1.16.0
smartypants                   2.0.1
sniffio                       1.2.0
snowballstemmer               2.1.0
Sphinx                        4.3.2.dev20211220
sphinxcontrib-applehelp       1.0.2.dev20210802
sphinxcontrib-devhelp         1.0.2.dev20210801
sphinxcontrib_github_alt      1.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-httpdomain      1.7.0
sphinxcontrib-jsmath          1.0.1.dev20210801
sphinxcontrib-openapi         0.7.0
sphinxcontrib-qthelp          1.0.3.dev20210824
sphinxcontrib-serializinghtml 1.1.5
sphinxemoji                   0.1.9
terminado                     0.12.1
testpath                      0.5.0
testtools                     2.5.0
toml                          0.10.2
tomli                         2.0.0
tornado                       6.1
traitlets                     5.1.1
typogrify                     2.0.7
urllib3                       1.26.7
wcwidth                       0.2.5
webencodings                  0.5.1
websocket-client              1.2.3
wheel                         0.37.0
widgetsnbextension            3.5.1
youtube-dl                    2021.6.6
zipp                          3.6.0

I made terminal dump of the gdb session using script command so by "cat python_testing_jupyter-server_pytest.log" on current termilnal you may see full gdb back trace with original colouring.

Please let me know what I can do more to diagnose that issue or if you need more details.

I can add that exactly that python binary was up to now rock solid on building, minstalling and testing +800 python modules as rpm packages.

----------
files: python_testing_jupyter-server_pytest.log
messages: 409098
nosy: kloczek
priority: normal
severity: normal
status: open
title: pythin is core dumping with SIGILL in pytest of the jupyter-server
versions: Python 3.8
Added file: https://bugs.python.org/file50514/python_testing_jupyter-server_pytest.log

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46165>
_______________________________________

From report at bugs.python.org  Thu Dec 23 13:56:35 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Thu, 23 Dec 2021 18:56:35 +0000
Subject: [issue46162] Make `builtins.property` generic
In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org>
Message-ID: <1640285795.56.0.348114207558.issue46162@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Yes, it is too late for 3.10 (but you can add it to typing_extensions). Also, PEP 585 is done, we don't update PEPs. Please do test with `from __future__ import annotations` -- you never know.

When this was first proposed (https://github.com/python/typing/issues/985) there were worries about backwards compatibility. Given how common property is, we need to make sure there are no problems with that. Can you address that? I don't see it in the original thread.

Also, since this requires type checkers to change, do we need a PEP?

Finally. Please keep discussion in this bpo issue, don't have long discussions on the PR. (Honestly I think it's too soon for a PR given that we don't seem to have agreement in the typing tracker discussion.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46162>
_______________________________________

From report at bugs.python.org  Thu Dec 23 14:33:30 2021
From: report at bugs.python.org (Aaron Gokaslan)
Date: Thu, 23 Dec 2021 19:33:30 +0000
Subject: [issue46166] Get "self" args or non-null co_varnames from frame
 object with C-API
Message-ID: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org>


New submission from Aaron Gokaslan <aaronGokaslan at gmail.com>:

Hello, I am a maintainer with the PyBind11 project. We have been following the 3.11 development branch and have noticed an issue we are encountering with changes to the C-API. 

Particularly, we have an edge case in our overloading dispatch mechanism that we used to solve by inspecting the "self" argument in the co_varnames member of the python frame object: (https://github.com/pybind/pybind11/blob/a224d0cca5f1752acfcdad8e37369e4cda42259e/include/pybind11/pybind11.h#L2380). However, in the new struct, the co_varnames object can now be null. There also doesn't appear to be any public API to populate it on the C-API side. Accessing it via the "inspect" module still works, but that requires us to run a Python code snippit in a potentially very hot code path: (https://github.com/pybind/pybind11/blob/a224d0cca5f1752acfcdad8e37369e4cda42259e/include/pybind11/pybind11.h#L2408).

As such, we were hoping that either there is some new API change we have missed, or if there is some way other modern (and hopefully somewhat  stable way to access the API) so we can emulate the old behavior with the C-API.

----------
components: C API
messages: 409100
nosy: Skylion007
priority: normal
severity: normal
status: open
title: Get "self" args or non-null co_varnames from frame object with C-API
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46166>
_______________________________________

From report at bugs.python.org  Thu Dec 23 14:51:59 2021
From: report at bugs.python.org (Henry Schreiner)
Date: Thu, 23 Dec 2021 19:51:59 +0000
Subject: [issue46166] Get "self" args or non-null co_varnames from frame
 object with C-API
In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org>
Message-ID: <1640289119.27.0.8131019197.issue46166@roundup.psfhosted.org>


Change by Henry Schreiner <henryschreineriii at gmail.com>:


----------
nosy: +Henry Schreiner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46166>
_______________________________________

From report at bugs.python.org  Thu Dec 23 14:58:53 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Thu, 23 Dec 2021 19:58:53 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
Message-ID: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>


New submission from Gregory P. Smith <greg at krypto.org>:

Now that we have a shiny new parser, can we finally get rid of this language wart:

assert thing, description  # works as intended

assert (thing, description)  # always True as non-empty tuples are Truthy

This most often happens when extending thing or description beyond a single line on assert statements as () are the natural way to do that and as it is with assert being a statement, knowing specifically where to place the ()s to not fall into the pit of snakes of unintentionally nerfing your assertion to be an always true tuple is hard for human authors.

This would obsolete the pylint error about tuple assertion and enable more natural assert use.

py.test framework users would presumably rejoice as well.


This parsing change would need a PEP.  I fail to see any obvious downsides though.

----------
components: Parser
messages: 409101
nosy: gregory.p.smith, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Parse assert (x == y, "Descriptive text") as statement params instead of a tuple
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Thu Dec 23 15:01:30 2021
From: report at bugs.python.org (Sergei Lebedev)
Date: Thu, 23 Dec 2021 20:01:30 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640289690.41.0.752432323342.issue46167@roundup.psfhosted.org>


Change by Sergei Lebedev <slebedev at google.com>:


----------
nosy: +slebedev

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Thu Dec 23 15:15:15 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 23 Dec 2021 20:15:15 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640290515.9.0.777988490966.issue46167@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It does not need any change in parser, it can be done in the code generator which currently explicitly warns about such ambiguity.

Although it needs changes in formal grammar which will be more complex.

But what is a benefit? What is an advantage of writing

   assert (thing, description)

instead of

   assert thing, description

?

----------
nosy: +gvanrossum, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Thu Dec 23 15:18:06 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Thu, 23 Dec 2021 20:18:06 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640290686.19.0.131465203297.issue46167@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I can try to prototype something in the parser to see how it looks and work on the pep if everything looks ok.

Parentheses are a bit tricky in general as backtracking ends causing all sorts of tricky situations with custom syntax errors as the parser needs to distinguish between function calls, tuple construction and grouping so that's the only dangerous situation I can think of

----------
nosy:  -gvanrossum, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Thu Dec 23 15:20:38 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Thu, 23 Dec 2021 20:20:38 +0000
Subject: [issue46117] tk could not refresh auto in mac os
In-Reply-To: <1639751230.51.0.11843295078.issue46117@roundup.psfhosted.org>
Message-ID: <1640290838.49.0.177433551858.issue46117@roundup.psfhosted.org>


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

The script seems to work fine for me, python 3.10.1 on macOS 12.1. I used the python.org installer.

Did you install Python from source or using the installer? What's the output of ``python3 -m test.pythoninfo``, in particular the lines related to Tcl/Tk at the end?

For example:

...
time.tzname: ('CET', 'CEST')
tkinter.TCL_VERSION: 8.6
tkinter.TK_VERSION: 8.6
tkinter.info_patchlevel: 8.6.12
zlib.ZLIB_RUNTIME_VERSION: 1.2.11
...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46117>
_______________________________________

From report at bugs.python.org  Thu Dec 23 15:35:19 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Thu, 23 Dec 2021 20:35:19 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640291719.36.0.619323229429.issue46167@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:

It's not about an advantage, it's about removing the problem of what edit to make when working on


assert thing_that_has_a_meaningful_name.methods_have_good_names(value_from_somewhere) == other_thing_that_is_meaningful, "Description of what the issue is if this fails for humans, as if the names weren't enough"

and making that fit within whatever line length limit your codebase has.

put () in the wrong place and it triggers the long standing Python wart or parsing as a tuple.

rather than warn about the syntax wart, we should just do the thing code authors want in the first place.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Thu Dec 23 15:42:14 2021
From: report at bugs.python.org (Carl Friedrich Bolz-Tereick)
Date: Thu, 23 Dec 2021 20:42:14 +0000
Subject: [issue38085] Interrupting class creation in __init_subclass__ may
 lead to incorrect isinstance() and issubclass() results
In-Reply-To: <1568106581.16.0.558052842785.issue38085@roundup.psfhosted.org>
Message-ID: <1640292134.08.0.308553892178.issue38085@roundup.psfhosted.org>


Carl Friedrich Bolz-Tereick <cfbolz at gmx.de> added the comment:

hm, I think I figured it out. The root cause is that even though the creation of the class Triffid fails, it can still be found via Animal.__subclasses__(), which the special subclass logic for ABCs is looking at. Triffid fills its _abc_impl data with some content, but Triffid._abc_impl was never successfully initialized, therefore it mutates the _abc_impl of its first base class Animal.

My conclusion would be that if a class is not successfully created, it shouldn't appear in the .__subclasses__() list of its bases.

See attached script for some illuminating prints.

----------
nosy: +Carl.Friedrich.Bolz
Added file: https://bugs.python.org/file50515/x.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38085>
_______________________________________

From report at bugs.python.org  Thu Dec 23 15:42:44 2021
From: report at bugs.python.org (Carl Friedrich Bolz-Tereick)
Date: Thu, 23 Dec 2021 20:42:44 +0000
Subject: [issue38085] Interrupting class creation in __init_subclass__ may
 lead to incorrect isinstance() and issubclass() results
In-Reply-To: <1568106581.16.0.558052842785.issue38085@roundup.psfhosted.org>
Message-ID: <1640292164.14.0.0273300017342.issue38085@roundup.psfhosted.org>


Carl Friedrich Bolz-Tereick <cfbolz at gmx.de> added the comment:

Or, in other words, in my opinion this is the root cause of the bug:

class Base:
    def __init_subclass__(cls):
        global broken_class
        broken_class = cls
        assert 0
try:
    class Broken(Base): pass
except: pass
assert broken_class not in Base.__subclasses__()

The assert fails, which imo it shouldn't.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38085>
_______________________________________

From report at bugs.python.org  Thu Dec 23 15:58:06 2021
From: report at bugs.python.org (David Bereza)
Date: Thu, 23 Dec 2021 20:58:06 +0000
Subject: [issue46168] Incorrect format specified for the "style" key in the
 configuration file format formatter example
Message-ID: <1640293086.43.0.363469814409.issue46168@roundup.psfhosted.org>


New submission from David Bereza <bokunogf at gmail.com>:

Documentation link: https://docs.python.org/3/library/logging.config.html#configuration-file-format

It seems that the example for the "formatter_form01" formatter section specifies following for the style(please note the single-quotes around the value). 
style='%'

This seems to raise a ValueError with the message "Style must be one of..." when parsing the configuration file. Removing the single quotes seems to fix the issue:
style=%

----------
assignee: docs at python
components: Documentation
messages: 409108
nosy: bokunogf, docs at python
priority: normal
severity: normal
status: open
title: Incorrect format specified for the "style" key in the configuration file format formatter example
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46168>
_______________________________________

From report at bugs.python.org  Thu Dec 23 17:27:31 2021
From: report at bugs.python.org (SelfAdjointOperator)
Date: Thu, 23 Dec 2021 22:27:31 +0000
Subject: [issue45587] argparse add_argument_group: distinguish title and
 description from **kwargs
Message-ID: <1640298451.28.0.335351945028.issue45587@roundup.psfhosted.org>


New submission from SelfAdjointOperator <jayberry141 at gmail.com>:

This is a pretty trivial PR; Can it be merged? Nearly 2 months have gone by.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45587>
_______________________________________

From report at bugs.python.org  Thu Dec 23 17:28:03 2021
From: report at bugs.python.org (Tim Peters)
Date: Thu, 23 Dec 2021 22:28:03 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640298483.33.0.657612856975.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

Please don't use "long long". It usually introduces platform dependence where none is intended, or helpful. PEP 7 requires that the compiler in use supply the fixed-width integer types defined by C99's stdint.h[1]. These are:

int8_t
int16_t
int32_t
int64_t
uint8_t
uint16_t
uint32_t
uint64_t

This has been required since Python 3.6. There is no reason not to use them.

[1] https://www.python.org/dev/peps/pep-0007/#c-dialect

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 23 18:03:45 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Thu, 23 Dec 2021 23:03:45 +0000
Subject: [issue46168] Incorrect format specified for the "style" key in the
 configuration file format formatter example
In-Reply-To: <1640293086.43.0.363469814409.issue46168@roundup.psfhosted.org>
Message-ID: <1640300625.97.0.843910289205.issue46168@roundup.psfhosted.org>


Daniel Diniz <ajaksu at gmail.com> added the comment:

This example was added in issue 43047. It only seems to affect 3.10+ docs. Ian, is this something you'd like to tackle?

----------
keywords: +easy
nosy: +ajaksu2, iwienand
stage:  -> needs patch
versions: +Python 3.10, Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46168>
_______________________________________

From report at bugs.python.org  Thu Dec 23 18:11:48 2021
From: report at bugs.python.org (Karthikeyan Singaravelan)
Date: Thu, 23 Dec 2021 23:11:48 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640301108.77.0.788991998429.issue46167@roundup.psfhosted.org>


Change by Karthikeyan Singaravelan <tir.karthi at gmail.com>:


----------
nosy: +gvanrossum, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Thu Dec 23 18:20:55 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Thu, 23 Dec 2021 23:20:55 +0000
Subject: [issue42673] Optimize round_size for rehashing
In-Reply-To: <1608284127.41.0.53520654621.issue42673@roundup.psfhosted.org>
Message-ID: <1640301655.59.0.545165066702.issue42673@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Closing as it sounds like OP agreed to it in the last msg; and no benchmarking was provided.

----------
nosy: +andrei.avk
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42673>
_______________________________________

From report at bugs.python.org  Thu Dec 23 18:26:47 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Thu, 23 Dec 2021 23:26:47 +0000
Subject: [issue504219] locale.resetlocale is broken
Message-ID: <1640302007.41.0.321392508888.issue504219@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
nosy: +ajaksu2
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue504219>
_______________________________________

From report at bugs.python.org  Thu Dec 23 18:27:29 2021
From: report at bugs.python.org (Huon Wilson)
Date: Thu, 23 Dec 2021 23:27:29 +0000
Subject: [issue46169] Same-moment datetimes with different ZoneInfo timezones
 are not considered ==
Message-ID: <1640302049.86.0.995317132949.issue46169@roundup.psfhosted.org>


New submission from Huon Wilson <wilson.huon at gmail.com>:

The documentation suggests that two datetimes that represent the same moment should compare equal, even if they have different timezones: "If both comparands are aware and have different tzinfo attributes, the comparands are first adjusted by subtracting their UTC offsets (obtained from self.utcoffset())." (below https://docs.python.org/3/library/datetime.html#datetime.datetime.fold)

This doesn't seem to be true for == with ZoneInfo timezones, even though it is true for <= and >=, and -, meaning these seem to violate mathematical laws/expectations:

    from zoneinfo import ZoneInfo
    from datetime import datetime, timezone

    dt_utc = datetime(2020, 11, 1, 8, tzinfo=timezone.utc)
    dt_local = dt_utc.astimezone(ZoneInfo("America/Los_Angeles"))
    print(f"{dt_local == dt_utc = }")
    print(f"{dt_local <= dt_utc = }")
    print(f"{dt_local >= dt_utc = }")
    print(f"{dt_local - dt_utc = }")

Output:

    dt_local == dt_utc = False
    dt_local <= dt_utc = True
    dt_local >= dt_utc = True
    dt_local - dt_utc = datetime.timedelta(0)

Tested with:

- macOS 11.4; Python 3.9.7, 3.10.1, 3.11.0a3
- Linux; via docker image python:3.9.7

Full test including comparisons to python-dateutil (same behaviour as ZoneInfo) and pytz (== gives True as expected) is attached.

Comparing timestamps for exact equality is potentially unusual, but we use it extensively in tests for some time-handling functions.

----------
components: Library (Lib)
files: tz.py
messages: 409113
nosy: huonw
priority: normal
severity: normal
status: open
title: Same-moment datetimes with different ZoneInfo timezones are not considered ==
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9
Added file: https://bugs.python.org/file50516/tz.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46169>
_______________________________________

From report at bugs.python.org  Thu Dec 23 19:01:32 2021
From: report at bugs.python.org (Gobot1234)
Date: Fri, 24 Dec 2021 00:01:32 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
Message-ID: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>


New submission from Gobot1234 <gobot1234yt at gmail.com>:

I'd like to propose making the error message when subclassing typing.NewType much more understandable. Currently it looks like:
```
TypeError: NewType.__init__() takes 3 positional arguments but 4 were given
```
But I think we could do much better by adding __mro_entries__ to the class and then just having that raise a TypeError telling users they cannot subclass NewType and they are probably looking for `NewType('Subclass', OlderType)`. I'd be happy to patch this myself if this sounds like a good idea.

----------
components: Library (Lib)
messages: 409114
nosy: Gobot1234, gvanrossum, kj
priority: normal
severity: normal
status: open
title: Improving the error message when subclassing NewType
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Thu Dec 23 19:17:10 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 24 Dec 2021 00:17:10 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640305030.96.0.413442380881.issue46167@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> can we finally get rid of this language wart

Yes, please.  This is a pretty bad pitfall.

I've seen this happen to people who've been conditioned by other languages to think of assert() as a macro or function:

    assert(sometest, somemessage)

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Thu Dec 23 19:19:02 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 24 Dec 2021 00:19:02 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640305142.08.0.504199070192.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

[Mark]
> Should I code up my suggestion in a PR, 

Yes, go for it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 23 19:58:19 2021
From: report at bugs.python.org (Barry A. Warsaw)
Date: Fri, 24 Dec 2021 00:58:19 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1640307499.68.0.361530859452.issue46090@roundup.psfhosted.org>


Change by Barry A. Warsaw <barry at python.org>:


----------
nosy: +barry

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Thu Dec 23 20:01:21 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Fri, 24 Dec 2021 01:01:21 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640307681.52.0.90578840299.issue46167@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

We managed to do this for 'with' so it should be possible here too, I'd think. The "committing" token would be the newline following the close parenthesis.

Serhiy: the benefit is when you want to split it across two lines, e.g.

assert (a_very_long_condition(),
        "A Very Long Message")

I know you can do this using backslash, e..

assert a_very_long_condition(), \
        "A Very Long Message"

but there's a strong cultural rejection of backslash for line splitting (it's in PEP 8 and engrained in many people's brains) and it's just so natural to use parentheses -- they work for 'import', 'with', function calls, 'if', etc.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Thu Dec 23 20:11:27 2021
From: report at bugs.python.org (Christian Heimes)
Date: Fri, 24 Dec 2021 01:11:27 +0000
Subject: [issue46165] pythin is core dumping with SIGILL in pytest of the
 jupyter-server
In-Reply-To: <1640285607.3.0.100411347335.issue46165@roundup.psfhosted.org>
Message-ID: <1640308287.26.0.118068225253.issue46165@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

The traceback indicates that it's a problem with a 3rd party extension module and not a bug in CPython core. The C stack suggests that your copy of libargon2 is the root cause.

----------
nosy: +christian.heimes
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type:  -> crash

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46165>
_______________________________________

From report at bugs.python.org  Thu Dec 23 22:29:51 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Fri, 24 Dec 2021 03:29:51 +0000
Subject: [issue46169] Same-moment datetimes with different ZoneInfo timezones
 are not considered ==
In-Reply-To: <1640302049.86.0.995317132949.issue46169@roundup.psfhosted.org>
Message-ID: <1640316591.39.0.329650172593.issue46169@roundup.psfhosted.org>


Daniel Diniz <ajaksu at gmail.com> added the comment:

Confirmed for 3.11 in Windows. 

The C datetime code can be trivially fixed so your equality test returns True, but there are two Python tests that depend on current behavior so it might not be so easy. They were added with current code in issue 24773, to implement PEP 495 -- Local Time Disambiguation.

Also, using a timezone implementation from the test suite makes the equality work, so maybe the bug depends on zoneinfo.

If you change datetimemodule.c line 5761 from "diff = 1;" to "diff = 0;", two tests fail and your code works.

See attached file for the tests that fail and using the timezone implementation mentioned above.

----------
nosy: +ajaksu2
Added file: https://bugs.python.org/file50517/dt_equality.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46169>
_______________________________________

From report at bugs.python.org  Thu Dec 23 23:07:42 2021
From: report at bugs.python.org (Tomasz Kloczko)
Date: Fri, 24 Dec 2021 04:07:42 +0000
Subject: [issue46165] pythin is core dumping with SIGILL in pytest of the
 jupyter-server
In-Reply-To: <1640285607.3.0.100411347335.issue46165@roundup.psfhosted.org>
Message-ID: <1640318862.36.0.0320940149226.issue46165@roundup.psfhosted.org>


Tomasz Kloczko <kloczko.tomasz at gmail.com> added the comment:

OK accorting to your expertise this could be somethning wrong in some of the DSOs ..

May I ask for a little help with pointing on possible module which i doing sometbing wrong?

Just looking on top of the call trace 

                #0  0x00007f480be7a54c __pthread_kill_implementation (libc.so.6 + 0x8f54c)
                #1  0x00007f480be2d696 raise (libc.so.6 + 0x42696)
                #2  0x00007f480be2d740 __restore_rt (libc.so.6 + 0x42740)
                #3  0x00007f47f9fbe8ff blake2b_init (libargon2.so.1 + 0x38ff)
                #4  0x00007f47f9fbfb0e argon2_ctx.part.0 (libargon2.so.1 + 0x4b0e)
                #5  0x00007f47f9fc0a9f argon2_hash (libargon2.so.1 + 0x5a9f)
                #6  0x00007f47f9fc8f16 _cffi_f_argon2_hash (_ffi.abi3.so + 0x2f16)
                #7  0x00007f480c0a0077 cfunction_call_varargs (libpython3.8.so.1.0 + 0xb7077)
                #8  0x00007f480c10febb _PyObject_MakeTpCall (libpython3.8.so.1.0 + 0x126ebb)
                #9  0x00007f480c05eee4 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x75ee4)
                #10 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #11 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #12 0x00007f480c05d42c _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x7442c)
                #13 0x00007f480c05897b function_code_fastcall (libpython3.8.so.1.0 + 0x6f97b)
                #14 0x00007f480c05d8e3 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x748e3)
                #15 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #16 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #17 0x00007f480c05d3e0 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x743e0)
                #18 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #19 0x00007f480c1784e7 PyEval_EvalCode (libpython3.8.so.1.0 + 0x18f4e7)
                #20 0x00007f480c1d9295 builtin_exec (libpython3.8.so.1.0 + 0x1f0295)
                #21 0x00007f480c176c37 cfunction_vectorcall_FASTCALL (libpython3.8.so.1.0 + 0x18dc37)
                #22 0x00007f480c05d3e0 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x743e0)
                #23 0x00007f480c05897b function_code_fastcall (libpython3.8.so.1.0 + 0x6f97b)
                #24 0x00007f480c05d8e3 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x748e3)
                #25 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #26 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #27 0x00007f480c05e93d _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x7593d)
                #28 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #29 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #30 0x00007f480c132c9a method_vectorcall (libpython3.8.so.1.0 + 0x149c9a)
                #31 0x00007f480c05d42c _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x7442c)
                #32 0x00007f480c05897b function_code_fastcall (libpython3.8.so.1.0 + 0x6f97b)
                #33 0x00007f480c05d8e3 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x748e3)
                #34 0x00007f480c05897b function_code_fastcall (libpython3.8.so.1.0 + 0x6f97b)
                #35 0x00007f480c1100bd PyVectorcall_Call (libpython3.8.so.1.0 + 0x1270bd)
                #36 0x00007f480c05ada7 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x71da7)
                #37 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #38 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #39 0x00007f480c05e93d _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x7593d)
                #40 0x00007f480c05897b function_code_fastcall (libpython3.8.so.1.0 + 0x6f97b)
                #41 0x00007f480c132c9a method_vectorcall (libpython3.8.so.1.0 + 0x149c9a)
                #42 0x00007f480c05e93d _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x7593d)
                #43 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #44 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #45 0x00007f480c110246 _PyObject_FastCallDict (libpython3.8.so.1.0 + 0x127246)
                #46 0x00007f480c11042d _PyObject_Call_Prepend (libpython3.8.so.1.0 + 0x12742d)
                #47 0x00007f480c110501 slot_tp_call (libpython3.8.so.1.0 + 0x127501)
                #48 0x00007f480c0a01f4 PyObject_Call (libpython3.8.so.1.0 + 0xb71f4)
                #49 0x00007f480c05ada7 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x71da7)
                #50 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #51 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #52 0x00007f480c05d3e0 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x743e0)
                #53 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #54 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #55 0x00007f480c132c9a method_vectorcall (libpython3.8.so.1.0 + 0x149c9a)
                #56 0x00007f480c05d42c _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x7442c)
                #57 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #58 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #59 0x00007f480c1100bd PyVectorcall_Call (libpython3.8.so.1.0 + 0x1270bd)
                #60 0x00007f480c05ada7 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x71da7)
                #61 0x00007f480c1781b7 _PyEval_EvalCodeWithName (libpython3.8.so.1.0 + 0x18f1b7)
                #62 0x00007f480c1787e3 _PyFunction_Vectorcall (libpython3.8.so.1.0 + 0x18f7e3)
                #63 0x00007f480c05d3e0 _PyEval_EvalFrameDefault (libpython3.8.so.1.0 + 0x743e0)


I don't see any DSO module code on that call trace (?!?)
May I ask help with assesment which one module may be messing here?

Thank you for any help

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46165>
_______________________________________

From report at bugs.python.org  Thu Dec 23 23:29:36 2021
From: report at bugs.python.org (asper)
Date: Fri, 24 Dec 2021 04:29:36 +0000
Subject: [issue46117] tk could not refresh auto in mac os
In-Reply-To: <1639751230.51.0.11843295078.issue46117@roundup.psfhosted.org>
Message-ID: <1640320176.31.0.323336967871.issue46117@roundup.psfhosted.org>


asper <asper at 21cn.com> added the comment:

tkinter.TCL_VERSION: 8.6
tkinter.TK_VERSION: 8.6
tkinter.info_patchlevel: 8.6.11
zlib.ZLIB_RUNTIME_VERSION: 1.2.11
zlib.ZLIB_VERSION: 1.2.11
On my system, it shows like that.
It works well if not change the widnow's size of program, but once change the window's size manually, press "change" button, it shows a little delay.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46117>
_______________________________________

From report at bugs.python.org  Fri Dec 24 00:09:07 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 24 Dec 2021 05:09:07 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640322547.92.0.267047784581.issue46167@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

> We managed to do this for 'with' so it should be possible here too, I'd think. The "committing" token would be the newline following the close parenthesis.


I am not so sure is that inmediate. Changing the assert statement from:

 'assert' a=expression b=[',' z=expression { z }]

to

    | 'assert' '(' a=expression b=[',' z=expression { z }] ')'
    | 'assert' a=expression b=[',' z=expression { z }] 

will render this invalid:

assert (a, b) <= c, "something"

The reason is that it will parse the (a, b) as the assert statement eagerly and then it will fail to parse the rest.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Fri Dec 24 00:14:07 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 24 Dec 2021 05:14:07 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640322847.81.0.275524569419.issue46167@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

We could do this, but feels a bit hacky:

    | 'assert' '(' a=expression b=[',' z=expression { z }] ')' &(NEWLINE | ';')
    | 'assert' a=expression b=[',' z=expression { z }]

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Fri Dec 24 00:30:57 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 24 Dec 2021 05:30:57 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640323857.89.0.349368550307.issue46167@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Another possibility is actually handled this in the compiler:

if we see an assert with a tuple of two elements, we can assume is basically in the form that we want and proceed as if is in the form
assert A, B

This also feels a bit hacky because the AST is somehow wrong as the assert node is already prepared to differentiate these two cases.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Fri Dec 24 00:41:59 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Fri, 24 Dec 2021 05:41:59 +0000
Subject: [issue9334] argparse does not accept options taking arguments
 beginning with dash (regression from optparse)
In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za>
Message-ID: <1640324519.37.0.107866402818.issue9334@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

@karzes: If you read all of the messages above, you'll find that the behavior is deeply baked in to argparse. So, no, there is no fix for this issue.

I'm not sure about others, but I believe that the behavior is so deeply ingrained in how argparse works that it can't be changed. I have the same desire as you: to use a command line parser that works like all other Unix commands. I've switched my personal code to click. There's also Appeal, typer, and others.

Unlike when argparse was added to the stdlib, at this point installing modules from PyPI is sufficiently easy that I'm not sure it makes sense to advocate for another command line parser in the stdlib.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9334>
_______________________________________

From report at bugs.python.org  Fri Dec 24 01:04:48 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Fri, 24 Dec 2021 06:04:48 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640325888.4.0.220592130506.issue46167@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

I like the lookahead. We could also make the comma and the message mandatory when inside parentheses:

    | 'assert' '(' a=expression ',' b=expression [','] ')' &(NEWLINE | ';')
    | 'assert' a=expression b=[',' z=expression { z }]

(And probably add an "invalid" rule to cover tuples with 0, 1, 3 or more elements.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Fri Dec 24 01:30:21 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 24 Dec 2021 06:30:21 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640327421.56.0.0466085218477.issue46167@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
keywords: +patch
pull_requests: +28465
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30247

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Fri Dec 24 02:34:10 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 24 Dec 2021 07:34:10 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640331250.58.0.445152000346.issue46150@roundup.psfhosted.org>


Change by Gregory P. Smith <greg at krypto.org>:


----------
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Fri Dec 24 02:36:42 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Fri, 24 Dec 2021 07:36:42 +0000
Subject: [issue46162] Make `builtins.property` generic
In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org>
Message-ID: <1640331402.56.0.91126926712.issue46162@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Thanks, Guido!

> Yes, it is too late for 3.10 (but you can add it to typing_extensions). Also, PEP 585 is done, we don't update PEPs. 

Got it!

> Please do test with `from __future__ import annotations` -- you never know.

Done, PR is updated. Now we test that `property` works with future import.

> When this was first proposed (https://github.com/python/typing/issues/985) there were worries about backwards compatibility. Given how common property is, we need to make sure there are no problems with that. Can you address that? I don't see it in the original thread.

I guess you were thinking about this one: https://github.com/python/typing/issues/594

Here's a list of problem from the original thread:

## the returned value of property has no typing equivalent

Now there is: `property[G, S]`

## There is no consistency in how properties in classes work in comparison to normal variables or functions

Author points out that all python versions right now ignore `property`s when `get_type_hints()` is used. There's nothing we can do here: it is not related to `property`s being generic in any way.

Here's how it works before my patch:

```python
Python 3.10.0 (default, Nov  1 2021, 10:24:06) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import get_type_hints
>>> class Some:
...   @property
...   def a(self) -> int:
...     return 1
... 
>>> get_type_hints(Some)
{}
>>> get_type_hints(Some.a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/sobolev/.pyenv/versions/3.10.0/lib/python3.10/typing.py", line 1827, in get_type_hints
    raise TypeError('{!r} is not a module, class, method, '
TypeError: <property object at 0x102b7a7f0> is not a module, class, method, or function.
```

I've added a test case for my patch to make sure this behavior is not changed. And indeed, it works exactly the same as before.

I've also covered a part from https://github.com/python/typing/issues/594#issuecomment-627692188

Runtime introspection of `fget` / `fset` / `fdel` works the same as before. I've added a test case for this.

## Forward compat

Users of python<3.11 will have `property` with `[]` type syntax via `typing_extensions`.
I don't think it is going to be widely used, though.

> Also, since this requires type checkers to change, do we need a PEP?

I cannot speak for all type-checkers, but I know how it works in mypy. Mypy already supports descriptors. So, this example works:

```python
class Desc:
    def __get__(self, obj, typ) -> int: pass

class Some:
    a = Desc()

s = Some()
reveal_type(s.a)     # N: Revealed type is "builtins.int"
reveal_type(Some.a)  # N: Revealed type is "builtins.int"
```

The same just works for my `property` stub example from https://github.com/python/typing/issues/985

All in all, I don't think that we need a PEP for three reasons:
1. properties are already supported in all type checkers (with special casing), if it does not cause any trouble, existing behavior can be left untouched. Mypy has multiple problem with our special casing
2. Underlying mechanism - which are descriptors - is also supported
3. Change is relatively small, it does not add any new concepts

Feedback on this is welcome! Maybe I am missing something.

> Honestly I think it's too soon for a PR given that we don't seem to have agreement in the typing tracker discussion.

This PR is really small. It took me like 30 mins, but we have a reference now. 
We can close it anytime with no damage done!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46162>
_______________________________________

From report at bugs.python.org  Fri Dec 24 02:46:06 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 24 Dec 2021 07:46:06 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640331966.94.0.59181345824.issue46150@roundup.psfhosted.org>


Change by Gregory P. Smith <greg at krypto.org>:


----------
pull_requests: +28466
pull_request: https://github.com/python/cpython/pull/30244

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Fri Dec 24 03:07:54 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 24 Dec 2021 08:07:54 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640333274.03.0.326217665357.issue46150@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:


New changeset b8de8b7039cee47465b2af9950b0b9ed2d3f2903 by Nikita Sobolev in branch 'main':
bpo-46150: ensure `fakeuser` does not exist in `PosixPathTest.test_expanduser` (GH-30240)
https://github.com/python/cpython/commit/b8de8b7039cee47465b2af9950b0b9ed2d3f2903


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Fri Dec 24 03:07:58 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 24 Dec 2021 08:07:58 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640333274.03.0.326217665357.issue46150@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:


New changeset b8de8b7039cee47465b2af9950b0b9ed2d3f2903 by Nikita Sobolev in branch 'main':
bpo-46150: ensure `fakeuser` does not exist in `PosixPathTest.test_expanduser` (GH-30240)
https://github.com/python/cpython/commit/b8de8b7039cee47465b2af9950b0b9ed2d3f2903


----------
message_count: 1.0 -> 2.0
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28467
pull_request: https://github.com/python/cpython/pull/30248

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Fri Dec 24 03:08:02 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 24 Dec 2021 08:08:02 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640333282.43.0.69104964288.issue46150@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28468
pull_request: https://github.com/python/cpython/pull/30249

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Fri Dec 24 03:08:06 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 24 Dec 2021 08:08:06 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640333286.77.0.270869848139.issue46150@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28468, 28469
pull_request: https://github.com/python/cpython/pull/30249

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Fri Dec 24 03:08:12 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 24 Dec 2021 08:08:12 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640333292.31.0.982199279939.issue46150@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28468, 28469, 28470
pull_request: https://github.com/python/cpython/pull/30249

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Fri Dec 24 03:28:03 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 24 Dec 2021 08:28:03 +0000
Subject: [issue46162] Make `builtins.property` generic
In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org>
Message-ID: <1640334483.84.0.456282355725.issue46162@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Does it mean that property[GetType, SetType] will be required and MyPy will complain if the raw property decorator be used?

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46162>
_______________________________________

From report at bugs.python.org  Fri Dec 24 03:31:26 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 24 Dec 2021 08:31:26 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640334686.12.0.3434132173.issue46150@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 8005e22c9c71708ead0e5b16e55e005844c5131f by Miss Islington (bot) in branch '3.10':
bpo-46150: ensure `fakeuser` does not exist in `PosixPathTest.test_expanduser` (GH-30240)
https://github.com/python/cpython/commit/8005e22c9c71708ead0e5b16e55e005844c5131f


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Fri Dec 24 03:32:30 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 24 Dec 2021 08:32:30 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640334750.4.0.178276543304.issue46150@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset d718764f389acd1bf4a5a65661bb58862f14fb98 by Miss Islington (bot) in branch '3.9':
bpo-46150: ensure `fakeuser` does not exist in `PosixPathTest.test_expanduser` (GH-30240)
https://github.com/python/cpython/commit/d718764f389acd1bf4a5a65661bb58862f14fb98


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Fri Dec 24 03:44:22 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 24 Dec 2021 08:44:22 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640335462.67.0.627577206569.issue46167@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

For very long expression or very long message you can add parentheses around the expression or message. Black will format it as:

assert (
    very very long
    expression
), (
    "very very long "
    "message"
)

With the proposed feature it will be:

assert (
    very very long
    expression,
    "very very long "
    "message",
)

It saves one line, but the border between an expression and a message is blur. Since they are separated by a comma at the end of line and all lines have the same indentation it looks less readable to me.

Note also that Black adds a comma after message.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Fri Dec 24 04:27:34 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 24 Dec 2021 09:27:34 +0000
Subject: [issue45878] Use `self.assertRaises` instead of `try/except` in
 `ctypes/test_functions.py::test_mro`
In-Reply-To: <1637659974.6.0.574362436807.issue45878@roundup.psfhosted.org>
Message-ID: <1640338054.74.0.923990943598.issue45878@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 393ff040281db818f2d6e0240919316f58f989a6 by Miss Islington (bot) in branch '3.9':
bpo-45878: convert `try/except` to `self.assertRaises` in `Lib/ctypes/test/test_functions.py` (GH-29721) (GH-29723)
https://github.com/python/cpython/commit/393ff040281db818f2d6e0240919316f58f989a6


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45878>
_______________________________________

From report at bugs.python.org  Fri Dec 24 04:29:07 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 24 Dec 2021 09:29:07 +0000
Subject: [issue45878] Use `self.assertRaises` instead of `try/except` in
 `ctypes/test_functions.py::test_mro`
In-Reply-To: <1637659974.6.0.574362436807.issue45878@roundup.psfhosted.org>
Message-ID: <1640338147.51.0.669687337023.issue45878@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset a9e0b2b49374df91c40fe409508cfcdc6332450e by Miss Islington (bot) in branch '3.10':
bpo-45878: convert `try/except` to `self.assertRaises` in `Lib/ctypes/test/test_functions.py` (GH-29721) (GH-29748)
https://github.com/python/cpython/commit/a9e0b2b49374df91c40fe409508cfcdc6332450e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45878>
_______________________________________

From report at bugs.python.org  Fri Dec 24 04:29:51 2021
From: report at bugs.python.org (layday)
Date: Fri, 24 Dec 2021 09:29:51 +0000
Subject: [issue46171] venv module produces spurious warning that location has
 moved
Message-ID: <1640338191.84.0.15434906765.issue46171@roundup.psfhosted.org>


New submission from layday <layday at protonmail.com>:

After https://github.com/python/cpython/commit/6811fdaec825bd6ab64e358a4b480108f5634d2d
the venv module produces spurious warnings for venv paths which contain
DOS-encoded parts e.g. "USER\~1" in "C:\Users\USER~1".
`tempfile.gettempdir()` returns legacy paths like these for
user temp dirs.

MRE:

    python -c "import tempfile
    import venv

    venv.create(tempfile.mkdtemp())"
    Actual environment location may have moved due to redirects, links or junctions.
    Requested location: "C:\Users\RUNNER~1\AppData\Local\Temp\tmpfoobar\Scripts\python.exe"
    Actual location:    "C:\Users\runneradmin\AppData\Local\Temp\tmpfoobar\Scripts\python.exe"

----------
components: Library (Lib), Windows
messages: 409135
nosy: layday, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: venv module produces spurious warning that location has moved
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46171>
_______________________________________

From report at bugs.python.org  Fri Dec 24 04:48:33 2021
From: report at bugs.python.org (Adam Johnson)
Date: Fri, 24 Dec 2021 09:48:33 +0000
Subject: [issue45865] Old syntax in unittest
In-Reply-To: <1637576990.34.0.316155860666.issue45865@roundup.psfhosted.org>
Message-ID: <1640339313.41.0.171360032592.issue45865@roundup.psfhosted.org>


Adam Johnson <me at adamj.eu> added the comment:

Okay, I updated the PR to only remove inheritance from object. Should I reopen the ticket? (Not sure of the etiquette.)

Perhaps I could later submit a second patch for use of `super()`, and so on?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45865>
_______________________________________

From report at bugs.python.org  Fri Dec 24 04:53:47 2021
From: report at bugs.python.org (CCXXXI)
Date: Fri, 24 Dec 2021 09:53:47 +0000
Subject: [issue46172] [doc] Outdated description of `license` object
Message-ID: <1640339627.46.0.314703994034.issue46172@roundup.psfhosted.org>


New submission from CCXXXI <ccxxxi at qq.com>:

https://docs.python.org/3/library/constants.html#license

> Object that when printed, prints the message ?Type license() to see the full license text?, and when called, displays the full license text in a pager-like fashion (one screen at a time).

It displays "See https://www.python.org/psf/license/" when either printed or called in Python 3.10.1.

----------
assignee: docs at python
components: Documentation
messages: 409138
nosy: CCXXXI, docs at python
priority: normal
severity: normal
status: open
title: [doc] Outdated description of `license` object
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46172>
_______________________________________

From report at bugs.python.org  Fri Dec 24 04:57:32 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 24 Dec 2021 09:57:32 +0000
Subject: [issue46172] [doc] Outdated description of `license` object
In-Reply-To: <1640339627.46.0.314703994034.issue46172@roundup.psfhosted.org>
Message-ID: <1640339852.69.0.147345900344.issue46172@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46172>
_______________________________________

From report at bugs.python.org  Fri Dec 24 04:59:16 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Fri, 24 Dec 2021 09:59:16 +0000
Subject: [issue45865] Old syntax in unittest
In-Reply-To: <1637576990.34.0.316155860666.issue45865@roundup.psfhosted.org>
Message-ID: <1640339956.11.0.165901248945.issue45865@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Not worth the hassle.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45865>
_______________________________________

From report at bugs.python.org  Fri Dec 24 06:47:37 2021
From: report at bugs.python.org (lkraav)
Date: Fri, 24 Dec 2021 11:47:37 +0000
Subject: [issue46156] 3.9.9: python built-in SSL module unable to connect to
 an IIS server (104 Connection reset by peer), but pyopenssl works fine
In-Reply-To: <1640199734.31.0.675782620401.issue46156@roundup.psfhosted.org>
Message-ID: <1640346457.49.0.361362317214.issue46156@roundup.psfhosted.org>


lkraav <leho at kraav.com> added the comment:

> I need more information to diagnose the issue. Could you please provide:
> - your operating system and vendor/distribution

Gentoo, so rolling, but 20 years of maintenance experience.

> - your OpenSSL version (ssl.OPENSSL_VERSION)

$ python
Python 3.9.9 (main, Dec 21 2021, 17:21:49) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
@>>> import ssl
@>>> print(ssl.OPENSSL_VERSION)
OpenSSL 1.1.1l  24 Aug 2021


> - how did you install Python (self-compiled, pyenv, system Python)?

System Python. On Gentoo, features configuration revolve around USE flags, but I don't have anything curious built with "gdbm ncurses readline sqlite ssl xml" being active:

$ eix dev-lang/python$
[U] dev-lang/python
     Available versions:  
     ...
     (3.9)  3.9.9^t{xpak}
     ...
       {berkdb bluetooth build examples gdbm hardened libedit lto +ncurses pgo +readline +sqlite +ssl test tk verify-sig wininst +xml ELIBC="uclibc"}
     Installed versions:  3.9.9(3.9)^t{xpak}(17:22:24 21.12.2021)(gdbm ncurses readline sqlite ssl xml -bluetooth -build -examples -hardened -lto -pgo -test -tk -verify-sig -wininst)
     Homepage:            https://www.python.org/
     Description:         An interpreted, interactive, object-oriented programming language


> - how did you install PyOpenSSL and cryptography?

Regular system package manager install

$ eix pyopenssl
[I] dev-python/pyopenssl
     Available versions:  20.0.1^t{xpak} {doc test PYTHON_TARGETS="pypy3 python3_8 python3_9 python3_10"}
     Installed versions:  20.0.1^t{xpak}(11:43:07 03.06.2021)(-doc -test PYTHON_TARGETS="python3_9 -pypy3 -python3_8 -python3_10")
     Homepage:            https://www.pyopenssl.org/ https://pypi.org/project/pyOpenSSL/ https://github.com/pyca/pyopenssl/
     Description:         Python interface to the OpenSSL library

$ eix cryptography
[I] dev-python/cryptography
     Available versions:  3.4.7-r2^t{xpak} **36.0.0^t {debug test PYTHON_TARGETS="pypy3 python3_8 python3_9 python3_10"}
     Installed versions:  3.4.7-r2^t{xpak}(16:35:10 21.12.2021)(-test PYTHON_TARGETS="python3_9 -pypy3 -python3_8 -python3_10")
     Homepage:            https://github.com/pyca/cryptography/ https://pypi.org/project/cryptography/
     Description:         Library providing cryptographic recipes and primitives

> - the full output of: openssl s_client -connect webapi.remote:52100

$ openssl s_client -connect webapi.remote:52100                                                                                                                                                   
CONNECTED(00000003)
depth=0 CN = webapi.remote
verify error:num=18:self signed certificate
verify return:1
depth=0 CN = webapi.remote
verify return:1
---
Certificate chain
 0 s:CN = webapi.remote
   i:CN = webapi.remote
---
Server certificate
-----BEGIN CERTIFICATE-----
<cut>
-----END CERTIFICATE-----
subject=CN = webapi.remote

issuer=CN = webapi.remote

---
No client certificate CA names sent
Peer signing digest: SHA1
Peer signature type: RSA
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 1254 bytes and written 502 bytes
Verification error: self signed certificate
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-SHA384
    Session-ID: 27060000127E5AA837E96D63F5DE532C53FAD1D5C034CBF3D305B7978E9636A0
    Session-ID-ctx: 
    Master-Key: FAE8DE30BF627E7F02F8B4AA856075675FAF3A92365A1E9E8041F799E29CE809749B35514065255C62F0D449405C02B8
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1640346190
    Timeout   : 7200 (sec)
    Verify return code: 18 (self signed certificate)
    Extended master secret: yes
---
DONE

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46156>
_______________________________________

From report at bugs.python.org  Fri Dec 24 08:01:05 2021
From: report at bugs.python.org (mike mcleod)
Date: Fri, 24 Dec 2021 13:01:05 +0000
Subject: [issue4849] instantiating and populating xml.dom.minidom.Element is
 cumbersome
In-Reply-To: <1231182515.38.0.572857860756.issue4849@psf.upfronthosting.co.za>
Message-ID: <1640350865.52.0.664639642302.issue4849@roundup.psfhosted.org>


mike mcleod <mikecmcleod at gmail.com> added the comment:

I would like to help with this issue. I'm new to this space hence I am not aware of what patch review means.

----------
nosy: +mikecmcleod

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue4849>
_______________________________________

From report at bugs.python.org  Fri Dec 24 08:12:22 2021
From: report at bugs.python.org (mike mcleod)
Date: Fri, 24 Dec 2021 13:12:22 +0000
Subject: [issue24364] Not all defects pass through email policy
In-Reply-To: <1433263153.11.0.33312264244.issue24364@psf.upfronthosting.co.za>
Message-ID: <1640351542.93.0.901795851795.issue24364@roundup.psfhosted.org>


mike mcleod <mikecmcleod at gmail.com> added the comment:

I would like to help with this issue.

----------
nosy: +mikecmcleod

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24364>
_______________________________________

From report at bugs.python.org  Fri Dec 24 08:17:25 2021
From: report at bugs.python.org (Cyker Way)
Date: Fri, 24 Dec 2021 13:17:25 +0000
Subject: [issue46173] float(x) with large x not raise OverflowError
Message-ID: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>


New submission from Cyker Way <cykerway at gmail.com>:

Acccording to: https://docs.python.org/3/library/functions.html#float

>    If the argument is outside the range of a Python float, an OverflowError will be raised.

It is well known that the maximum value in IEEE 754 binary64 format is:

    >>> M = ((1<<53)-1)<<(1023-52)
    ...

So `(M+1)` will be out of range. But `float(M+1)` gives me:

    >>> float(M+1)
    1.7976931348623157e+308

No OverflowError is thrown. Contrast this with:

    >>> float(M+M)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OverflowError: int too large to convert to float

In another text: https://docs.python.org/3/tutorial/floatingpoint.html#representation-error

>   ...Almost all machines today (November 2000) use IEEE-754 floating point arithmetic, and almost all platforms map Python floats to IEEE-754 ?double precision?...

Is Python not following IEEE 754 binary64 format or something missing here?

----------
components: Interpreter Core
messages: 409143
nosy: cykerway
priority: normal
severity: normal
status: open
title: float(x) with large x not raise OverflowError
type: behavior
versions: Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Fri Dec 24 08:48:41 2021
From: report at bugs.python.org (Eryk Sun)
Date: Fri, 24 Dec 2021 13:48:41 +0000
Subject: [issue46171] venv module produces spurious warning that location has
 moved
In-Reply-To: <1640338191.84.0.15434906765.issue46171@roundup.psfhosted.org>
Message-ID: <1640353721.04.0.627099183413.issue46171@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

There's no point to making the user worry about short names, symlinks, or non-canonical mount points in the filesystem path of a virtual environment. It's still accessible where the user expects to find it. The problem for bpo-45337 is filesystem redirection in UWP apps, in particular for files and directories created under "%USERPROFILE%\AppData". The warning could be limited to just paths in that tree.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46171>
_______________________________________

From report at bugs.python.org  Fri Dec 24 09:02:50 2021
From: report at bugs.python.org (Eryk Sun)
Date: Fri, 24 Dec 2021 14:02:50 +0000
Subject: [issue46171] venv module produces spurious warning that location has
 moved
In-Reply-To: <1640338191.84.0.15434906765.issue46171@roundup.psfhosted.org>
Message-ID: <1640354570.05.0.681534501065.issue46171@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

There's still the problem of the system using short names in %TEMP%, since by default that's under "%USERPROFILE%\AppData". Either an exception could be made for the temp directory, since it's never redirected (AFAIK), or support could be added for GetLongPathNameW() [1] as nt._getlongpathname().

---
[1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlongpathnamew

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46171>
_______________________________________

From report at bugs.python.org  Fri Dec 24 09:08:37 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Fri, 24 Dec 2021 14:08:37 +0000
Subject: [issue46173] float(x) with large x not raise OverflowError
In-Reply-To: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>
Message-ID: <1640354917.54.0.0252327554058.issue46173@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

float(x) performs rounding. Only if the value after rounding is out of range is OverflowError raised.

M + 1, when correctly rounded to the nearest even float, gives sys.float_info.max. Likewise for M+2, M+3 etc all the way to M+K where K equals 2**960 before the correctly rounded result of float(M+K) overflows.

Anything less than K=2**960 is too small to be distinguished from M when added to it. So there's no bug here, the behaviour is correct for IEEE-754, although perhaps the documentation is misleading.

Mark, is my explanation right?

----------
nosy: +mark.dickinson, steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Fri Dec 24 09:33:12 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Fri, 24 Dec 2021 14:33:12 +0000
Subject: [issue46169] Same-moment datetimes with different ZoneInfo timezones
 are not considered ==
In-Reply-To: <1640302049.86.0.995317132949.issue46169@roundup.psfhosted.org>
Message-ID: <1640356392.37.0.748024722192.issue46169@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
nosy: +belopolsky

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46169>
_______________________________________

From report at bugs.python.org  Fri Dec 24 10:57:30 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Fri, 24 Dec 2021 15:57:30 +0000
Subject: [issue46167] Parse assert (x == y,
 "Descriptive text") as statement params instead of a tuple
In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org>
Message-ID: <1640361450.07.0.455008577115.issue46167@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

You don?t have to use the new feature. But people expect it to work.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________

From report at bugs.python.org  Fri Dec 24 11:09:55 2021
From: report at bugs.python.org (Cyker Way)
Date: Fri, 24 Dec 2021 16:09:55 +0000
Subject: [issue46173] float(x) with large x not raise OverflowError
In-Reply-To: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>
Message-ID: <1640362195.58.0.773222600103.issue46173@roundup.psfhosted.org>


Cyker Way <cykerway at gmail.com> added the comment:

If python's float strictly adheres to IEEE 754 binary64 (is that so?), then the problem may be caused by rounding. However, even in that case I still don't get the benefits of doing range check on a rounded input but not the input itself. Does IEEE 754 itself give any specifications about range check and rounding during such type conversion?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Fri Dec 24 11:17:33 2021
From: report at bugs.python.org (Or)
Date: Fri, 24 Dec 2021 16:17:33 +0000
Subject: [issue46174] Feature Request for Python Interfaces
Message-ID: <1640362653.44.0.824482732412.issue46174@roundup.psfhosted.org>


New submission from Or <orieeeams at gmail.com>:

Most object oriented languages provide interfaces as part of the core language, this helps bring better design principles to a team's workflows.

Today Python provides the ABC module for abstract base classes and the Protocol class from typing module as something that might resemble an interface.

Creating abstract classes to simulate interface behavior is pretty tedious and the Protocol class is not supported by IDEs for type hints, completions, bug findings, etc.

I think the Python community would really benefit if we have an interface keyword built into the core language and enforced by the interpreter, similar to how it's implemented in Java and C#.

----------
messages: 409149
nosy: Orie
priority: normal
severity: normal
status: open
title: Feature Request for Python Interfaces
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46174>
_______________________________________

From report at bugs.python.org  Fri Dec 24 11:33:42 2021
From: report at bugs.python.org (Cyker Way)
Date: Fri, 24 Dec 2021 16:33:42 +0000
Subject: [issue46173] float(x) with large x not raise OverflowError
In-Reply-To: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>
Message-ID: <1640363622.48.0.411992901273.issue46173@roundup.psfhosted.org>


Cyker Way <cykerway at gmail.com> added the comment:

IEEE 754, 7.4 Overflow:

>   The overflow exception shall be signaled if and only if the destination format?s largest finite number is exceeded in magnitude by what would have been the rounded floating-point result (see 4) were the exponent range unbounded...

Were this the basis of the float implementation, not raising an overflow exception seems to be the correct behavior? Then this is not a bug, but the python float doc might better say "If the *rounded* argument is outside..."

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Fri Dec 24 12:11:52 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 24 Dec 2021 17:11:52 +0000
Subject: [issue46173] float(x) with large x not raise OverflowError
In-Reply-To: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>
Message-ID: <1640365912.24.0.184601737216.issue46173@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

Yes, exactly: Python's intentionally following the normal IEEE 754 rules for rounding a value to the binary64 format using the round-ties-to-even rounding rule, as formalised in section 7.4 of IEEE 754-2019 (and quoted by @cykerway). These are the exact same rules that are followed for conversion from str to float (where we return `inf` rather than raise `OverflowError` for large values, but the overflow boundary is the same), or conversion from Fraction to float, or conversion from Decimal to float, etc.

> the python float doc might better say "If the *rounded* argument is outside..."

Docs are hard. I think there's a danger that that word "rounded" would cause more confusion than it alleviates - to me, it suggests that there's some kind of rounding going on *before* conversion to float, rather than *as part of* the conversion to float. This isn't a language specification document, so it's not reasonable to give a perfectly accurate description of what happens - the actual meaning would be lost in the mass of details. (In this case, it would also be rather hard to be precise, given that we have to allow for platforms that aren't using IEEE 754.) I'm not seeing an obvious way to improve the docs here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Fri Dec 24 12:15:57 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 24 Dec 2021 17:15:57 +0000
Subject: [issue46173] float(x) with large x not raise OverflowError
In-Reply-To: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>
Message-ID: <1640366157.9.0.00740327508204.issue46173@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

If we wanted to make a change, I think the part of the docs that I'd target would be this sentence:

> a floating point number with the same value (within Python?s floating point precision) is returned

It's that "same value (within Python's floating point precision)" bit that I'd consider changing. We could consider replacing it with something along the lines that "an integer argument is rounded to the nearest float", possibly with an additional note that under the assumption of IEEE 754 binary64 format, we follow the usual IEEE 754 rules.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Fri Dec 24 12:16:15 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 24 Dec 2021 17:16:15 +0000
Subject: [issue46173] float(x) with large x not raise OverflowError
In-Reply-To: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>
Message-ID: <1640366175.66.0.319591402793.issue46173@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
resolution:  -> not a bug

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Fri Dec 24 13:18:26 2021
From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=)
Date: Fri, 24 Dec 2021 18:18:26 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1640369906.07.0.750579113579.issue46118@roundup.psfhosted.org>


Change by Filipe La?ns <lains at riseup.net>:


----------
nosy: +FFY00

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Fri Dec 24 13:19:34 2021
From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=)
Date: Fri, 24 Dec 2021 18:19:34 +0000
Subject: [issue46125] Test the preferred API instead of relying on legacy for
 coverage
In-Reply-To: <1639866651.22.0.383271924508.issue46125@roundup.psfhosted.org>
Message-ID: <1640369974.07.0.163945814225.issue46125@roundup.psfhosted.org>


Change by Filipe La?ns <lains at riseup.net>:


----------
nosy: +FFY00

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46125>
_______________________________________

From report at bugs.python.org  Fri Dec 24 13:21:46 2021
From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=)
Date: Fri, 24 Dec 2021 18:21:46 +0000
Subject: [issue46171] venv module produces spurious warning that location has
 moved
In-Reply-To: <1640338191.84.0.15434906765.issue46171@roundup.psfhosted.org>
Message-ID: <1640370106.26.0.23031555581.issue46171@roundup.psfhosted.org>


Change by Filipe La?ns <lains at riseup.net>:


----------
nosy: +FFY00

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46171>
_______________________________________

From report at bugs.python.org  Fri Dec 24 13:26:29 2021
From: report at bugs.python.org (Gobot1234)
Date: Fri, 24 Dec 2021 18:26:29 +0000
Subject: [issue46174] Feature Request for Python Interfaces
In-Reply-To: <1640362653.44.0.824482732412.issue46174@roundup.psfhosted.org>
Message-ID: <1640370389.54.0.389618209588.issue46174@roundup.psfhosted.org>


Gobot1234 <gobot1234yt at gmail.com> added the comment:

> Protocol class is not supported by IDEs for type hints, completions, bug findings, etc.

I think most good modern IDEs support using Protocols as type hints, offer completions on them and help you to find bugs with static analysis. That was one of the main reasons they were implemented.

----------
nosy: +Gobot1234

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46174>
_______________________________________

From report at bugs.python.org  Fri Dec 24 14:40:20 2021
From: report at bugs.python.org (Tim Peters)
Date: Fri, 24 Dec 2021 19:40:20 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640374820.82.0.994922890272.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

If people are keen to speed comb() for larger arguments, the approach in Stefan's "comb_with_primes.py" is very much worth looking at. I've played with that idea before, and it runs circles around any other approach I've seen.

The only divisions it does are of integers no larger than n by primes no larger than k (the "effective" k: min(k, n-k)). The current CPython implementation guarantees the latter fit in a C "long long", so the divisor is never notably stressful.

The downside is that it requires O(log(n) * k) temp storage, to hold list(range(n, n-k, -1)), and O(k) temp storage to hold a sieve to find the primes <= k.

A subtlety: Stefan's `myprod()` is also important to its speed gains when k gets large. For example, given xs = list(range(1, 1000000)), math.prod(xs) takes over 40 times longer than myprod(xs). myprod() is obscurely coded (presumably for peak speed), but effectively arranges the multiplications in a complete binary tree (e.g., myprod([1, 2, 3, 4, 5, 6, 7, 8]) is evaluated as ((1*2)*(3*4))*((5*6)*(7*8))). This gives Karatsuba multiplication good chances to get exploited at higher levels in the tree.

The "divide-and-conquer" recurrence already checked in also bought speed gains by getting Karatsuba in play, but is much less effective overall because it can still need divisions of giant ints by giant ints. Then again, it's frugal with memory.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Fri Dec 24 15:36:47 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 24 Dec 2021 20:36:47 +0000
Subject: [issue4079] urllib.requst.Request 'timeout' attribute needs to have a
 default
In-Reply-To: <1223490599.12.0.198174561396.issue4079@psf.upfronthosting.co.za>
Message-ID: <1640378207.74.0.180088765627.issue4079@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

urllib2 became urllib.request in 3.x.  In 2.6, 'timeout' became a parameter of both urlopen and OpenerDirector.open.  In both cases the default was and is the 'global default timeout setting'.  So 'timeout' has a default.

Both functions take a Request object in lieu of a url.  I see no indication that the Request object itself ever has a timeout attribute, at least not in .__init__.  It certainly does not now.  It seems that the idea was that timeouts are a property of an open action, not of the reusable Request object that wraps a url.


CacheFTPHandler.setTimeout() is for FTP handlers.

So it seems that this should be closed as either 'not a bug' or 'out of date'.

----------
nosy: +terry.reedy
title: new urllib2.Request 'timeout' attribute needs to have a default -> urllib.requst.Request 'timeout' attribute needs to have a default
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue4079>
_______________________________________

From report at bugs.python.org  Fri Dec 24 15:42:15 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 24 Dec 2021 20:42:15 +0000
Subject: [issue2756] urllib2 add_header fails with existing unredirected_header
In-Reply-To: <1209913898.38.0.175541514636.issue2756@psf.upfronthosting.co.za>
Message-ID: <1640378535.67.0.687877747832.issue2756@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Bug needs to be verified on 3.10 or 3.11.

----------
nosy: +terry.reedy
versions: +Python 3.10, Python 3.11 -Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue2756>
_______________________________________

From report at bugs.python.org  Fri Dec 24 15:42:46 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 24 Dec 2021 20:42:46 +0000
Subject: [issue2756] urllib.request.add_header fails with existing
 unredirected_header
In-Reply-To: <1209913898.38.0.175541514636.issue2756@psf.upfronthosting.co.za>
Message-ID: <1640378566.92.0.0800934342907.issue2756@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
title: urllib2 add_header fails with existing unredirected_header -> urllib.request.add_header fails with existing unredirected_header

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue2756>
_______________________________________

From report at bugs.python.org  Fri Dec 24 15:52:45 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 24 Dec 2021 20:52:45 +0000
Subject: [issue10202] ftplib doesn't check close status after sending file
In-Reply-To: <1288119890.05.0.476969255522.issue10202@psf.upfronthosting.co.za>
Message-ID: <1640379165.02.0.460711373323.issue10202@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:

[pasting in my investigation that I replied with on a mailing list:]

The possible problem does appear real but it likely not frequently observed and is something most people reading the code wouldn't see as it's rather esoteric:

https://blog.netherlabs.nl/articles/2009/01/18/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable
via https://stackoverflow.com/questions/8874021/close-socket-directly-after-send-unsafe describes the scenario.

So does this apply in Python?

Apparently.  Our socket module close() is simply calling close as expected.
 https://github.com/python/cpython/blob/main/Modules/socketmodule.c#L3132 ->
 https://github.com/python/cpython/blob/main/Modules/socketmodule.c#L443

Our ftplib code that implicitly calls close on the data connection when exiting the
 `        with self.transfercmd(cmd, rest) as conn: ` context manager
https://github.com/python/cpython/blob/main/Lib/ftplib.py#L498`

Triggers a close() without a prior shutdown(socket.SHUT_RDWR) + read() -> EOF or timeout dance.

In most protocols this isn't a big deal. ftp being so old as to rely solely on the TCP connection itself is the outlier.

How often does this happen in practice?  I don't know.  I haven't heard of it happening, but how many people honestly use ftplib to send data between operating systems where a socket close triggering a TCP RST rather than FIN on the sender might be more likely in the past 20 years?  I suspect not many.  

The code can be improved to prevent it.  But I don't believe it'll be feasible to construct a real world not-mock-filled regression test that would fail without it.

Potential solution:
  Do the shutdown+recv EOF dance as the final step inside of the storbinary and storlines `with self.transfercmd as conn` blocks.

Technically speaking socket.socket.shutdown() is conditionally compiled but I don't know if any platforms lacking the socket shutdown API exist anymore (my guess is that conditional compilation for shutdown is a leftover from the 1990s). If so, a "if hasattr(conn, 'shutdown'):" conditional before the added logic would suffice.

Looking at various ftp client source code (netkit ftp & netbsd ftp - both bsd derivatives) as well as a modern gonuts golang one I do not see them explicitly doing the shutdown dance.  (I didn't dive in to figure out if it is hidden within their flclose() or conn.Close() implementations as that'd be surprising)

----------
nosy: +gregory.p.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10202>
_______________________________________

From report at bugs.python.org  Fri Dec 24 15:53:20 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 24 Dec 2021 20:53:20 +0000
Subject: [issue10202] ftplib doesn't check close status after sending file
In-Reply-To: <1288119890.05.0.476969255522.issue10202@psf.upfronthosting.co.za>
Message-ID: <1640379200.19.0.865974618739.issue10202@roundup.psfhosted.org>


Change by Gregory P. Smith <greg at krypto.org>:


----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10202>
_______________________________________

From report at bugs.python.org  Fri Dec 24 15:53:29 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 24 Dec 2021 20:53:29 +0000
Subject: [issue10202] ftplib doesn't check close status after sending file
In-Reply-To: <1288119890.05.0.476969255522.issue10202@psf.upfronthosting.co.za>
Message-ID: <1640379209.35.0.579993336647.issue10202@roundup.psfhosted.org>


Change by Gregory P. Smith <greg at krypto.org>:


----------
stage: test needed -> needs patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10202>
_______________________________________

From report at bugs.python.org  Fri Dec 24 16:36:38 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Fri, 24 Dec 2021 21:36:38 +0000
Subject: [issue46120] Add note to `typing.Union` that it is recommended to use
 `|` instead
In-Reply-To: <1639815639.46.0.989122263928.issue46120@roundup.psfhosted.org>
Message-ID: <1640381798.98.0.078667728971.issue46120@roundup.psfhosted.org>


Gregory P. Smith <greg at krypto.org> added the comment:


New changeset 1b30660c3b40da557050948ac8635f2dc50c4ee2 by Nikita Sobolev in branch 'main':
bpo-46120: State that `|` is preferred over `Union` (GH-30222)
https://github.com/python/cpython/commit/1b30660c3b40da557050948ac8635f2dc50c4ee2


----------
nosy: +gregory.p.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46120>
_______________________________________

From report at bugs.python.org  Fri Dec 24 16:38:26 2021
From: report at bugs.python.org (Marc Mueller)
Date: Fri, 24 Dec 2021 21:38:26 +0000
Subject: [issue46162] Make `builtins.property` generic
In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org>
Message-ID: <1640381906.6.0.426214199286.issue46162@roundup.psfhosted.org>


Change by Marc Mueller <cdce8p at gmail.com>:


----------
nosy: +cdce8p

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46162>
_______________________________________

From report at bugs.python.org  Fri Dec 24 16:42:50 2021
From: report at bugs.python.org (Alex Waygood)
Date: Fri, 24 Dec 2021 21:42:50 +0000
Subject: [issue46162] Make `builtins.property` generic
In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org>
Message-ID: <1640382170.38.0.907330283855.issue46162@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46162>
_______________________________________

From report at bugs.python.org  Fri Dec 24 16:44:39 2021
From: report at bugs.python.org (miss-islington)
Date: Fri, 24 Dec 2021 21:44:39 +0000
Subject: [issue46120] Add note to `typing.Union` that it is recommended to use
 `|` instead
In-Reply-To: <1639815639.46.0.989122263928.issue46120@roundup.psfhosted.org>
Message-ID: <1640382279.81.0.365460703336.issue46120@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +28472
pull_request: https://github.com/python/cpython/pull/30250

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46120>
_______________________________________

From report at bugs.python.org  Fri Dec 24 17:29:09 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 24 Dec 2021 22:29:09 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1640384949.68.0.127606209392.issue46126@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

> I presume I don't need to explain why docstrings are nice and preferable over comments.

Actually, can you?

Docstrings to document regular modules, classes or functions are a fine tool, especially with tools that extract them (pydoc, sphinx).  I don?t see the same need for test functions.

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Fri Dec 24 17:40:30 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Fri, 24 Dec 2021 22:40:30 +0000
Subject: [issue46162] Make `builtins.property` generic
In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org>
Message-ID: <1640385630.31.0.295208836534.issue46162@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Serhiy, no, we can infer that.

There are two general cases:

1. `x = property(x_get, x_set)`, it is just ideal
2. `@property x` and `@x.setter`, it is also inferable with a bit of special casing for the mutable type part (we mutate the type of `x` when adding a setter)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46162>
_______________________________________

From report at bugs.python.org  Fri Dec 24 17:52:24 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 24 Dec 2021 22:52:24 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1640386344.94.0.743455838325.issue46126@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I also use comments in lieu of docstrings for text_xyx methods because I find the addition of the first line of the docstring in error reports to be useless, distracting, and sometimes, depending on the content, confusing.  If the error is in the test method, the full comment is available when looking back at the method code.  If the error is in the tested code, the comment/docstring is inapplicable.

When I edit test files, I run them directly from an IDLE editor via the 'if __name__' clause.  When I run all IDLE tests from Command Prompt, I usually run 'python -m test.test_idle'.  (Similar but not necessarily identical to 'python -m -ugui test_idle'.)  So fiddling with regrtest will not help in either case.

Based on the above, the following seems to work.
    runner = unittest.TextTestRunner(descriptions=False, verbosity=2)    
    unittest.main(testRunner=runner)
I am not sure what passing a runner does, versus leaving the default None, but the verbosity passed to the runner overrides and verbosity argument passed to main.  What I would like is 'descriptions' added as a parameter to main, so that
    unittest.main(descriptions=False, verbosity=2)
would work.

----------
nosy: +terry.reedy -eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Fri Dec 24 18:09:38 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 24 Dec 2021 23:09:38 +0000
Subject: [issue46166] Get "self" args or non-null co_varnames from frame
 object with C-API
In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org>
Message-ID: <1640387378.07.0.532931319395.issue46166@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Pablo, Mark: I am guessing that at least one of you know about this.

----------
nosy: +Mark.Shannon, pablogsal, terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46166>
_______________________________________

From report at bugs.python.org  Fri Dec 24 18:40:21 2021
From: report at bugs.python.org (Cyker Way)
Date: Fri, 24 Dec 2021 23:40:21 +0000
Subject: [issue46173] float(x) with large x not raise OverflowError
In-Reply-To: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>
Message-ID: <1640389221.41.0.938480898517.issue46173@roundup.psfhosted.org>


Cyker Way <cykerway at gmail.com> added the comment:

Alright that helps. I guess I now understand what's happening here. Here are the two numbers in question:

>>> M = int('1'*53+'0'*971, 2)
>>> N = int('1'*53+'0'+'1'*970, 2)

M is the largest number in binary64 range, while N is the largest number that does not emit an OverflowError when converted to binary64. N+1 will emit that error. N-M == 2**970-1 which means N is larger than M that caused the confusion.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Fri Dec 24 20:56:38 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 25 Dec 2021 01:56:38 +0000
Subject: [issue46172] [doc] Outdated description of `license` object
In-Reply-To: <1640339627.46.0.314703994034.issue46172@roundup.psfhosted.org>
Message-ID: <1640397398.31.0.426164651592.issue46172@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

On Windows, with the python.orgs 3.9.9, 3.10.1, and 3.11.0b3 installers, 'licence' displays the documented text. Ditto for all 3 build from repository.  Ditto for 3.10.1 on Mac.  The behavior is set, I believe, in site.py, so your system ignored the doc.  What are you running on?

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46172>
_______________________________________

From report at bugs.python.org  Fri Dec 24 21:02:53 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 25 Dec 2021 02:02:53 +0000
Subject: [issue46174] Feature Request for Python Interfaces
In-Reply-To: <1640362653.44.0.824482732412.issue46174@roundup.psfhosted.org>
Message-ID: <1640397773.74.0.315470023051.issue46174@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

(IDLE does not support typing.Protocol classes, because no one has proposed that it do so, let alone submit a patch.)

A new keyword requires a PEP that specifies the syntax for an 'interface' statement and what such a statement would do.  You should start with discussion on the python-ideas list.  This should probably be closed until there is a concrete proposal that could be evaluated and possibly implemented or rejected.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46174>
_______________________________________

From report at bugs.python.org  Fri Dec 24 22:25:41 2021
From: report at bugs.python.org (Alex Walters)
Date: Sat, 25 Dec 2021 03:25:41 +0000
Subject: [issue46175] Zero argument super() does not function properly inside
 generator expressions
Message-ID: <1640402741.49.0.663575697797.issue46175@roundup.psfhosted.org>


New submission from Alex Walters <tritium-list at sdamon.com>:

When zero argument super is used inside a generator expression, it raises 'TypeError: super(type, obj): obj must be an instance or subtype of type'.

I can find no information on if this is working as intended, a bug, or a known issue, and the error isn't helping.  Attached is a minimal example of the error.

----------
files: superbug.py
messages: 409166
nosy: tritium
priority: normal
severity: normal
status: open
title: Zero argument super() does not function properly inside generator expressions
versions: Python 3.9
Added file: https://bugs.python.org/file50518/superbug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46175>
_______________________________________

From report at bugs.python.org  Fri Dec 24 23:55:58 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Sat, 25 Dec 2021 04:55:58 +0000
Subject: [issue45665] Problems caused by isinstance(list[int],
 type) returning True
In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org>
Message-ID: <1640408158.94.0.796543521708.issue45665@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

See https://github.com/python/mypy/issues/9773#issuecomment-1000975000. I may have talked myself into agreeing with Serhiy there! It does seem inconsistent that Any is not considered a type but list[int] is:

>>> isinstance(list[int], type)
True
>>> import typing
>>> isinstance(typing.Any, type)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45665>
_______________________________________

From report at bugs.python.org  Sat Dec 25 02:24:28 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 25 Dec 2021 07:24:28 +0000
Subject: [issue46126] Unittest output drives developers to avoid docstrings
In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org>
Message-ID: <1640417068.87.0.326045151078.issue46126@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46126>
_______________________________________

From report at bugs.python.org  Sat Dec 25 04:31:59 2021
From: report at bugs.python.org (CCXXXI)
Date: Sat, 25 Dec 2021 09:31:59 +0000
Subject: [issue46172] [doc] Outdated description of `license` object
In-Reply-To: <1640339627.46.0.314703994034.issue46172@roundup.psfhosted.org>
Message-ID: <1640424719.71.0.701486582447.issue46172@roundup.psfhosted.org>


CCXXXI <ccxxxi at qq.com> added the comment:

3.10.1 packaged by conda-forge on Windows. Maybe the behavior is changed by conda-forge.

```
from sys import version

print(version)
print(license)
license()
```

```
3.10.1 | packaged by conda-forge | (main, Dec 22 2021, 01:34:40) [MSC v.1929 64 bit (AMD64)]
See https://www.python.org/psf/license/
See https://www.python.org/psf/license/
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46172>
_______________________________________

From report at bugs.python.org  Sat Dec 25 04:37:23 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 25 Dec 2021 09:37:23 +0000
Subject: [issue46175] Zero argument super() does not function properly inside
 generator expressions
In-Reply-To: <1640402741.49.0.663575697797.issue46175@roundup.psfhosted.org>
Message-ID: <1640425043.01.0.22912454452.issue46175@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46175>
_______________________________________

From report at bugs.python.org  Sat Dec 25 05:23:30 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sat, 25 Dec 2021 10:23:30 +0000
Subject: [issue4079] urllib.request.Request 'timeout' attribute needs to have
 a default
In-Reply-To: <1223490599.12.0.198174561396.issue4079@psf.upfronthosting.co.za>
Message-ID: <1640427810.92.0.0629350084948.issue4079@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
title: urllib.requst.Request 'timeout' attribute needs to have a default -> urllib.request.Request 'timeout' attribute needs to have a default

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue4079>
_______________________________________

From report at bugs.python.org  Sat Dec 25 06:10:06 2021
From: report at bugs.python.org (David CARLIER)
Date: Sat, 25 Dec 2021 11:10:06 +0000
Subject: [issue46176] mmap module add MAP_STACK constant mostly for OpenBSD
Message-ID: <1640430606.11.0.300408283052.issue46176@roundup.psfhosted.org>


Change by David CARLIER <devnexen at gmail.com>:


----------
components: Library (Lib)
nosy: devnexen
priority: normal
pull_requests: 28473
severity: normal
status: open
title: mmap module add MAP_STACK constant mostly for OpenBSD
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46176>
_______________________________________

From report at bugs.python.org  Sat Dec 25 07:15:03 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 25 Dec 2021 12:15:03 +0000
Subject: [issue40296] help(list[int]) fails
In-Reply-To: <1586983817.03.0.686824683966.issue40296@roundup.psfhosted.org>
Message-ID: <1640434503.84.0.431262733817.issue40296@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
keywords: +patch
pull_requests: +28474
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30253

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40296>
_______________________________________

From report at bugs.python.org  Sat Dec 25 07:16:19 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 25 Dec 2021 12:16:19 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1640434579.09.0.801515796362.issue46032@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 078abb676cf759b1e960f78390b6e80f256f0255 by Serhiy Storchaka in branch 'main':
bpo-46032: Check types in singledispatch's register() at declaration time (GH-30050)
https://github.com/python/cpython/commit/078abb676cf759b1e960f78390b6e80f256f0255


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sat Dec 25 08:28:39 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 25 Dec 2021 13:28:39 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1640438919.52.0.170000090181.issue46032@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
pull_requests: +28475
pull_request: https://github.com/python/cpython/pull/30254

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sat Dec 25 09:12:41 2021
From: report at bugs.python.org (miss-islington)
Date: Sat, 25 Dec 2021 14:12:41 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1640441561.16.0.704808740488.issue46032@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +28476
pull_request: https://github.com/python/cpython/pull/30255

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sat Dec 25 09:12:57 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sat, 25 Dec 2021 14:12:57 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1640441577.15.0.188091940712.issue46032@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 03c7449fbc7c57f5e0365f234a0b65c1dde763f2 by Serhiy Storchaka in branch '3.10':
[3.10] bpo-46032: Check types in singledispatch's register() at declaration time (GH-30050) (GH-30254)
https://github.com/python/cpython/commit/03c7449fbc7c57f5e0365f234a0b65c1dde763f2


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sat Dec 25 10:07:37 2021
From: report at bugs.python.org (Carlos Damazio)
Date: Sat, 25 Dec 2021 15:07:37 +0000
Subject: [issue46175] Zero argument super() does not function properly inside
 generator expressions
In-Reply-To: <1640402741.49.0.663575697797.issue46175@roundup.psfhosted.org>
Message-ID: <1640444857.83.0.137243464983.issue46175@roundup.psfhosted.org>


Carlos Damazio <carlos.damazio at damazio.dev> added the comment:

By explicitly sending a type and object to the super function, it should work as usual, like in the file that I've just sent. I've seen this behavior before, it's related to Python's module reload function, which returns a new reference to the reloaded module. This issue is not widely known though, should be documented.

----------
nosy: +carlosdamazio
Added file: https://bugs.python.org/file50519/superbug-fixd.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46175>
_______________________________________

From report at bugs.python.org  Sat Dec 25 12:41:25 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Sat, 25 Dec 2021 17:41:25 +0000
Subject: [issue46173] Clarify conditions under which float(x) with large x
 raises OverflowError
In-Reply-To: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>
Message-ID: <1640454085.86.0.175488643771.issue46173@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

Changing to a documentation issue.

----------
assignee:  -> docs at python
components: +Documentation -Interpreter Core
nosy: +docs at python
resolution: not a bug -> 
title: float(x) with large x not raise OverflowError -> Clarify conditions under which float(x) with large x raises OverflowError
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Sat Dec 25 14:00:42 2021
From: report at bugs.python.org (Amine Harrabi)
Date: Sat, 25 Dec 2021 19:00:42 +0000
Subject: [issue46177] can't install launcher for all users
Message-ID: <1640458842.49.0.0625081718975.issue46177@roundup.psfhosted.org>


New submission from Amine Harrabi <amineiiiiharrabi at gmail.com>:

the install launcher for all users is grayed out although im logged in as admin

----------
components: Windows
messages: 409173
nosy: Amine, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: can't install launcher for all users
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46177>
_______________________________________

From report at bugs.python.org  Sat Dec 25 14:01:38 2021
From: report at bugs.python.org (Amine Harrabi)
Date: Sat, 25 Dec 2021 19:01:38 +0000
Subject: [issue46177] can't install launcher for all users
In-Reply-To: <1640458842.49.0.0625081718975.issue46177@roundup.psfhosted.org>
Message-ID: <1640458898.71.0.958073667131.issue46177@roundup.psfhosted.org>


Change by Amine Harrabi <amineiiiiharrabi at gmail.com>:


----------
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46177>
_______________________________________

From report at bugs.python.org  Sat Dec 25 14:02:02 2021
From: report at bugs.python.org (Amine Harrabi)
Date: Sat, 25 Dec 2021 19:02:02 +0000
Subject: [issue46177] can't install launcher for all users
In-Reply-To: <1640458842.49.0.0625081718975.issue46177@roundup.psfhosted.org>
Message-ID: <1640458922.03.0.143613705138.issue46177@roundup.psfhosted.org>


Change by Amine Harrabi <amineiiiiharrabi at gmail.com>:


Added file: https://bugs.python.org/file50520/Annotation 2021-12-25 165843.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46177>
_______________________________________

From report at bugs.python.org  Sat Dec 25 14:08:40 2021
From: report at bugs.python.org (Amine Harrabi)
Date: Sat, 25 Dec 2021 19:08:40 +0000
Subject: [issue46177] can't install launcher for all users
In-Reply-To: <1640458842.49.0.0625081718975.issue46177@roundup.psfhosted.org>
Message-ID: <1640459320.22.0.0375171048131.issue46177@roundup.psfhosted.org>


Amine Harrabi <amineiiiiharrabi at gmail.com> added the comment:

the install launcher for all users is grayed out although im logged in as admin
windows 10 64bit

----------
Added file: https://bugs.python.org/file50521/Annotation 2021-12-25 165843.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46177>
_______________________________________

From report at bugs.python.org  Sat Dec 25 16:23:02 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Sat, 25 Dec 2021 21:23:02 +0000
Subject: [issue46177] can't install launcher for all users
In-Reply-To: <1640458842.49.0.0625081718975.issue46177@roundup.psfhosted.org>
Message-ID: <1640467382.08.0.69630981474.issue46177@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

Try right-clicking the installer and choosing "run as administrator". Then hopefully that checkbox should be available.

It's not enough to be logged in as an admin, you also have to run this particular program with admin permissions.

----------
nosy: +Dennis Sweeney

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46177>
_______________________________________

From report at bugs.python.org  Sat Dec 25 17:25:27 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 25 Dec 2021 22:25:27 +0000
Subject: [issue42259] pprint: infinite recursion for saferepr() when using
 nested objects, but str() works
In-Reply-To: <1604490271.59.0.652277780579.issue42259@roundup.psfhosted.org>
Message-ID: <1640471127.28.0.431064519827.issue42259@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
keywords: +patch
nosy: +andrei.avk
nosy_count: 2.0 -> 3.0
pull_requests: +28477
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30256

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42259>
_______________________________________

From report at bugs.python.org  Sat Dec 25 17:49:13 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 25 Dec 2021 22:49:13 +0000
Subject: [issue42259] pprint: infinite recursion for saferepr() when using
 nested objects, but str() works
In-Reply-To: <1604490271.59.0.652277780579.issue42259@roundup.psfhosted.org>
Message-ID: <1640472553.42.0.31208084636.issue42259@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

The recursion protection in `saferepr` applies when two conditions are met: 

- the structure is subclassed from list, tuple or dict
- __repr__ is not overriden

In this case neither condition is met.

However, the recursion is caused by the `__repr__` so when it's removed, recursion doesn't happen (but not due to recursion protection).

Btw also note that recursive path must be continuous for recursion detection to apply, e.g. if it's list[cust_obj[list[cust_obj...]]], detection also won't work.

I don't think we can fix this in code in a straightforward way, because  we want to avoid recursively calling saferepr in case __repr__ does not recurse.

In other words, if we knew __repr__ DOES recurse, we could call saferepr recursively and apply recursion detection without any problems, but __repr__ might intentionally say something like "<Mylist: 1423434 items>", and then recursively calling saferepr would be undesirable.

So unfortunately we lose the recursion detection because of that.

One possible option would be to add an optional param like *force_recursion*, to recurse with detection even on overridden *__repr__*. I'm not sure it's worth it. But that's something users can consider: subclass PrettyPrinter and override saferepr() and either remove the checks for __repr__ override or add a param to do just that.

Current docs really make it sound like any recursion that shows up in repr() will be protected; it's really much more limited than that. Adding PR to clarify the limitations.

----------
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42259>
_______________________________________

From report at bugs.python.org  Sat Dec 25 19:32:27 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Sun, 26 Dec 2021 00:32:27 +0000
Subject: [issue978604] wait_variable hangs at exit
Message-ID: <1640478747.23.0.0963899463083.issue978604@roundup.psfhosted.org>


Daniel Diniz <ajaksu at gmail.com> added the comment:

Confirmed on Python 3.11.0a3+, assuming older versions also affected. This issue has different versions of tests to confirm it, but I think not in a test suite-friendly format yet.

There's also a patch and detailed analysis by gpolo indicating that it might need editing _tkinter.c to handle fallout from his proposed Python-side patch.

----------
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue978604>
_______________________________________

From report at bugs.python.org  Sun Dec 26 00:28:37 2021
From: report at bugs.python.org (TobiasHT)
Date: Sun, 26 Dec 2021 05:28:37 +0000
Subject: [issue46175] Zero argument super() does not function properly inside
 generator expressions
In-Reply-To: <1640402741.49.0.663575697797.issue46175@roundup.psfhosted.org>
Message-ID: <1640496517.95.0.835144896476.issue46175@roundup.psfhosted.org>


TobiasHT <higenyi.tobias at gmail.com> added the comment:

I'm not so sure, but I think this characteristic was carried from python 2. I guess it's not well documented because they assumed that people would carry on the knowledge to python 3. To be on the safe side, I always pass the arguments to super.

https://docs.python.org/2/library/functions.html#super

----------
nosy: +TobiasHT

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46175>
_______________________________________

From report at bugs.python.org  Sun Dec 26 03:34:18 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Sun, 26 Dec 2021 08:34:18 +0000
Subject: [issue46117] tk could not refresh auto in mac os
In-Reply-To: <1639751230.51.0.11843295078.issue46117@roundup.psfhosted.org>
Message-ID: <1640507658.97.0.405856955934.issue46117@roundup.psfhosted.org>


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

I don't know why it doesn't work for you. The version of Tk looks recent enough.

As I mentioned before I don't see this problem using the script in your initial message, it works fine both with and without changing the size of the window. 

You could try installing Python 3.10.1, which should get you the exact some binary and Tcl/Tk version as I'm using. That might fix the problem.

Btw. I'm on an M1 MacBook, although that shouldn't be relevant here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46117>
_______________________________________

From report at bugs.python.org  Sun Dec 26 04:23:24 2021
From: report at bugs.python.org (Ronald Oussoren)
Date: Sun, 26 Dec 2021 09:23:24 +0000
Subject: [issue46174] Feature Request for Python Interfaces
In-Reply-To: <1640362653.44.0.824482732412.issue46174@roundup.psfhosted.org>
Message-ID: <1640510604.52.0.850176038791.issue46174@roundup.psfhosted.org>


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

I agree with Terry. This requires a clear proposal that describes the behaviour and differences with ABC-s.

I'm closing this issue for now.

----------
nosy: +ronaldoussoren
resolution:  -> later
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46174>
_______________________________________

From report at bugs.python.org  Sun Dec 26 04:27:08 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sun, 26 Dec 2021 09:27:08 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
Message-ID: <1640510828.17.0.55395849901.issue46170@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

This seems like a good idea to me.

I will send a PR for others to judge :)

----------
nosy: +sobolevn

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Sun Dec 26 04:34:33 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sun, 26 Dec 2021 09:34:33 +0000
Subject: [issue46178] Remove `.travis.yml`?
Message-ID: <1640511273.57.0.0109670921395.issue46178@roundup.psfhosted.org>


New submission from Nikita Sobolev <mail at sobolevn.me>:

Travis does not seem to be used anymore. 
There are not builds in Travis for cpython on `.org`: https://travis-ci.org/github/python/cpython/builds
The last build on `.com` is 6 month old: https://app.travis-ci.com/github/python/cpython/builds

If some information from this file will be needed in the future, we can always find its legacy version in git.

I will send a PR!

----------
components: Build
messages: 409182
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Remove `.travis.yml`?
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46178>
_______________________________________

From report at bugs.python.org  Sun Dec 26 04:37:22 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sun, 26 Dec 2021 09:37:22 +0000
Subject: [issue46178] Remove `.travis.yml`?
In-Reply-To: <1640511273.57.0.0109670921395.issue46178@roundup.psfhosted.org>
Message-ID: <1640511442.49.0.598985126954.issue46178@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
pull_requests: +28478
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30257

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46178>
_______________________________________

From report at bugs.python.org  Sun Dec 26 04:37:38 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sun, 26 Dec 2021 09:37:38 +0000
Subject: [issue46178] Remove `.travis.yml`?
In-Reply-To: <1640511273.57.0.0109670921395.issue46178@roundup.psfhosted.org>
Message-ID: <1640511458.45.0.546254849791.issue46178@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Permanent link to the last version of this file: https://github.com/python/cpython/blob/078abb676cf759b1e960f78390b6e80f256f0255/.travis.yml

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46178>
_______________________________________

From report at bugs.python.org  Sun Dec 26 04:42:47 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sun, 26 Dec 2021 09:42:47 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
Message-ID: <1640511767.73.0.781481902887.issue46170@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

> I'd be happy to patch this myself if this sounds like a good idea.

Oh, please, go ahead! :)
Would be happy to review.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Sun Dec 26 04:58:08 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 09:58:08 +0000
Subject: [issue45878] Use `self.assertRaises` instead of `try/except` in
 `ctypes/test_functions.py::test_mro`
In-Reply-To: <1637659974.6.0.574362436807.issue45878@roundup.psfhosted.org>
Message-ID: <1640512688.03.0.20830139634.issue45878@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
pull_requests: +28479
pull_request: https://github.com/python/cpython/pull/30258

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45878>
_______________________________________

From report at bugs.python.org  Sun Dec 26 05:00:12 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 10:00:12 +0000
Subject: [issue45878] Use `self.assertRaises` instead of `try/except` in
 `ctypes/test_functions.py::test_mro`
In-Reply-To: <1637659974.6.0.574362436807.issue45878@roundup.psfhosted.org>
Message-ID: <1640512812.24.0.0302990339566.issue45878@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
pull_requests: +28480
pull_request: https://github.com/python/cpython/pull/30259

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45878>
_______________________________________

From report at bugs.python.org  Sun Dec 26 05:02:13 2021
From: report at bugs.python.org (Jason Yang)
Date: Sun, 26 Dec 2021 10:02:13 +0000
Subject: [issue46179] Delete selected item generate "<<TreeviewSelect>>" event
 or not in different version of tkinter or Python
Message-ID: <1640512933.66.0.468585865252.issue46179@roundup.psfhosted.org>


New submission from Jason Yang <jason990420 at outlook.com>:

In python(3.8.10)/tkinter(8.6.9), it won't generate "<<TreeviewSelect>>" event if we delete selected item of ttk.Treeview, but it will for python(3.9.9/3.10.1)/tkinter(8.6.12).

Check it just by clicking 'Delete Item 1' button in following demo code

```python
import sys
from random import randint
from datetime import datetime
import tkinter as tk
from tkinter import ttk

def button_callback():
    button.configure(state='disabled')
    treeview.delete(1)

def treeview_callback(event):
    print(datetime.now().strftime("%H:%M:%S"), "Treeview selection changed !")

print(f"Python version : {sys.version.split(' ')[0]}")
print(f"tkinter version: {tk.Tcl().eval('info patchlevel')}")

columns = ('President', 'Birthday')
data = [
    ('Ronald Reagan', 'February 6'),
    ('Abraham Lincoln', 'February 12'),
    ('George Washington', 'February 22'),
    ('Andrew Jackson', 'March 15'),
    ('Thomas Jefferson', 'April 13'),
]

root = tk.Tk()

treeview = ttk.Treeview(root, columns=columns, height=5, show='headings')
treeview.pack()
for column in columns:
    treeview.heading(column, text=column)
    treeview.column(column, width=150)
for i, row in enumerate(data):
    treeview.insert('', i, iid=i, text=str(i), values=row)
treeview.selection_set(1)

button = tk.Button(root, text='Delete Item 1', command=button_callback)
button.pack()

treeview.bind("<<TreeviewSelect>>", treeview_callback)

root.mainloop()
```

```python
d:\>python test3.py
Python version : 3.8.10
tkinter version: 8.6.9
17:57:43 Treeview selection changed !

d:\>python test3.py
Python version : 3.9.9
tkinter version: 8.6.12
17:58:10 Treeview selection changed !
17:58:11 Treeview selection changed !

d:\>python test3.py
Python version : 3.10.1
tkinter version: 8.6.12
18:01:10 Treeview selection changed !
18:01:12 Treeview selection changed !
```

----------
components: Tkinter
messages: 409185
nosy: Jason990420
priority: normal
severity: normal
status: open
title: Delete selected item generate "<<TreeviewSelect>>" event or not in different version of tkinter or Python
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46179>
_______________________________________

From report at bugs.python.org  Sun Dec 26 05:37:47 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 10:37:47 +0000
Subject: [issue45878] Use `self.assertRaises` instead of `try/except` in
 `ctypes/test_functions.py::test_mro`
In-Reply-To: <1637659974.6.0.574362436807.issue45878@roundup.psfhosted.org>
Message-ID: <1640515067.74.0.657159151691.issue45878@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 11909c12c75a7f377460561abc97707a4006fc07 by Serhiy Storchaka in branch '3.10':
[3.10] Remove a NEWS entry for bpo-45878 (GH-30258)
https://github.com/python/cpython/commit/11909c12c75a7f377460561abc97707a4006fc07


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45878>
_______________________________________

From report at bugs.python.org  Sun Dec 26 05:37:57 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 26 Dec 2021 10:37:57 +0000
Subject: [issue45878] Use `self.assertRaises` instead of `try/except` in
 `ctypes/test_functions.py::test_mro`
In-Reply-To: <1637659974.6.0.574362436807.issue45878@roundup.psfhosted.org>
Message-ID: <1640515077.05.0.0641005499025.issue45878@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28481
pull_request: https://github.com/python/cpython/pull/30260

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45878>
_______________________________________

From report at bugs.python.org  Sun Dec 26 05:38:23 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 10:38:23 +0000
Subject: [issue45878] Use `self.assertRaises` instead of `try/except` in
 `ctypes/test_functions.py::test_mro`
In-Reply-To: <1637659974.6.0.574362436807.issue45878@roundup.psfhosted.org>
Message-ID: <1640515103.08.0.965607511284.issue45878@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 1fb7c61ca76c6fbff4d90b272e34e92bc2c7d729 by Serhiy Storchaka in branch 'main':
Remove a NEWS entry for bpo-45878 (GH-30259)
https://github.com/python/cpython/commit/1fb7c61ca76c6fbff4d90b272e34e92bc2c7d729


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45878>
_______________________________________

From report at bugs.python.org  Sun Dec 26 05:39:08 2021
From: report at bugs.python.org (Jason Yang)
Date: Sun, 26 Dec 2021 10:39:08 +0000
Subject: [issue46180] Button clicked failed when mouse hover tooltip and
 tooltip destroyed
Message-ID: <1640515148.68.0.766649384181.issue46180@roundup.psfhosted.org>


New submission from Jason Yang <jason990420 at outlook.com>:

Button no response when clicked if mouse move into tooltip and tooltip destroyed for Python 3.9.9/3.10.1 and tkinter 8.6.12

You can check it by moving mouse into button, then move to tooltip after it shown, then click button and you won't get response for button clicked, but "Leave". It is OK for lower version of Python/tkinter.

```python
import sys
from datetime import datetime
import tkinter as tk

class Tooltip(object):
    """
    create a tooltip for a given widget
    """
    def __init__(self, widget, text='widget info'):
        self.waittime = 500     # miliseconds
        self.widget = widget
        self.text = text
        self.widget.bind("<Enter>", self.enter)
        self.widget.bind("<Leave>", self.leave)
        self.widget.bind("<ButtonPress>", self.leave)
        self.id = None
        self.top = None

    def enter(self, event=None):
        print(now(), "Enter")
        self.schedule()

    def leave(self, event=None):
        print(now(), "Leave")
        self.unschedule()
        self.hidetip()

    def schedule(self):
        self.unschedule()
        self.id = self.widget.after(self.waittime, self.showtip)

    def unschedule(self):
        id = self.id
        self.id = None
        if id:
            self.widget.after_cancel(id)

    def showtip(self, event=None):
        x = y = 0
        x, y, cx, cy = self.widget.bbox("insert")
        x += self.widget.winfo_rootx() + self.widget.winfo_width()//2
        y += self.widget.winfo_rooty() + self.widget.winfo_height()//2
        self.top = tk.Toplevel(self.widget)
        self.top.wm_overrideredirect(True)
        self.top.wm_geometry("+%d+%d" % (x, y))
        label = tk.Label(self.top, text=self.text, bd=1, font=font, relief='solid')
        label.pack(ipadx=1)

    def hidetip(self):
        top = self.top
        self.top = None
        if top:
            top.destroy()

def now():
    return datetime.now().strftime("%H:%M:%S")

print(f"Python version : {sys.version.split(' ')[0]}")
print(f"tkinter version: {tk.Tcl().eval('info patchlevel')}")

font = ("Courier New", 40)

root = tk.Tk()
button = tk.Button(root, text="button", font=font,
    command=lambda:print(now(), 'Button clicked'))
button.pack(padx=10, pady=5)
tooltip = Tooltip(button, 'This is button 1')

root.mainloop()
```

```python
d:\>python test.py
Python version : 3.10.1
tkinter version: 8.6.12
18:21:52 Enter (Mouse to button)
18:21:54 Leave (mouse to tooltip)
18:21:55 Leave (button clicked get no response)
18:21:57 Leave (button clicked get no response)
18:21:58 Leave (button clicked get no response)

d:\>python test.py
Python version : 3.9.9
tkinter version: 8.6.12
18:22:51 Enter (Mouse to button)
18:22:54 Leave (mouse to tooltip)
18:22:55 Leave (button clicked get no response)
18:22:56 Leave (button clicked get no response)
18:22:57 Leave (button clicked get no response)

d:\>python test.py
Python version : 3.8.10
tkinter version: 8.6.9
18:23:22 Enter (Mouse to button)
18:23:23 Leave (mouse to tooltip)
18:23:23 Enter (mouse stay, and it will repeat `Enter and Leave` again and again)
18:23:24 Leave
...
18:23:28 Enter
18:23:28 Leave
18:23:28 Button clicked (button clicked get response)
18:23:31 Leave
18:23:31 Button clicked (button clicked get response)
18:23:32 Leave
```

Platform - WIN10

----------
components: Tkinter
messages: 409188
nosy: Jason990420
priority: normal
severity: normal
status: open
title: Button clicked failed when mouse hover tooltip and tooltip destroyed
type: crash
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46180>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:13:17 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 11:13:17 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1640517197.75.0.169280975336.issue23819@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset a23ab7b6d8b3ae3a47747c0c4bceb2370cc48dcc by Kumar Aditya in branch 'main':
bpo-23819: Fix asyncio tests on python optimized mode (GH-30195)
https://github.com/python/cpython/commit/a23ab7b6d8b3ae3a47747c0c4bceb2370cc48dcc


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:13:24 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 26 Dec 2021 11:13:24 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1640517204.3.0.25293832347.issue23819@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28482
pull_request: https://github.com/python/cpython/pull/30265

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:17:00 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 26 Dec 2021 11:17:00 +0000
Subject: [issue31914] Document Pool.(star)map return type
In-Reply-To: <1509482713.68.0.213398074469.issue31914@psf.upfronthosting.co.za>
Message-ID: <1640517420.63.0.856939827751.issue31914@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31914>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:20:04 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 11:20:04 +0000
Subject: [issue45321] Module xml.parsers.expat.errors misses error code
 constants of libexpat >=2.0
In-Reply-To: <1632919785.51.0.148853477081.issue45321@roundup.psfhosted.org>
Message-ID: <1640517604.21.0.932674488592.issue45321@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
nosy: +eli.bendersky, scoder

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45321>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:22:47 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 11:22:47 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1640517767.92.0.638993620077.issue22815@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 1944434b44e0118e812bf63f47b268ff6dd0c8f1 by Serhiy Storchaka in branch 'main':
bpo-22815: Print unexpected successes in summary in TextTestResult (GH-30138)
https://github.com/python/cpython/commit/1944434b44e0118e812bf63f47b268ff6dd0c8f1


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:22:56 2021
From: report at bugs.python.org (Alex Waygood)
Date: Sun, 26 Dec 2021 11:22:56 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
Message-ID: <1640517776.24.0.459563043921.issue46170@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:23:43 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 11:23:43 +0000
Subject: [issue22815] unexpected successes are not output
In-Reply-To: <1415355708.14.0.235525212407.issue22815@psf.upfronthosting.co.za>
Message-ID: <1640517823.42.0.665976791228.issue22815@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22815>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:26:02 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 11:26:02 +0000
Subject: [issue45878] Use `self.assertRaises` instead of `try/except` in
 `ctypes/test_functions.py::test_mro`
In-Reply-To: <1637659974.6.0.574362436807.issue45878@roundup.psfhosted.org>
Message-ID: <1640517962.2.0.0395052214142.issue45878@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset bee660e46ae2a051400177dcd758d95b5b4a6fcc by Miss Islington (bot) in branch '3.9':
[3.9] Remove a NEWS entry for bpo-45878 (GH-30258) (GH-30260)
https://github.com/python/cpython/commit/bee660e46ae2a051400177dcd758d95b5b4a6fcc


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45878>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:27:06 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 11:27:06 +0000
Subject: [issue43413] tuple subclasses allow arbitrary kwargs
In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org>
Message-ID: <1640518026.89.0.44347392642.issue43413@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset ad4857884b4821fc2c9bd23b63d03f9570eb03d1 by Serhiy Storchaka in branch 'main':
bpo-43413: Revert changes in set.__init__ (GH-28403)
https://github.com/python/cpython/commit/ad4857884b4821fc2c9bd23b63d03f9570eb03d1


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43413>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:28:27 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 11:28:27 +0000
Subject: [issue45496] Tkinter: test_winfo_rgb failure
In-Reply-To: <1634401740.26.0.645054867141.issue45496@roundup.psfhosted.org>
Message-ID: <1640518107.76.0.936804009588.issue45496@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 2e3e0d23adca8d83722d939d6abd1e467d7578f7 by E-Paine in branch 'main':
bpo-45496: Allow flexibility in winfo_rgb tests (GH-30185)
https://github.com/python/cpython/commit/2e3e0d23adca8d83722d939d6abd1e467d7578f7


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45496>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:28:31 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 26 Dec 2021 11:28:31 +0000
Subject: [issue45496] Tkinter: test_winfo_rgb failure
In-Reply-To: <1634401740.26.0.645054867141.issue45496@roundup.psfhosted.org>
Message-ID: <1640518111.6.0.25609219231.issue45496@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28483
pull_request: https://github.com/python/cpython/pull/30266

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45496>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:28:35 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 26 Dec 2021 11:28:35 +0000
Subject: [issue45496] Tkinter: test_winfo_rgb failure
In-Reply-To: <1634401740.26.0.645054867141.issue45496@roundup.psfhosted.org>
Message-ID: <1640518115.13.0.76670914574.issue45496@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28484
pull_request: https://github.com/python/cpython/pull/30267

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45496>
_______________________________________

From report at bugs.python.org  Sun Dec 26 06:54:22 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 11:54:22 +0000
Subject: [issue23819] test_asyncio fails when run under -O
In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za>
Message-ID: <1640519662.07.0.371255957905.issue23819@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 07229054a129a72b4ffdf29252eb73c6154c0ccf by Miss Islington (bot) in branch '3.9':
[3.9] bpo-23819: Fix asyncio tests on python optimized mode (GH-30195) (GH-30265)
https://github.com/python/cpython/commit/07229054a129a72b4ffdf29252eb73c6154c0ccf


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23819>
_______________________________________

From report at bugs.python.org  Sun Dec 26 07:04:30 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 26 Dec 2021 12:04:30 +0000
Subject: [issue45496] Tkinter: test_winfo_rgb failure
In-Reply-To: <1634401740.26.0.645054867141.issue45496@roundup.psfhosted.org>
Message-ID: <1640520270.69.0.223997387513.issue45496@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset bb0b5c12419b8fa657c96185d62212aea975f500 by Miss Islington (bot) in branch '3.10':
bpo-45496: Allow flexibility in winfo_rgb tests (GH-30185)
https://github.com/python/cpython/commit/bb0b5c12419b8fa657c96185d62212aea975f500


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45496>
_______________________________________

From report at bugs.python.org  Sun Dec 26 07:21:18 2021
From: report at bugs.python.org (Jonathan Lahav)
Date: Sun, 26 Dec 2021 12:21:18 +0000
Subject: [issue46181] Destroying an expaned Combobox prevents Entry focus
 until Alt+Tab
Message-ID: <1640521278.35.0.92599921807.issue46181@roundup.psfhosted.org>


New submission from Jonathan Lahav <j.lahav at gmail.com>:

Happens on Windows.

Observation:
When an expanded Combobox is destroyerd, widgets in the window can't get focus until Alt+Tab forth and back.
Buttons can still be clicked, but focus can't be obtained by widgets, entries fro example, not by clicking nor by the Tab or arrow keys.

The attached file contains a minimal reproduction example.

Motivation:
I develop the GUI for a complex application at work which needs to recreate its GUI layout upon a combobox selection, thus destroying the combobox as well.

----------
components: Tkinter
files: combobug.py
messages: 409196
nosy: j.lahav
priority: normal
severity: normal
status: open
title: Destroying an expaned Combobox prevents Entry focus until Alt+Tab
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50522/combobug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46181>
_______________________________________

From report at bugs.python.org  Sun Dec 26 07:23:31 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 12:23:31 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1640521411.24.0.258545572231.issue46032@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 25a12aac4de819745dfc64664ba183a5784b5a81 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-46032: Check types in singledispatch's register() at declaration time (GH-30050) (GH-30254) (GH-30255)
https://github.com/python/cpython/commit/25a12aac4de819745dfc64664ba183a5784b5a81


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sun Dec 26 07:23:57 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 12:23:57 +0000
Subject: [issue46032] functools' singledispatch does not support GenericAlias
In-Reply-To: <1639127096.15.0.258621113418.issue46032@roundup.psfhosted.org>
Message-ID: <1640521437.24.0.0916132159628.issue46032@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________

From report at bugs.python.org  Sun Dec 26 07:27:37 2021
From: report at bugs.python.org (miss-islington)
Date: Sun, 26 Dec 2021 12:27:37 +0000
Subject: [issue45496] Tkinter: test_winfo_rgb failure
In-Reply-To: <1634401740.26.0.645054867141.issue45496@roundup.psfhosted.org>
Message-ID: <1640521657.17.0.13698385463.issue45496@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset aa056ed472e9d0a79ea21784f6f5171d12a13f85 by Miss Islington (bot) in branch '3.9':
bpo-45496: Allow flexibility in winfo_rgb tests (GH-30185)
https://github.com/python/cpython/commit/aa056ed472e9d0a79ea21784f6f5171d12a13f85


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45496>
_______________________________________

From report at bugs.python.org  Sun Dec 26 07:40:16 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 12:40:16 +0000
Subject: [issue45496] Tkinter: test_winfo_rgb failure
In-Reply-To: <1634401740.26.0.645054867141.issue45496@roundup.psfhosted.org>
Message-ID: <1640522416.22.0.545740913769.issue45496@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45496>
_______________________________________

From report at bugs.python.org  Sun Dec 26 07:40:23 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Sun, 26 Dec 2021 12:40:23 +0000
Subject: [issue45496] Tkinter: test_winfo_rgb failure
In-Reply-To: <1634401740.26.0.645054867141.issue45496@roundup.psfhosted.org>
Message-ID: <1640522423.99.0.287636173917.issue45496@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45496>
_______________________________________

From report at bugs.python.org  Sun Dec 26 08:13:01 2021
From: report at bugs.python.org (Carlos Damazio)
Date: Sun, 26 Dec 2021 13:13:01 +0000
Subject: [issue46175] Zero argument super() does not function properly inside
 generator expressions
In-Reply-To: <1640402741.49.0.663575697797.issue46175@roundup.psfhosted.org>
Message-ID: <1640524381.81.0.892254718051.issue46175@roundup.psfhosted.org>


Carlos Damazio <carlos.damazio at damazio.dev> added the comment:

Normally, users assume it's safe to use `super` without explicit arguments, until an undefined behavior happens, such as now. The only thing that glances into this issue is the observation in the docs you've provided that omitting the second argument (self), `super` returns an unbounded object, which is a super object.

I mean, there are 2 alternatives: this issue is related to a lower level implementation and it's another way to solve it (of which needs investigation of course) or state that it's required to provide such arguments in the docs.

https://docs.python.org/3.9/library/functions.html#super

In the newer docs, we are assuming that `super()` is the same as `super(cls, self)`, but clearly it's not.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46175>
_______________________________________

From report at bugs.python.org  Sun Dec 26 08:13:35 2021
From: report at bugs.python.org (CCXXXI)
Date: Sun, 26 Dec 2021 13:13:35 +0000
Subject: [issue46172] [doc] Outdated description of `license` object
In-Reply-To: <1640339627.46.0.314703994034.issue46172@roundup.psfhosted.org>
Message-ID: <1640524415.8.0.228576751693.issue46172@roundup.psfhosted.org>


Change by CCXXXI <ccxxxi at qq.com>:


----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46172>
_______________________________________

From report at bugs.python.org  Sun Dec 26 09:29:37 2021
From: report at bugs.python.org (Gobot1234)
Date: Sun, 26 Dec 2021 14:29:37 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
Message-ID: <1640528977.52.0.917072155141.issue46170@roundup.psfhosted.org>


Change by Gobot1234 <gobot1234yt at gmail.com>:


----------
keywords: +patch
pull_requests: +28485
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30268

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Sun Dec 26 10:33:52 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Sun, 26 Dec 2021 15:33:52 +0000
Subject: [issue46173] Clarify conditions under which float(x) with large x
 raises OverflowError
In-Reply-To: <1640351845.8.0.430184776211.issue46173@roundup.psfhosted.org>
Message-ID: <1640532832.59.0.434307236571.issue46173@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

I think the documentation reads better as it currently is. Does this really cause any practical confusion?

As Mark notes, we can't specify things exactly here: that would obfuscate all of the things we're actually trying to say.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46173>
_______________________________________

From report at bugs.python.org  Sun Dec 26 10:38:34 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Sun, 26 Dec 2021 15:38:34 +0000
Subject: [issue46182] `super` and descriptor clarification
Message-ID: <1640533114.63.0.779589080472.issue46182@roundup.psfhosted.org>


New submission from Arthur Milchior <arthur at milchior.fr>:

I find super documentation confusing because it uses multiple variables that are never introduced. Once you understand super, the meaning of those variables gets easier to understand, but still, I believe that it would help the documentation to rephrase some sentences.

In https://docs.python.org/3/reference/datamodel.html#invoking-descriptors you can read
> If a is an instance of super, then the binding super(B, obj).m() searches obj.__class__.__mro__ for the base class A immediately following B and then invokes the descriptor with the call: A.__dict__['m'].__get__(obj, obj.__class__).

It took me many reading to understand that `obj` is supposed to be a new variable; and also why `a` only appear once in the line. I believe it'd be better to explicitly state "We consider the case where a = super(B, obj), with `obj` an instance of B."

Also, `super(B, obj).m()` seems to indicate that the method `m` is called. While ` A.__dict__['m'].__get__(obj, obj.__class__)` does not seems to call this method. Hence, I believe that the parentheses should be removed after `m` (and either `m` should be renamed to `x`, or we should state explicitly that we are not considered `a.x` anymore, contrary to the previous cases)



In https://docs.python.org/3/library/functions.html#super , you can read 
> If the second argument is omitted, the super object returned is unbound. If the second argument is an object, isinstance(obj, type) must be true. If the second argument is a type, issubclass(type2, type) must be true (this is useful for classmethods).

On first reading, I have no idea what it means that a returned object is unbound. I know what "variable binding" mean, but it really does not seems to apply here. My current understanding, and I would love if someone can confirm it, is that the first sentence means that "contrary to the other cases, the returned value do not have to satisfy any bound". In this case, I believe that it would be far better to put the case with no second argument at the end of the paragraph, ensuring that "is unbound" makes sens to the reader since they already will have seen bounds.
Also, it may help clarify to write "is an object `obj`" and "is a type `type2`" so that it get clear what `obj` and `type2` means.



Any feedback welcome.

----------
assignee: docs at python
components: Documentation
messages: 409201
nosy: Arthur-Milchior, docs at python
priority: normal
severity: normal
status: open
title: `super` and descriptor clarification
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46182>
_______________________________________

From report at bugs.python.org  Sun Dec 26 10:58:26 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Sun, 26 Dec 2021 15:58:26 +0000
Subject: [issue1438480] shutil.move raises OSError when copystat fails
Message-ID: <1640534306.33.0.535334002421.issue1438480@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
keywords:  -easy
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1438480>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:10:13 2021
From: report at bugs.python.org (syed shah)
Date: Sun, 26 Dec 2021 16:10:13 +0000
Subject: [issue46183] float function errors on negative number string with
 comma seperator ex: '-1, 234.0'
Message-ID: <1640535013.14.0.929646727158.issue46183@roundup.psfhosted.org>


New submission from syed shah <jj.github.jj at gmail.com>:

>>> float ('-1,234')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: could not convert string to float: '-1,234'

----------
components: Library (Lib)
messages: 409202
nosy: jj.github.jj
priority: normal
severity: normal
status: open
title: float function errors on negative number string with comma seperator ex: '-1,234.0'
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46183>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:15:04 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Sun, 26 Dec 2021 16:15:04 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
Message-ID: <1640535304.9.0.933506201249.issue46170@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Do you have evidence that people make this particular mistake often? And that the suggested solution is indeed what they should use? Why would you want to subclass UserId?

Do we have examples of other error messages split across two lines like this?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:15:58 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Sun, 26 Dec 2021 16:15:58 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1640535358.9.0.672963229917.issue20751@roundup.psfhosted.org>


Arthur Milchior <arthur at milchior.fr> added the comment:

Shouldn't those change be ported to 3.10 and maybe even earlier version? They are great, but hard to find if you read the current version manual.

I'm just surprised by the term "dotted lookup". The remaining of the documentation mention "attribute access". So I assumed that there was a reason to use "dotted lookup" instead of "attribute access". If there is such a reason, it's not clear right now. Otherwise, if they are equivalent, I'd suggest remaining consistent in the term used.

I must note that "dotted lookup" is also used in the howto about descriptor, but it does not explain the difference with "attribute access".

One last note, I find it a little bit strange that `a` was supposed to be the value on which the access is done, and suddenly it becomes a part of the value.

----------
nosy: +Arthur-Milchior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:17:56 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Sun, 26 Dec 2021 16:17:56 +0000
Subject: [issue46182] `super` and descriptor clarification
In-Reply-To: <1640533114.63.0.779589080472.issue46182@roundup.psfhosted.org>
Message-ID: <1640535476.72.0.40900237784.issue46182@roundup.psfhosted.org>


Arthur Milchior <arthur at milchior.fr> added the comment:

I just realized that https://bugs.python.org/issue20751 already tackled some of my issues. While I still believe that some things can be improved, this mean that some of the critiques in my first messages are not entirely up to date.

----------
versions:  -Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46182>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:19:10 2021
From: report at bugs.python.org (E. Paine)
Date: Sun, 26 Dec 2021 16:19:10 +0000
Subject: [issue46179] Delete selected item generate "<<TreeviewSelect>>" event
 or not in different version of tkinter or Python
In-Reply-To: <1640512933.66.0.468585865252.issue46179@roundup.psfhosted.org>
Message-ID: <1640535550.42.0.776415296441.issue46179@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

Reproduced on Wish 8.6.9 and 8.6.11 (same behaviour on 8.6.11 as reported on 8.6.12).

I can't comment on why this is happening or which is correct behaviour so I would recommend taking it up with the Tk team https://core.tcl-lang.org/tk/reportlist (tkinter is just a thin wrapper of Tk and doesn't modify the event handling code). If you do take it up with them, here's the minimum equivalent Tcl code:

pack [ttk::treeview .t]
pack [button .b -text delete -command {.t delete 0}]
.t insert {} 0 -id 0 -text 0 -values {V1, V2}
bind .t <<TreeviewSelect>> {puts {select}}
.t selection set 0

----------
nosy: +epaine, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46179>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:27:23 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Sun, 26 Dec 2021 16:27:23 +0000
Subject: [issue46182] `super` and descriptor clarification
In-Reply-To: <1640533114.63.0.779589080472.issue46182@roundup.psfhosted.org>
Message-ID: <1640536043.25.0.256791365564.issue46182@roundup.psfhosted.org>


Arthur Milchior <arthur at milchior.fr> added the comment:

"a base class ``B`` following ``A``" shouldn't it be "the base class"? . After all, there is at most one base class following ``A``.

Also, I find it unclear what means "``x`` is returned unchanged, since in this context ``x`` is not a value which exists by itself.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46182>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:27:34 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Sun, 26 Dec 2021 16:27:34 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1640536054.62.0.330148684161.issue20751@roundup.psfhosted.org>


Arthur Milchior <arthur at milchior.fr> added the comment:

"a base class ``B`` following ``A``" shouldn't it be "the base class"? . After all, there is at most one base class following ``A``.

Also, I find it unclear what means "``x`` is returned unchanged, since in this context ``x`` is not a value which exists by itself.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:28:21 2021
From: report at bugs.python.org (Gobot1234)
Date: Sun, 26 Dec 2021 16:28:21 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
Message-ID: <1640536101.54.0.815544501045.issue46170@roundup.psfhosted.org>


Gobot1234 <gobot1234yt at gmail.com> added the comment:

> Do you have evidence that people make this particular mistake often? And that the suggested solution is indeed what they should use? Why would you want to subclass UserId?

I was just trying to implement something that I thought had a non-obvious error message and isn't necessarily initially obvious if you have the idea that NewType creates a new type/class. The documentation suggests this is what you should be doing instead of subclassing it
https://github.com/python/cpython/commit/342e800e974475cc302c46ed6d9f75276035278f#diff-8a0f115fde6769c122b771b6d0eca184c4580f7b5fabe2f0b0579c679424364fR101-R113

> Do we have examples of other error messages split across two lines like this?

No if you want me to remove it thats fine by me.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:31:25 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Sun, 26 Dec 2021 16:31:25 +0000
Subject: [issue46183] float function errors on negative number string with
 comma seperator ex: '-1, 234.0'
In-Reply-To: <1640535013.14.0.929646727158.issue46183@roundup.psfhosted.org>
Message-ID: <1640536285.15.0.236992737818.issue46183@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

The behaviour is correct and not a bug. Commas are not supported when converting strings to float.

The allowed format for floats as strings is described in the docs:

https://docs.python.org/3/library/functions.html#float

By the way, the negative sign is irrelevant. Commas are not supported regardless of whether there is a negative sign or not.

The difficulty with commas is that it is ambiguous whether float('1,234') should interpret the comma as British/American digit grouping separator, and return 1234.0, or as the European decimal point, and return 1.234. For good or bad, Python has a bias towards English (like most programming languages) and so it chooses to only recognise the decimal point as a dot in the British/American style, and reject the comma.

If you want to support European-style commas as the decimal point, the easiest way is to call float('1,234'.replace(',', '.'))

----------
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46183>
_______________________________________

From report at bugs.python.org  Sun Dec 26 11:36:13 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Sun, 26 Dec 2021 16:36:13 +0000
Subject: [issue46183] float function errors on negative number string with
 comma seperator ex: '-1, 234.0'
In-Reply-To: <1640535013.14.0.929646727158.issue46183@roundup.psfhosted.org>
Message-ID: <1640536573.16.0.615637946925.issue46183@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

Aside: for what it is worth, the British style with a middle dot is also not supported: float('1?234') also raises ValueError.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46183>
_______________________________________

From report at bugs.python.org  Sun Dec 26 12:01:19 2021
From: report at bugs.python.org (Andre Roberge)
Date: Sun, 26 Dec 2021 17:01:19 +0000
Subject: [issue44780] Incorrect message: "Invalid decimal literal" (python
 3.10)
In-Reply-To: <1627656754.25.0.173168289644.issue44780@roundup.psfhosted.org>
Message-ID: <1640538079.89.0.585594273063.issue44780@roundup.psfhosted.org>


Andre Roberge <andre.roberge at gmail.com> added the comment:

The last of these three cases (with FRACTION SLASH) is fixed 3.10.1.

The other two are still present in 3.10.1 and in 3.11.0a3

----------
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44780>
_______________________________________

From report at bugs.python.org  Sun Dec 26 12:16:10 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Sun, 26 Dec 2021 17:16:10 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
Message-ID: <1640538970.44.0.253600190508.issue46170@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Weird, the docs you cite claims


   # Also does not typecheck
   ProUserId = NewType('ProUserId', UserId)

but when I try it, it works at runtime and passes mypy (even with --strict) and also pyright.

So maybe those docs are incorrect? I can't find anything in PEP 484 about this.

In any case I'd drop the newline in the message -- other "Did you mean" errors don't have those.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Sun Dec 26 12:29:27 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sun, 26 Dec 2021 17:29:27 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
Message-ID: <1640539767.11.0.315645537274.issue46170@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

> So maybe those docs are incorrect? I can't find anything in PEP 484 about this.

Mypy even has an explicit test that NewType of NewType should work: https://github.com/python/mypy/blob/f96446ce2f99a86210b21d39c7aec4b13a8bfc66/test-data/unit/check-newtype.test#L162-L165

I tend to agree with this behavior. This allows us to create complex type-safe DSLs:

```python
from typing import NewType

UserId = NewType('UserId', int)
ProUserId = NewType('ProUserId', UserId)

x: ProUserId = ProUserId(UserId(1))
```

Mypy is happy with that!

I will open a new issue about incorrect docs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Sun Dec 26 12:36:24 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sun, 26 Dec 2021 17:36:24 +0000
Subject: [issue46170] Improving the error message when subclassing NewType
In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
Message-ID: <1640540184.53.0.603563453077.issue46170@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Turns out modern docs already have this problem fixed: https://docs.python.org/3/library/typing.html#newtype

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46170>
_______________________________________

From report at bugs.python.org  Sun Dec 26 13:22:53 2021
From: report at bugs.python.org (Jason Yang)
Date: Sun, 26 Dec 2021 18:22:53 +0000
Subject: [issue46179] Delete selected item generate "<<TreeviewSelect>>" event
 or not in different version of tkinter or Python
In-Reply-To: <1640512933.66.0.468585865252.issue46179@roundup.psfhosted.org>
Message-ID: <1640542973.45.0.131050950084.issue46179@roundup.psfhosted.org>


Jason Yang <jason990420 at outlook.com> added the comment:

>From https://core.tcl-lang.org/tk/reportlist, I found the same issue

ttk::treeview <<TreeviewSelect>> event bug 
https://core.tcl-lang.org/tk/tktview?name=2a6c62afd9

It is an old bug from 2014 anf not fixed, and now it fixed.
OK, no more question about it.

Thank you for your information.



B.R.,

Jason Yng

----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46179>
_______________________________________

From report at bugs.python.org  Sun Dec 26 15:35:55 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 26 Dec 2021 20:35:55 +0000
Subject: [issue46182] `super` and descriptor clarification
In-Reply-To: <1640533114.63.0.779589080472.issue46182@roundup.psfhosted.org>
Message-ID: <1640550955.58.0.0423355755854.issue46182@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> "a base class ``B`` following ``A``" shouldn't it  be "the base 
> class"? . After all, there is at most one base class following ``A``

No. There can be other classes in the chain.  The first to match the lookup wins.

> Also, it may help clarify to write "is an object `obj`" and 
> "is a type `type2`" so that it get clear what `obj` and `type2` means.

Sorry, but I don't your proposed wording adds value.  While you may feel that it is more precise, it just adds redundant words without adding information.  FWIW, we do this all over the docs, letting parameter names such as *obj* and *type2* communicate that we're referring to an object or a type.

> Hence, I believe that the parentheses should be removed after `m`

I took care of that in the other tracker issue.  That said, it arguably made the docs worse rather than better because by far the dominant use case for super() is calling methods rather than doing attribute lookup.  I only made the change to be consistent with the other attribute lookup examples.

> I find super documentation confusing because it uses multiple variables
> that are never introduced.

ISTM that you're looking for a full tutorial with fully worked worked out examples rather than English text interspersed with code snippets.  Consider reading the super-considered-super post for that purpose.

As for the existing text, I've wrestled with it for years and think we've hit a local optimum.  Expanding the text with more steps and descriptions of each step results in documentation that causes people's eyes to glaze over and to miss the main point of each sentence.

Also, remember that the documentation is factored.  The descriptor tutorial is primarily about descriptors.  A super() call is just one of four ways to invoke a descriptor.  From a descriptor howto point-of-view, all we want to communicate is that the attribute/method search starts at the next in the mro rather than the current instance.  It is not the goal of that section to fully document or discuss super().  

As for the main super() docs, that is the place talk about how super works; however, it is not the job of that section to explain the rest of Python (terms like bound, unbound, etc). In a way, the only job of this section is to differentiate how ``super(A, a).x`` differs from ``a.x``.  Other parts of the docs cover the general attribute lookup, C3 algorithm, method binding, etc.   The use of super() is just a special case where where the search starts from the class right after the given or inferred *type* argument.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46182>
_______________________________________

From report at bugs.python.org  Sun Dec 26 15:59:08 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Sun, 26 Dec 2021 20:59:08 +0000
Subject: [issue46182] `super` and descriptor clarification
In-Reply-To: <1640533114.63.0.779589080472.issue46182@roundup.psfhosted.org>
Message-ID: <1640552348.57.0.669585795484.issue46182@roundup.psfhosted.org>


Arthur Milchior <arthur at milchior.fr> added the comment:

I do regret to have created a single bug, as I now realize that there are two issues that are less related than I first imagined. Is there a way to split a bug in two, so that both discussion can be discussed in different places.

Actually, after more search abound "unbound method", I discovered in https://www.python.org/download/releases/3.0/whatsnew/ that this concept was supposed to be gone for good in 3.0

The notion is also used in a few other places in the documentation but as far as I can tell the only "definition" would be in https://docs.python.org/3.11/c-api/method.html#method-objects. 
While my first suggestion here was clearly wrong, I believe it still indicates a documentation bug. In that if the concept is still in the language, "unbound" should be a link to this concept. If the concept is not in the language anymore, then it should not be used without explanation.
"super considered super" does not give a single example of super with a single argument. Which is probably great, because this case is far less super. However, this means that:
* there is currently no way for a user that want to discover python to know that there is virtually no more reason to use super with a single argument. 
* for someone reading a codebase with super called with a single argument, it would be hard to figure out what it does.

Actually, I was going to create a PR https://github.com/Arthur-Milchior/cpython/commit/dd453acad2b1f61867717cee4b47f944d37fb213 before seeing your answer, and while less certain, I still believe it has merits

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46182>
_______________________________________

From report at bugs.python.org  Sun Dec 26 16:10:15 2021
From: report at bugs.python.org (Arthur Milchior)
Date: Sun, 26 Dec 2021 21:10:15 +0000
Subject: [issue20751] Harmonize descriptor protocol documentation: direct call, 
 super binding with Descriptor Howto docs
In-Reply-To: <1393193636.36.0.125202538555.issue20751@psf.upfronthosting.co.za>
Message-ID: <1640553015.43.0.236407798481.issue20751@roundup.psfhosted.org>


Change by Arthur Milchior <arthur at milchior.fr>:


----------
pull_requests: +28486
pull_request: https://github.com/python/cpython/pull/30271

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20751>
_______________________________________

From report at bugs.python.org  Sun Dec 26 16:51:54 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 26 Dec 2021 21:51:54 +0000
Subject: [issue46182] `super` and descriptor clarification
In-Reply-To: <1640533114.63.0.779589080472.issue46182@roundup.psfhosted.org>
Message-ID: <1640555514.27.0.245230799483.issue46182@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I'm reluctant to give any more space to the least important case, one that rarely arises in practice.  The text in the PR is wordy and IMO creates more confusion that it solves.

Per the dev-guide, we mostly avoid "preachy" text.  No, "it is recommended to avoid the single argument form".  In the unlikely event that a person needs this, we are not recommending against it.  It is in fact supported, tested, and mentioned in the documentation.  And to the extend we care to nudge users in one direction or another, the traditional way to deemphasize a feature is spend less time and space talking about it :-) 

At this point, I recommend just letting it be.  It feels like we're going down a rabbit hole here rather than solving problems that users actually have.  These features are almost two decades old and the docs have been stable for a long time.  If there were a significant communication issue here, we would have known long ago.

To gain an appreciation for the challenges we face in documentation, take a look at the discussion in https://bugs.python.org/issue46173 .  

In the case of super(), more words don't make the docs better; it just adds more text that a user has to fight through to get the gestalt of what is going on.  When I talk to advanced users of the language, they almost never think of super() in more detail than is covered in the docs; instead, they've grokked the central concept of next-in-mro and that it is commonly used in two ways either to call parent class or to implement cooperative multiple inheritance.  Ideally, we want to lead readers to that same understanding.  IMO, detailing the mechnanics of uncommon cases takes us in the opposite direction.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46182>
_______________________________________

From report at bugs.python.org  Sun Dec 26 17:00:27 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sun, 26 Dec 2021 22:00:27 +0000
Subject: [issue46184] Remove `netlify.toml`?
Message-ID: <1640556026.15.0.409778819422.issue46184@roundup.psfhosted.org>


New submission from Nikita Sobolev <mail at sobolevn.me>:

It was added one year ago in https://bugs.python.org/issue37860

But, it is not used. Right now it does not do anything. Others report that it has a lot of limitations (including financial and technical ones): https://github.com/python/cpython/pull/15288#issuecomment-579476340

Original author even proposed another solution: https://bugs.python.org/issue37860 (PR is stale)

I propose to remove it. It can always be found in git.
Permalink to the last version in `main`: https://github.com/python/cpython/blob/2e3e0d23adca8d83722d939d6abd1e467d7578f7/netlify.toml

Related issue about `.travis.yml`: https://bugs.python.org/issue46178

----------
components: Build
messages: 409220
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Remove `netlify.toml`?
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46184>
_______________________________________

From report at bugs.python.org  Sun Dec 26 17:02:09 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Sun, 26 Dec 2021 22:02:09 +0000
Subject: [issue46184] Remove `netlify.toml`?
In-Reply-To: <1640556026.15.0.409778819422.issue46184@roundup.psfhosted.org>
Message-ID: <1640556129.95.0.234393382233.issue46184@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
pull_requests: +28487
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30272

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46184>
_______________________________________

From report at bugs.python.org  Sun Dec 26 18:41:14 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sun, 26 Dec 2021 23:41:14 +0000
Subject: [issue9334] argparse does not accept options taking arguments
 beginning with dash (regression from optparse)
In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za>
Message-ID: <1640562074.51.0.982578051047.issue9334@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> I believe that the behavior is so deeply ingrained in how argparse
> works that it can't be changed.

I think so as well.  Handling arguments with a dash prefiew could be viewed as fundamental design flaw except for the fact that the module has been so successful (both before and after landing in the standard library).

I've come to believe that argparse is very difficult to change without risk of breaking many existing tools that depend on argparse working exactly the way it does now.

Also, this issue is over a decade old and no clear solution has emerged.


> at this point installing modules from PyPI is sufficiently easy
> that I'm not sure it makes sense to advocate for another command
> line parser in the stdlib.

I agree. It would be a hard sell at this point.

Let's close this one.  I don't think it is going to get solved.

----------
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9334>
_______________________________________

From report at bugs.python.org  Sun Dec 26 19:18:17 2021
From: report at bugs.python.org (Clint Olsen)
Date: Mon, 27 Dec 2021 00:18:17 +0000
Subject: [issue9334] argparse does not accept options taking arguments
 beginning with dash (regression from optparse)
In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za>
Message-ID: <1640564297.97.0.780608172414.issue9334@roundup.psfhosted.org>


Clint Olsen <clint.olsen at gmail.com> added the comment:

I think this should serve as a cautionary tale that while (POSIX) standards aren't always the best of solutions, they are often made for good reasons, and special care should be taken when you decide to deviate from them. Otherwise it just causes frustration.

While argparse behavior has some convenience, it isn't a very good fit for a multi-layered scripting environments where arguments for subordinate programs need consideration.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9334>
_______________________________________

From report at bugs.python.org  Sun Dec 26 19:20:51 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Mon, 27 Dec 2021 00:20:51 +0000
Subject: [issue42079] Why does tarfile.next swallow InvalidHeaderError
In-Reply-To: <1603097737.92.0.915813500773.issue42079@roundup.psfhosted.org>
Message-ID: <1640564451.28.0.626177563343.issue42079@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> tarfile module next() method hides exceptions

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42079>
_______________________________________

From report at bugs.python.org  Sun Dec 26 19:22:27 2021
From: report at bugs.python.org (Tom Karzes)
Date: Mon, 27 Dec 2021 00:22:27 +0000
Subject: [issue9334] argparse does not accept options taking arguments
 beginning with dash (regression from optparse)
In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za>
Message-ID: <1640564547.2.0.00216872962636.issue9334@roundup.psfhosted.org>


Tom Karzes <karzes at sonic.net> added the comment:

If it's going to be closed, it should at least be acknowledged that it *is* a fundamental design flaw, stemming from the misguided goal of trying (and necessarily failing) to allow options to be freely intermixed with positional arguments, which of course can't be done without dropping support for unrestricted string arguments.  This means that argparse does not, and apparently never will, support string argument values that begin with hyphens.  Yes, I know that the equal sign can be used to handle *some* cases, but who wants to use equal signs to specify command-line options?  And there is no direct workaround for options that specify an nargs value of 2 or more.

Also, fixing this is *not* hard at all.  All that needs to be done is to add a keyword argument to the parser that tells it not to try to look ahead to find options, but to instead scan for them sequentially.  Just like any properly designed option parser does.  It's *easier* than trying to look ahead.

I have my own quick-and-dirty hack that approximates this, but it's ugly and disgusting, it only handles some cases, and I hate using it.  All the hack does is replace -- with a different prefix that I'm willing to avoid, then uses a different option prefix character so that the remaining strings starting with a single - are not seen as options.  This handles a single leading - in an option value.  It's not a general solution at all, but it's just barely good enough to solve my problem cases.

Yes, argparse has been successful, but the reason for that success is that it wasn't made for proficient users.  Rather, it was designed to cater to people who aren't very capable, and are perfectly happy to live with restricted string values if it means they can shuffle their command-line arguments willy nilly and still have it recognize them, rather than stopping when it should and giving the appropriate error.  It trades precision for ease of use.  This creates a vacuum for highly capable users who don't want to give up precise argument processing for the sake of a feature that's of no use to them in the first place.

Don't get me wrong.  There are a lot of nice features that argparse added which I find very useful.  The problem is it also sacrifices core functionality, making its predecessor, optparse, preferable for some applications.  In those cases, there is no transition path from optparse to argparse, since argparse does not handle all of the cases that optparse does.  And since argparse does not subsume the functionality of optparse, I find the decision to deprecate optparse highly questionable.

With optparse deprecated, Python no longer supports POSIX-compliant command-line option processing.  How is that a sound decision?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9334>
_______________________________________

From report at bugs.python.org  Sun Dec 26 21:28:28 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Mon, 27 Dec 2021 02:28:28 +0000
Subject: [issue14844] netrc does not handle accentuated characters
In-Reply-To: <1337289825.27.0.400304162278.issue14844@psf.upfronthosting.co.za>
Message-ID: <1640572108.7.0.150124880085.issue14844@roundup.psfhosted.org>


Daniel Diniz <ajaksu at gmail.com> added the comment:

Now that a PR has landed in #28806 to improve shlex, we need to check whether this issue can/needs to move forward.

----------
nosy: +ajaksu2, asvetlov
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue14844>
_______________________________________

From report at bugs.python.org  Sun Dec 26 21:36:15 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Mon, 27 Dec 2021 02:36:15 +0000
Subject: [issue7687] Bluetooth support untested
In-Reply-To: <1263367703.76.0.187821272753.issue7687@psf.upfronthosting.co.za>
Message-ID: <1640572575.5.0.325173446552.issue7687@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
versions: +Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue7687>
_______________________________________

From report at bugs.python.org  Sun Dec 26 21:36:57 2021
From: report at bugs.python.org (Daniel Diniz)
Date: Mon, 27 Dec 2021 02:36:57 +0000
Subject: [issue25044] bring BTPROTO_SCO inline with other Bluetooth protocols
In-Reply-To: <1441812442.49.0.0898907161184.issue25044@psf.upfronthosting.co.za>
Message-ID: <1640572617.12.0.537180503895.issue25044@roundup.psfhosted.org>


Change by Daniel Diniz <ajaksu at gmail.com>:


----------
versions: +Python 3.11 -Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25044>
_______________________________________

From report at bugs.python.org  Sun Dec 26 22:40:05 2021
From: report at bugs.python.org (Anders Kaseorg)
Date: Mon, 27 Dec 2021 03:40:05 +0000
Subject: [issue9334] argparse does not accept options taking arguments
 beginning with dash (regression from optparse)
In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za>
Message-ID: <1640576405.13.0.468510108946.issue9334@roundup.psfhosted.org>


Anders Kaseorg <andersk at mit.edu> added the comment:

If argparse will not be developed further to fix this bug, then we should undo the deprecation of optparse in the documentation (https://bugs.python.org/issue37103), since the stated justification for that deprecation was that optparse will not be developed further.

The documentation should encourage programmers to use correct libraries, and optparse is correct here where argparse is not.  People who need the extra features of argparse and aren?t bothered by its incorrectness are welcome to decide to use it, but this is not the right default decision for the documentation to promote.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9334>
_______________________________________

From report at bugs.python.org  Mon Dec 27 00:06:52 2021
From: report at bugs.python.org (tongxiaoge)
Date: Mon, 27 Dec 2021 05:06:52 +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: <1640581612.66.0.211469824914.issue44598@roundup.psfhosted.org>


tongxiaoge <shixuantong at huawei.com> added the comment:

We make SSL3 disappear to newly built dependencies, the test_ssl success. Refer to the modification of OpenSSL on fedoras (address: https://src.fedoraproject.org/rpms/openssl/tree/f34 ?

```
 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/*.dist
 
+# Next step of gradual disablement of SSL3.
+# Make SSL3 disappear to newly built dependencies.
+sed -i '/^\#ifndef OPENSSL_NO_SSL_TRACE/i\
+#ifndef OPENSSL_NO_SSL3\
+# define OPENSSL_NO_SSL3\
+#endif' $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf.h
+
 %check
```

----------
nosy: +sxt1001

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44598>
_______________________________________

From report at bugs.python.org  Mon Dec 27 01:39:09 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Mon, 27 Dec 2021 06:39:09 +0000
Subject: [issue9334] argparse does not accept options taking arguments
 beginning with dash (regression from optparse)
In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za>
Message-ID: <1640587149.86.0.710671458152.issue9334@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> we should undo the deprecation of optparse in the documentation 
> (https://bugs.python.org/issue37103), since the stated justification 
> for that deprecation was that optparse will not be developed further.

While optparse that it isn't being developed further, therebut will not be taken away.  IIRC the reason for this was that it too had become difficult to build out and that is what necessitated the creation of argparse -- there wasn't clean way to add the desired features (subparsers, actions, etc).


> If it's going to be closed, it should at least be acknowledged 
> that it *is* a fundamental design flaw

That seems a spiteful demand. It is more correct to say that the design met its original intended goals but unfortunately the structure of the first pass scan precludes cleanly handling arguments with dashes.  The limitations are noted in the docs in the section, "Arguments containing -". 

As Eric pointed out, there are alternative argument parsing packages available on PyPI.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9334>
_______________________________________

From report at bugs.python.org  Mon Dec 27 02:11:28 2021
From: report at bugs.python.org (Joshua Root)
Date: Mon, 27 Dec 2021 07:11:28 +0000
Subject: [issue45863] tarfile zeroes ustar header fields unnecessarily
In-Reply-To: <1637568080.9.0.260845551853.issue45863@roundup.psfhosted.org>
Message-ID: <1640589088.63.0.853496522632.issue45863@roundup.psfhosted.org>


Joshua Root <josh+python at root.id.au> added the comment:

PR has been marked stale; friendly ping.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45863>
_______________________________________

From report at bugs.python.org  Mon Dec 27 03:35:25 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Mon, 27 Dec 2021 08:35:25 +0000
Subject: [issue45863] tarfile zeroes ustar header fields unnecessarily
In-Reply-To: <1637568080.9.0.260845551853.issue45863@roundup.psfhosted.org>
Message-ID: <1640594125.39.0.141519275019.issue45863@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
nosy: +ethan.furman

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45863>
_______________________________________

From report at bugs.python.org  Mon Dec 27 05:41:33 2021
From: report at bugs.python.org (Alex Waygood)
Date: Mon, 27 Dec 2021 10:41:33 +0000
Subject: [issue18677] Enhanced context managers with ContextManagerExit and
 None
In-Reply-To: <1375885327.18.0.790620363467.issue18677@psf.upfronthosting.co.za>
Message-ID: <1640601693.77.0.196206338381.issue18677@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Given that this issue has seen no activity for eight years, I am closing it as "rejected".

----------
nosy: +AlexWaygood
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18677>
_______________________________________

From report at bugs.python.org  Mon Dec 27 06:29:52 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Mon, 27 Dec 2021 11:29:52 +0000
Subject: =?utf-8?q?=5Bissue34963=5D_String_representation_for_types_created_with_t?=
 =?utf-8?q?yping=2ENewType=28=E2=80=A6=29_are_opaque_and_unappealing?=
In-Reply-To: <1539313395.67.0.788709270274.issue34963@psf.upfronthosting.co.za>
Message-ID: <1640604592.91.0.353198294164.issue34963@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34963>
_______________________________________

From report at bugs.python.org  Mon Dec 27 07:05:26 2021
From: report at bugs.python.org (Jaap Roes)
Date: Mon, 27 Dec 2021 12:05:26 +0000
Subject: [issue46185] Python 3.10.1 installer refers to /Applications/Python
 3.9 Install Certificates
Message-ID: <1640606726.92.0.295758053578.issue46185@roundup.psfhosted.org>


New submission from Jaap Roes <jaap.roes at gmail.com>:

The Python 3.10.1 installer on macOS has the text "A sample command script is included in /Applications/Python 3.9" when mentioning the "Install Certificates" command. This location doesn't exist (unless one has installed Python 3.9).

The source of this text can be found here:

https://github.com/python/cpython/blob/f4c03484da59049eb62a9bf7777b963e2267d187/Mac/BuildScript/resources/ReadMe.rtf#L29

----------
components: Installation
messages: 409230
nosy: jaap3, ned.deily
priority: normal
severity: normal
status: open
title: Python 3.10.1 installer refers to /Applications/Python 3.9 Install Certificates
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46185>
_______________________________________

From report at bugs.python.org  Mon Dec 27 07:57:28 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Mon, 27 Dec 2021 12:57:28 +0000
Subject: [issue46166] Get "self" args or non-null co_varnames from frame
 object with C-API
In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org>
Message-ID: <1640609848.82.0.301486539674.issue46166@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46166>
_______________________________________

From report at bugs.python.org  Mon Dec 27 08:20:19 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Mon, 27 Dec 2021 13:20:19 +0000
Subject: [issue45189] Drop the "list_frozen" command from _test_embed.
In-Reply-To: <1631575373.13.0.588141988765.issue45189@roundup.psfhosted.org>
Message-ID: <1640611219.55.0.437733652483.issue45189@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
keywords: +patch
nosy: +corona10
nosy_count: 2.0 -> 3.0
pull_requests: +28488
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30273

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45189>
_______________________________________

From report at bugs.python.org  Mon Dec 27 08:52:02 2021
From: report at bugs.python.org (Ned Deily)
Date: Mon, 27 Dec 2021 13:52:02 +0000
Subject: [issue46185] Python 3.10.1 installer refers to /Applications/Python
 3.9 Install Certificates
In-Reply-To: <1640606726.92.0.295758053578.issue46185@roundup.psfhosted.org>
Message-ID: <1640613122.23.0.770137265442.issue46185@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
assignee:  -> ned.deily

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46185>
_______________________________________

From report at bugs.python.org  Mon Dec 27 09:38:42 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Mon, 27 Dec 2021 14:38:42 +0000
Subject: [issue45924] Incorrect traceback when future's exception is raised
 multiple times
In-Reply-To: <1638186926.45.0.137493772787.issue45924@roundup.psfhosted.org>
Message-ID: <1640615922.42.0.779658804903.issue45924@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
keywords: +patch
nosy: +kumaraditya303
nosy_count: 5.0 -> 6.0
pull_requests: +28489
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30274

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45924>
_______________________________________

From report at bugs.python.org  Mon Dec 27 11:14:50 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Mon, 27 Dec 2021 16:14:50 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640621690.27.0.57975297335.issue37295@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
pull_requests: +28490
pull_request: https://github.com/python/cpython/pull/30275

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Mon Dec 27 11:15:59 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Mon, 27 Dec 2021 16:15:59 +0000
Subject: [issue42918] Nested multi-line expression will lead to "compile()"
 fails
In-Reply-To: <1610517717.73.0.740461753555.issue42918@roundup.psfhosted.org>
Message-ID: <1640621759.3.0.838090068297.issue42918@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset 576e38f9db61ca09ca6dc57ad13b02a7bf9d370a by Miss Islington (bot) in branch '3.10':
bpo-42918: Improve built-in function compile() in mode 'single' (GH-29934) (GH-30040)
https://github.com/python/cpython/commit/576e38f9db61ca09ca6dc57ad13b02a7bf9d370a


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42918>
_______________________________________

From report at bugs.python.org  Mon Dec 27 11:17:23 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Mon, 27 Dec 2021 16:17:23 +0000
Subject: [issue42918] Nested multi-line expression will lead to "compile()"
 fails
In-Reply-To: <1610517717.73.0.740461753555.issue42918@roundup.psfhosted.org>
Message-ID: <1640621843.7.0.498515723493.issue42918@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:

Thanks! ? ? ?

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42918>
_______________________________________

From report at bugs.python.org  Mon Dec 27 11:42:24 2021
From: report at bugs.python.org (Joseph Perez)
Date: Mon, 27 Dec 2021 16:42:24 +0000
Subject: [issue45665] Problems caused by isinstance(list[int],
 type) returning True
In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org>
Message-ID: <1640623344.9.0.501974745919.issue45665@roundup.psfhosted.org>


Joseph Perez <joperez at hotmail.fr> added the comment:

There is also https://bugs.python.org/issue44293 about inspect.isclass

----------
nosy: +joperez

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45665>
_______________________________________

From report at bugs.python.org  Mon Dec 27 12:24:47 2021
From: report at bugs.python.org (Eric Snow)
Date: Mon, 27 Dec 2021 17:24:47 +0000
Subject: [issue46109] Separate resources docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1640625887.73.0.787036419562.issue46109@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

+1

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:01:07 2021
From: report at bugs.python.org (Guo Ci Teo)
Date: Mon, 27 Dec 2021 18:01:07 +0000
Subject: [issue46186] replace `io.IncrementalNewlineDecoder` with non
 incremental newline decoders
Message-ID: <1640628066.96.0.973649532824.issue46186@roundup.psfhosted.org>


New submission from Guo Ci Teo <zguoci at gmail.com>:

replace unnecessary use of `io.IncrementalNewlineDecoder` in code.
Some uses of the `decode` method were also incorrect without the `final=True` argument.

----------
messages: 409235
nosy: guoci
priority: normal
severity: normal
status: open
title: replace `io.IncrementalNewlineDecoder` with non incremental newline decoders

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46186>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:02:19 2021
From: report at bugs.python.org (Guo Ci Teo)
Date: Mon, 27 Dec 2021 18:02:19 +0000
Subject: [issue46186] replace `io.IncrementalNewlineDecoder` with non
 incremental newline decoders
In-Reply-To: <1640628066.96.0.973649532824.issue46186@roundup.psfhosted.org>
Message-ID: <1640628139.12.0.237024805898.issue46186@roundup.psfhosted.org>


Change by Guo Ci Teo <zguoci at gmail.com>:


----------
keywords: +patch
pull_requests: +28491
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30276

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46186>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:04:46 2021
From: report at bugs.python.org (Guo Ci Teo)
Date: Mon, 27 Dec 2021 18:04:46 +0000
Subject: [issue46186] replace `io.IncrementalNewlineDecoder` with non
 incremental newline decoders
In-Reply-To: <1640628066.96.0.973649532824.issue46186@roundup.psfhosted.org>
Message-ID: <1640628286.18.0.239674376255.issue46186@roundup.psfhosted.org>


Guo Ci Teo <zguoci at gmail.com> added the comment:

In any case, the use of an incremental newline decoder is not required

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46186>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:04:56 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Mon, 27 Dec 2021 18:04:56 +0000
Subject: [issue46055] Speed up binary shifting operators
In-Reply-To: <1639287218.01.0.821172330488.issue46055@roundup.psfhosted.org>
Message-ID: <1640628296.56.0.454574102831.issue46055@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:


New changeset 360fedc2d2ce6ccb0dab554ef45fe83f7aea1862 by Mark Dickinson in branch 'main':
bpo-46055: Streamline inner loop for right shifts (#30243)
https://github.com/python/cpython/commit/360fedc2d2ce6ccb0dab554ef45fe83f7aea1862


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46055>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:23:53 2021
From: report at bugs.python.org (Samriddhi Bhardwaj)
Date: Mon, 27 Dec 2021 18:23:53 +0000
Subject: [issue46168] Incorrect format specified for the "style" key in the
 configuration file format formatter example
In-Reply-To: <1640293086.43.0.363469814409.issue46168@roundup.psfhosted.org>
Message-ID: <1640629433.3.0.423047902637.issue46168@roundup.psfhosted.org>


Samriddhi Bhardwaj <samriddhi.bhardwaj at gmail.com> added the comment:

I would like to help with this issue. It should take me less than 5 days.

----------
nosy: +samriddhi.bhardwaj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46168>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:37:01 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Mon, 27 Dec 2021 18:37:01 +0000
Subject: [issue46055] Speed up binary shifting operators
In-Reply-To: <1639287218.01.0.821172330488.issue46055@roundup.psfhosted.org>
Message-ID: <1640630221.15.0.902010154484.issue46055@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:


New changeset 3581c7abbe15bad6ae08fc38887e5948f8f39e08 by Xinhang Xu in branch 'main':
bpo-46055: Speed up binary shifting operators (GH-30044)
https://github.com/python/cpython/commit/3581c7abbe15bad6ae08fc38887e5948f8f39e08


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46055>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:37:51 2021
From: report at bugs.python.org (Gregory P. Smith)
Date: Mon, 27 Dec 2021 18:37:51 +0000
Subject: [issue46150] test_pathlib assumes "fakeuser" does not exist as user
In-Reply-To: <1640177928.13.0.0270124264104.issue46150@roundup.psfhosted.org>
Message-ID: <1640630271.95.0.583283567472.issue46150@roundup.psfhosted.org>


Change by Gregory P. Smith <greg at krypto.org>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46150>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:40:50 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Mon, 27 Dec 2021 18:40:50 +0000
Subject: [issue46055] Speed up binary shifting operators
In-Reply-To: <1639287218.01.0.821172330488.issue46055@roundup.psfhosted.org>
Message-ID: <1640630450.51.0.218918639691.issue46055@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

Two separate significant improvements have been pushed: thanks, Xinhang Xu!

The original PR also contained a reworking of the general case for right-shifting a negative integer. The current code (in main) for that case does involve some extra allocations, and it ought to be possible to write something that doesn't need to allocate temporary PyLongs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46055>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:51:25 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Mon, 27 Dec 2021 18:51:25 +0000
Subject: [issue26214] textwrap should minimize number of breaks in extra long
 words
In-Reply-To: <1453882121.55.0.184610339904.issue26214@psf.upfronthosting.co.za>
Message-ID: <1640631085.93.0.102503579982.issue26214@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

It may be worth fixing wrap() to do the nicer style of wrapping for long words. If we decide to do that, it should be done via a new parameter because the same logic (TextWrapper class) is used for `shorten` and in that case it may be preferable to have the chunk of longer word rather than cutting it out entirely.

----------
nosy: +andrei.avk
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26214>
_______________________________________

From report at bugs.python.org  Mon Dec 27 13:57:54 2021
From: report at bugs.python.org (Eric Snow)
Date: Mon, 27 Dec 2021 18:57:54 +0000
Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with
 subinterpreters
In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org>
Message-ID: <1640631474.55.0.232573951358.issue46006@roundup.psfhosted.org>


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

are there any objections to my PR?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46006>
_______________________________________

From report at bugs.python.org  Mon Dec 27 14:29:59 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Mon, 27 Dec 2021 19:29:59 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
Message-ID: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>


New submission from Raymond Hettinger <raymond.hettinger at gmail.com>:

By default, isqrt(n) gives the floor of the exact square of n.  It would be nice to have a flag to give a rounded result:

    y = isqrt(n, round=True)

Alternatively, set a mode argument to one of {'floor', 'round', 'ceil'}:

    y = isqrt(n, mode='round')

I would like something better than this:

    def risqrt(x):
        'Big integer version of: round(sqrt(x)).'
        y = isqrt(x)
        s = y ** 2
        return y if x <= s + y else y + 1

    def cisqrt(x):
        'Big integer version of: ceil(sqrt(x)).'
        return isqrt(x - 1) + 1

My use case arose when building a table of square roots incorporated in arbitrary precision functions implemented with scaled integer arithmetic:

    def get_root_table(base, steps, scale):
        s = []
        x = round(base * scale)
        for i in range(steps):
            x = risqrt(x * scale)
            s.append(x)
        return s

----------
assignee: mark.dickinson
components: Library (Lib)
messages: 409243
nosy: mark.dickinson, rhettinger, tim.peters
priority: normal
severity: normal
status: open
title: Optionally support rounding for math.isqrt()
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Mon Dec 27 15:14:05 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Mon, 27 Dec 2021 20:14:05 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640636045.87.0.569461286622.issue46187@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

FWIW, when this need has turned up for me (which it has, a couple of times), I've used this:

def risqrt(n):
    return (isqrt(n<<2) + 1) >> 1

But I'll admit that that's a bit non-obvious.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Mon Dec 27 17:15:42 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Mon, 27 Dec 2021 22:15:42 +0000
Subject: [issue46055] Speed up binary shifting operators
In-Reply-To: <1639287218.01.0.821172330488.issue46055@roundup.psfhosted.org>
Message-ID: <1640643342.58.0.547645867084.issue46055@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
pull_requests: +28493
pull_request: https://github.com/python/cpython/pull/30277

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46055>
_______________________________________

From report at bugs.python.org  Mon Dec 27 18:22:32 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Mon, 27 Dec 2021 23:22:32 +0000
Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a
 crash in subintepreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1640647352.44.0.92660196014.issue46070@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

FWIW, I've managed to reproduce once with win_py399_crash_reproducer.py on macOS 12.1 (with very high load average). With bug.py, I can reproduce almost always (more than 90% of the time).

----------
nosy: +erlendaasland

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Mon Dec 27 18:29:03 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Mon, 27 Dec 2021 23:29:03 +0000
Subject: [issue46185] Python 3.10.1 installer refers to /Applications/Python
 3.9 Install Certificates
In-Reply-To: <1640606726.92.0.295758053578.issue46185@roundup.psfhosted.org>
Message-ID: <1640647743.84.0.201602624956.issue46185@roundup.psfhosted.org>


Change by Erlend E. Aasland <erlend.aasland at innova.no>:


----------
keywords: +patch
nosy: +erlendaasland
nosy_count: 2.0 -> 3.0
pull_requests: +28494
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30278

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46185>
_______________________________________

From report at bugs.python.org  Mon Dec 27 18:34:23 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Mon, 27 Dec 2021 23:34:23 +0000
Subject: [issue31369] re.RegexFlag is not included in __all__,
 makes type inference less useful
In-Reply-To: <1504730402.58.0.544251648863.issue31369@psf.upfronthosting.co.za>
Message-ID: <1640648063.92.0.454347357206.issue31369@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
keywords: +patch
nosy: +andrei.avk
nosy_count: 10.0 -> 11.0
pull_requests: +28495
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30279

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31369>
_______________________________________

From report at bugs.python.org  Mon Dec 27 18:38:17 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Mon, 27 Dec 2021 23:38:17 +0000
Subject: [issue46185] Python 3.10.1 installer refers to /Applications/Python
 3.9 Install Certificates
In-Reply-To: <1640606726.92.0.295758053578.issue46185@roundup.psfhosted.org>
Message-ID: <1640648297.34.0.144384778462.issue46185@roundup.psfhosted.org>


Change by Erlend E. Aasland <erlend.aasland at innova.no>:


----------
pull_requests: +28496
pull_request: https://github.com/python/cpython/pull/30280

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46185>
_______________________________________

From report at bugs.python.org  Mon Dec 27 21:06:01 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Tue, 28 Dec 2021 02:06:01 +0000
Subject: [issue45189] Drop the "list_frozen" command from _test_embed.
In-Reply-To: <1631575373.13.0.588141988765.issue45189@roundup.psfhosted.org>
Message-ID: <1640657161.37.0.196194075641.issue45189@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45189>
_______________________________________

From report at bugs.python.org  Mon Dec 27 21:06:02 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Tue, 28 Dec 2021 02:06:02 +0000
Subject: [issue45189] Drop the "list_frozen" command from _test_embed.
In-Reply-To: <1631575373.13.0.588141988765.issue45189@roundup.psfhosted.org>
Message-ID: <1640657162.07.0.552428489707.issue45189@roundup.psfhosted.org>


Dong-hee Na <donghee.na at python.org> added the comment:


New changeset 196b53eb1e62871ca80dee180e4891b4dd5c52ac by Dong-hee Na in branch 'main':
bpo-45189: Drop the "list_frozen" command from _test_embed. (GH-30273)
https://github.com/python/cpython/commit/196b53eb1e62871ca80dee180e4891b4dd5c52ac


----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45189>
_______________________________________

From report at bugs.python.org  Mon Dec 27 22:26:46 2021
From: report at bugs.python.org (asper)
Date: Tue, 28 Dec 2021 03:26:46 +0000
Subject: [issue46117] tk could not refresh auto in mac os
In-Reply-To: <1639751230.51.0.11843295078.issue46117@roundup.psfhosted.org>
Message-ID: <1640662006.48.0.0639820842418.issue46117@roundup.psfhosted.org>


asper <asper at 21cn.com> added the comment:

It looks like that Python3.10.1 has solved this question.
Now use grid_remove() and grid() to switch two widgets smoother than before on my mac system. 
Ronald Oussoren, Thank you for your time and advice, I could close this issue.

----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46117>
_______________________________________

From report at bugs.python.org  Mon Dec 27 23:47:00 2021
From: report at bugs.python.org (Stanley)
Date: Tue, 28 Dec 2021 04:47:00 +0000
Subject: [issue21910] [doc] File protocol should document if writelines must
 handle generators sensibly
In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za>
Message-ID: <1640666820.89.0.476713756217.issue21910@roundup.psfhosted.org>


Stanley <ostanley.lee at gmail.com> added the comment:

I'd be interested in taking a look at this - would these changes clarify things?

Current (https://docs.python.org/3/library/codecs.html#codecs.StreamWriter):

Writes the concatenated list of strings to the stream (possibly by reusing the write() method). The standard bytes-to-bytes codecs do not support this method.

Proposed:

Writes the concatenated list of strings to the stream by reusing the write() method, and thus does not support infinite or very large generators. The standard bytes-to-bytes codecs do not support this method.

----------
nosy: +slateny

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21910>
_______________________________________

From report at bugs.python.org  Tue Dec 28 00:11:49 2021
From: report at bugs.python.org (Josh Rosenberg)
Date: Tue, 28 Dec 2021 05:11:49 +0000
Subject: [issue46175] Zero argument super() does not function properly inside
 generator expressions
In-Reply-To: <1640402741.49.0.663575697797.issue46175@roundup.psfhosted.org>
Message-ID: <1640668309.5.0.117739705621.issue46175@roundup.psfhosted.org>


Josh Rosenberg <shadowranger+python at gmail.com> added the comment:

Carlos: This has nothing to do with reloading (as Alex's repro shows, no reload calls are made).

super() *should* behave the same as super(CLASS_DEFINED_IN, self), and it looks like the outer function is doing half of what it must do to make no-arg super() work in the genexpr (dis.dis reports that __class__ is being loaded, and a closure constructed from the genexpr that includes it, so __class__, which no-arg super pulls from closure scope to get its first argument, is there).

The problem is that super() *also* assumes the first argument to the function is self, and a genexpr definitionally receives just one argument, the iterator (the outermost one for genexprs with nested loops). So no-arg super is doing the equivalent of:

super(__class__, iter(vars))

when it should be doing:

super(__class__, self)

Only way to fix it I can think of would be one of:

1. Allow a genexpr to receive multiple arguments to support this use case (ugly, requires significant changes to current design of genexprs and probably super() too)
2. Somehow teach super() to pull self (positional argument #1 really; super() doesn't care about names) from closure scope (and make the compiler put self in the closure scope when it builds the closure) when run in a genexpr.

Both options seem... sub-optimal. Better suggestions welcome. Note that the same problem affects the various forms of comprehension as well (this isn't specific to the lazy design of genexprs; listcomps have the same problem).

----------
nosy: +josh.r

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46175>
_______________________________________

From report at bugs.python.org  Tue Dec 28 01:48:57 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 28 Dec 2021 06:48:57 +0000
Subject: [issue46175] Zero argument super() does not function properly inside
 generator expressions
In-Reply-To: <1640402741.49.0.663575697797.issue46175@roundup.psfhosted.org>
Message-ID: <1640674137.24.0.745603193067.issue46175@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I concur with Josh. super() uses a lot of magic, and in case of comprehensions it fails in interesting way.

Most common cases in which super() does not work:

1. Outside of a function defined in a class.
2. In a static method.
3. In inner function.
4. In comprehensions and generator expressions.

Idea #2 could help in cases 3 and 4.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46175>
_______________________________________

From report at bugs.python.org  Tue Dec 28 05:00:03 2021
From: report at bugs.python.org (TobiasHT)
Date: Tue, 28 Dec 2021 10:00:03 +0000
Subject: [issue46188] dictionary creation error
Message-ID: <1640685602.96.0.10576142491.issue46188@roundup.psfhosted.org>


New submission from TobiasHT <higenyi.tobias at gmail.com>:

I was creating a dictionary when I noticed something weird.
I had a function responsible for creating dictionary keys and then values were assigned to the keys in a for loop.
The code goes a little like this:

>>> def key_maker(n):
...     if (n % 2) == 0:
...         return n
...     return None

>>> dictionary = {}
>>> for i in range(10):
...     dictionary[key_maker(i)] = i if key_maker(i) else "error"

>>> dictionary
{0: 'error', None: 'error', 2: 2, 4: 4, 6: 6, 8: 8}


when I tried to print out the rest of the values in the "else" clause,
I realized that 0 appeared there as well, so 0 appeared twice.

>>> for i in range(10):
...     dictionary[key_maker(i)] = i if key_maker(i) else print(i)
...
0
1
3
5
7
9
>>> dictionary
{0: 'error', None: 'error', 2: 2, 4: 4, 6: 6, 8: 8}

I still can not figure out why the first two elements are inconsistent
from the rest of the dictionary, and why they appear in the first place.

----------
messages: 409251
nosy: TobiasHT
priority: normal
severity: normal
status: open
title: dictionary creation error
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46188>
_______________________________________

From report at bugs.python.org  Tue Dec 28 05:12:39 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Tue, 28 Dec 2021 10:12:39 +0000
Subject: [issue46188] dictionary creation error
In-Reply-To: <1640685602.96.0.10576142491.issue46188@roundup.psfhosted.org>
Message-ID: <1640686359.79.0.819844090097.issue46188@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

> I still can not figure out why the first two elements are inconsistent
from the rest of the dictionary, and why they appear in the first place.

Hi Tobias,

This is a bug tracker for reporting bugs in Python, not a help desk to ask for explanations. The behaviour you see is correct. Except for the last line, which is a copy-and-paste error on your part: the actual last line is

>>> dictionary
{0: None, None: None, 2: 2, 4: 4, 6: 6, 8: 8}

So there is no error here, everything is working as expected.

If you need help understanding why the code is correct, please take the discussion to the Python Discuss forum where you will be sure to get answers.

----------
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46188>
_______________________________________

From report at bugs.python.org  Tue Dec 28 07:02:58 2021
From: report at bugs.python.org (Alex Waygood)
Date: Tue, 28 Dec 2021 12:02:58 +0000
Subject: [issue30420] Clarify kwarg handing for subprocess convenience APIs
In-Reply-To: <1495337351.2.0.395497440987.issue30420@psf.upfronthosting.co.za>
Message-ID: <1640692978.02.0.491622676655.issue30420@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

The modern docs for these functions seem to:

* Document the cwd argument for these functions, following PR 1685 & PR 2253.
* Include an **other_popen_kwargs parameter for all these functions.

Nick, is there anything left to do here, or can this issue be closed now?

----------
nosy: +AlexWaygood

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30420>
_______________________________________

From report at bugs.python.org  Tue Dec 28 07:26:45 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Tue, 28 Dec 2021 12:26:45 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640694405.06.0.289749388771.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:


New changeset 02b5417f1107415abaf81acab7522f9aa84269ea by Mark Dickinson in branch 'main':
bpo-37295: Speed up math.comb(n, k) for 0 <= k <= n <= 67 (GH-30275)
https://github.com/python/cpython/commit/02b5417f1107415abaf81acab7522f9aa84269ea


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 28 08:17:05 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Tue, 28 Dec 2021 13:17:05 +0000
Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a
 crash in subintepreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1640697425.7.0.0286093091714.issue46070@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
nosy: +corona10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Tue Dec 28 08:19:36 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Tue, 28 Dec 2021 13:19:36 +0000
Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a
 crash in subintepreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1640697576.17.0.0229531333844.issue46070@roundup.psfhosted.org>


Dong-hee Na <donghee.na at python.org> added the comment:

I can reproduce the crash on my macOS with main branch version.

Fatal Python error: Segmentation fault

Thread 0x0000700010389000 (most recent call first):
  File "/Users/user/oss/cpython/bug.py", line 16 in doIt
  File "/Users/user/oss/cpython/Lib/threading.py", line 968 in run
  File "/Users/user/oss/cpython/Lib/threading.py", line 1031 in _bootstrap_inner
  File "/Users/user/oss/cpython/Lib/threading.py", line 988 in _bootstrap

Current thread 0x000070000f386000 (most recent call first):
  File "/Users/user/oss/cpython/bug.py", line 16 in doIt
  File "/Users/user/oss/cpython/Lib/threading.py", line 968 in run
  File "/Users/user/oss/cpython/Lib/threading.py", line 1031 in _bootstrap_inner
  File "/Users/user/oss/cpython/Lib/threading.py", line 988 in _bootstrap

Thread 0x000070000e383000 (most recent call first):
  File "/Users/user/oss/cpython/bug.py", line 16 in doIt
  File "/Users/user/oss/cpython/Lib/threading.py", line 968 in run
  File "/Users/user/oss/cpython/Lib/threading.py", line 1031 in _bootstrap_inner
  File "/Users/user/oss/cpython/Lib/threading.py", line 988 in _bootstrap

Thread 0x000070000d380000 (most recent call first):
  File "/Users/user/oss/cpython/bug.py", line 16 in doIt
  File "/Users/user/oss/cpython/Lib/threading.py", line 968 in run
  File "/Users/user/oss/cpython/Lib/threading.py", line 1031 in _bootstrap_inner
  File "/Users/user/oss/cpython/Lib/threading.py", line 988 in _bootstrap

Thread 0x000000010a590e00 (most recent call first):
  File "/Users/user/oss/cpython/Lib/threading.py", line 1125 in _wait_for_tstate_lock
  File "/Users/user/oss/cpython/Lib/threading.py", line 1105 in join
  File "/Users/user/oss/cpython/bug.py", line 23 in func
  File "/Users/user/oss/cpython/bug.py", line 25 in <module>

Extension modules: _testcapi (total: 1)
[1]    9098 segmentation fault  ./python.exe bug.py

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Tue Dec 28 08:40:56 2021
From: report at bugs.python.org (Steve Dower)
Date: Tue, 28 Dec 2021 13:40:56 +0000
Subject: [issue46171] venv module produces spurious warning that location has
 moved
In-Reply-To: <1640338191.84.0.15434906765.issue46171@roundup.psfhosted.org>
Message-ID: <1640698856.58.0.728429314547.issue46171@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

There are plenty of other ways to get a venv through a potentially unexpected path (turns out I've been doing one for years), which is why I went with the general warning rather than limiting it to specific behaviours that are subject to change outside of our control.

I'm not opposed to strengthening this check to ignore DOS encoded names, but I think it should remain for anything where the realised executable path isn't the same as what you'd assume from the requested path. Without being very aware of how your directories are all configured, it could be near impossible to diagnose, so the warning in the command-line tool is appropriate.

----------
nosy: +vinay.sajip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46171>
_______________________________________

From report at bugs.python.org  Tue Dec 28 08:42:18 2021
From: report at bugs.python.org (Steve Dower)
Date: Tue, 28 Dec 2021 13:42:18 +0000
Subject: [issue46177] can't install launcher for all users
In-Reply-To: <1640458842.49.0.0625081718975.issue46177@roundup.psfhosted.org>
Message-ID: <1640698938.6.0.594653886316.issue46177@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

This normally happens because you've already installed the launcher "just for me". You can't change that setting later.

Open Add/Remove Programs and uninstall the Python Launcher first. Then you should be able to reinstall it for all users.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46177>
_______________________________________

From report at bugs.python.org  Tue Dec 28 10:01:14 2021
From: report at bugs.python.org (hejin517)
Date: Tue, 28 Dec 2021 15:01:14 +0000
Subject: [issue46189] Text containing "wide" character not correctly refreshed
Message-ID: <1640703674.26.0.944384925323.issue46189@roundup.psfhosted.org>


New submission from hejin517 <hejin517 at 126.com>:

When the app runs it first shows a black character "f" in Times New Roman.
By clicking the button, I expect that the color of the whole character will be changed to red, but actually only part is changed.

In FontForge (a font editor), I find the character "f" in Times New Roman is wider than its "width".
Please look into this problem. Thanks.

Code to reproduce:
----------------------
import tkinter

def change_color():
    canvas.itemconfig(text, fill="red")

root = tkinter.Tk()
canvas = tkinter.Canvas(root, width=500, height=500)
canvas.pack()

text = canvas.create_text((200, 200), text="f", font=("Times New Roman", 200), fill="black")

button = tkinter.Button(text="Change Color", command=change_color)
button.pack()

root.mainloop()

----------
components: Tkinter
messages: 409258
nosy: hejin517
priority: normal
severity: normal
status: open
title: Text containing "wide" character not correctly refreshed
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46189>
_______________________________________

From report at bugs.python.org  Tue Dec 28 10:09:09 2021
From: report at bugs.python.org (Paul Ganssle)
Date: Tue, 28 Dec 2021 15:09:09 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1640704149.16.0.477189073349.issue46124@roundup.psfhosted.org>


Paul Ganssle <bpo at m.ganssle.io> added the comment:

Jason's patch looks good to me, but I don't understand why Karthikeyan originally suggested using `normalize_path`. Trying to dig through exactly how `files().joinpath().open` is implemented has so many layers of indirection and abstract classes that I can't quite figure out if the two things are equivalent or not. Seems like `joinpath()` is the right thing to do, but does it have less validation than the `normalize_path` method?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Tue Dec 28 11:33:11 2021
From: report at bugs.python.org (Karthikeyan Singaravelan)
Date: Tue, 28 Dec 2021 16:33:11 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1640709191.59.0.557856317402.issue46124@roundup.psfhosted.org>


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

I just copied the implementation and normalize_path function was part of it. Looking into the implementation of normalize_path it validates the given argument to be a filename without any separator. I will leave it to Jason for a better understanding of the API and compatibility here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Tue Dec 28 11:58:04 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Tue, 28 Dec 2021 16:58:04 +0000
Subject: [issue21987] TarFile.getmember on directory requires trailing slash
 iff over 100 chars
In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za>
Message-ID: <1640710684.75.0.550195920412.issue21987@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
nosy: +andrei.avk
nosy_count: 8.0 -> 9.0
pull_requests: +28497
pull_request: https://github.com/python/cpython/pull/30283

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21987>
_______________________________________

From report at bugs.python.org  Tue Dec 28 12:08:06 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Tue, 28 Dec 2021 17:08:06 +0000
Subject: [issue21987] TarFile.getmember on directory requires trailing slash
 iff over 100 chars
In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za>
Message-ID: <1640711286.77.0.664535057162.issue21987@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

The original issue was twofold:
1. below 100 char not working with trailing slash
2. over 100 char not working WITHOUT trailing slash

The second part is no longer an issue -- tested in 3.9 and 3.11 on MacOS.

Currently the issue is that a trailing slash now doesn't work for lookup of dirs, no matter the size of name.

This is inconsistent with the way shell commands work as well as various Python path related modules that tolerate trailing slash for dirs.

This can cause users to wrongly assume a dir is absent in a tarfile, so I think it's worth fixing and I've added a PR with a test for both old and new issue.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21987>
_______________________________________

From report at bugs.python.org  Tue Dec 28 12:12:22 2021
From: report at bugs.python.org (Irit Katriel)
Date: Tue, 28 Dec 2021 17:12:22 +0000
Subject: [issue42259] pprint: infinite recursion for saferepr() when using
 nested objects, but str() works
In-Reply-To: <1604490271.59.0.652277780579.issue42259@roundup.psfhosted.org>
Message-ID: <1640711542.13.0.401106289404.issue42259@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42259>
_______________________________________

From report at bugs.python.org  Tue Dec 28 12:50:32 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Tue, 28 Dec 2021 17:50:32 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1640713832.81.0.371273288907.issue46090@roundup.psfhosted.org>


Change by Brandt Bucher <brandtbucher at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Tue Dec 28 12:49:52 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Tue, 28 Dec 2021 17:49:52 +0000
Subject: [issue46090] C extensions can't swap out live frames anymore
In-Reply-To: <1639601731.02.0.904150269203.issue46090@roundup.psfhosted.org>
Message-ID: <1640713792.13.0.822036701709.issue46090@roundup.psfhosted.org>


Brandt Bucher <brandtbucher at gmail.com> added the comment:


New changeset 77195cd44b2506cda88a3cfc98918526068b1d46 by Brandt Bucher in branch 'main':
bpo-46090: Allow PyThreadState.datastack_* members to be NULL (GH-30234)
https://github.com/python/cpython/commit/77195cd44b2506cda88a3cfc98918526068b1d46


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46090>
_______________________________________

From report at bugs.python.org  Tue Dec 28 13:28:25 2021
From: report at bugs.python.org (Carlos Damazio)
Date: Tue, 28 Dec 2021 18:28:25 +0000
Subject: [issue46175] Zero argument super() does not function properly inside
 generator expressions
In-Reply-To: <1640402741.49.0.663575697797.issue46175@roundup.psfhosted.org>
Message-ID: <1640716105.25.0.828551688467.issue46175@roundup.psfhosted.org>


Carlos Damazio <carlos.damazio at damazio.dev> added the comment:

Josh: My mistake, I've seen a similar issue, then. And agreed, I think #2 is a great candidate since we don't need to re-design existing structures. I don't know a better option... yet.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46175>
_______________________________________

From report at bugs.python.org  Tue Dec 28 13:47:17 2021
From: report at bugs.python.org (Tim Peters)
Date: Tue, 28 Dec 2021 18:47:17 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640717237.84.0.75269877767.issue46187@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

[Mark]
> def risqrt(n):
>    return (isqrt(n<<2) + 1) >> 1

Sweet! New one on me - did you invent this? It's slick :-)

I'd be happy to see recipes added to the docs for rounded and ceiling flavors of isqrt, but am dubious about the value of building them in.

If they are added via an optional rounding argument, can we use the decimal module's names for the supported rounding modes?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Tue Dec 28 13:51:01 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Tue, 28 Dec 2021 18:51:01 +0000
Subject: [issue21987] TarFile.getmember on directory requires trailing slash
 iff over 100 chars
In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za>
Message-ID: <1640717461.17.0.0717238669842.issue21987@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Well, the tar command strips trailing slashes (even from file paths), so it is reasonable to do this in getmember().

$ mkdir dir
$ touch dir/file
$ tar cf archive.tar dir
$ tar tf archive.tar dir
dir/
dir/file
$ tar tf archive.tar dir/
dir/
dir/file
$ tar tf archive.tar dir/file
dir/file
$ tar tf archive.tar dir/file/
dir/file
$ tar tf archive.tar dir/file////
dir/file

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21987>
_______________________________________

From report at bugs.python.org  Tue Dec 28 14:07:28 2021
From: report at bugs.python.org (Carlos Damazio)
Date: Tue, 28 Dec 2021 19:07:28 +0000
Subject: [issue2756] urllib.request.add_header fails with existing
 unredirected_header
In-Reply-To: <1209913898.38.0.175541514636.issue2756@psf.upfronthosting.co.za>
Message-ID: <1640718448.93.0.412246531424.issue2756@roundup.psfhosted.org>


Carlos Damazio <carlos.damazio at damazio.dev> added the comment:

This is the server for testing in 3.10.

----------
nosy: +carlosdamazio
Added file: https://bugs.python.org/file50523/server310.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue2756>
_______________________________________

From report at bugs.python.org  Tue Dec 28 14:07:57 2021
From: report at bugs.python.org (Carlos Damazio)
Date: Tue, 28 Dec 2021 19:07:57 +0000
Subject: [issue2756] urllib.request.add_header fails with existing
 unredirected_header
In-Reply-To: <1209913898.38.0.175541514636.issue2756@psf.upfronthosting.co.za>
Message-ID: <1640718477.66.0.0668330583247.issue2756@roundup.psfhosted.org>


Carlos Damazio <carlos.damazio at damazio.dev> added the comment:

And here's the code to reproduce the bug in 3.10.

----------
Added file: https://bugs.python.org/file50524/bug310.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue2756>
_______________________________________

From report at bugs.python.org  Tue Dec 28 14:10:05 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Tue, 28 Dec 2021 19:10:05 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640718605.32.0.709858058074.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

It's a little late, but I had a thought that code could be made more general, slightly faster, and much easier to understand if the popcount logic were to be replaced with a table that records how many bits of the factorial were shifted out to make it odd.

from math import comb, perm, factorial as fact

Modulus = 2 ** 64
Cmax = 67
Pmax = 25
Fmax = Pmax

F = []          # odd factorial
S = []          # shift back to factorial
Finv = []       # multiplicative inverse of odd fact
for n in range(Cmax+1):
    f = fact(n)
    s = (f & -f).bit_length() - 1
    odd_f = (f >> s) % Modulus
    inv_f = pow(odd_f, -1, Modulus)
    assert odd_f * inv_f % Modulus == 1
    assert (odd_f << s) % Modulus == f % Modulus
    F.append(odd_f)
    S.append(s)
    Finv.append(inv_f)

def fact_small(n):
    return F[n] << S[n]

def perm_small(n, k):
    return (F[n] * Finv[n-k] % Modulus) << (S[n] - S[n-k])

def comb_small(n, k):
    return (F[n] * Finv[k] * Finv[n-k] % Modulus) << (S[n] - S[k] - S[n-k])

assert all(fact_small(n) == fact(n) for n in range(Fmax+1))
assert all(perm_small(n, k) == perm(n, k) for n in range(Pmax+1) for k in range(0, n+1))
assert all(comb_small(n, k) == comb(n, k) for n in range(Cmax+1) for k in range(0, n+1))

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 28 14:14:20 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Tue, 28 Dec 2021 19:14:20 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640718860.37.0.883375512704.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

The shift table is an array of uint8_t, so it would be tiny (nearly fitting in one cache line).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 28 14:23:58 2021
From: report at bugs.python.org (Tim Peters)
Date: Tue, 28 Dec 2021 19:23:58 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640719438.25.0.394127986693.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

Raymond, using the count of trailing zeroes instead is exactly what I suggested before, here:

https://bugs.python.org/issue37295#msg409000

So Mark & I already batted that around. For whatever reasons he had, though, he stuck with the xor-popcount approach. Presumably he found that was faster than looking up trailing zero counts.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 28 14:26:25 2021
From: report at bugs.python.org (=?utf-8?q?Carlos_Dam=C3=A1zio?=)
Date: Tue, 28 Dec 2021 19:26:25 +0000
Subject: [issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not
 present in code
In-Reply-To: <1571436071.95.0.156296507321.issue38522@roundup.psfhosted.org>
Message-ID: <1640719585.48.0.00889193754219.issue38522@roundup.psfhosted.org>


Change by Carlos Dam?zio <carlos.edamazio at gmail.com>:


----------
keywords: +patch
nosy: +dmzz
nosy_count: 3.0 -> 4.0
pull_requests: +28498
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30284

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38522>
_______________________________________

From report at bugs.python.org  Tue Dec 28 15:31:16 2021
From: report at bugs.python.org (E. Paine)
Date: Tue, 28 Dec 2021 20:31:16 +0000
Subject: [issue46189] Text containing "wide" character not correctly refreshed
In-Reply-To: <1640703674.26.0.944384925323.issue46189@roundup.psfhosted.org>
Message-ID: <1640723476.37.0.477315816522.issue46189@roundup.psfhosted.org>


E. Paine <xepaine13 at gmail.com> added the comment:

I have been able to reproduce this in Wish built from the current head. Interestingly, the cut-off seems to be 1px off what `font measure` gives (see attached). Though in this behaviour is a problem, the man page does note the following:
> The return value is the total width in pixels of text, not including the extra pixels used by highly exaggerated characters such as cursive ?f? [https://www.tcl.tk/man/tcl/TkCmd/font.html#M10]

Tkinter is simply a thin wrapper of Tk, so I suggest you take it up with that team so they can fix it upstream (a minimal equivalent of your code in Tcl can be found below): https://core.tcl-lang.org/tk/reportlist

pack [canvas .c -width 250 -height 500]
font create .f -family "Times New Roman" -size -500
set t [.c create text 0 250 -text f -font .f -anchor w]
update ; # A window render is required for the bug to occur
.c itemconfigure $t -fill red
set x [font measure .f f]
.c create line $x 0 $x 500

----------
nosy: +epaine, serhiy.storchaka
Added file: https://bugs.python.org/file50525/Screenshot 2021-12-28 201447.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46189>
_______________________________________

From report at bugs.python.org  Tue Dec 28 16:15:41 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Tue, 28 Dec 2021 21:15:41 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1640726141.83.0.795460388952.issue46124@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

> Does `joinpath` have less validation?

Yes. Previously, resources.* would perform some validation on the path to ensure that it didn't contain path separators (to avoid users attempting to get resources in subdirectories or perhaps manipulating the path in other ways).

So no, they're not equivalent. If `resource_name` or "zones" ever contained path separators, the former implementation would raise an error whereas this implementation would attempt to join those characters to the path. Since "zones" is a static string, it's clearly not affected. And `resource_name` can't have posixpath.sep. If `key` had an ntpath.sep, that might behave differently, but that seemed like an edge case not worth exploring.

If it is worth exploring, I would recommend not to use normalize_path, but instead to implement the validation in zoneinfo._common. That is, wrap key in `_validate_key()` that protects against invalid paths. But in practice, it's better to do that closer to where the unsanitized data would be encountered (if at all).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Tue Dec 28 16:16:34 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Tue, 28 Dec 2021 21:16:34 +0000
Subject: [issue46124] Deprecation warning in zoneinfo module
In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org>
Message-ID: <1640726194.48.0.397291387307.issue46124@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

Normalize_path from legacy implementation: https://github.com/python/importlib_resources/blob/3beb2fd5831e65f7b45033e1ec276c4a6b4ca973/importlib_resources/_legacy.py#L30-L40

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46124>
_______________________________________

From report at bugs.python.org  Tue Dec 28 17:08:15 2021
From: report at bugs.python.org (Tim Peters)
Date: Tue, 28 Dec 2021 22:08:15 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640729295.15.0.809792925169.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

A timing confounder: I see that CPython's _Py_popcount32() only tries to use the relevant blazing fast hardware instruction if defined(__clang__) || defined(__GNUC__). On Windows, it's a long-winded bit-fiddling dance.

So which of xor-popcount and add-up-up-trailing-zero-counts is faster may well depend on platform.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 28 19:50:49 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 29 Dec 2021 00:50:49 +0000
Subject: [issue34498] Python 3.7+ break on
 singledispatch_function.register(pseudo_type), which Python 3.6 accepted
In-Reply-To: <1535199569.5.0.56676864532.issue34498@psf.upfronthosting.co.za>
Message-ID: <1640739049.55.0.927638793372.issue34498@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

There's no point in lamenting the compatibility with Python 3.6, it's water under the bridge. Dispatching on types like list[int] or types generated by NewType is not realistic. Maybe the only thing left to do is to raise an error on registration when the type is e.g. list[int]? Currently that passes, but then attempting to dispatch on *anything* fails with TypeError: issubclass() argument 2 cannot be a parameterized generic

----------
nosy: +gvanrossum, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34498>
_______________________________________

From report at bugs.python.org  Tue Dec 28 20:01:54 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 29 Dec 2021 01:01:54 +0000
Subject: [issue34498] Python 3.7+ break on
 singledispatch_function.register(pseudo_type), which Python 3.6 accepted
In-Reply-To: <1535199569.5.0.56676864532.issue34498@psf.upfronthosting.co.za>
Message-ID: <1640739714.28.0.121972745649.issue34498@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Guido: Serhiy fixed this very recently in Issue46032.

The documentation should probably be improved, however, in my opinion; there's currently nothing officially stating that GenericAlias/NewType/typing aliases are unsupported.

Support for singledispatch.register(union_type) was also recently added in Issue46014, but has yet to be documented.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34498>
_______________________________________

From report at bugs.python.org  Tue Dec 28 20:21:46 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 01:21:46 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640740906.5.0.469037060361.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Also, it would help Serhiy's divide and conquer algorithm if the fast cases included the sides of Pascal's triangle rather than just the top:

   if n < TableSize and k < limits[n]:
       return comb_small(n, k)
   return comb_slow(n, k)

Build the table like this:

    TableSize = 101
    limits = bytearray(TableSize)
    for n in range(0, TableSize):
        for k in range(0, n+1):
            if comb(n, k) != comb_small(n, k):
                break
        else:
            k += 1
        limits[n] = k

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Tue Dec 28 22:23:05 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 03:23:05 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640748185.72.0.393255495894.issue46187@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> Sweet! New one on me 

Tim already knows this but for the record the derivation is isn't tricky.

With y=isqrt(x), then next root is at y+1 and the half way point is y+1/2 which isn't an integer.  The corresponding squares are y**2, (y+1/2)**2, and (y+1)**2.  With a multiple of four, those become 4*y**2, 4*(y+1/2)**2, and 4*y+1)**2 which are equivalent to the squares of consecutive integers: (2y)**2, (2y+1)**2, and (2y+2)**2.  Adding one gives the roots 2y+1, 2y+2, and 2y+3.  The floor division eliminates the constant term giving the desired roots y, y+1, and y+1.

> can we use the decimal module's names for the supported rounding modes?

I'm not sure those make sense because we never get to exactly half.  There is only floor, ceil, and round, not half_up, half_even, etc.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Tue Dec 28 22:41:31 2021
From: report at bugs.python.org (Tim Peters)
Date: Wed, 29 Dec 2021 03:41:31 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640749291.85.0.0754282004116.issue46187@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

>> can we use the decimal module's names for the supported
>> rounding modes?

> I'm not sure those make sense because we never get to
> exactly half.  There is only floor, ceil, and round,
> not half_up, half_even, etc.

So use decimal's ROUND_CEILING, ROUND_FLOOR, and ROUND_HALF_EVEN. It's irrelevant that the halfway case can't occur: it's still following the ROUND_HALF_EVEN rules, it's just that one of those rules never happens to apply in this context. So what? Your _intent_ is to supply "best possible rounding", and that's what ROUND_HALF_EVEN means. It's not doing any favors to make up a new name for a rounding mode that only applies to values that can never tie. Tail. dog, wag ;-) If someone knows what half/even does, they already know what _this_ rounding mode does. Why complicate it with a useless distinction?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Tue Dec 28 22:47:26 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Wed, 29 Dec 2021 03:47:26 +0000
Subject: [issue41585] policy.max_line_length is incorrectly assumed to never
 be None
In-Reply-To: <1597783641.3.0.970481026671.issue41585@roundup.psfhosted.org>
Message-ID: <1640749646.38.0.677015792987.issue41585@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Seems to be a duplicate of #34800

----------
nosy: +andrei.avk

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41585>
_______________________________________

From report at bugs.python.org  Tue Dec 28 23:19:06 2021
From: report at bugs.python.org (Tim Peters)
Date: Wed, 29 Dec 2021 04:19:06 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640751546.59.0.999734857312.issue46187@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

FYI, I had a simpler derivation in mind. Say

sqrt(n) = r + f

where r = isqrt(n) and 0 <= f < 1. Then

sqrt(4n) = 2 * sqrt(n) = 2*(r + f) = 2r + 2f, with 0 <= 2f < 2.

If f < 0.5, 2f < 1, so isqrt(4n) = 2r, and we shouldn't round r up either.

If f > 0.5, 2f > 1, so sqrt(4n) = 2r + 1 + (2f - 1), with 0 <= 2f - 1 < 1, so isqrt(4n) = 2*r + 1. In this case (f > 0.5) we need to round r up.

f = 0.5 can't happen.

Regardless, I don't believe I would have thought of this myself! It was an unexpected delight :-

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Tue Dec 28 23:34:23 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 29 Dec 2021 04:34:23 +0000
Subject: [issue46171] venv module produces spurious warning that location has
 moved
In-Reply-To: <1640338191.84.0.15434906765.issue46171@roundup.psfhosted.org>
Message-ID: <1640752463.62.0.34602242959.issue46171@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> There are plenty of other ways to get a venv through a potentially 
> unexpected path (turns out I've been doing one for years)

Examples would be appreciated because I'm drawing a blank here. A junction or directory symlink in the parent path shouldn't be a problem. Otherwise I'd prefer that the solution for bpo-45337 was limited to an app container and paths in "%USERPROFILE%\AppData" (excluding "%TEMP%"). An app container can be detected via the package family name, if any, as returned by GetCurrentPackageFamilyName().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46171>
_______________________________________

From report at bugs.python.org  Wed Dec 29 00:36:37 2021
From: report at bugs.python.org (Tilman Krummeck)
Date: Wed, 29 Dec 2021 05:36:37 +0000
Subject: [issue46190] Omit k in random.sample()
Message-ID: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>


New submission from Tilman Krummeck <tilman.krummeck at googlemail.com>:

random.sample can be used to choose k items from a given sequence. Currently, k is a mandatory parameter. 

I suggest to make k optional and instead, if omitted, pick a random value from the range of 0 and the length of the sequence.

Of course, doing this must also consider any possible value of 'count'

----------
components: Extension Modules
messages: 409283
nosy: TilmanKrummeck
priority: normal
severity: normal
status: open
title: Omit k in random.sample()
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 01:48:51 2021
From: report at bugs.python.org (hongweipeng)
Date: Wed, 29 Dec 2021 06:48:51 +0000
Subject: [issue43118] inspect.signature() raises RuntimeError on failed to
 resolve the default argument value
In-Reply-To: <1612364652.22.0.413597788447.issue43118@roundup.psfhosted.org>
Message-ID: <1640760531.4.0.78020102036.issue43118@roundup.psfhosted.org>


Change by hongweipeng <hongweichen8888 at sina.com>:


----------
nosy: +hongweipeng
nosy_count: 1.0 -> 2.0
pull_requests: +28499
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30285

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43118>
_______________________________________

From report at bugs.python.org  Wed Dec 29 01:52:24 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Wed, 29 Dec 2021 06:52:24 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640760744.63.0.195054328693.issue46190@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

Can you describe more about your use-case for this?

You can already do something like this now with something like the following:

    def random_subset(sequence):
        source = random.randbytes(len(sequence))
        return [x for x, r in zip(sequence, source) if r & 1]

You could add a random.shuffle() call at the end if your application needs it.

For the case with counts, you could do getrandbits(i).bit_count() to get a binomial distribution to choose how many of each element to include.

----------
components: +Library (Lib) -Extension Modules
nosy: +Dennis Sweeney, rhettinger
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 02:04:54 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 07:04:54 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640761494.67.0.627644474869.issue46190@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

If all you want is a sample where k==1, then use choice().  That is clearer and more efficient.  

The sample() function is for sampling without replacement which only makes sense when k > 1; otherwise, choice() or choices() is usually what you want.

----------
assignee:  -> rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 02:06:50 2021
From: report at bugs.python.org (Tilman Krummeck)
Date: Wed, 29 Dec 2021 07:06:50 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640761610.87.0.481587585405.issue46190@roundup.psfhosted.org>


Tilman Krummeck <tilman.krummeck at googlemail.com> added the comment:

I use this mostly in tests to randomize my inputs. So currently I'm doing something like this:

result = random.sample(items, random.randint(0, len(items)))

I guess if someone would omit 'k' he wouldn't care about the result (which is probably a use-case when using random functions). This would mostly be a convenience improvement for lazy guys like myself.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 02:10:34 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Wed, 29 Dec 2021 07:10:34 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640761834.88.0.440619142364.issue46190@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

For completeness:

def random_subset_with_counts(sequence, counts):
    result = []
    for x, k in zip(sequence, counts):
        result.extend([x] * random.getrandbits(k).bit_count())
    return result

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 02:12:24 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 07:12:24 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640761944.89.0.259038201871.issue46190@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Okay. Thank for the quick response and the suggestion.  I'm going to mark this one as closed.  AFAICT, it distracts users from better solutions.  

I did a quick code search for sample().  The k==1 case is rare and in most cases the code should have used choice() or choices() instead.  Accordingly, it doesn't make sense to make k==1 the default.  

Also, I suspect (but don't no for sure) that most users benefit by having the error message when k is omitted.  That is more likely a user mistake than a correct design choice.

----------
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 02:19:04 2021
From: report at bugs.python.org (Tilman Krummeck)
Date: Wed, 29 Dec 2021 07:19:04 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640762344.41.0.786540476096.issue46190@roundup.psfhosted.org>


Tilman Krummeck <tilman.krummeck at googlemail.com> added the comment:

My suggestion is not to set k=1 when omitted but to assign it a random value that is something between 0 and the maximum possible value which is:

sum(counts) if counts else len(population)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 02:19:05 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Wed, 29 Dec 2021 07:19:05 +0000
Subject: [issue45508] Specialize INPLACE_ADD
In-Reply-To: <1634550582.0.0.584054071431.issue45508@roundup.psfhosted.org>
Message-ID: <1640762345.34.0.973146835033.issue45508@roundup.psfhosted.org>


Change by Dennis Sweeney <sweeney.dennis650 at gmail.com>:


----------
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45508>
_______________________________________

From report at bugs.python.org  Wed Dec 29 02:27:29 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 07:27:29 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640762849.73.0.418718943956.issue46190@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> My suggestion is not to set k=1 when omitted but to assign it a random value 

Sorry, I think that is just bizarre.  Also, some populations are *very* large, so a minor user accident of omitting a parameter would result in a large unexpected output.  For choices(), it would have been nice to have k default the population size (because resampling is a common use case) but we didn't go that path because of the likelihood of a large unexpected output.  The same reasoning holds here a well.

If you want to go down this path, I recommend making your code explicit about what it is trying to do.  Something this unexpected should not be the implicit and default behavior.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 02:31:52 2021
From: report at bugs.python.org (Tilman Krummeck)
Date: Wed, 29 Dec 2021 07:31:52 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640763112.96.0.215567868742.issue46190@roundup.psfhosted.org>


Tilman Krummeck <tilman.krummeck at googlemail.com> added the comment:

Well, it's not bizarre, it's a use-case I'm facing quite often.

But thanks for the clarification, I haven't had very large populations in mind - this makes indeed sense.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 02:32:26 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Wed, 29 Dec 2021 07:32:26 +0000
Subject: [issue41850] inspect.py: access block stack
In-Reply-To: <1600935790.44.0.688452336961.issue41850@roundup.psfhosted.org>
Message-ID: <1640763146.5.0.416436904169.issue41850@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

With the advent of zero-cost exception handling in Python 3.10, there is no block stack, neither for exceptions nor for loops. These were always regarded as an implementation detail of the compiler. If you have any new ideas for a feature like this, I would suggest sending them to the Python-Ideas mailing list, but I'm closing this for now.

----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41850>
_______________________________________

From report at bugs.python.org  Wed Dec 29 03:00:05 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 08:00:05 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640764805.38.0.418003511243.issue46190@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

The use case isn't bizarre.  But having an API where that is the default behavior would be.  From the point of view of most users, such an API would be unusual and surprising (I don't know of any other random package that has such a default).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 03:14:55 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 08:14:55 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640765695.91.0.574385834915.issue46187@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> So use decimal's ROUND_CEILING, ROUND_FLOOR, and ROUND_HALF_EVEN

It think is would suck to have to type those out.  Sorry, I think you're headed down the path of foolish consistency with an unrelated module and a more complicated topic.  What's wrong with keeping consistent the name of the existing functions: round, floor, and ceil which are self-explanatory and much better known than the decimal module constants.  Also, the intent for these to be substitutable for existing code which uses round(sqrt(x)), floor(sqrt(x)), and ceil(sqrt(x)).  If those are the starting point, then round, floor, and ceil are a logical progression from the existing code.  It is also consistent with how the numeric tower approaches various ways of rounding.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Wed Dec 29 03:28:12 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 29 Dec 2021 08:28:12 +0000
Subject: [issue46191] Conflict between using annotations in singledispatch()
 and MyPy
Message-ID: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

You can dispatch on collections.abc.Sequence.

@functools.singledispatch
def f(a: collections.abc.Sequence) -> None:
    pass

But MyPy complains about this:

error: Missing type parameters for generic type "Sequence"

MyPy requires parametrized generic (like collections.abc.Sequence[int]), but singledispatch() does not work with it.

----------
components: Library (Lib)
messages: 409295
nosy: gvanrossum, kj, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Conflict between using annotations in singledispatch() and MyPy
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46191>
_______________________________________

From report at bugs.python.org  Wed Dec 29 03:29:23 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 29 Dec 2021 08:29:23 +0000
Subject: [issue34498] Python 3.7+ break on
 singledispatch_function.register(pseudo_type), which Python 3.6 accepted
In-Reply-To: <1535199569.5.0.56676864532.issue34498@psf.upfronthosting.co.za>
Message-ID: <1640766563.31.0.0273331417877.issue34498@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

The original issue is about dispatching on non-parametrized generics like typing.Sequence. isinstance([], typing.Sequence) works, so it could be possible to support dispatching on typing.Sequence. But I have doubts that it is worth to revive such feature, because it needs some effort, and you can use collections.abc.Sequence instead.

But there is a conflict between using annotations in singledispatch() and MyPy (issue46191).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34498>
_______________________________________

From report at bugs.python.org  Wed Dec 29 04:19:39 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 09:19:39 +0000
Subject: [issue43639] Do not raise AttributeError on instance attribute
 update/deletion if data descriptor with missing __set__/__delete__ method
 found on its type
In-Reply-To: <1616848832.19.0.971517857631.issue43639@roundup.psfhosted.org>
Message-ID: <1640769579.59.0.129277545515.issue43639@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I'm going to decline this one.  

* It is arguable whether or not this behavior should have been designed in originally.  However, changing it now is risky (as noted by Brett and Ethan).

* Personally, I disagree with the notion of allowing a partial pass through.  That seems hazardous and error-prone to me.  It is easier to reason about data descriptors being all or nothing.  I like that AttributeError is raised while still allowing me to add the missing methods if I want to explicitly define some other behavior. 

* This has been open for 9 months and no one else stepped forward to champion it.

* For two decades, no one has complained that the current behavior got in the way of what they were trying to do.  That provides some evidence that there isn't a real world problem to be solved.

----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43639>
_______________________________________

From report at bugs.python.org  Wed Dec 29 04:19:49 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 09:19:49 +0000
Subject: [issue43639] Do not raise AttributeError on instance attribute
 update/deletion if data descriptor with missing __set__/__delete__ method
 found on its type
In-Reply-To: <1616848832.19.0.971517857631.issue43639@roundup.psfhosted.org>
Message-ID: <1640769589.49.0.944885757658.issue43639@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
assignee:  -> rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43639>
_______________________________________

From report at bugs.python.org  Wed Dec 29 04:24:38 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 09:24:38 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640769878.59.0.652266662701.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

-             if comb(n, k) != comb_small(n, k):
+             if comb(n, k) != comb_small(n, k) % Modulus:

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 29 05:04:55 2021
From: report at bugs.python.org (colorfulappl)
Date: Wed, 29 Dec 2021 10:04:55 +0000
Subject: [issue46192] Optimize builtin functions min() and max()
Message-ID: <1640772295.19.0.507214715597.issue46192@roundup.psfhosted.org>


New submission from colorfulappl <colorfulappl at qq.com>:

https://github.com/faster-cpython/ideas/discussions/199

----------
components: Interpreter Core
messages: 409299
nosy: colorfulappl
priority: normal
severity: normal
status: open
title: Optimize builtin functions min() and max()
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46192>
_______________________________________

From report at bugs.python.org  Wed Dec 29 05:05:14 2021
From: report at bugs.python.org (colorfulappl)
Date: Wed, 29 Dec 2021 10:05:14 +0000
Subject: [issue46192] Optimize builtin functions min() and max()
In-Reply-To: <1640772295.19.0.507214715597.issue46192@roundup.psfhosted.org>
Message-ID: <1640772314.5.0.494951981341.issue46192@roundup.psfhosted.org>


Change by colorfulappl <colorfulappl at qq.com>:


----------
type:  -> performance

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46192>
_______________________________________

From report at bugs.python.org  Wed Dec 29 05:10:13 2021
From: report at bugs.python.org (colorfulappl)
Date: Wed, 29 Dec 2021 10:10:13 +0000
Subject: [issue46192] Optimize builtin functions min() and max()
In-Reply-To: <1640772295.19.0.507214715597.issue46192@roundup.psfhosted.org>
Message-ID: <1640772613.12.0.0784190977505.issue46192@roundup.psfhosted.org>


Change by colorfulappl <colorfulappl at qq.com>:


----------
keywords: +patch
pull_requests: +28500
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30286

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46192>
_______________________________________

From report at bugs.python.org  Wed Dec 29 05:28:38 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 29 Dec 2021 10:28:38 +0000
Subject: [issue46191] Conflict between using annotations in singledispatch()
 and MyPy
In-Reply-To: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>
Message-ID: <1640773718.69.0.587888776076.issue46191@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
nosy: +AlexWaygood, lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46191>
_______________________________________

From report at bugs.python.org  Wed Dec 29 06:23:46 2021
From: report at bugs.python.org (Tilman Krummeck)
Date: Wed, 29 Dec 2021 11:23:46 +0000
Subject: [issue46190] Omit k in random.sample()
In-Reply-To: <1640756197.3.0.702729016627.issue46190@roundup.psfhosted.org>
Message-ID: <1640777026.45.0.246908705863.issue46190@roundup.psfhosted.org>


Tilman Krummeck <tilman.krummeck at googlemail.com> added the comment:

Hmm, ok, that sounds obvious. Thanks for the clarification.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46190>
_______________________________________

From report at bugs.python.org  Wed Dec 29 06:28:22 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 29 Dec 2021 11:28:22 +0000
Subject: [issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py
In-Reply-To: <1637421251.02.0.184439782821.issue45853@roundup.psfhosted.org>
Message-ID: <1640777302.53.0.952259862221.issue45853@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It was assigned to a variable initially because it was used in multiple places. Now it is only used in one place, but I agree with keeping the variable for readability.

But it should be named _IGNORED_ERRNOS.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45853>
_______________________________________

From report at bugs.python.org  Wed Dec 29 06:45:17 2021
From: report at bugs.python.org (miss-islington)
Date: Wed, 29 Dec 2021 11:45:17 +0000
Subject: [issue46120] Add note to `typing.Union` that it is recommended to use
 `|` instead
In-Reply-To: <1639815639.46.0.989122263928.issue46120@roundup.psfhosted.org>
Message-ID: <1640778317.56.0.788914924382.issue46120@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset ed1671ced7c9b951dfc16a0cf32a2b4eab914cf1 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46120: State that `|` is preferred over `Union` (GH-30222) (GH-30250)
https://github.com/python/cpython/commit/ed1671ced7c9b951dfc16a0cf32a2b4eab914cf1


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46120>
_______________________________________

From report at bugs.python.org  Wed Dec 29 06:57:14 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 29 Dec 2021 11:57:14 +0000
Subject: [issue46120] Add note to `typing.Union` that it is recommended to use
 `|` instead
In-Reply-To: <1639815639.46.0.989122263928.issue46120@roundup.psfhosted.org>
Message-ID: <1640779034.81.0.923648537438.issue46120@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46120>
_______________________________________

From report at bugs.python.org  Wed Dec 29 06:59:30 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 29 Dec 2021 11:59:30 +0000
Subject: [issue30420] [doc] subprocess module: Clarify kwarg handing for
 convenience APIs
In-Reply-To: <1495337351.2.0.395497440987.issue30420@psf.upfronthosting.co.za>
Message-ID: <1640779170.4.0.569702106909.issue30420@roundup.psfhosted.org>


Change by Alex Waygood <Alex.Waygood at Gmail.com>:


----------
title: Clarify kwarg handing for subprocess convenience APIs -> [doc] subprocess module: Clarify kwarg handing for convenience APIs

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30420>
_______________________________________

From report at bugs.python.org  Wed Dec 29 07:34:59 2021
From: report at bugs.python.org (Keepun)
Date: Wed, 29 Dec 2021 12:34:59 +0000
Subject: [issue46193] Using a dictionary for open files.
Message-ID: <1640781299.57.0.336049681987.issue46193@roundup.psfhosted.org>


New submission from Keepun <keepun at gmail.com>:

"""
Using a dictionary for open files.

The file is filled with NULL. Only the last entry is normal.

Result:
00 00 00 00 ... 00 0A 48 65 6C 6C 6F 0A

Ubuntu - 3.8.10
Windows - 3.9.8
"""
fhandles = {}
for f in range(100):
    fh = fhandles.setdefault("suffix", open(r"test.txt", "w"))
    fh.write("\nHello\n")
    fh.flush()
for f in fhandles.values():
    f.close()

import sys
print(sys.version_info)

----------
components: IO
messages: 409303
nosy: Keepun
priority: normal
severity: normal
status: open
title: Using a dictionary for open files.
type: behavior
versions: Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46193>
_______________________________________

From report at bugs.python.org  Wed Dec 29 07:47:39 2021
From: report at bugs.python.org (Erik Gebeshuber)
Date: Wed, 29 Dec 2021 12:47:39 +0000
Subject: [issue38401] Make dataclass attribute docstrings accessible
In-Reply-To: <1570494293.05.0.934356434949.issue38401@roundup.psfhosted.org>
Message-ID: <1640782059.96.0.205182478336.issue38401@roundup.psfhosted.org>


Erik Gebeshuber <erik.gebeshuber at gmx.net> added the comment:

There is some confusion in the answers that I want to clear up:

"Attribute docstrings" were suggested in PEP 224 in August 2000 and rejected March 2001: https://www.python.org/dev/peps/pep-0224/

taleinat mentioned already PEP 258 from May 2001, which also contained "attribute docstrings" and was as well rejected.

At the same time - May 2001 - the well-known PEP 257 about docstring conventions came up and was accepted. It also mentions "attribute docstrings", but in a kind of restricted way (highlighting *** by me):

> String literals occurring elsewhere in Python code ***may also act as documentation***. They are ***not recognized*** by the Python bytecode compiler and are ***not accessible*** as runtime object attributes (i.e. not assigned to __doc__), ...
> Please see PEP 258, "Docutils Design Specification" [2], for a detailed description of attribute and additional docstrings.

The reference to the rejected PEP 258 does in my opinion not make the concept of "attribute docstrings" invalid, but indeed the restrictive wording (highlighted *** in the quote) defines their status, and it helps to explain the situation:

* Attribute docstrings are not supported by Python itself (no __doc__ etc.) -> that's why it is hard to add support for dataclass documentation in `help` as John Parejko suggested.

* It is totally fine to use attribute docstrings, since PEP 257 explicitly mentions them. Various tools support them.

* There is - as far as I can see it - no clear notion to differentiate between "official" docstrings and "inofficial" ones (attribute docstrings, additional docstrings). All of them are docstrings in the broader sense, though most times only the "official" ones are meant, and many don't even know about the "inofficial" ones.

----------
nosy: +egebes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38401>
_______________________________________

From report at bugs.python.org  Wed Dec 29 08:04:14 2021
From: report at bugs.python.org (=?utf-8?q?Carlos_Dam=C3=A1zio?=)
Date: Wed, 29 Dec 2021 13:04:14 +0000
Subject: [issue26552] Failing ensure_future still creates a Task
In-Reply-To: <1457869570.39.0.866858008064.issue26552@psf.upfronthosting.co.za>
Message-ID: <1640783054.65.0.760677969292.issue26552@roundup.psfhosted.org>


Change by Carlos Dam?zio <carlos.edamazio at gmail.com>:


----------
keywords: +patch
nosy: +dmzz
nosy_count: 4.0 -> 5.0
pull_requests: +28501
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30287

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26552>
_______________________________________

From report at bugs.python.org  Wed Dec 29 08:15:12 2021
From: report at bugs.python.org (Eryk Sun)
Date: Wed, 29 Dec 2021 13:15:12 +0000
Subject: [issue46193] Using a dictionary for open files.
In-Reply-To: <1640781299.57.0.336049681987.issue46193@roundup.psfhosted.org>
Message-ID: <1640783712.17.0.441442419265.issue46193@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

Every time open(r"test.txt", "w") is called, the existing "test.txt" file gets overwritten in the filesystem as an empty file. For each iteration, setdefault() returns a reference to the first file object, which advances its file pointer with each fh.write("\nHello\n") call. For the last write, the file pointer is at offset 693 (i.e. 7 * 99), and the OS first writes null bytes up to the file pointer. This is normal behavior, not a bug.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46193>
_______________________________________

From report at bugs.python.org  Wed Dec 29 08:18:03 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 29 Dec 2021 13:18:03 +0000
Subject: [issue38397] __init_subclass__ causes TypeError when used with more
 standard library metaclasses (such as EnumMeta)
In-Reply-To: <1570464400.89.0.0085195281122.issue38397@roundup.psfhosted.org>
Message-ID: <1640783883.7.0.250843604764.issue38397@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

I am closing this, as I believe it was fixed by the addition of **kwds to EnumMeta. Feel free to reopen this if you disagree, @retnikt.

----------
nosy: +AlexWaygood
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38397>
_______________________________________

From report at bugs.python.org  Wed Dec 29 08:40:59 2021
From: report at bugs.python.org (Kumar Aditya)
Date: Wed, 29 Dec 2021 13:40:59 +0000
Subject: [issue26552] Failing ensure_future still creates a Task
In-Reply-To: <1457869570.39.0.866858008064.issue26552@psf.upfronthosting.co.za>
Message-ID: <1640785259.03.0.0556037389007.issue26552@roundup.psfhosted.org>


Change by Kumar Aditya <rahuladitya303 at gmail.com>:


----------
nosy: +kumaraditya303
nosy_count: 5.0 -> 6.0
pull_requests: +28502
pull_request: https://github.com/python/cpython/pull/30288

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26552>
_______________________________________

From report at bugs.python.org  Wed Dec 29 08:52:41 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Wed, 29 Dec 2021 13:52:41 +0000
Subject: [issue46176] mmap module add MAP_STACK constant mostly for OpenBSD
Message-ID: <1640785961.66.0.760920806997.issue46176@roundup.psfhosted.org>


New submission from Dong-hee Na <donghee.na at python.org>:


New changeset 66c47b63a0df3143fe48d6efc1183eecda2a363d by David CARLIER in branch 'main':
bpo-46176: mmap module adding MAP_STACK constant. (GH-30252)
https://github.com/python/cpython/commit/66c47b63a0df3143fe48d6efc1183eecda2a363d


----------
nosy: +corona10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46176>
_______________________________________

From report at bugs.python.org  Wed Dec 29 08:52:53 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Wed, 29 Dec 2021 13:52:53 +0000
Subject: [issue46176] mmap module add MAP_STACK constant mostly for OpenBSD
In-Reply-To: <1640785961.66.0.760920806997.issue46176@roundup.psfhosted.org>
Message-ID: <1640785973.72.0.523365513648.issue46176@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
nosy:  -corona10
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46176>
_______________________________________

From report at bugs.python.org  Wed Dec 29 08:53:00 2021
From: report at bugs.python.org (Keepun)
Date: Wed, 29 Dec 2021 13:53:00 +0000
Subject: [issue46193] Using a dictionary for open files.
In-Reply-To: <1640781299.57.0.336049681987.issue46193@roundup.psfhosted.org>
Message-ID: <1640785980.84.0.488450750158.issue46193@roundup.psfhosted.org>


Keepun <keepun at gmail.com> added the comment:

I didn't think about calculating the argument before passing it to the function...

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46193>
_______________________________________

From report at bugs.python.org  Wed Dec 29 09:37:17 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 29 Dec 2021 14:37:17 +0000
Subject: [issue45711] Simplify the interpreter's (type, val,
 tb) exception representation
In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org>
Message-ID: <1640788637.47.0.989321179971.issue45711@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
pull_requests: +28503
pull_request: https://github.com/python/cpython/pull/30289

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________

From report at bugs.python.org  Wed Dec 29 09:56:23 2021
From: report at bugs.python.org (Andrew Svetlov)
Date: Wed, 29 Dec 2021 14:56:23 +0000
Subject: [issue46194] Wrong base class for transport returned by
 loop.create_datagram_endpoint()
Message-ID: <1640789783.73.0.00777071599466.issue46194@roundup.psfhosted.org>


New submission from Andrew Svetlov <andrew.svetlov at gmail.com>:

Selector-based event loops returns `_SelectorDatagramTransport` which inherits `asyncio.Transport` instead of `asyncio.DatagramTransport`.

isinstance(transp, asyncio.DatagramTransport) fails.
It doesn't affect the actual execution since `transp.sendto()` and `transp.error_received()` are correctly implemented.

The bug doesn't affect Windows proactor-based implementation.

The fix is relatively easy, a champion is welcome!

----------
components: asyncio
messages: 409309
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Wrong base class for transport returned by loop.create_datagram_endpoint()
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46194>
_______________________________________

From report at bugs.python.org  Wed Dec 29 10:25:10 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Wed, 29 Dec 2021 15:25:10 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1640791510.63.0.982569786874.issue46085@roundup.psfhosted.org>


Change by Dong-hee Na <donghee.na at python.org>:


----------
keywords: +patch
nosy: +corona10
nosy_count: 4.0 -> 5.0
pull_requests: +28504
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30290

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Wed Dec 29 12:27:30 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 29 Dec 2021 17:27:30 +0000
Subject: [issue46191] Conflict between using annotations in singledispatch()
 and MyPy
In-Reply-To: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>
Message-ID: <1640798850.28.0.334717101655.issue46191@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

That mypy error is only reported with a certain mypy setting (--strict, or probably one of the specific settings that that turns on).

We won't be supporting Sequence[Any] at runtime (because we only support actual types), but we should support Sequence, since that *is* an actual type (at least collections.abc.Sequence is).

So IMO this is either a problem in mypy (though in that case probably in typeshed) or a situation for which the user should just silence mypy (it's not perfect and never claimed to be).

But I think there's nothing for us to do in Python itself, so this bug should be closed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46191>
_______________________________________

From report at bugs.python.org  Wed Dec 29 12:31:01 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 29 Dec 2021 17:31:01 +0000
Subject: [issue34498] Python 3.7+ break on
 singledispatch_function.register(pseudo_type), which Python 3.6 accepted
In-Reply-To: <1535199569.5.0.56676864532.issue34498@psf.upfronthosting.co.za>
Message-ID: <1640799061.13.0.158341142631.issue34498@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Let's close this issue as "won't fix" then. The solution "use collections.abc.Sequence" makes sense.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34498>
_______________________________________

From report at bugs.python.org  Wed Dec 29 12:36:03 2021
From: report at bugs.python.org (=?utf-8?q?Carlos_Dam=C3=A1zio?=)
Date: Wed, 29 Dec 2021 17:36:03 +0000
Subject: [issue46194] Wrong base class for transport returned by
 loop.create_datagram_endpoint()
In-Reply-To: <1640789783.73.0.00777071599466.issue46194@roundup.psfhosted.org>
Message-ID: <1640799363.24.0.778654823131.issue46194@roundup.psfhosted.org>


Change by Carlos Dam?zio <carlos.edamazio at gmail.com>:


----------
keywords: +patch
nosy: +dmzz
nosy_count: 2.0 -> 3.0
pull_requests: +28505
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30291

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46194>
_______________________________________

From report at bugs.python.org  Wed Dec 29 12:43:23 2021
From: report at bugs.python.org (Tim Peters)
Date: Wed, 29 Dec 2021 17:43:23 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640799803.78.0.705609407056.issue46187@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

All cool. Since I doubt these new rounding modes will get much use anyway, it's not worth arguing about. If I were to do this for myself, the rounding argument would be one of the three values {-1, 0, +1}, which are already more than good enough as mnemonics for "go down, get close, go up". Passing strings of any kind is already pedantic overkill ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Wed Dec 29 13:06:31 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 29 Dec 2021 18:06:31 +0000
Subject: [issue46191] Conflict between using annotations in singledispatch()
 and MyPy
In-Reply-To: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>
Message-ID: <1640801191.16.0.347538439319.issue46191@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I do not think there is a problem in MyPy. What if use __origin__ for dispatching? Registering with parametrized generics with the same __origin__ will be error.

@sigledispatch
def f(a: int) -> None:
    pass

@f.register  # ok
def _(a: list[int]) -> None:
    pass

@f.register  # runtime error
def _(a: list[str]) -> None:
    pass

@f.register  # runtime error
def _(a: list) -> None:
    pass

f(1)  # ok
f([1])  # ok
f([])  # ok
f(['abc'])  # static type checking error

I think that it will have advantage of stronger static type checking.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46191>
_______________________________________

From report at bugs.python.org  Wed Dec 29 13:15:43 2021
From: report at bugs.python.org (Alex Waygood)
Date: Wed, 29 Dec 2021 18:15:43 +0000
Subject: [issue46191] Conflict between using annotations in singledispatch()
 and MyPy
In-Reply-To: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>
Message-ID: <1640801743.77.0.626009972873.issue46191@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

I like Serhiy's idea from a type-checking perspective. It would mean we could continue to have sophisticated type inference from mypy/pyright/etc. inside singledispatch function definitions. It would also mean people could use type annotations in singledispatch functions in much the same way as in the rest of their code, instead of having to remember that *this specific stdlib function* works differently. Lastly, it avoids having to have each type-checker separately special-case singledispatch so that they do not raise an error when an unparameterised generic is used as a type annotation. 

My concern, however, is that the runtime semantics are slightly unintuitive. Registering an implementation to the "type" `list[str]` (and having it succeed without an error being raised) might give the false implication that there will be runtime checking of whether all the elements in a list are strings.

I also think that GenericAlias objects should probably only be accepted in the form of `singledispatch.register()` that parses type annotations. There's no use case for allowing GenericAlias objects in the other forms of registering implementations.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46191>
_______________________________________

From report at bugs.python.org  Wed Dec 29 13:17:20 2021
From: report at bugs.python.org (Tim Peters)
Date: Wed, 29 Dec 2021 18:17:20 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640801840.59.0.571380493201.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

About:

    TableSize = 101
    limits = bytearray(TableSize)
    for n in range(0, TableSize):
        for k in range(0, n+1):
            if comb(n, k) != comb_small(n, k):

(and regardless of whether the last line is replaced with the later correction):

Did you try running that? Assuming "comb_small()" refers to the earlier Python function of that name you posted, it dies in the obvious way:

Traceback (most recent call last):
  File "C:\MyPy\temp3.py", line 29414, in <module>
    if comb(n, k) != comb_small(n, k) % Modulus:
  File "C:\MyPy\temp3.py", line 29404, in comb_small
    return (F[n] * Finv[k] * Finv[n-k] % Modulus) << (S[n] - S[k] - S[n-k])
IndexError: list index out of range

This occurs, as expected, when n first reaches 68 (because Cmax = 67 in the code posted for comb_small()).

So it's unclear what you intended to say. Certainly, the current mathmodule.c perm_comb_small() (where "small" appears to mean merely that the args fit in C "unsigned long long") makes no attempt to exploit the newer n <= 67 code Mark checked in.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 29 13:20:58 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Wed, 29 Dec 2021 18:20:58 +0000
Subject: [issue46120] Add note to `typing.Union` that it is recommended to use
 `|` instead
In-Reply-To: <1639815639.46.0.989122263928.issue46120@roundup.psfhosted.org>
Message-ID: <1640802058.25.0.046536756404.issue46120@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:

Haha, that backport took more time than I thought :D

Thanks! ? ? ?

----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46120>
_______________________________________

From report at bugs.python.org  Wed Dec 29 13:32:32 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Wed, 29 Dec 2021 18:32:32 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640802752.81.0.178340873386.issue37295@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I think Raymond means extending the tables to TableSize=101. It can benefit larger arguments if move the code in perm_comb_small(). And perhaps loops in perm_comb_small() could be optimized by using precalculated values for some products.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 29 13:36:41 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Wed, 29 Dec 2021 18:36:41 +0000
Subject: [issue41593] pathlib PermissionError problem
In-Reply-To: <1597876109.8.0.763662606664.issue41593@roundup.psfhosted.org>
Message-ID: <1640803001.26.0.742286337019.issue41593@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Cannot reproduce on 3.9 and 3.11; the quoted fragment of code is no longer in pathlib.

Closing as fixed as it seems that it was fixed in 3.9 or earlier.

Please comment if you think it should be reopened.

----------
nosy: +andrei.avk, kj
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41593>
_______________________________________

From report at bugs.python.org  Wed Dec 29 13:38:47 2021
From: report at bugs.python.org (Mehdi2277)
Date: Wed, 29 Dec 2021 18:38:47 +0000
Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction
Message-ID: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org>


New submission from Mehdi2277 <med2277 at gmail.com>:

This is two closely related issues with get_type_hints on an optional annotated member. I'm testing with Annotated/get_type_hints from typing extensions on 3.8 and assuming they're backport equivalent to current behavior.

The first issue is get_type_hints has inconsistent behavior depending on whether annotation comes from a function with a None default or an attribute with a None default.

class Foo:
    def __init__(
        self,
        x: 
            Annotated[Optional[str], "doc string"] = None,
    ):
        ...

class Foo2:
    x: Annotated[Optional[str], "doc string"] = None

get_type_hints(Foo.__init__) 
# {'x': typing.Union[typing_extensions.Annotated[typing.Union[str, NoneType], 'doc string'], NoneType]}

get_type_hints(Foo2)
# {'x': typing_extensions.Annotated[typing.Union[str, NoneType], 'doc string']}

Attributes with a None default are not wrapped by get_type_hints, but function parameters. Which of the two behaviors is correct I don't know, but I'd expect the two to be equivalent annotations.

The second issue is for function arguments with a None default the optional wrapper happens even if the type inside annotated already has optional. Example,

from typing_extensions import Annotated, get_type_hints

class Foo:
    def __init__(
        self,
        x: 
            Annotated[Optional[str], "doc string"] = None,
    ):
        ...

get_type_hints(Foo.__init__, include_extras=True)
# {'x': typing.Union[typing_extensions.Annotated[typing.Union[str, NoneType], 'doc string'], NoneType]}


For Annotated types I would expect any type rules like wrapping to apply only to the first argument and not the entire annotation. I mainly ran into this for a runtime type introspection library (similar in spirit to pydantic).

As a note include_extras being True or False while it changes type is an issue in either case. With include_extras as False the Annotated goes away, but the type still gets double wrapped as an Optional.

----------
messages: 409319
nosy: gvanrossum, kj, med2277
priority: normal
severity: normal
status: open
title: Annotated and Optional get_type_hints buggy interaction
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46195>
_______________________________________

From report at bugs.python.org  Wed Dec 29 13:41:09 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Wed, 29 Dec 2021 18:41:09 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640803269.11.0.239785639377.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> Did you try running that?

Yes.  The table size was extended beyond what we have now. See attached file.

----------
Added file: https://bugs.python.org/file50526/comb_with_side_limits.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 29 13:45:23 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Wed, 29 Dec 2021 18:45:23 +0000
Subject: [issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py
In-Reply-To: <1637421251.02.0.184439782821.issue45853@roundup.psfhosted.org>
Message-ID: <1640803523.75.0.337822217323.issue45853@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
pull_requests: +28506
pull_request: https://github.com/python/cpython/pull/30292

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45853>
_______________________________________

From report at bugs.python.org  Wed Dec 29 14:10:03 2021
From: report at bugs.python.org (Mehdi2277)
Date: Wed, 29 Dec 2021 19:10:03 +0000
Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction
In-Reply-To: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org>
Message-ID: <1640805003.61.0.386396558224.issue46195@roundup.psfhosted.org>


Change by Mehdi2277 <med2277 at gmail.com>:


----------
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46195>
_______________________________________

From report at bugs.python.org  Wed Dec 29 14:27:39 2021
From: report at bugs.python.org (Tim Peters)
Date: Wed, 29 Dec 2021 19:27:39 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640806059.89.0.147417002585.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

{Serhiy]
> It can benefit larger arguments if move the code in
> perm_comb_small().

Seems pretty clear that the newer code really belongs there instead.

> And perhaps loops in perm_comb_small() could be optimized 
> by using precalculated values for some products.

For all n <= 67, the newer code computes comb(n, k), for all k, in a small and fixed number of operations, all in platform C arithmetic. Two multiplies, a shift, and some fiddling to compute the shift count. No divisions. That's cheaper than almost every case handled by perm_comb_small()'s current

k < Py_ARRAY_LENGTH(fast_comb_limits)
           && n <= fast_comb_limits[k])

"iscomb" loop. That loop is constrained by that all intermediate results have to fit in a C unsigned long long, but the newer code only needs to know that the _final_ result fits (intermediate overflows are both expected and harmless - indeed, they're _necessary_ for the modular arithmetic to work as intended).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 29 14:34:55 2021
From: report at bugs.python.org (=?utf-8?q?Carlos_Dam=C3=A1zio?=)
Date: Wed, 29 Dec 2021 19:34:55 +0000
Subject: [issue22859] unittest.TestProgram.usageExit no longer invoked
In-Reply-To: <1415874322.06.0.308310544849.issue22859@psf.upfronthosting.co.za>
Message-ID: <1640806495.92.0.993590912008.issue22859@roundup.psfhosted.org>


Change by Carlos Dam?zio <carlos.edamazio at gmail.com>:


----------
keywords: +patch
nosy: +dmzz
nosy_count: 1.0 -> 2.0
pull_requests: +28507
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30293

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22859>
_______________________________________

From report at bugs.python.org  Wed Dec 29 14:39:57 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Wed, 29 Dec 2021 19:39:57 +0000
Subject: [issue46185] Python 3.10.1 installer refers to /Applications/Python
 3.9 Install Certificates
In-Reply-To: <1640606726.92.0.295758053578.issue46185@roundup.psfhosted.org>
Message-ID: <1640806797.89.0.569107570177.issue46185@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset bc87ac6d0b13116f525215f8a31b46506bc8d629 by Erlend Egeberg Aasland in branch 'main':
bpo-46185: Fix wrong version ref. in macOS installer ReadMe (GH-30278)
https://github.com/python/cpython/commit/bc87ac6d0b13116f525215f8a31b46506bc8d629


----------
nosy: +lukasz.langa

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46185>
_______________________________________

From report at bugs.python.org  Wed Dec 29 14:40:16 2021
From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=)
Date: Wed, 29 Dec 2021 19:40:16 +0000
Subject: [issue46185] Python 3.10.1 installer refers to /Applications/Python
 3.9 Install Certificates
In-Reply-To: <1640606726.92.0.295758053578.issue46185@roundup.psfhosted.org>
Message-ID: <1640806816.58.0.206071641184.issue46185@roundup.psfhosted.org>


?ukasz Langa <lukasz at langa.pl> added the comment:


New changeset c31fdef1e71ff1598f213b1b4ad1a565e47d7864 by Erlend Egeberg Aasland in branch '3.10':
[3.10] bpo-46185: Fix wrong version ref. in macOS installer ReadMe (GH-30280)
https://github.com/python/cpython/commit/c31fdef1e71ff1598f213b1b4ad1a565e47d7864


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46185>
_______________________________________

From report at bugs.python.org  Wed Dec 29 14:40:51 2021
From: report at bugs.python.org (Carlos Damazio)
Date: Wed, 29 Dec 2021 19:40:51 +0000
Subject: [issue22859] unittest.TestProgram.usageExit no longer invoked
In-Reply-To: <1415874322.06.0.308310544849.issue22859@psf.upfronthosting.co.za>
Message-ID: <1640806851.85.0.132851374792.issue22859@roundup.psfhosted.org>


Carlos Damazio <carlos.damazio at damazio.dev> added the comment:

Well, to this issue, I'm going to put a PR to remove it and give it a chance for it to being reinstated if you folks want to.

----------
nosy: +carlosdamazio -dmzz

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22859>
_______________________________________

From report at bugs.python.org  Wed Dec 29 14:54:58 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 29 Dec 2021 19:54:58 +0000
Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction
In-Reply-To: <1640805003.66.0.14878328921.issue46195@roundup.psfhosted.org>
Message-ID: <CAP7+vJLMYEJ3VTCH1ZWrFFQUBTea8DbVfMC-kxsseyK90JJYfw@mail.gmail.com>


Guido van Rossum <guido at python.org> added the comment:

Could you try with 3.10 and the stdlib typing.Annotated please? There might
be changes (in the past a default of None automatically caused an Optional
to be added, but we changed our minds.--
--Guido (mobile)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46195>
_______________________________________

From report at bugs.python.org  Wed Dec 29 15:28:11 2021
From: report at bugs.python.org (Yatin Kanetkar)
Date: Wed, 29 Dec 2021 20:28:11 +0000
Subject: [issue23952] cgi: Document the 'maxlen' member of the cgi module
In-Reply-To: <1429034285.17.0.254053228622.issue23952@psf.upfronthosting.co.za>
Message-ID: <1640809691.49.0.358083254798.issue23952@roundup.psfhosted.org>


Change by Yatin Kanetkar <yatin.kanetkar at gmail.com>:


----------
nosy: +yatink

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23952>
_______________________________________

From report at bugs.python.org  Wed Dec 29 15:44:28 2021
From: report at bugs.python.org (Carlos Damazio)
Date: Wed, 29 Dec 2021 20:44:28 +0000
Subject: [issue46194] Wrong base class for transport returned by
 loop.create_datagram_endpoint()
In-Reply-To: <1640789783.73.0.00777071599466.issue46194@roundup.psfhosted.org>
Message-ID: <1640810668.03.0.51270995664.issue46194@roundup.psfhosted.org>


Carlos Damazio <carlos.damazio at damazio.dev> added the comment:

I think I have a fix for this, I opened a PR. Let me know if you have any questions.

----------
nosy: +carlosdamazio

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46194>
_______________________________________

From report at bugs.python.org  Wed Dec 29 15:48:08 2021
From: report at bugs.python.org (Carlos Damazio)
Date: Wed, 29 Dec 2021 20:48:08 +0000
Subject: [issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not
 present in code
In-Reply-To: <1571436071.95.0.156296507321.issue38522@roundup.psfhosted.org>
Message-ID: <1640810888.9.0.395957252478.issue38522@roundup.psfhosted.org>


Carlos Damazio <carlos.damazio at damazio.dev> added the comment:

Opened a PR for this issue. It'll remove the mentions to the `Py_USING_MEMORY_DEBUGGER` since it'd been removed 5 years ago.

----------
nosy: +carlosdamazio

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38522>
_______________________________________

From report at bugs.python.org  Wed Dec 29 16:33:41 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Wed, 29 Dec 2021 21:33:41 +0000
Subject: [issue46120] Add note to `typing.Union` that it is recommended to use
 `|` instead
In-Reply-To: <1639815639.46.0.989122263928.issue46120@roundup.psfhosted.org>
Message-ID: <1640813621.57.0.0144131851266.issue46120@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Thank you for your time, ?ukasz!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46120>
_______________________________________

From report at bugs.python.org  Wed Dec 29 17:00:04 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Wed, 29 Dec 2021 22:00:04 +0000
Subject: [issue46185] Python 3.10.1 installer refers to /Applications/Python
 3.9 Install Certificates
In-Reply-To: <1640606726.92.0.295758053578.issue46185@roundup.psfhosted.org>
Message-ID: <1640815204.5.0.114034625566.issue46185@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

Thanks for the report, Jaap, and thanks ?ukasz for merging :)

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46185>
_______________________________________

From report at bugs.python.org  Wed Dec 29 17:21:21 2021
From: report at bugs.python.org (miss-islington)
Date: Wed, 29 Dec 2021 22:21:21 +0000
Subject: [issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not
 present in code
In-Reply-To: <1571436071.95.0.156296507321.issue38522@roundup.psfhosted.org>
Message-ID: <1640816481.56.0.795608056226.issue38522@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +28508
pull_request: https://github.com/python/cpython/pull/30295

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38522>
_______________________________________

From report at bugs.python.org  Wed Dec 29 17:21:44 2021
From: report at bugs.python.org (miss-islington)
Date: Wed, 29 Dec 2021 22:21:44 +0000
Subject: [issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not
 present in code
In-Reply-To: <1571436071.95.0.156296507321.issue38522@roundup.psfhosted.org>
Message-ID: <1640816504.85.0.816827111924.issue38522@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28509
pull_request: https://github.com/python/cpython/pull/30296

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38522>
_______________________________________

From report at bugs.python.org  Wed Dec 29 17:34:48 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 29 Dec 2021 22:34:48 +0000
Subject: [issue28141] shutil.copystat utime lookup fails on certain Android
 file systems
In-Reply-To: <1473833050.26.0.837055301848.issue28141@psf.upfronthosting.co.za>
Message-ID: <1640817288.27.0.36881207208.issue28141@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Please create a new issue if this is still a problem on a currentl version of python (>= 3.9).

----------
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28141>
_______________________________________

From report at bugs.python.org  Wed Dec 29 17:34:54 2021
From: report at bugs.python.org (Tim Peters)
Date: Wed, 29 Dec 2021 22:34:54 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640817294.7.0.891408467189.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

A practical caution about this in comb_with_side_limits.py:

    Pmax = 25           # 25         41
    Fmax = Pmax

It's true then that 25! == F[25] << S[25], but that's so in Python. The result has 84 bits, so 64-bit C arithmetic isn't enough.

That's apparently why mathmodule.c's static SmallFactorials[] table ends at 20 (the largest n such that n! fits in 64 bits).

(Well, actually, it ends at 12 on Windows, where sizeof(long) is 4, even on "modern" 64-bit boxes)

I would, of course, use uint64_t for these things - "long" and "long long" are nuisances, and not even attractive ones ;-) While support (both software and HW) for 64-bit ints progressed steadily in the 32-bit era, the same does not appear to be true of 128-bit ints in the 64-bit era. Looks to me like 64-bit ints will become as much a universal HW truth as, say, 2's-complement, and byte addresses, have become.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Wed Dec 29 17:35:52 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 29 Dec 2021 22:35:52 +0000
Subject: [issue17024] cElementTree calls end() on parser taget even if start()
 fails
In-Reply-To: <1359040208.76.0.707549580683.issue17024@psf.upfronthosting.co.za>
Message-ID: <1640817352.19.0.0641305369454.issue17024@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> works for me
stage: needs patch -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17024>
_______________________________________

From report at bugs.python.org  Wed Dec 29 17:35:57 2021
From: report at bugs.python.org (sharewell)
Date: Wed, 29 Dec 2021 22:35:57 +0000
Subject: [issue46196] documentation for cmd library should include columnize()
 function
Message-ID: <1640817357.67.0.539360584483.issue46196@roundup.psfhosted.org>


New submission from sharewell <jawed at sharewellnow.com>:

Cmd.columnize is an extremely useful function in Python, that can be used in many situations. It is part of the Cmd library. Unfortunately, the Cmd documentation does not mention it. It should. I only found out about it via https://stackoverflow.com/a/59627245

Please add to the documentation: https://docs.python.org/3/library/cmd.html

----------
assignee: docs at python
components: Documentation
messages: 409332
nosy: docs at python, sharewell
priority: normal
severity: normal
status: open
title: documentation for cmd library should include columnize() function
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46196>
_______________________________________

From report at bugs.python.org  Wed Dec 29 17:38:52 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 29 Dec 2021 22:38:52 +0000
Subject: [issue9350] add remove_argument_group to argparse
In-Reply-To: <1279893088.18.0.675631346333.issue9350@psf.upfronthosting.co.za>
Message-ID: <1640817532.43.0.0166229512597.issue9350@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
stage: needs patch -> resolved
status: pending -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9350>
_______________________________________

From report at bugs.python.org  Wed Dec 29 18:01:25 2021
From: report at bugs.python.org (Benjamin Peterson)
Date: Wed, 29 Dec 2021 23:01:25 +0000
Subject: [issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not
 present in code
In-Reply-To: <1571436071.95.0.156296507321.issue38522@roundup.psfhosted.org>
Message-ID: <1640818885.95.0.630834822494.issue38522@roundup.psfhosted.org>


Benjamin Peterson <benjamin at python.org> added the comment:


New changeset 9f0e40fae5191c3e3ed6109bd2e2f97aa0ac8d64 by Miss Islington (bot) in branch '3.10':
closes bpo-38522 docs: remove references to Py_USING_MEMORY_DEBUGGER (GH-30284) (GH-30295)
https://github.com/python/cpython/commit/9f0e40fae5191c3e3ed6109bd2e2f97aa0ac8d64


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38522>
_______________________________________

From report at bugs.python.org  Wed Dec 29 18:24:11 2021
From: report at bugs.python.org (kcdodd)
Date: Wed, 29 Dec 2021 23:24:11 +0000
Subject: [issue46197] ensurepip bootstrap breaks out of isolated environment
Message-ID: <1640820251.78.0.719610352005.issue46197@roundup.psfhosted.org>


New submission from kcdodd <carter.dodd at gmail.com>:

A change in behavior was made to the `ensurepip` module in Python 3.8.7 that causes bootstrapping to break out of an isolated environment. This is relevant to the assumption made in the `venv` module, which ran ensurepip as a sub-process with the `-I` flag environment isolation to force installation in the virtual environment directory.

In Python <= 3.8.6, ensurepip ran the bootstrap within the current interpreter, so the environment remained isolated. But in Python >= 3.8.7 it creates a second subprocess without the `-I` flag, and the un-isolated environment appears to be restored for pip. This would then allow a search of any additional paths, and prevent installation of pip and setuptools from being installed in the venv environment directory if they are found somewhere else.

----------
messages: 409334
nosy: kcdodd
priority: normal
severity: normal
status: open
title: ensurepip bootstrap breaks out of isolated environment
type: behavior
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46197>
_______________________________________

From report at bugs.python.org  Wed Dec 29 18:57:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Wed, 29 Dec 2021 23:57:55 +0000
Subject: [issue45108] frame.f_lasti points at DICT_MERGE instead of
 CALL_FUNCTION_EX in Windows only
In-Reply-To: <1630863308.34.0.524127924669.issue45108@roundup.psfhosted.org>
Message-ID: <1640822275.03.0.0885707932043.issue45108@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I've reproduced this on 3.10 but in 3.11 the result on windows is correct, f_lasti is of the CALL_FUNCTION_EX opcode.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45108>
_______________________________________

From report at bugs.python.org  Wed Dec 29 18:58:53 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Wed, 29 Dec 2021 23:58:53 +0000
Subject: [issue46191] Conflict between using annotations in singledispatch()
 and MyPy
In-Reply-To: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>
Message-ID: <1640822333.72.0.0968909819831.issue46191@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

If we allow registering list[int] but give it the same meaning as registering plain list (at runtime), that would violate user expectations pretty strongly -- for the same reason why we don't allow isinstance(x, list[int]).

If you want stronger checking inside the function you should probably do something like

@foo.register
def _(_a: list) -> ...:
    a: list[int] = _a
    ...

That said I don't care enough about singledispatch to argue strongly.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46191>
_______________________________________

From report at bugs.python.org  Wed Dec 29 19:05:54 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 30 Dec 2021 00:05:54 +0000
Subject: [issue12535] Chained tracebacks are confusing because the first
 traceback is minimal
In-Reply-To: <1310405583.64.0.419150537523.issue12535@psf.upfronthosting.co.za>
Message-ID: <1640822754.44.0.274879935584.issue12535@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

This was created about 10 years ago, I wonder if people still feel there is a need to change something here, or did we all get used to the status quo by now?

In particular, the suggestion is to indicate that the traceback of chained exceptions is truncated.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue12535>
_______________________________________

From report at bugs.python.org  Wed Dec 29 19:20:44 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 30 Dec 2021 00:20:44 +0000
Subject: [issue13672] Add co_qualname attribute in code objects
In-Reply-To: <1325100000.16.0.854542819355.issue13672@psf.upfronthosting.co.za>
Message-ID: <1640823644.77.0.627739928017.issue13672@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Propagate qualname from the compiler unit to code objects for finer grained profiling data

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13672>
_______________________________________

From report at bugs.python.org  Wed Dec 29 19:23:42 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 30 Dec 2021 00:23:42 +0000
Subject: [issue46198] Duplicated test name `test_get_unstructured_invalid_ew`
 in `test__header_value_parser.py`
Message-ID: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org>


New submission from Nikita Sobolev <mail at sobolevn.me>:

There are two tests with the same name in a same test class in `Lib/test/test_email/test__header_value_parser.py`: `test_get_unstructured_invalid_ew`

1. https://github.com/python/cpython/blob/8e11237c5d24e649b26cc928b52bc37f2fde9c7a/Lib/test/test_email/test__header_value_parser.py#L304
2. https://github.com/python/cpython/blob/8e11237c5d24e649b26cc928b52bc37f2fde9c7a/Lib/test/test_email/test__header_value_parser.py#L398

So, because of this bad naming - the first test is always shadowed by the second one and is silently skipped. With my patch: 1660 tests, without: 1659 tests.

PR to rename the second test is on its way.

----------
components: Tests
messages: 409338
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46198>
_______________________________________

From report at bugs.python.org  Wed Dec 29 19:23:49 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 30 Dec 2021 00:23:49 +0000
Subject: [issue46191] Conflict between using annotations in singledispatch()
 and MyPy
In-Reply-To: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>
Message-ID: <1640823829.08.0.727497924192.issue46191@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

Yeah, I think I agree with Guido. Mypy only has partial support for singledispatch anyway, and only achieves that through a plugin, so special-casing by type-checkers is inevitable.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46191>
_______________________________________

From report at bugs.python.org  Wed Dec 29 19:26:31 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 30 Dec 2021 00:26:31 +0000
Subject: [issue46198] Duplicated test name `test_get_unstructured_invalid_ew`
 in `test__header_value_parser.py`
In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org>
Message-ID: <1640823991.94.0.447327566906.issue46198@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
pull_requests: +28510
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30297

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46198>
_______________________________________

From report at bugs.python.org  Wed Dec 29 19:38:12 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 30 Dec 2021 00:38:12 +0000
Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction
In-Reply-To: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org>
Message-ID: <1640824692.62.0.382788886032.issue46195@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

I can verify that this happens on `3.10` and `main` branches:

```
from typing import Annotated, Optional, get_type_hints

class Foo:
    def __init__(self, x: Annotated[Optional[str], "d"] = None): ...

class Foo2:
    x: Annotated[Optional[str], "d"] = None

print(get_type_hints(Foo.__init__, include_extras=False))  # ok
# {'x': typing.Optional[str]}
print(get_type_hints(Foo2, include_extras=False))  # ok
# {'x': typing.Optional[str]}

print(get_type_hints(Foo.__init__, include_extras=True))  # not ok?
# {'x': typing.Optional[typing.Annotated[typing.Optional[str], 'd']]}
print(get_type_hints(Foo2, include_extras=True))  # ok
# {'x': typing.Annotated[typing.Optional[str], 'd']}
```

Notice that 3rd case does not look correct: `{'x': typing.Optional[typing.Annotated[typing.Optional[str], 'd']]}`

In my opinion it should be `{'x': typing.Annotated[typing.Optional[str], 'd']}`

I will look into it! :)

----------
nosy: +sobolevn

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46195>
_______________________________________

From report at bugs.python.org  Wed Dec 29 19:38:21 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 30 Dec 2021 00:38:21 +0000
Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction
In-Reply-To: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org>
Message-ID: <1640824701.45.0.21680181606.issue46195@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
versions: +Python 3.10, Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46195>
_______________________________________

From report at bugs.python.org  Wed Dec 29 19:39:09 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 30 Dec 2021 00:39:09 +0000
Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction
In-Reply-To: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org>
Message-ID: <1640824749.75.0.16222380822.issue46195@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

And on 3.9 as well.

----------
versions: +Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46195>
_______________________________________

From report at bugs.python.org  Wed Dec 29 20:13:58 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Thu, 30 Dec 2021 01:13:58 +0000
Subject: [issue41569] json.JSONEncoder.default should be called for dict keys
 as well
In-Reply-To: <1597686141.71.0.298355570835.issue41569@roundup.psfhosted.org>
Message-ID: <1640826838.53.0.901249855331.issue41569@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
nosy: +kj
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> json.dump() ignores its 'default' option when serializing dictionary keys

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41569>
_______________________________________

From report at bugs.python.org  Wed Dec 29 20:30:17 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Thu, 30 Dec 2021 01:30:17 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1615081108.59.0.182832926789.issue43424@roundup.psfhosted.org>
Message-ID: <1640827817.56.0.0153532564475.issue43424@roundup.psfhosted.org>


Dong-hee Na <donghee.na at python.org> added the comment:


New changeset d12bec69931503be78cd555cf7bc22ad6f4f2bd5 by Nikita Sobolev in branch 'main':
bpo-43424: Deprecate `webbrowser.MacOSXOSAScript._name` attribute (GH-30241)
https://github.com/python/cpython/commit/d12bec69931503be78cd555cf7bc22ad6f4f2bd5


----------
nosy: +corona10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Wed Dec 29 21:23:22 2021
From: report at bugs.python.org (wby78826)
Date: Thu, 30 Dec 2021 02:23:22 +0000
Subject: [issue46199] Calculation influenced by print
Message-ID: <1640831002.13.0.0752515074236.issue46199@roundup.psfhosted.org>


New submission from wby78826 <wby78826 at boofx.com>:

(Could be a numpy bug)
##Just run the script, then uncomment Line 14 and run again
The result of "supertrend" is different, depending on whether I print "LB" first or not.
If I don't print it first, the result is wrong.

It also does'nt matter if I print it to stdout or stderr, it only works this way.

(sry if I did something wrong)

----------
components: Windows
files: supertrend.py
messages: 409343
nosy: paul.moore, steve.dower, tim.golden, wby78826, zach.ware
priority: normal
severity: normal
status: open
title: Calculation influenced by print
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50527/supertrend.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46199>
_______________________________________

From report at bugs.python.org  Wed Dec 29 21:27:21 2021
From: report at bugs.python.org (Ilya Grigoriev)
Date: Thu, 30 Dec 2021 02:27:21 +0000
Subject: [issue43424] Document the `controller.name` field in `webbrowser`
 module
In-Reply-To: <1640827817.56.0.0153532564475.issue43424@roundup.psfhosted.org>
Message-ID: <CAAVOqmvOa-EiiEmRecsVUx7KiwNptwpu8AajRoXk1Jm8jNqd=g@mail.gmail.com>


Ilya Grigoriev <ilyagr at gmail.com> added the comment:

Thank you very much, Nikita! Your patch would certainly solve my issue.

As is, I checked the code I wrote, and it seems that only a lucky
ordering of if-statements caused it to work on Macs.

Ilya.

On Wed, Dec 29, 2021 at 5:30 PM Dong-hee Na <report at bugs.python.org> wrote:
>
>
> Dong-hee Na <donghee.na at python.org> added the comment:
>
>
> New changeset d12bec69931503be78cd555cf7bc22ad6f4f2bd5 by Nikita Sobolev in branch 'main':
> bpo-43424: Deprecate `webbrowser.MacOSXOSAScript._name` attribute (GH-30241)
> https://github.com/python/cpython/commit/d12bec69931503be78cd555cf7bc22ad6f4f2bd5
>
>
> ----------
> nosy: +corona10
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue43424>
> _______________________________________

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43424>
_______________________________________

From report at bugs.python.org  Wed Dec 29 22:35:56 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 30 Dec 2021 03:35:56 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1640835356.78.0.920816496582.issue46085@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +28511
pull_request: https://github.com/python/cpython/pull/30299

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Wed Dec 29 22:36:00 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 30 Dec 2021 03:36:00 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1640835360.53.0.340980562938.issue46085@roundup.psfhosted.org>


Change by miss-islington <mariatta.wijaya+miss-islington at gmail.com>:


----------
pull_requests: +28512
pull_request: https://github.com/python/cpython/pull/30300

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Wed Dec 29 22:36:05 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Thu, 30 Dec 2021 03:36:05 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1640835365.62.0.796788724138.issue46085@roundup.psfhosted.org>


Dong-hee Na <donghee.na at python.org> added the comment:


New changeset fb44d0589615590b1e7895ba78a038e96b15a219 by Dong-hee Na in branch 'main':
bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290)
https://github.com/python/cpython/commit/fb44d0589615590b1e7895ba78a038e96b15a219


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Wed Dec 29 22:46:55 2021
From: report at bugs.python.org (Tim Peters)
Date: Thu, 30 Dec 2021 03:46:55 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640836015.89.0.904355123256.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

[Tim]
> That's [Mark's code] cheaper than almost every case handled by
> perm_comb_small()'s current ... "iscomb" loop.

Although I should clarify they're aimed at different things, and don't overlap all that much. Mark's code, & even more so Raymond's extension, picks on small "n" and then looks for the largest "k" such that comb(n, k) can be done with supernatural speed.

But the existing perm_comb_small() picks on small "k" and then looks for the largest "n" such that "the traditional" one-at-a-time loop can complete without ever overflowing a C uint64 along the way.

The latter is doubtless more valuable for perm_comb_small(), since its recursive calls cut k roughly in half, and the first such call doesn't reduce n at all.

But where they do overlap (e.g., comb(50, 15)), Mark's approach is much faster, so that should be checked first.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 00:29:12 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 30 Dec 2021 05:29:12 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1640842152.4.0.667436200793.issue46085@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 1b37268ef10bd20c30d349b8401c88215c8a6be8 by Miss Islington (bot) in branch '3.10':
bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290)
https://github.com/python/cpython/commit/1b37268ef10bd20c30d349b8401c88215c8a6be8


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Thu Dec 30 00:29:23 2021
From: report at bugs.python.org (miss-islington)
Date: Thu, 30 Dec 2021 05:29:23 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1640842163.09.0.429760626765.issue46085@roundup.psfhosted.org>


miss-islington <mariatta.wijaya+miss-islington at gmail.com> added the comment:


New changeset 2d4049da1f61df5cb4314d7e10b54fa556880b0e by Miss Islington (bot) in branch '3.9':
bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290)
https://github.com/python/cpython/commit/2d4049da1f61df5cb4314d7e10b54fa556880b0e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Thu Dec 30 00:29:44 2021
From: report at bugs.python.org (Dong-hee Na)
Date: Thu, 30 Dec 2021 05:29:44 +0000
Subject: [issue46085] OrderedDict iterator allocates di_result unnecessarily
In-Reply-To: <1639586880.61.0.695571105446.issue46085@roundup.psfhosted.org>
Message-ID: <1640842184.37.0.252529497891.issue46085@roundup.psfhosted.org>


Dong-hee Na <donghee.na at python.org> added the comment:

Thanks for reporting Kevin!

----------
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46085>
_______________________________________

From report at bugs.python.org  Thu Dec 30 02:00:14 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Thu, 30 Dec 2021 07:00:14 +0000
Subject: [issue46199] Calculation influenced by print
In-Reply-To: <1640831002.13.0.0752515074236.issue46199@roundup.psfhosted.org>
Message-ID: <1640847614.11.0.871650738201.issue46199@roundup.psfhosted.org>


Eric V. Smith <eric at trueblade.com> added the comment:

This is likely not a bug in python. You might have better luck asking on a numpy support list.

That said, what results do you get, and what do you expect to get? We don't know what error you're seeing.

You might replace:
print("LB: ", LB)

with:
str(LB)

and see what happens. That's the only operation that's called on LB when you're printing.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46199>
_______________________________________

From report at bugs.python.org  Thu Dec 30 02:36:01 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 30 Dec 2021 07:36:01 +0000
Subject: [issue46191] Conflict between using annotations in singledispatch()
 and MyPy
In-Reply-To: <1640766492.06.0.603316818634.issue46191@roundup.psfhosted.org>
Message-ID: <1640849761.4.0.776499257048.issue46191@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Okay. As a workaround we can explicitly specify the dispatching type:

@f.register(list)
def _(a: list[int]) -> None:
    pass

----------
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46191>
_______________________________________

From report at bugs.python.org  Thu Dec 30 02:44:15 2021
From: report at bugs.python.org (Arie Bovenberg)
Date: Thu, 30 Dec 2021 07:44:15 +0000
Subject: [issue46200] Discourage logging f-strings due to security
 considerations
Message-ID: <1640850255.25.0.496981368409.issue46200@roundup.psfhosted.org>


New submission from Arie Bovenberg <a.c.bovenberg at gmail.com>:

(I've already submitted this issue to security at python.org, who directed me to propose a documentation change here)

Logging f-strings is quite popular, because the `%` style of logging is often considered ugly.
However, logging preformatted strings comes with security risks which should explicitly be mentioned in the logging documentation.

The following example illustrates the problem:

    logger.info('look: %s', untrusted_string)                # OK
    logger.info('look: %(foo)s', {'foo', untrusted_string})  # OK
    logger.info(f'look: {untrusted_string}')                 # OK (security-wise)
    logger.info(f'look: {untrusted_string}', some_dict)      # DANGER!

The problem is that `untrusted_string` will be interpreted as a string template by the logger. 
If `untrusted_string` has the value `%(foo)999999999s` (where foo is present in `some_dict`), 
logging gets stuck trying to add over a gigabyte of whitespace to a string. 
In other words: a Denial-of-Service attack.

Of course, this combination of f-string and logger arguments is unlikely. But it is plausible that:
- After a refactoring to f-string, removing the dict argument is forgotten;
- A developer adding a variable to a message prefers using f-strings and thus creates a template mixing the two styles (e.g. `{foo} and %(bar)s`);
- The string is passed through a logging Filter or other function which adds a dict argument.

Open questions:
1. Do we want to simply highlight the risks, or actively discourage logging f-strings?

   My thoughts:
   I feel it's important enough to actively discourage logging preformatted strings (i.e. also .format and manual %-formatting).
   A strong recommendation will allow security linters to flag this.
   Additionally, there are other advantages to the formatting built into `logging` (e.g. performance).

2. Should we type annotate logger `msg` as `Literal[str]` following PEP675?

   My thoughts:
   Annotating `msg` as a literal string will greatly help enforce this best practice.
   The adoption of typecheckers exceeds that of security linters.

3. Where should this risk be documented?
  a. In the `logger.debug` function docs
  b. In the `logging` docs introduction (like xml.etree.elementtree)
  c. In a new "security" section of the `logging` docs
  d. An informational PEP on logging security considerations (similar to PEP672)

  My thoughts:
  I fear option (a) would not get the attention of most readers.
  Option (c) or (d) may be useful to also highlight general risks 
  of logging (i.e. log injection)

As soon as there is agreement on these questions, I would be happy to submit a PR.

----------
assignee: docs at python
components: Documentation
messages: 409352
nosy: ariebovenberg, docs at python
priority: normal
severity: normal
status: open
title: Discourage logging f-strings due to security considerations
type: security
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46200>
_______________________________________

From report at bugs.python.org  Thu Dec 30 02:45:14 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 30 Dec 2021 07:45:14 +0000
Subject: [issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py
In-Reply-To: <1637421251.02.0.184439782821.issue45853@roundup.psfhosted.org>
Message-ID: <1640850314.53.0.535387915255.issue45853@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:


New changeset 8d7644fa64213207b8dc6f555cb8a02bfabeced2 by andrei kulakov in branch 'main':
bpo-45853: Fix misspelling and unused import in pathlib (GH-30292)
https://github.com/python/cpython/commit/8d7644fa64213207b8dc6f555cb8a02bfabeced2


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45853>
_______________________________________

From report at bugs.python.org  Thu Dec 30 02:46:26 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 30 Dec 2021 07:46:26 +0000
Subject: [issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py
In-Reply-To: <1637421251.02.0.184439782821.issue45853@roundup.psfhosted.org>
Message-ID: <1640850386.55.0.709358264932.issue45853@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45853>
_______________________________________

From report at bugs.python.org  Thu Dec 30 02:57:07 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 30 Dec 2021 07:57:07 +0000
Subject: [issue46200] Discourage logging f-strings due to security
 considerations
In-Reply-To: <1640850255.25.0.496981368409.issue46200@roundup.psfhosted.org>
Message-ID: <1640851027.38.0.632510984216.issue46200@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
nosy: +vinay.sajip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46200>
_______________________________________

From report at bugs.python.org  Thu Dec 30 03:13:16 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 30 Dec 2021 08:13:16 +0000
Subject: [issue34498] Python 3.7+ break on
 singledispatch_function.register(pseudo_type), which Python 3.6 accepted
In-Reply-To: <1535199569.5.0.56676864532.issue34498@psf.upfronthosting.co.za>
Message-ID: <1640851996.5.0.917795254404.issue34498@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34498>
_______________________________________

From report at bugs.python.org  Thu Dec 30 03:14:48 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 30 Dec 2021 08:14:48 +0000
Subject: [issue46189] Text containing "wide" character not correctly refreshed
In-Reply-To: <1640703674.26.0.944384925323.issue46189@roundup.psfhosted.org>
Message-ID: <1640852088.46.0.951182156824.issue46189@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46189>
_______________________________________

From report at bugs.python.org  Thu Dec 30 03:25:05 2021
From: report at bugs.python.org (Eric V. Smith)
Date: Thu, 30 Dec 2021 08:25:05 +0000
Subject: [issue46200] Discourage logging f-strings due to security
 considerations
In-Reply-To: <1640850255.25.0.496981368409.issue46200@roundup.psfhosted.org>
Message-ID: <1640852705.07.0.371090560697.issue46200@roundup.psfhosted.org>


Change by Eric V. Smith <eric at trueblade.com>:


----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46200>
_______________________________________

From report at bugs.python.org  Thu Dec 30 04:30:15 2021
From: report at bugs.python.org (Carl Drougge)
Date: Thu, 30 Dec 2021 09:30:15 +0000
Subject: [issue46201] PEP 495 misnames PyDateTime_DATE_GET_FOLD
Message-ID: <1640856615.86.0.436530713038.issue46201@roundup.psfhosted.org>


New submission from Carl Drougge <bugs.python.org at s.z42.net>:

PEP 495 names one of the accessor macros PyDateTime_GET_FOLD but the code names it PyDateTime_DATE_GET_FOLD.

The FOLD macros are also missing from https://docs.python.org/3/c-api/datetime.html (and versions).

----------
assignee: docs at python
components: Documentation
messages: 409354
nosy: docs at python, drougge
priority: normal
severity: normal
status: open
title: PEP 495 misnames PyDateTime_DATE_GET_FOLD
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46201>
_______________________________________

From report at bugs.python.org  Thu Dec 30 04:43:14 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Thu, 30 Dec 2021 09:43:14 +0000
Subject: [issue46199] Calculation influenced by print
In-Reply-To: <1640831002.13.0.0752515074236.issue46199@roundup.psfhosted.org>
Message-ID: <1640857394.72.0.92077918706.issue46199@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

Please try to provide a minimal reproducible example:

https://stackoverflow.com/help/minimal-reproducible-example

http://sscce.org/

At the very least, you need to provide three pieces of information:

1. What you tried.
2. What you expected to happen (and why, if it isn't obvious).
3. What actually happened instead.


Ideally you should be able to get your example down to using one or two values, not three lists with 30 values each (90 values).

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46199>
_______________________________________

From report at bugs.python.org  Thu Dec 30 05:16:16 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 30 Dec 2021 10:16:16 +0000
Subject: [issue46202] remove opcode POP_EXCEPT_AND_RERAISE
Message-ID: <1640859376.18.0.58534498395.issue46202@roundup.psfhosted.org>


New submission from Irit Katriel <iritkatriel at gmail.com>:

Following issue45711 this opcode can be replaced by 

ADDOP(c, ROT_THREE);
ADDOP(c, ROT_THREE);
ADDOP(c, POP_EXCEPT);
ADDOP_I(c, RERAISE, 1);

----------
assignee: iritkatriel
components: Interpreter Core
messages: 409356
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: remove opcode POP_EXCEPT_AND_RERAISE
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46202>
_______________________________________

From report at bugs.python.org  Thu Dec 30 05:38:57 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 30 Dec 2021 10:38:57 +0000
Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction
In-Reply-To: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org>
Message-ID: <1640860737.17.0.142442499658.issue46195@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

As Guido said, the root cause of this problem is because `None` default automatically adds `Optional` to the resulting type.

Source: https://github.com/python/cpython/blob/8d7644fa64213207b8dc6f555cb8a02bfabeced2/Lib/typing.py#L1854-L1856

So, what happens there:
- correct `value` is passed to `_eval_type`, correct result `typing.Annotated[typing.Optional[str], 'd']` is returned at this point
- then `if name in defaults and defaults[name] is None:` adds extra `Optional` annotation on top of `Annotated`

> in the past a default of None automatically caused an Optional
to be added, but we changed our minds

Guido, are you talking about https://github.com/python/typing/issues/275 ?

Now all type-checkers (AFAIK) support something similar to `--no-implicit-optional` mode.

Having this in mind, I see different solutions to the current problem:
1. Remove `Optional` inference with `None` default. This is going to be a some-what breaking change. The only positive side of this is that we can really simplify our code (mainly because the other solution is to complicate our code even more).
2. Or we can change this place to explicitly check for `Annotated` type and its internal type. This should be the easiest to write and backport. But, it still has some complexity to it. I think that this is a better solution: we don't break existing behavior, change is local and pretty trivial.

Also caused by this:
- https://bugs.python.org/issue42921
- https://bugs.python.org/issue42288

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46195>
_______________________________________

From report at bugs.python.org  Thu Dec 30 05:44:14 2021
From: report at bugs.python.org (wrobell)
Date: Thu, 30 Dec 2021 10:44:14 +0000
Subject: [issue34498] Python 3.7+ break on
 singledispatch_function.register(pseudo_type), which Python 3.6 accepted
In-Reply-To: <1535199569.5.0.56676864532.issue34498@psf.upfronthosting.co.za>
Message-ID: <1640861054.69.0.691466974779.issue34498@roundup.psfhosted.org>


wrobell <wrobell at riseup.net> added the comment:

To add bit more context, there is a discussion about Python types and
annotation types, where suggestion of closing this bug has been raised

    https://github.com/python/mypy/issues/9773

The discussion is about the need of distinction between Python types and
annotation types, and explicit terminology in the documentation.

Closing this bug gives clearer indication to tools like Mypy, how to deal
with annotation types used with singledispatch.

IMHO, it is small step towards more explict Python type system, whatever
its limitations.

----------
nosy: +wrobell

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34498>
_______________________________________

From report at bugs.python.org  Thu Dec 30 06:06:59 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 11:06:59 +0000
Subject: [issue46203] Add timeout for Windows build steps
Message-ID: <1640862419.94.0.348307028163.issue46203@roundup.psfhosted.org>


New submission from Mark Dickinson <dickinsm at gmail.com>:

Recently there was an upstream issue with GitHub Actions that caused the Windows build steps in build.yml to hang. No output for the step was displayed in the build logs until the entire job was eventually cancelled, after the default step timeout of 6 hours.

I don't know how to fix the "no output" problem, but we can mitigate the 6 hour wait by adding a timeout for the build step. Some external discussion suggested that a conservative timeout of 30 minutes would be appropriate; looking at recent PRs, the build usually completes in around 5 minutes.

The (soon-to-be-)attached PR adds that timeout.

Here's the log from one of the failed jobs: https://github.com/python/cpython/runs/4641823914?check_suite_focus=true  (note that this link will probably eventually become invalid).

Here's the relevant GitHub incident: https://www.githubstatus.com/incidents/gh0vvxtlj5v7

----------
messages: 409359
nosy: christian.heimes, mark.dickinson, steve.dower
priority: normal
severity: normal
status: open
title: Add timeout for Windows build steps
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46203>
_______________________________________

From report at bugs.python.org  Thu Dec 30 06:07:48 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 11:07:48 +0000
Subject: [issue46203] Add timeout for Windows build steps
In-Reply-To: <1640862419.94.0.348307028163.issue46203@roundup.psfhosted.org>
Message-ID: <1640862468.68.0.281475441065.issue46203@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
keywords: +patch
pull_requests: +28513
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30301

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46203>
_______________________________________

From report at bugs.python.org  Thu Dec 30 06:24:05 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 11:24:05 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640863445.78.0.928280710492.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> So which of xor-popcount and add-up-up-trailing-zero-counts is faster may well depend on platform.

I ran some timings for comb(k, 67) on my macOS / Intel MacBook Pro, using timeit to time calls to a function that looked like this:

def f(comb):
    for k in range(68):
        for _ in range(256):
            comb(k, 67)
            comb(k, 67)
            ... # 64 repetitions of comb(k, 67) in all

Based on 200 timings of this script with each of the popcount approach and the uint8_t-table-of-trailing-zero-counts approach (interleaved), the popcount approach won, but just barely, at around 1.3% faster. The result was statistically significant (SciPy gave me a result of Ttest_indResult(statistic=19.929941828072433, pvalue=8.570975609117687e-62)).

Interestingly, the default build on macOS/Intel is _not_ using the dedicated POPCNT instruction that arrived with the Nehalem architecture, presumably because it wants to produce builds that will still be useable on pre-Nehalem machines. It uses Clang's __builtin_popcount, but that gets translated to the same SIMD-within-a-register approach that we have already in pycore_bitutils.h.

If I recompile with -msse4.2, then the POPCNT instruction *is* used, and I get an even more marginal improvement: a 1.7% speedup over the lookup-table-based version.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 06:31:21 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 11:31:21 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640863881.06.0.170165811697.issue46187@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> did you invent this?

The idea is no more than: "compute an extra bit, then use that extra bit to determine which way to round". More generally, for any real number x, the nearest integer to x (rounding ties towards +infinity) is `?(?2x? + 1) / 2?`. Now put x = ?n, then ?2x? is ??(4n)?, and the rest follows.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Thu Dec 30 06:32:49 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 11:32:49 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640863969.04.0.161231510436.issue46187@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> I'd be happy to see recipes added to the docs for rounded and ceiling flavors of isqrt, but am dubious about the value of building them in.

I'd similarly prefer to see recipes in the docs. We already have such a recipe for ceil(?n).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Thu Dec 30 06:53:58 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 30 Dec 2021 11:53:58 +0000
Subject: [issue46202] remove opcode POP_EXCEPT_AND_RERAISE
In-Reply-To: <1640859376.18.0.58534498395.issue46202@roundup.psfhosted.org>
Message-ID: <1640865238.54.0.665710481901.issue46202@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +patch
pull_requests: +28514
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30302

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46202>
_______________________________________

From report at bugs.python.org  Thu Dec 30 07:10:51 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 30 Dec 2021 12:10:51 +0000
Subject: [issue45033] Calls to PyErr_PrintEx in destructors cause calling
 async functions to incorrectly return None
In-Reply-To: <1630108585.95.0.412897766167.issue45033@roundup.psfhosted.org>
Message-ID: <1640866251.95.0.338243696157.issue45033@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

Zac, the documentation for PyErr_Print [1] states that it clears the error indicator. This is akin to handling the exception. Was this your intention?

If you want to print the exception without clearing it, I think you would probably need to call PyErr_Fetch, then PyErr_Display, then PyErr_Restore.

[1] https://docs.python.org/3/c-api/exceptions.html#c.PyErr_PrintEx

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45033>
_______________________________________

From report at bugs.python.org  Thu Dec 30 07:37:13 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 30 Dec 2021 12:37:13 +0000
Subject: [issue1598083] Top-level exception handler writes to stdout unsafely
Message-ID: <1640867833.59.0.890817730039.issue1598083@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

I think this can be closed as out of date because PyFile_WriteString/Object no longer use puts and they do check for errors. The error checking of PyFile_WriteString/Object in the traceback display code was the subject of Issue45635.

----------
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1598083>
_______________________________________

From report at bugs.python.org  Thu Dec 30 07:45:11 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 12:45:11 +0000
Subject: [issue45569] Drop support for 15-bit PyLong digits?
In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org>
Message-ID: <1640868311.72.0.431103619711.issue45569@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

I posted a request for information on usage of 15-bit digits to python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/ZICIMX5VFCX4IOFH5NUPVHCUJCQ4Q7QM/

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45569>
_______________________________________

From report at bugs.python.org  Thu Dec 30 07:55:43 2021
From: report at bugs.python.org (wrobell)
Date: Thu, 30 Dec 2021 12:55:43 +0000
Subject: [issue46014] functools.singledispatch does not support Union types
In-Reply-To: <1638970452.65.0.012237534186.issue46014@roundup.psfhosted.org>
Message-ID: <1640868943.93.0.941131859284.issue46014@roundup.psfhosted.org>


wrobell <wrobell at riseup.net> added the comment:

Will it support Optional as well?

According to PEP-604, these two shall be equivalent (using Python 3.10 below)?
```
type(int | None)
types.UnionType

type(tp.Optional[int])
typing._UnionGenericAlias
```

Also, IMHO, the documentation of singledispatch should be improved. It needs to state that only Python types are supported with few exceptions (union type now), but other annotation types are not supported, i.e. generics like `list[int]`.

----------
nosy: +wrobell

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46014>
_______________________________________

From report at bugs.python.org  Thu Dec 30 08:06:30 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Thu, 30 Dec 2021 13:06:30 +0000
Subject: [issue46192] Optimize builtin functions min() and max()
In-Reply-To: <1640772295.19.0.507214715597.issue46192@roundup.psfhosted.org>
Message-ID: <1640869590.5.0.689267584501.issue46192@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

Repeating my comment on GH-30286: If we are touching `min()` and `max()`, it would make sense, IMO, to port them to Argument Clinic. FTR, Argument Clinic got `*args` support in GH-18609 / bpo-20291.

@colorfulappl made a "competing" branch using AC on his local fork[^1]. However, that branch contained a bug with the key function; I made an amended version[^2] for benchmarking. Here's some micro-benchmarks from optimised builds on macOS 12.1 w/Clang 13:

```
+---------------------------------------------------------+---------+-----------------------+----------------------+
| Benchmark                                               | main    | GH-30286              | GH-30286-ac          |
+=========================================================+=========+=======================+======================+
| max(a, b)                                               | 193 ns  | 74.1 ns: 2.60x faster | 179 ns: 1.08x faster |
+---------------------------------------------------------+---------+-----------------------+----------------------+
| max(a, b, c, d, e)                                      | 273 ns  | 126 ns: 2.17x faster  | 260 ns: 1.05x faster |
+---------------------------------------------------------+---------+-----------------------+----------------------+
| max([a, b])                                             | 267 ns  | 185 ns: 1.44x faster  | 239 ns: 1.12x faster |
+---------------------------------------------------------+---------+-----------------------+----------------------+
| max([a, b, c, d, e])                                    | 345 ns  | 259 ns: 1.33x faster  | 312 ns: 1.10x faster |
+---------------------------------------------------------+---------+-----------------------+----------------------+
| max((a,), (b,), key=lambda x: x[0])                     | 707 ns  | 444 ns: 1.59x faster  | 513 ns: 1.38x faster |
+---------------------------------------------------------+---------+-----------------------+----------------------+
| max((a,), (b,), (c,), (d,), (e,), key=lambda x: x[0])   | 1.12 us | 831 ns: 1.35x faster  | 930 ns: 1.20x faster |
+---------------------------------------------------------+---------+-----------------------+----------------------+
| max([(a,), (b,)], key=lambda x: x[0])                   | 786 ns  | 561 ns: 1.40x faster  | 570 ns: 1.38x faster |
+---------------------------------------------------------+---------+-----------------------+----------------------+
| max([(a,), (b,), (c,), (d,), (e,)], key=lambda x: x[0]) | 1.19 us | 981 ns: 1.22x faster  | 981 ns: 1.22x faster |
+---------------------------------------------------------+---------+-----------------------+----------------------+
| max([], default=-1)                                     | 484 ns  | 177 ns: 2.73x faster  | 188 ns: 2.57x faster |
+---------------------------------------------------------+---------+-----------------------+----------------------+
| Geometric mean                                          | (ref)   | 1.68x faster          | 1.29x faster         |
+---------------------------------------------------------+---------+-----------------------+----------------------+
```



[^1]: https://github.com/colorfulappl/cpython/commit/29b9559de31ae19e8d127d7a3063494b2d9791b0
[^2]: https://github.com/erlend-aasland/cpython/tree/gh-30286-ac

----------
nosy: +erlendaasland
Added file: https://bugs.python.org/file50528/bench-minmax.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46192>
_______________________________________

From report at bugs.python.org  Thu Dec 30 08:20:40 2021
From: report at bugs.python.org (Irit Katriel)
Date: Thu, 30 Dec 2021 13:20:40 +0000
Subject: [issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict
 subclasses
In-Reply-To: <1541398981.44.0.788709270274.issue35166@psf.upfronthosting.co.za>
Message-ID: <1640870440.94.0.67443651476.issue35166@roundup.psfhosted.org>


Irit Katriel <iritkatriel at gmail.com> added the comment:

BUILD_MAP_UNPACK and BUILD_MAP_UNPACK_WITH_CALL have been removed.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35166>
_______________________________________

From report at bugs.python.org  Thu Dec 30 08:40:20 2021
From: report at bugs.python.org (David Mc Dougall)
Date: Thu, 30 Dec 2021 13:40:20 +0000
Subject: [issue46071] Graphlib documentation (edge direction)
In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org>
Message-ID: <1640871620.98.0.503016392222.issue46071@roundup.psfhosted.org>


Change by David Mc Dougall <dam1784 at g.rit.edu>:


----------
title: Graphlib documentation -> Graphlib documentation (edge direction)

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46071>
_______________________________________

From report at bugs.python.org  Thu Dec 30 08:42:12 2021
From: report at bugs.python.org (Alex Waygood)
Date: Thu, 30 Dec 2021 13:42:12 +0000
Subject: [issue46014] functools.singledispatch does not support Union types
In-Reply-To: <1638970452.65.0.012237534186.issue46014@roundup.psfhosted.org>
Message-ID: <1640871732.05.0.682238650609.issue46014@roundup.psfhosted.org>


Alex Waygood <Alex.Waygood at Gmail.com> added the comment:

```
>>> from typing import Optional, get_origin
>>> get_origin(Optional[int])
typing.Union
```

^Because of that, it will work with typing.Optional as well as typing.Union and types.UnionType, yes.

I am planning on submitting a docs PR at some point in the next few days (probably linked to a new BPO issue).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46014>
_______________________________________

From report at bugs.python.org  Thu Dec 30 08:42:32 2021
From: report at bugs.python.org (David Mc Dougall)
Date: Thu, 30 Dec 2021 13:42:32 +0000
Subject: [issue46204] Graphlib documentation (general cleanup)
Message-ID: <1640871752.23.0.818403233457.issue46204@roundup.psfhosted.org>


New submission from David Mc Dougall <dam1784 at g.rit.edu>:

The graphlib documentation has some grammar & phrasing issues.

----------
components: Library (Lib)
messages: 409370
nosy: dam1784
priority: normal
severity: normal
status: open
title: Graphlib documentation (general cleanup)
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46204>
_______________________________________

From report at bugs.python.org  Thu Dec 30 08:44:49 2021
From: report at bugs.python.org (David Mc Dougall)
Date: Thu, 30 Dec 2021 13:44:49 +0000
Subject: [issue46204] Graphlib documentation (general cleanup)
In-Reply-To: <1640871752.23.0.818403233457.issue46204@roundup.psfhosted.org>
Message-ID: <1640871889.35.0.224896530408.issue46204@roundup.psfhosted.org>


Change by David Mc Dougall <dam1784 at g.rit.edu>:


----------
keywords: +patch
pull_requests: +28515
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30269

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46204>
_______________________________________

From report at bugs.python.org  Thu Dec 30 11:13:43 2021
From: report at bugs.python.org (Zac Bentley)
Date: Thu, 30 Dec 2021 16:13:43 +0000
Subject: [issue45033] Calls to PyErr_PrintEx in destructors cause calling
 async functions to incorrectly return None
In-Reply-To: <1630108585.95.0.412897766167.issue45033@roundup.psfhosted.org>
Message-ID: <1640880823.42.0.403020951719.issue45033@roundup.psfhosted.org>


Zac Bentley <zbbentley at gmail.com> added the comment:

Irit, the documentation is clear.

However, the problem is that the presence of StopIteration in the exception global during async return time causes very unexpected behavior.

If, during async return time (in the linked issue, I do this in a boost-python object destructor), I write code like this:

        try {
            boost::python::call(somefunction);
        } catch (boost::python::error_already_set e) {
            PyErr_Print();
        }

then two things go wrong:
1. The "catch" block runs even if "somefunction" did not raise, because StopIteration is already in the exception handler.
2. When PyErr_Print clears StopIteration, the currently-returning async function returns None, regardless of what it was supposed to return. I consider this to be interpreter-induced data corruption.

I'm not sure what happens if user code raises an additional exception.

Do you think this is a Python bug, or a Boost bug? I'm not familiar enough with interpreter internals to know whether or not there are other ways besides boost-python destructors to get code to run "during async return". If there are, I would definitely consider this a Python bug: PyErr_Print should not be able to corrupt interpreter/return state.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45033>
_______________________________________

From report at bugs.python.org  Thu Dec 30 11:13:49 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 30 Dec 2021 16:13:49 +0000
Subject: [issue46196] documentation for cmd library should include columnize()
 function
In-Reply-To: <1640817357.67.0.539360584483.issue46196@roundup.psfhosted.org>
Message-ID: <1640880829.61.0.468297810006.issue46196@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
nosy: +sobolevn
nosy_count: 2.0 -> 3.0
pull_requests: +28516
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30303

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46196>
_______________________________________

From report at bugs.python.org  Thu Dec 30 11:31:07 2021
From: report at bugs.python.org (Zac Bentley)
Date: Thu, 30 Dec 2021 16:31:07 +0000
Subject: [issue45033] Calls to PyErr_PrintEx in destructors cause calling
 async functions to incorrectly return None
In-Reply-To: <1630108585.95.0.412897766167.issue45033@roundup.psfhosted.org>
Message-ID: <1640881867.15.0.438974078723.issue45033@roundup.psfhosted.org>


Zac Bentley <zbbentley at gmail.com> added the comment:

For context (copied from the linked GitHub issue), this has affected at least two OSS projects:

https://github.com/apache/pulsar/issues/11823
https://github.com/tbodt/v8py/issues/45

The proposed alternative ("PyErr_Fetch, then PyErr_Display, then PyErr_Restore") does not work well: if code runs in a boost-python destructor which runs during async return time, how would it tell the difference between a "real" exception raised from within whatever function is currently returning and the "fake" StopIteration exception that is in the error global while an async function returns? Aka, this code would not have any way to function properly:

    async def func():
        thing = MyNativeCodeObject()
        raise ValueError()

The destructor for MyNativeCodeObject would have to perform a complex check, and PyErr_Restore/do nothing IFF the following are all true:
- Is there an exception currently being handled/in the global?
- Is that exception a StopIteration?
- Is the interpreter currently in the process of returning from an async function (I'm not sure how to check this)?


The fact that non-StopIteration exceptions are handled correctly (e.g. the ValueError in the above example makes it out of the async call during "await func()") means, I think, that there's already some secondary exception storage mechanism that's used to stash and restore user exceptions while the async machinery raises StopIteration to return from an async function. Could that same mechanism be used to "hide" the StopIteration from user code that runs during async-return time?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45033>
_______________________________________

From report at bugs.python.org  Thu Dec 30 11:51:29 2021
From: report at bugs.python.org (Tim Peters)
Date: Thu, 30 Dec 2021 16:51:29 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640883089.36.0.741603405852.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

[Mark]
> I ran some timings for comb(k, 67) on my macOS / Intel MacBook Pro,
> using timeit to time calls to a function that looked like this:
>
> def f(comb):
>     for k in range(68):
>         for _ in range(256):
>             comb(k, 67)
>             comb(k, 67)
>            ... # 64 repetitions of comb(k, 67) in all

I'm assuming you meant to write comb(67, k) instead, since the comb(k, 67) given is 0 at all tested k values except for k=67, and almost never executes any of the code in question.

It's surprising to me that even the long-winded popcount code was faster! The other way needs to read up 3 1-byte values from a trailing zero table, but the long-winded popcount emulation needs to read up 4 4-byte mask constants (or are they embedded in the instruction stream?), in addition to doing many more bit-fiddling operations (4 shifts, 4 "&" masks, 3 add/subtract, and a multiply - compared to just 2 add/subtract).

So if the results are right, Intel timings make no sense to me at all ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 12:12:53 2021
From: report at bugs.python.org (Sam Gross)
Date: Thu, 30 Dec 2021 17:12:53 +0000
Subject: [issue46205] Race condition in runtest_mp leads to hangs (never exits)
Message-ID: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org>


New submission from Sam Gross <colesbury at gmail.com>:

The runtest_mp.py has a race condition between checking for worker.is_alive() and processing the queue that can lead to indefinite hangs.

The hang happens when the all the results from the self.output queue are processed but at least one of the workers hasn't finished exiting.

https://github.com/python/cpython/blob/8d7644fa64213207b8dc6f555cb8a02bfabeced2/Lib/test/libregrtest/runtest_mp.py#L394-L418

The main thread tries to get a result from the output queue, but the queue is empty and remains empty. Although the queue.get() operation eventually times out (after 30 seconds), the main thread does not re-check if all the workers have exited (!), but instead retries the queue.get() in the "while True" loop.

https://github.com/python/cpython/blob/8d7644fa64213207b8dc6f555cb8a02bfabeced2/Lib/test/libregrtest/runtest_mp.py#L415-L418

To reproduce, apply the below patch which introduces a small delay to more reliably trigger the hang.

curl "https://gist.githubusercontent.com/colesbury/fe3769f43dfb724c86ecbb182b1f6749/raw/e29a4eaeebb8d5252cdd66f3f8a70f7bc5fa14e7/runtest_mp.diff" | patch -p1
./python -m test test_regrtest -m test_module_from_test_autotest -v

----------
messages: 409374
nosy: colesbury
priority: normal
severity: normal
status: open
title: Race condition in runtest_mp leads to hangs (never exits)
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46205>
_______________________________________

From report at bugs.python.org  Thu Dec 30 12:13:13 2021
From: report at bugs.python.org (Sam Gross)
Date: Thu, 30 Dec 2021 17:13:13 +0000
Subject: [issue46205] Race condition in runtest_mp leads to hangs (never exits)
In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org>
Message-ID: <1640884393.07.0.50280176732.issue46205@roundup.psfhosted.org>


Change by Sam Gross <colesbury at gmail.com>:


----------
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46205>
_______________________________________

From report at bugs.python.org  Thu Dec 30 12:17:54 2021
From: report at bugs.python.org (Sam Gross)
Date: Thu, 30 Dec 2021 17:17:54 +0000
Subject: [issue46205] Race condition in runtest_mp leads to hangs (never exits)
In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org>
Message-ID: <1640884674.57.0.257438553968.issue46205@roundup.psfhosted.org>


Change by Sam Gross <colesbury at gmail.com>:


----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46205>
_______________________________________

From report at bugs.python.org  Thu Dec 30 12:21:30 2021
From: report at bugs.python.org (Guido van Rossum)
Date: Thu, 30 Dec 2021 17:21:30 +0000
Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction
In-Reply-To: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org>
Message-ID: <1640884890.46.0.801463310145.issue46195@roundup.psfhosted.org>


Guido van Rossum <guido at python.org> added the comment:

Yes, we changed PEP 484 in https://github.com/python/peps/pull/689.

So get_type_hints() should follow suit.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46195>
_______________________________________

From report at bugs.python.org  Thu Dec 30 12:47:49 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 17:47:49 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640886469.79.0.284725124338.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> I'm assuming you meant to write comb(67, k) instead

Aargh! That is of course what I meant, but not in fact what I timed. :-(

I'll redo the timings. Please disregard the previous message.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 12:59:53 2021
From: report at bugs.python.org (Tim Peters)
Date: Thu, 30 Dec 2021 17:59:53 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640887193.18.0.89863868837.issue37295@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

> Aargh! That is of course what I meant, but not in fact
> what I timed. :-(

!!! Even more baffling then. Seems like the code posted got out of math_comb_impl() early here:

        if (overflow || ki > ni) {
            result = PyLong_FromLong(0);
            goto done;
        }

67 out of every 68 times comb() was called, before any actual ;-) computation was even tried. Yet one way was significantly faster than the other overall, despite that they were so rarely executed at all?

Something ... seems off here ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 13:07:40 2021
From: report at bugs.python.org (Tim Peters)
Date: Thu, 30 Dec 2021 18:07:40 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640887660.02.0.757064958411.issue46187@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

[Mark]
> The idea is no more than: "compute an extra bit, then use
> that extra bit to determine which way to round".

Thanks! Despite that this is what the derivation I sketched boiled down to, I was still missing how general the underlying principle was. Duh! Indeed, nothing special about sqrt here. So I'm delightfully surprised again :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Thu Dec 30 13:17:59 2021
From: report at bugs.python.org (Brandt Bucher)
Date: Thu, 30 Dec 2021 18:17:59 +0000
Subject: [issue46202] remove opcode POP_EXCEPT_AND_RERAISE
In-Reply-To: <1640859376.18.0.58534498395.issue46202@roundup.psfhosted.org>
Message-ID: <1640888279.96.0.772068860764.issue46202@roundup.psfhosted.org>


Change by Brandt Bucher <brandtbucher at gmail.com>:


----------
nosy: +brandtbucher

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46202>
_______________________________________

From report at bugs.python.org  Thu Dec 30 13:39:11 2021
From: report at bugs.python.org (Manuel Reimer)
Date: Thu, 30 Dec 2021 18:39:11 +0000
Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a
 crash in subintepreters
In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org>
Message-ID: <1640889551.17.0.639713575831.issue46070@roundup.psfhosted.org>


Change by Manuel Reimer <manuel.reimer at gmx.de>:


----------
nosy: +M-Reimer

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46070>
_______________________________________

From report at bugs.python.org  Thu Dec 30 13:40:26 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Thu, 30 Dec 2021 18:40:26 +0000
Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction
In-Reply-To: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org>
Message-ID: <1640889626.23.0.291414127463.issue46195@roundup.psfhosted.org>


Change by Nikita Sobolev <mail at sobolevn.me>:


----------
keywords: +patch
pull_requests: +28517
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30304

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46195>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:00:20 2021
From: report at bugs.python.org (M Z)
Date: Thu, 30 Dec 2021 19:00:20 +0000
Subject: [issue46206] Crash when editing emoji containing strings
Message-ID: <1640890820.86.0.186821451382.issue46206@roundup.psfhosted.org>


New submission from M Z <10maurycy10 at gmail.com>:

Reproduction steps:
0. start rpel. command: ``python``
1. enter into  '___?'
2. use arrow keys and backspace to delete an underscore
3. press enter.
4. observe segfault

- insertion of chars before emoji can also cause crash

back trace (gdb):

```
(gdb) bt
#0  0x00007ffff7495d22 in raise () from /lib/libc.so.6
#1  0x00007ffff747f862 in abort () from /lib/libc.so.6
#2  0x00007ffff747f747 in __assert_fail_base.cold () from /lib/libc.so.6
#3  0x00007ffff748e616 in __assert_fail () from /lib/libc.so.6
#4  0x00007ffff77e7b6e in get_error_line (p=p at entry=0x7ffff6e53b80, lineno=lineno at entry=0) at Parser/pegen.c:438
#5  0x00007ffff7b3660d in _PyPegen_raise_error_known_location (p=p at entry=0x7ffff6e53b80, errtype=errtype at entry=0x7ffff7e7ac00 <_PyExc_SyntaxError>, lineno=0, col_offset=0, end_lineno=0, end_col_offset=-1, errmsg=0x7ffff7c84bcd "(%s) %U",
    va=0x7fffffffdcb0) at Parser/pegen.c:491
#6  0x00007ffff7b36d33 in _PyPegen_raise_error (p=p at entry=0x7ffff6e53b80, errtype=0x7ffff7e7ac00 <_PyExc_SyntaxError>, errmsg=errmsg at entry=0x7ffff7c84bcd "(%s) %U") at Parser/pegen.c:422
#7  0x00007ffff7b37213 in raise_decode_error (p=p at entry=0x7ffff6e53b80) at Parser/pegen.c:271
#8  0x00007ffff7bbed14 in initialize_token (token_type=60, end=0x0, start=<optimized out>, token=0x7ffff6ffb330, p=0x7ffff6e53b80) at Parser/pegen.c:712
#9  _PyPegen_fill_token (p=p at entry=0x7ffff6e53b80) at Parser/pegen.c:785
#10 0x00007ffff7c5eca1 in statement_newline_rule (p=0x7ffff6e53b80) at Parser/parser.c:1521
#11 interactive_rule (p=0x7ffff6e53b80) at Parser/parser.c:994
#12 _PyPegen_parse (p=p at entry=0x7ffff6e53b80) at Parser/parser.c:33180
#13 0x00007ffff7bd5784 in _PyPegen_run_parser (p=p at entry=0x7ffff6e53b80) at Parser/pegen.c:1343
#14 0x00007ffff7bd8e72 in _PyPegen_run_parser_from_file_pointer (fp=fp at entry=0x7ffff7619800 <_IO_2_1_stdin_>, start_rule=start_rule at entry=256, filename_ob=filename_ob at entry=0x7ffff7155490, enc=enc at entry=0x7ffff714bdb0 "utf-8",
    ps1=ps1 at entry=0x7ffff7155c40 ">>> ", ps2=ps2 at entry=0x7ffff6ffafa0 "... ", flags=0x7fffffffe0f8, errcode=0x7fffffffdfe4, arena=0x7ffff6feb820) at Parser/pegen.c:1440
#15 0x00007ffff7bd903e in _PyParser_ASTFromFile (fp=fp at entry=0x7ffff7619800 <_IO_2_1_stdin_>, filename_ob=filename_ob at entry=0x7ffff7155490, enc=enc at entry=0x7ffff714bdb0 "utf-8", mode=mode at entry=256, ps1=ps1 at entry=0x7ffff7155c40 ">>> ",
    ps2=ps2 at entry=0x7ffff6ffafa0 "... ", flags=0x7fffffffe0f8, errcode=0x7fffffffdfe4, arena=0x7ffff6feb820) at Parser/peg_api.c:26
#16 0x00007ffff7bd9205 in PyRun_InteractiveOneObjectEx (fp=fp at entry=0x7ffff7619800 <_IO_2_1_stdin_>, filename=filename at entry=0x7ffff7155490, flags=flags at entry=0x7fffffffe0f8) at Python/pythonrun.c:257
#17 0x00007ffff7bda02d in _PyRun_InteractiveLoopObject (fp=0x7ffff7619800 <_IO_2_1_stdin_>, filename=0x7ffff7155490, flags=0x7fffffffe0f8) at Python/pythonrun.c:148
#18 0x00007ffff7bdbbc7 in _PyRun_AnyFileObject (fp=0x7ffff7619800 <_IO_2_1_stdin_>, filename=0x7ffff7155490, closeit=0, flags=0x7fffffffe0f8) at Python/pythonrun.c:84
#19 0x00007ffff7bdbdf3 in PyRun_AnyFileExFlags (fp=0x7ffff7619800 <_IO_2_1_stdin_>, filename=<optimized out>, closeit=0, flags=0x7fffffffe0f8) at Python/pythonrun.c:116
#20 0x00007ffff7bddf60 in pymain_run_stdin (config=0x55555555f910) at Modules/main.c:502
#21 pymain_run_python (exitcode=0x7fffffffe0f0) at Modules/main.c:590
#22 Py_RunMain () at Modules/main.c:666
#23 0x00007ffff7bde683 in pymain_main (args=args at entry=0x7fffffffe250) at Modules/main.c:696
#24 0x00007ffff7bde7f9 in Py_BytesMain (argc=argc at entry=1, argv=argv at entry=0x7fffffffe3a8) at Modules/main.c:720
#25 0x00005555555560af in main (argc=1, argv=0x7fffffffe3a8) at ./Programs/python.c:15
(gdb)
```

----------
components: Unicode
messages: 409379
nosy: 10maurycy10, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: Crash when editing emoji containing strings
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46206>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:15:38 2021
From: report at bugs.python.org (M Z)
Date: Thu, 30 Dec 2021 19:15:38 +0000
Subject: [issue46206] Crash when editing emoji containing strings
In-Reply-To: <1640890820.86.0.186821451382.issue46206@roundup.psfhosted.org>
Message-ID: <1640891738.89.0.57563972604.issue46206@roundup.psfhosted.org>


M Z <10maurycy10 at gmail.com> added the comment:

FYI: My platform is arch linux on amd64.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46206>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:22:09 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 30 Dec 2021 19:22:09 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640892129.53.0.62076360096.issue37295@roundup.psfhosted.org>


Change by Serhiy Storchaka <storchaka+cpython at gmail.com>:


----------
pull_requests: +28518
pull_request: https://github.com/python/cpython/pull/30305

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:31:56 2021
From: report at bugs.python.org (David Fritz)
Date: Thu, 30 Dec 2021 19:31:56 +0000
Subject: [issue46207] Log emit performance degradation in RotatingFileHandlers
 due to filesystem checks
Message-ID: <1640892716.93.0.621207003678.issue46207@roundup.psfhosted.org>


New submission from David Fritz <dfritz at purestorage.com>:

I believe this also impacts 3.10 and 3.11 based on the original bpo-45401 which led to this change. Prior to commit ac421c348b in the 3.9 branch there were no additional os.path checks in the shouldRollover() methods of RotatingFileHandler and TimedRotatingFileHandler, which led to maximum performance regardless of where log files existed. With the new "os.path.exists(self.baseFilename) and not os.path.isfile(self.baseFilename)" checks added to these functions, a varying performance degradation is seen if the log lives on a filesystem that is not a local disk. It is hard for me to strictly call this a "regression", since I understand the reason of the original change (only rollover regular files), but I feel this is something developers should be aware of, or possibly have a way to disable (without making their own subclass) since this cost was not incurred before.

For example, let's say we have user home folders as mounts via S3FS, and each user has a log stored in their home folders. Since there are now os.path checks on every single emit call, performance of logging is now directly impacted by networking latency if using one of these native logging handlers. This came as quite a surprise when upgrading to 3.9.8+, when operations that were previously taking ~2 seconds were now taking ~2 1/2 minutes. This is reproducible (once you have a similar external filesystem mounted) using the following script (also attached):


# vi logtest.py
import logging
import logging.handlers

logging.basicConfig(filename="test.log", level=logging.INFO)
logger = logging.getLogger("test_logger")
log_handler = logging.handlers.TimedRotatingFileHandler("test.log", when='D', backupCount=2)
logger.addHandler(log_handler)

for i in range(0, 10000):
    logger.info("iteration: %d", i)


As seen between the commits, cost spikes due to the new calls (double the amount of log emit calls):

$ time /build_397/bin/python3 -m cProfile logtest.py |awk '$5>0.00'
...[truncated output to highest percall items]...
ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  12/1    0.000    0.000    0.549    0.549 {built-in method builtins.exec} # 3.9.7_d57d33c234 (no posix.stat calls)
  12/1    0.000    0.000   70.125   70.125 {built-in method builtins.exec} # 3.9.7_ac421c348b
 20100   68.972    0.003   68.972    0.003 {built-in method posix.stat}    # 3.9.7_ac421c348b

This performance degradation is further compounded if for example you have logging being performed inside threads, where locks have to be obtained. This is actually how I noticed it originally, because I was attempting to use the cProfile module to find what was taking so long. I ended up testing several python versions to make sure I was not crazy, before identifying the exact commit where the change in performance occurred.

ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    67    0.661    0.010    0.661    0.010 {method 'acquire' of '_thread.lock' objects} # 3.7.8
    67    1.237    0.018    1.237    0.018 {method 'acquire' of '_thread.lock' objects} # 3.9.0
    67    1.293    0.019    1.293    0.019 {method 'acquire' of '_thread.lock' objects} # 3.9.4
    67    0.756    0.011    0.756    0.011 {method 'acquire' of '_thread.lock' objects} # 3.9.6
    67    1.218    0.018    1.218    0.018 {method 'acquire' of '_thread.lock' objects} # 3.9.7
    67  152.411    2.275  152.411    2.275 {method 'acquire' of '_thread.lock' objects} # 3.9.8
    67  152.382    2.274  152.382    2.274 {method 'acquire' of '_thread.lock' objects} # 3.9.9

Ultimately I do not have a recommendation for a native fix that keeps both the improvement from the commit, and the performance from before the commit. Perhaps caching the results of the checks until there is a rollover? Only perform the check on initial handler creation? Otherwise it appears the only solution is to subclass and override the shouldRollover() to not include the os.path checks and match <=3.9.7 behavior. This is the solution I am implementing in the codebase/environment where this was discovered while this report is discussed further. This feels less than ideal, but if that is the consensus then hopefully this report can help the next person to come across it. Thank you for your time and all the hard work put into Python!

----------
files: logtest.py
messages: 409381
nosy: dfritz
priority: normal
severity: normal
status: open
title: Log emit performance degradation in RotatingFileHandlers due to filesystem checks
type: performance
versions: Python 3.10, Python 3.11, Python 3.9
Added file: https://bugs.python.org/file50529/logtest.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46207>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:34:53 2021
From: report at bugs.python.org (Serhiy Storchaka)
Date: Thu, 30 Dec 2021 19:34:53 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640892893.16.0.629254900984.issue37295@roundup.psfhosted.org>


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

PR 30305 applies Mark's algorithm for larger n (up to 127) depending on k, as was suggested by Raymond. Note that it uses different table for limits, which maps k to maximal n.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:38:11 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 19:38:11 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640893091.04.0.166293247924.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

Thanks Tim for spotting the stupid mistake. The reworked timings are a bit more ... plausible.

tl;dr: On my machine, Raymond's suggestion gives a 2.2% speedup in the case where POPCNT is not available, and a 0.45% slowdown in the case that it _is_ available. Given that, and the fact that a single-instruction population count is not as readily available as I thought it was, I'd be happy to change the implementation to use the trailing zero counts as suggested.

I'll attach the scripts I used for timing and analysis. There are two of them: "timecomb.py" produces a single timing. "driver.py" repeatedly switches branches, re-runs make, runs "timecomb.py", then assembles the results.

I ran the driver.py script twice: once with a regular `./configure` step, and once with `./configure CFLAGS="-march=haswell"`. Below, "base" refers to the code currently in master; "alt" is the branch with Raymond's suggested change on it.

Output from the script for the normal ./configure

    Mean time for base: 40.130ns
    Mean for alt: 39.268ns
    Speedup: 2.19%
    Ttest_indResult(statistic=7.9929245698581415, pvalue=1.4418376402220854e-14)

Output for CFLAGS="-march=haswell":

    Mean time for base: 39.612ns
    Mean for alt: 39.791ns
    Speedup: -0.45%
    Ttest_indResult(statistic=-6.75385578636895, pvalue=5.119724894191512e-11)

----------
Added file: https://bugs.python.org/file50530/timecomb.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:38:24 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 19:38:24 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640893104.98.0.368201998994.issue37295@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


Added file: https://bugs.python.org/file50531/driver.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:38:30 2021
From: report at bugs.python.org (Hugo van Kemenade)
Date: Thu, 30 Dec 2021 19:38:30 +0000
Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+
Message-ID: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org>


New submission from Hugo van Kemenade <hugovk+python at gmail.com>:

The behaviour of os.path.normpath appears to have changed between Python 3.10/Python 3.11.0a2 and 3.11.0a3+.

I don't see anything mentioned in https://docs.python.org/3.11/whatsnew/3.11.html

Is this intentional?


Old behaviour:

Python 3.10.1 (v3.10.1:2cd268a3a9, Dec  6 2021, 14:28:59) [Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from os.path import normpath
>>> normpath('handbook/../../Tests/image.png')
'../Tests/image.png'
>>>


Python 3.11.0a2 (main, Dec 30 2021, 21:22:15) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from os.path import normpath
>>> normpath('handbook/../../Tests/image.png')
'../Tests/image.png'
>>>


New behaviour:

Python 3.11.0a3+ (heads/main:af6b406, Dec  9 2021, 15:34:48) [Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from os.path import normpath
>>> normpath('handbook/../../Tests/image.png')
'Tests/image.png'
>>>


Python 3.11.0a3+ (heads/main:8d7644f, Dec 30 2021, 21:32:51) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from os.path import normpath
>>> normpath('handbook/../../Tests/image.png')
'Tests/image.png'
>>>

(Found in https://github.com/sphinx-doc/sphinx/issues/10030.)

----------
components: Library (Lib)
messages: 409384
nosy: hugovk
priority: normal
severity: normal
status: open
title: os.path.normpath change between 3.11.0a2 and 3.11.0a3+
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46208>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:54:47 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 19:54:47 +0000
Subject: [issue45569] Drop support for 15-bit PyLong digits?
In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org>
Message-ID: <1640894087.57.0.908123338812.issue45569@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
keywords: +patch
pull_requests: +28519
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30306

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45569>
_______________________________________

From report at bugs.python.org  Thu Dec 30 14:57:22 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Thu, 30 Dec 2021 19:57:22 +0000
Subject: [issue45569] Drop support for 15-bit PyLong digits?
In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org>
Message-ID: <1640894242.71.0.371797382544.issue45569@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

Terry:

> create a fake test file test/test_xintperf [...]

Sounds reasonable, though I'm not sure I know what exact timings I'd want to try. Maybe some of the stock integer-heavy Python benchmarks (pidigits, etc.).

I realised that I have no idea whether any of the buildbots actually use 15-bit digits. I've created PR GH-30306 to find out.

----------
stage: patch review -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45569>
_______________________________________

From report at bugs.python.org  Thu Dec 30 15:03:35 2021
From: report at bugs.python.org (Christian Heimes)
Date: Thu, 30 Dec 2021 20:03:35 +0000
Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+
In-Reply-To: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org>
Message-ID: <1640894615.68.0.0835503521038.issue46208@roundup.psfhosted.org>


Christian Heimes <lists at cheimes.de> added the comment:

The issue could be related to 99fcf1505218464c489d419d4500f126b6d6dc28 / bpo-45582.

----------
nosy: +christian.heimes, steve.dower

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46208>
_______________________________________

From report at bugs.python.org  Thu Dec 30 15:31:13 2021
From: report at bugs.python.org (kcdodd)
Date: Thu, 30 Dec 2021 20:31:13 +0000
Subject: [issue46197] ensurepip bootstrap breaks out of isolated environment
In-Reply-To: <1640820251.78.0.719610352005.issue46197@roundup.psfhosted.org>
Message-ID: <1640896273.19.0.26108686085.issue46197@roundup.psfhosted.org>


Change by kcdodd <carter.dodd at gmail.com>:


----------
keywords: +patch
pull_requests: +28520
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30307

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46197>
_______________________________________

From report at bugs.python.org  Thu Dec 30 16:18:41 2021
From: report at bugs.python.org (Mariatta)
Date: Thu, 30 Dec 2021 21:18:41 +0000
Subject: [issue46184] Remove `netlify.toml`?
In-Reply-To: <1640556026.15.0.409778819422.issue46184@roundup.psfhosted.org>
Message-ID: <1640899121.41.0.842325352375.issue46184@roundup.psfhosted.org>


Mariatta <mariatta at python.org> added the comment:


New changeset fbaf2e604cd354f1ebc6be029480010c6715a8ca by Nikita Sobolev in branch 'main':
bpo-46184: remove `netlify.toml` (#30272)
https://github.com/python/cpython/commit/fbaf2e604cd354f1ebc6be029480010c6715a8ca


----------
nosy: +Mariatta

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46184>
_______________________________________

From report at bugs.python.org  Thu Dec 30 16:23:58 2021
From: report at bugs.python.org (Guo Ci Teo)
Date: Thu, 30 Dec 2021 21:23:58 +0000
Subject: [issue46209] add documentation for decoding newlines in the `io`
 module
Message-ID: <1640899438.69.0.632491877806.issue46209@roundup.psfhosted.org>


New submission from Guo Ci Teo <zguoci at gmail.com>:

add documentation for
`io.IncrementalNewlineDecoder`
`io.TextIOWrapper`
`io.StringIO`,
listing various ways to decode newlines

----------
messages: 409388
nosy: guoci
priority: normal
severity: normal
status: open
title: add documentation for decoding newlines in the `io` module

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46209>
_______________________________________

From report at bugs.python.org  Thu Dec 30 16:25:04 2021
From: report at bugs.python.org (Guo Ci Teo)
Date: Thu, 30 Dec 2021 21:25:04 +0000
Subject: [issue46209] add documentation for decoding newlines in the `io`
 module
In-Reply-To: <1640899438.69.0.632491877806.issue46209@roundup.psfhosted.org>
Message-ID: <1640899504.17.0.513327999798.issue46209@roundup.psfhosted.org>


Change by Guo Ci Teo <zguoci at gmail.com>:


----------
keywords: +patch
pull_requests: +28521
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30308

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46209>
_______________________________________

From report at bugs.python.org  Thu Dec 30 16:26:22 2021
From: report at bugs.python.org (Mariatta)
Date: Thu, 30 Dec 2021 21:26:22 +0000
Subject: [issue46178] Remove `.travis.yml`?
In-Reply-To: <1640511273.57.0.0109670921395.issue46178@roundup.psfhosted.org>
Message-ID: <1640899582.33.0.643054829246.issue46178@roundup.psfhosted.org>


Mariatta <mariatta at python.org> added the comment:


New changeset 82c2b54a35f85d87639201d1431ae6584b079e13 by Nikita Sobolev in branch 'main':
bpo-46178: remove unusued `.travis.yml` file (#30257)
https://github.com/python/cpython/commit/82c2b54a35f85d87639201d1431ae6584b079e13


----------
nosy: +Mariatta

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46178>
_______________________________________

From report at bugs.python.org  Thu Dec 30 16:34:08 2021
From: report at bugs.python.org (Zachary Ware)
Date: Thu, 30 Dec 2021 21:34:08 +0000
Subject: [issue46207] Log emit performance degradation in RotatingFileHandlers
 due to filesystem checks
In-Reply-To: <1640892716.93.0.621207003678.issue46207@roundup.psfhosted.org>
Message-ID: <1640900048.13.0.508841107699.issue46207@roundup.psfhosted.org>


Change by Zachary Ware <zachary.ware at gmail.com>:


----------
components: +Library (Lib)
nosy: +vinay.sajip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46207>
_______________________________________

From report at bugs.python.org  Thu Dec 30 16:42:14 2021
From: report at bugs.python.org (Hugo van Kemenade)
Date: Thu, 30 Dec 2021 21:42:14 +0000
Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+
In-Reply-To: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org>
Message-ID: <1640900534.72.0.946098647435.issue46208@roundup.psfhosted.org>


Hugo van Kemenade <hugovk+python at gmail.com> added the comment:

git bisect between v3.11.0a2 and v3.11.0a3 points to the same commit, 99fcf1505218464c489d419d4500f126b6d6dc28.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46208>
_______________________________________

From report at bugs.python.org  Thu Dec 30 17:30:20 2021
From: report at bugs.python.org (Daniel Lenski)
Date: Thu, 30 Dec 2021 22:30:20 +0000
Subject: [issue22833] The decode_header() function decodes raw part to bytes
 or str, depending on encoded part
In-Reply-To: <1415587360.95.0.777626227555.issue22833@psf.upfronthosting.co.za>
Message-ID: <1640903420.29.0.531458387048.issue22833@roundup.psfhosted.org>


Daniel Lenski <dlenski at gmail.com> added the comment:

I recently ran into this bug as well.

For those looking for a reliable workaround, here's an implementation of a 'decode_header_to_string' function which should Just Work? in all possible cases:

    #!/usr/bin/python3
    import email.header

    # Workaround for https://bugs.python.org/issue22833
    def decode_header_to_string(header):
        '''Decodes an email message header (possibly RFC2047-encoded)
        into a string, while working around https://bugs.python.org/issue22833'''

        return ''.join(
            alleged_string if isinstance(alleged_string, str) else alleged_string.decode(
                alleged_charset or 'ascii')
            for alleged_string, alleged_charset in email.header.decode_header(header))


    for header in ('=?utf-8?B?ZsOzbw==',
                   '=?ascii?Q?hello?==?utf-8?B?ZsOzbw==?=',
                   'bar=?ascii?Q?hello?==?utf-8?B?ZsOzbw==?=',
                   'plain string',):
        print("Header value: %r" % header)
        print("email.header.decode_header(...) -> %r" % email.header.decode_header(header))
        print("decode_header_to_string(...)    -> %r" % decode_header_to_string(header))
        print("-------")

Outputs:

    Header value: '=?utf-8?B?ZsOzbw=='
    email.header.decode_header(...) -> [('=?utf-8?B?ZsOzbw==', None)]
    decode_header_to_string(...)    -> '=?utf-8?B?ZsOzbw=='
    -------
    Header value: '=?ascii?Q?hello?==?utf-8?B?ZsOzbw==?='
    email.header.decode_header(...) -> [(b'hello', 'ascii'), (b'f\xc3\xb3o', 'utf-8')]
    decode_header_to_string(...)    -> 'hellof?o'
    -------
    Header value: 'bar=?ascii?Q?hello?==?utf-8?B?ZsOzbw==?='
    email.header.decode_header(...) -> [(b'bar', None), (b'hello', 'ascii'), (b'f\xc3\xb3o', 'utf-8')]
    decode_header_to_string(...)    -> 'barhellof?o'
    -------
    Header value: 'plain string'
    email.header.decode_header(...) -> [('plain string', None)]
    decode_header_to_string(...)    -> 'plain string'
    -------
    Header value: 'foo=?blah?Q??='
    email.header.decode_header(...) -> [(b'foo', None), (b'', 'blah')]
    decode_header_to_string(...)    -> 'foo'
    -------

----------
nosy: +dlenski

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22833>
_______________________________________

From report at bugs.python.org  Thu Dec 30 17:31:06 2021
From: report at bugs.python.org (Hugo van Kemenade)
Date: Thu, 30 Dec 2021 22:31:06 +0000
Subject: [issue46178] Remove `.travis.yml`?
In-Reply-To: <1640511273.57.0.0109670921395.issue46178@roundup.psfhosted.org>
Message-ID: <1640903466.42.0.541352562766.issue46178@roundup.psfhosted.org>


Change by Hugo van Kemenade <hugovk+python at gmail.com>:


----------
nosy: +hugovk
nosy_count: 2.0 -> 3.0
pull_requests: +28522
pull_request: https://github.com/python/cpython/pull/30309

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46178>
_______________________________________

From report at bugs.python.org  Thu Dec 30 17:31:06 2021
From: report at bugs.python.org (Hugo van Kemenade)
Date: Thu, 30 Dec 2021 22:31:06 +0000
Subject: [issue33937] test_socket: SendmsgSCTPStreamTest.testSendmsgTimeout()
 failed on Travis CI with: [Errno 12] Cannot allocate memory
In-Reply-To: <1529652776.13.0.56676864532.issue33937@psf.upfronthosting.co.za>
Message-ID: <1640903466.54.0.531295237018.issue33937@roundup.psfhosted.org>


Change by Hugo van Kemenade <hugovk+python at gmail.com>:


----------
nosy: +hugovk
nosy_count: 2.0 -> 3.0
pull_requests: +28523
pull_request: https://github.com/python/cpython/pull/30309

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33937>
_______________________________________

From report at bugs.python.org  Thu Dec 30 18:08:21 2021
From: report at bugs.python.org (Daniel Lenski)
Date: Thu, 30 Dec 2021 23:08:21 +0000
Subject: [issue22833] The decode_header() function decodes raw part to bytes
 or str, depending on encoded part
In-Reply-To: <1415587360.95.0.777626227555.issue22833@psf.upfronthosting.co.za>
Message-ID: <1640905701.53.0.857462247688.issue22833@roundup.psfhosted.org>


Daniel Lenski <dlenski at gmail.com> added the comment:

Due to this bug, any user of this function in Python 3.0+ *already* has to be able to handle all of the following outputs in order to use it reliably:

   decode_header(...) -> [(str, None)]
or decode_header(...) -> [(bytes, str)]
or decode_header(...) -> [(bytes, (str|None)), (bytes, (str|None)), ...]

== Fix str/bytes inconsistency ==

We could eliminate the inconsistency, and make the function only ever return bytes instead of str, with the following changes to https://github.com/python/cpython/blob/3.10/Lib/email/header.py.

```
diff --git a/Lib/email/header.py.orig b/Lib/email/header.py
index 4ab0032..41e91f2 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -61,7 +61,7 @@ _max_append = email.quoprimime._max_append
 def decode_header(header):
     """Decode a message header value without converting charset.
 
-    Returns a list of (string, charset) pairs containing each of the decoded
+    Returns a list of (bytes, charset) pairs containing each of the decoded
     parts of the header.  Charset is None for non-encoded parts of the header,
     otherwise a lower-case string containing the name of the character set
     specified in the encoded string.
@@ -78,7 +78,7 @@ def decode_header(header):
                     for string, charset in header._chunks]
     # If no encoding, just return the header with no charset.
     if not ecre.search(header):
-        return [(header, None)]
+        return [header.encode(), None)]
     # First step is to parse all the encoded parts into triplets of the form
     # (encoded_string, encoding, charset).  For unencoded strings, the last
     # two parts will be None.
```

With these changes, decode_header() would return one of the following:

   decode_header(...) -> [(bytes, None)]
or decode_header(...) -> [(bytes, str)]
or decode_header(...) -> [(bytes, (str|None)), (bytes, (str|None)), ...]


== Ensure that charset is always str, never None ==

A couple more small changes:

```
@@ -92,7 +92,7 @@ def decode_header(header):
                 unencoded = unencoded.lstrip()
                 first = False
             if unencoded:
-                words.append((unencoded, None, None))
+                words.append((unencoded, None, 'ascii'))
             if parts:
                 charset = parts.pop(0).lower()
                 encoding = parts.pop(0).lower()
@@ -133,7 +133,8 @@ def decode_header(header):
     # Now convert all words to bytes and collapse consecutive runs of
     # similarly encoded words.
     collapsed = []
-    last_word = last_charset = None
+    last_word = None
+    last_charset = 'ascii'
     for word, charset in decoded_words:
         if isinstance(word, str):
             word = bytes(word, 'raw-unicode-escape')
```

With these changes, decode_header() would return only:

   decode_header(...) -> List[(bytes, str)]

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22833>
_______________________________________

From report at bugs.python.org  Thu Dec 30 18:18:49 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 30 Dec 2021 23:18:49 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640906329.95.0.80497509134.issue37295@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> I'd be happy to change the implementation to use the trailing
> zero counts as suggested.

Thanks.  I think that is a portability win and will made the code a lot easier to explain.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Thu Dec 30 18:26:14 2021
From: report at bugs.python.org (Jason Wilkes)
Date: Thu, 30 Dec 2021 23:26:14 +0000
Subject: [issue46210] print deadlocks
Message-ID: <1640906774.22.0.0895418196174.issue46210@roundup.psfhosted.org>


New submission from Jason Wilkes <notarealdeveloper at gmail.com>:

Hi there. :)

(First time posting here, so apologies in advance if I'm a goof.)

I recently found a deadlock in the stdout and stderr buffer objects.

Following the dev guide, I

(1) wrote up a patch

(2) checked that it fixes the deadlock (on Linux and OS X)

(3) made sure it doesn't break any of the cpython tests (on Linux and OS X)

But I could use some feedback to make sure the patch isn't doing anything dumb, and to make sure I'm not missing something obvious.

Here's the situation.

The deadlock only occurs in the sinful state of threading while forking. (I'm aware of the reasons why one should never do that.)

But asking newcomers to never mix the two is sort of asking them to know the implementation details of every library they use (these abstractions are leaky). And I like teaching people about python and concurrency, so it would be nice if they didn't have to know all that.

So I've recently developed the ill-advised hobby of trying to run as much code as possible in the sinful state of threading while forking, to try to understand which bits of the interpreter and standard library are responsible for most of the deadlocks, in practice.

All the non-obvious deadlocks I've encountered seemed to be due to one thing, namely stdout and stderr's buffer->lock not having an _at_fork_reinit. So if a thread is printing during a fork, the child process can never print, else deadlock. Standard hazard of threading and forking.

What surprised me was that there didn't seem to be 100s of places in the interpreter where threading and forking don't mix. After fixing this one, all the different thread + fork code I'd been testing worked.

Which makes me wonder if there's a reason this hasn't been fixed yet.

Hence, maybe the patch is doing something dumb.

Anyways, this is sort of a bug report, and sort of a request for comments on how I can make this patch better. Equally cool would be an explanation of why re-initializing that lock is a bad idea to begin with.

Thanks for your patience if you read all that.

----------
components: IO
files: example.py
messages: 409394
nosy: notarealdeveloper
priority: normal
severity: normal
status: open
title: print deadlocks
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9
Added file: https://bugs.python.org/file50532/example.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46210>
_______________________________________

From report at bugs.python.org  Thu Dec 30 18:30:46 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Thu, 30 Dec 2021 23:30:46 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640907046.61.0.369559621699.issue46187@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> I'd similarly prefer to see recipes in the docs.

Can you elaborate on why you prefer having this in the docs rather than as built-in functionality?

For me, the rounded case would be the most common.  I don't think I'm better-off writing a wrapper with a semi-opaque trick, having to give it a different name and having it run more slowly than built in functionality. Also as builtin, I can be assured that it is maintained, documented, and well-tested.

Writing "y = isqrt(x, 'rounded')" is clear, fast, and convenient. I don't see the advantage is putting that functionality a little more out of reach.

The string options have been successful elsewhere in Python. For example, str.encode() has the error modes: "strict", "ignore", and "replace" which as clear, fast, and much better than users having to write their own wrappers.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Thu Dec 30 18:39:44 2021
From: report at bugs.python.org (Jason Wilkes)
Date: Thu, 30 Dec 2021 23:39:44 +0000
Subject: [issue46210] print deadlocks
In-Reply-To: <1640906774.22.0.0895418196174.issue46210@roundup.psfhosted.org>
Message-ID: <1640907584.12.0.163685755788.issue46210@roundup.psfhosted.org>


Change by Jason Wilkes <notarealdeveloper at gmail.com>:


----------
keywords: +patch
pull_requests: +28524
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30310

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46210>
_______________________________________

From report at bugs.python.org  Thu Dec 30 19:16:34 2021
From: report at bugs.python.org (Mariatta)
Date: Fri, 31 Dec 2021 00:16:34 +0000
Subject: [issue46178] Remove `.travis.yml`?
In-Reply-To: <1640511273.57.0.0109670921395.issue46178@roundup.psfhosted.org>
Message-ID: <1640909794.91.0.81752500264.issue46178@roundup.psfhosted.org>


Mariatta <mariatta at python.org> added the comment:


New changeset 2cf7d02b99ce8cebd26d330aa8aac2ee369d4600 by Hugo van Kemenade in branch 'main':
bpo-46178: Remove/rename redundant Travis CI code (#30309)
https://github.com/python/cpython/commit/2cf7d02b99ce8cebd26d330aa8aac2ee369d4600


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46178>
_______________________________________

From report at bugs.python.org  Thu Dec 30 19:52:29 2021
From: report at bugs.python.org (Tim Peters)
Date: Fri, 31 Dec 2021 00:52:29 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640911949.13.0.674744615955.issue46187@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

Pretend this were the itertools module and you were responding to someone suggesting a new optional argument to one of its functions. You have tons of experience rejecting those, and much the same arguments apply, from "not every one-line function needs to be built in" to "in seventeen centuries this is the first time someone asked for it" ;-)

Seriously, the only complaint I've seen about isqrt() before is that there isn't a version that raises an exception if the argument isn't a perfect square. That's so niche I wouldn't support adding that to the core either. Sure, sometimes that's what someone may want, and that's fine - they can do it on their own.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Thu Dec 30 21:00:56 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 02:00:56 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1640916056.49.0.306036889726.issue46118@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:


New changeset e712a5b277866a71c195f38c1b5d87d9126dba3e by Jason R. Coombs in branch 'main':
bpo-46118: Move importlib.resources to its own package. (#30176)
https://github.com/python/cpython/commit/e712a5b277866a71c195f38c1b5d87d9126dba3e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Thu Dec 30 21:01:07 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 02:01:07 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1640916067.5.0.0863698922002.issue46118@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Thu Dec 30 21:17:18 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 02:17:18 +0000
Subject: [issue46109] Separate resources docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1640917038.49.0.722633930752.issue46109@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:


New changeset 99945c6b5cf280bd90075cffae942af44941abcc by Jason R. Coombs in branch 'main':
bpo-46109: Separate out files relating to importlib.resources (GH-30160)
https://github.com/python/cpython/commit/99945c6b5cf280bd90075cffae942af44941abcc


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Thu Dec 30 21:21:56 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 02:21:56 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1640917316.44.0.679299298821.issue46118@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

Installed buildbots are failing (like this one: https://buildbot.python.org/all/#/builders/350/builds/1164). I'm going to see if it's a simple fix like updating the makefile or if a rollback is called for.

----------
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Thu Dec 30 21:30:44 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 02:30:44 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1640917844.53.0.161074370567.issue46118@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
pull_requests: +28525
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/30311

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Thu Dec 30 21:38:25 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 02:38:25 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1640918305.97.0.0140049739158.issue46118@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

Looks like I encountered the same foot gun when originally introducing the importlib.metadata package (issue34632).

----------
stage: patch review -> resolved

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Thu Dec 30 21:42:47 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 02:42:47 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1640918567.77.0.561610806873.issue46118@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

And the underlying cause is reported in issue37043.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Thu Dec 30 22:37:01 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 03:37:01 +0000
Subject: [issue37043] Buildbots fail when new files are added
In-Reply-To: <1558790050.59.0.505947951024.issue37043@roundup.psfhosted.org>
Message-ID: <1640921821.11.0.58323917865.issue37043@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I encountered this issue again today in issue46118.

I started looking into creating the patchcheck, but I realize it may be a little tricky to detect the introduction of a new folder, because `git diff` doesn't actually report new folders, and my initial research indicates it's [far from straightforward](https://stackoverflow.com/a/36293191/70170).

I thought maybe git diff --dirstat might help, but it doesn't. It reports 100% different for a new file in a new folder and same for a new file in an existing folder.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37043>
_______________________________________

From report at bugs.python.org  Thu Dec 30 22:39:28 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 03:39:28 +0000
Subject: [issue46118] Migrate importlib.resources into a package
In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org>
Message-ID: <1640921968.08.0.156136351137.issue46118@roundup.psfhosted.org>


Jason R. Coombs <jaraco at jaraco.com> added the comment:


New changeset 35628e4cde71e54afe12aea50c74069afe2c3389 by Jason R. Coombs in branch 'main':
bpo-46118: Make sure importlib.resources is included. (GH-30311)
https://github.com/python/cpython/commit/35628e4cde71e54afe12aea50c74069afe2c3389


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46118>
_______________________________________

From report at bugs.python.org  Thu Dec 30 23:02:51 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 31 Dec 2021 04:02:51 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640923371.29.0.750495651991.issue46187@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

So, are you going to reject my feature request?  I don't understand why.  Both Mark and I have had valid use cases.  The implementation is straight-forward and simple.  The workaround is slow and non-obvious.  The default remains the same so that usability isn't impaired in any way.  There is basically zero downside other that feeling icky about mode flags in general.

With respect to itertools, I did add *initial* to accumulate() solely because you wanted it ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Thu Dec 30 23:46:02 2021
From: report at bugs.python.org (Tim Peters)
Date: Fri, 31 Dec 2021 04:46:02 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640925962.81.0.432724860303.issue46187@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

I'm not rejecting anything. Mark wrote the function, and I'll defer to him.

Yes, you added `initial` to `accumulate()`, and I spent hours in all explaining to you why it was an utterly natural addition, conspicuous by absence, including writing up several real-life use cases that just happened to pop up while that discussion dragged on. Thanks! I've used it many more times since it was added. Adding it brought accumulate() into line with other languages' workalikes. Python was the oddball there.

OTOH, not even gmp's mpz supports rounded isqrt directly, just truncated, and a _different_ function that returns not only isqrt(n), but also "the remainder" (n - isqrt(n)**2). The latter shows they're not averse to adding cruft that can easily be done - which makes it all the more suggestive that they _didn't_ also add other rounding modes.

Note: the primary intended "use case" for the version with the remainder appears to be a fast way to detect if the argument was a perfect square. As mentioned earlier, the lack of a builtin way to do that is the only complaint I've seen before about Python's isqrt.

Mark didn't mention his use case for rounded isqrt, I don't have any myself, and your only named use case was "building a table of square roots incorporated in arbitrary precision functions implemented with scaled integer arithmetic". It's very hard to believe that minor speed boosts make any difference at all when building static tables, so "it's faster built in" falls flat for me.

To the contrary, adding _any_ optional argument (be it a string or of any other type) complicates the calling sequence and requires burning cycles on every invocation just to work out which arguments _were_ passed. So, despite that I have no expectation of ever asking for a rounded isqrt, adding the possibility would cost _me_ cycles on every isqrt() call I already have. None of which are in one-shot table-builders, but mostly in loops.

If there's a _compelling_ use case for rounded isqrt, I haven't seen one, but I'd be much happier to see it added it as a new function of its own. Like, e.g., gmp added mpz_sqrtrem() rather than add an annoying "mode" argument to the widely used mpz_sqrt().

I don't really object to string arguments per se, but in the context of what one hopes to be blazing fast integer functions, throwing in string comparisons just to set a flag seems ludicrously expensive. _PyUnicode_EqualToASCIIId() is not my idea of "cheap" ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Fri Dec 31 00:34:50 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 31 Dec 2021 05:34:50 +0000
Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library"
In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org>
Message-ID: <1640928890.22.0.220225923359.issue46079@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I'm thinking of this an a replacement example:

>>> import json
>>> import urllib.request
>>> url = "http://worldtimeapi.org/api/timezone/America/Los_Angeles"
>>> with urllib.request.urlopen(url) as response:
...     timeinfo = json.load(response)
...
>>> print(timeinfo['datetime'])
2021-12-30T21:32:08.588278-08:00

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46079>
_______________________________________

From report at bugs.python.org  Fri Dec 31 00:45:05 2021
From: report at bugs.python.org (Xinmeng Xia)
Date: Fri, 31 Dec 2021 05:45:05 +0000
Subject: [issue46211] Recursively calling makepasv() finally leads to core
 dumped.
Message-ID: <1640929505.72.0.774878078134.issue46211@roundup.psfhosted.org>


New submission from Xinmeng Xia <xiaxm at smail.nju.edu.cn>:

See the following 'test.py', we call client.makepasv() in socket, and then create_connection. Recursively calling makepasv() finally leads to core dumped.

System: Python 3.10.1, 3.11.0a3 ,master on Ubuntu 18.04
  
Reproduce step: 
1. executing "python test.py"
2. If only TimeoutError is observed, just executing this code again. Maybe after 4 or 5 times, this program crashes Python interpreter.


test.py
===============================================
import socket
from test.test_ftplib import TestFTPClass,TIMEOUT

def test_makepasv():
    host, port = TestFTPClass.client.makepasv()
    conn = socket.create_connection((test_makepasv(), host), timeout=TIMEOUT)
    conn.close()
===============================================

Error Message:
---------------------------------------------------
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/xxm/Desktop/compilers/cpython-main12-31/Lib/asyncore.py", line 90, in read
    obj.handle_read_event()
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxm/Desktop/compilers/cpython-main12-31/Lib/asyncore.py", line 427, in handle_read_event
Traceback (most recent call last):
.....
  File "/home/xxm/Desktop/compilers/cpython-main12-31/Lib/test/test_ftplib.py", line 298, in run
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: timed out
Fatal Python error: _enter_buffered_busy: could not acquire lock for <_io.BufferedWriter name='<stderr>'> at interpreter shutdown, possibly due to daemon threads
Python runtime state: finalizing (tstate=0x0000556df3cfbe30)

Current thread 0x00007fb82ce69080 (most recent call first):
  <no Python frame>

Extension modules: _testcapi (total: 1)
Aborted (core dumped)
-----------------------------------------------------

----------
components: Library (Lib)
messages: 409408
nosy: xxm
priority: normal
severity: normal
status: open
title: Recursively calling makepasv() finally leads to core dumped.
type: crash
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46211>
_______________________________________

From report at bugs.python.org  Fri Dec 31 02:52:19 2021
From: report at bugs.python.org (colorfulappl)
Date: Fri, 31 Dec 2021 07:52:19 +0000
Subject: [issue20291] Argument Clinic should understand *args and **kwargs
 parameters
In-Reply-To: <1390010125.91.0.58212727704.issue20291@psf.upfronthosting.co.za>
Message-ID: <1640937139.73.0.985269771114.issue20291@roundup.psfhosted.org>


Change by colorfulappl <colorfulappl at qq.com>:


----------
nosy: +colorfulappl
nosy_count: 11.0 -> 12.0
pull_requests: +28526
pull_request: https://github.com/python/cpython/pull/30286

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20291>
_______________________________________

From report at bugs.python.org  Fri Dec 31 03:24:59 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 31 Dec 2021 08:24:59 +0000
Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library"
In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org>
Message-ID: <1640939099.01.0.293764191482.issue46079@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

This is a little closer to the current code.  Also it has a simpler and more universal url.


from urllib.request import urlopen
url = 'http://worldtimeapi.org/api/timezone/etc/UTC.txt'
with urlopen(url) as request:
    for line in request:
        line = line.decode('utf-8')
        if line.startswith('datetime'):
            print(line)

datetime: 2021-12-31T08:23:15.083004+00:00

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46079>
_______________________________________

From report at bugs.python.org  Fri Dec 31 04:44:00 2021
From: report at bugs.python.org (Ruben Vorderman)
Date: Fri, 31 Dec 2021 09:44:00 +0000
Subject: [issue24301] gzip module failing to decompress valid compressed file
In-Reply-To: <1432742343.38.0.978535326882.issue24301@psf.upfronthosting.co.za>
Message-ID: <1640943840.4.0.75486479509.issue24301@roundup.psfhosted.org>


Ruben Vorderman <r.h.p.vorderman at lumc.nl> added the comment:

ping

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24301>
_______________________________________

From report at bugs.python.org  Fri Dec 31 04:57:32 2021
From: report at bugs.python.org (Stefan Behnel)
Date: Fri, 31 Dec 2021 09:57:32 +0000
Subject: [issue45321] Module xml.parsers.expat.errors misses error code
 constants of libexpat >=2.0
In-Reply-To: <1632919785.51.0.148853477081.issue45321@roundup.psfhosted.org>
Message-ID: <1640944652.88.0.665004694959.issue45321@roundup.psfhosted.org>


Stefan Behnel <stefan_ml at behnel.de> added the comment:


New changeset e18d81569fa0564f3bc7bcfd2fce26ec91ba0a6e by Sebastian Pipping in branch 'main':
bpo-45321: Add missing error codes to module `xml.parsers.expat.errors` (GH-30188)
https://github.com/python/cpython/commit/e18d81569fa0564f3bc7bcfd2fce26ec91ba0a6e


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45321>
_______________________________________

From report at bugs.python.org  Fri Dec 31 04:59:05 2021
From: report at bugs.python.org (Stefan Behnel)
Date: Fri, 31 Dec 2021 09:59:05 +0000
Subject: [issue45321] Module xml.parsers.expat.errors misses error code
 constants of libexpat >=2.0
In-Reply-To: <1632919785.51.0.148853477081.issue45321@roundup.psfhosted.org>
Message-ID: <1640944745.38.0.94937117182.issue45321@roundup.psfhosted.org>


Change by Stefan Behnel <stefan_ml at behnel.de>:


----------
components: +XML
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement
versions:  -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45321>
_______________________________________

From report at bugs.python.org  Fri Dec 31 05:05:47 2021
From: report at bugs.python.org (colorfulappl)
Date: Fri, 31 Dec 2021 10:05:47 +0000
Subject: [issue46212] Avoid temporary `varargs` tuple creation in argument
 passing
Message-ID: <1640945147.14.0.155789461509.issue46212@roundup.psfhosted.org>


New submission from colorfulappl <colorfulappl at qq.com>:

When "Augument Clinic generated code" are parsing arguments, the args are packed to a tuple before passing to callee. This may be unnecessary.

Pass a raw pointer which points to on-stack varargs, and a varargssize integer to indicate how many varargs are passed, can save the time of tuple creation/destruction and value copy.

----------
components: Argument Clinic
messages: 409412
nosy: colorfulappl, erlendaasland, larry
priority: normal
severity: normal
status: open
title: Avoid temporary `varargs` tuple creation in argument passing
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46212>
_______________________________________

From report at bugs.python.org  Fri Dec 31 05:07:14 2021
From: report at bugs.python.org (colorfulappl)
Date: Fri, 31 Dec 2021 10:07:14 +0000
Subject: [issue46212] Avoid temporary `varargs` tuple creation in argument
 passing
In-Reply-To: <1640945147.14.0.155789461509.issue46212@roundup.psfhosted.org>
Message-ID: <1640945234.29.0.67935811894.issue46212@roundup.psfhosted.org>


Change by colorfulappl <colorfulappl at qq.com>:


----------
keywords: +patch
pull_requests: +28527
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30312

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46212>
_______________________________________

From report at bugs.python.org  Fri Dec 31 05:18:07 2021
From: report at bugs.python.org (colorfulappl)
Date: Fri, 31 Dec 2021 10:18:07 +0000
Subject: [issue46212] Avoid temporary `varargs` tuple creation in argument
 passing
In-Reply-To: <1640945147.14.0.155789461509.issue46212@roundup.psfhosted.org>
Message-ID: <1640945887.73.0.115848516756.issue46212@roundup.psfhosted.org>


colorfulappl <colorfulappl at qq.com> added the comment:

I wrote some microbenchs.

Patch: https://github.com/python/cpython/pull/30312/commits/b68176d081e19a3cedbaf2cdb31ecd7690421ec8

Environment:
macOS 12.1
clang 13.0.0
configure with --enable-optimizations

Result on microbench:

```
+--------------------------------------------+-------------------------+------------------------+
| Benchmark                                  | ./opt_baseline/res.json | ./opt_patched/res.json |
+============================================+=========================+========================+
| print(a, b, c)                             | 917 ns                  | 820 ns: 1.12x faster   |
+--------------------------------------------+-------------------------+------------------------+
| print(a, b, c, *v)                         | 1.56 us                 | 1.62 us: 1.04x slower  |
+--------------------------------------------+-------------------------+------------------------+
| print(a, sep='', file=stdout)              | 376 ns                  | 295 ns: 1.27x faster   |
+--------------------------------------------+-------------------------+------------------------+
| print(*v, sep='', flush=True, file=stdout) | 2.02 us                 | 1.94 us: 1.04x faster  |
+--------------------------------------------+-------------------------+------------------------+
| Geometric mean                             | (ref)                   | 1.05x faster           |
+--------------------------------------------+-------------------------+------------------------+

Benchmark hidden because not significant (3): print(a), print(a, sep='', flush=True, file=stdout), print(a, b, c, *v, sep='', flush=True, file=stdout)
```

----------
Added file: https://bugs.python.org/file50533/bench-print.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46212>
_______________________________________

From report at bugs.python.org  Fri Dec 31 06:04:46 2021
From: report at bugs.python.org (Erlend E. Aasland)
Date: Fri, 31 Dec 2021 11:04:46 +0000
Subject: [issue46212] Avoid temporary `varargs` tuple creation in argument
 passing
In-Reply-To: <1640945147.14.0.155789461509.issue46212@roundup.psfhosted.org>
Message-ID: <1640948686.76.0.385616883364.issue46212@roundup.psfhosted.org>


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

Note that _PyArg_UnpackKeywordsWithVararg is defined with PyAPI_FUNC. Changing its argument spec is strictly a backwards incompatible change, IIUC.

----------
nosy: +BTaskaya

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46212>
_______________________________________

From report at bugs.python.org  Fri Dec 31 06:32:42 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 31 Dec 2021 11:32:42 +0000
Subject: [issue45569] Drop support for 15-bit PyLong digits?
In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org>
Message-ID: <1640950362.69.0.706847889728.issue45569@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> I've created PR GH-30306 to find out.

Results: we have two Gentoo/x86 buildbots, and a 32-bit Windows build in GitHub Actions: those machines use 15-bit digits, as a result of the logic in pyport.h that chooses 15-bit digits if SIZEOF_VOID_P < 8. Everything else seems to be using 30-bit digits.

GPS pointed out in the python-dev discussion that the other platform we should be thinking about is 32-bit ARM.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45569>
_______________________________________

From report at bugs.python.org  Fri Dec 31 06:53:49 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 31 Dec 2021 11:53:49 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640951629.91.0.329976803249.issue37295@roundup.psfhosted.org>


Change by Mark Dickinson <dickinsm at gmail.com>:


----------
pull_requests: +28529
pull_request: https://github.com/python/cpython/pull/30313

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Fri Dec 31 06:55:55 2021
From: report at bugs.python.org (Vinay Sajip)
Date: Fri, 31 Dec 2021 11:55:55 +0000
Subject: [issue46200] Discourage logging f-strings due to security
 considerations
In-Reply-To: <1640850255.25.0.496981368409.issue46200@roundup.psfhosted.org>
Message-ID: <1640951755.18.0.0826684327811.issue46200@roundup.psfhosted.org>


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

Another (minor) point against using f-strings or .format is that formatting prematurely might be doing unnecessary work - by default, logging formats messages lazily, waiting until a message actually needs to be output. This could perhaps be more prominently emphasized in the docs where formatting is first introduced.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46200>
_______________________________________

From report at bugs.python.org  Fri Dec 31 07:15:26 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 31 Dec 2021 12:15:26 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640952926.87.0.53928669937.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> I'd be happy to change the implementation to use the trailing zero counts as suggested.

Done in GH-30313 (though this will conflict with Serhiy's PR).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Fri Dec 31 08:07:27 2021
From: report at bugs.python.org (Arie Bovenberg)
Date: Fri, 31 Dec 2021 13:07:27 +0000
Subject: [issue46200] Discourage logging f-strings due to security
 considerations
In-Reply-To: <1640850255.25.0.496981368409.issue46200@roundup.psfhosted.org>
Message-ID: <1640956047.21.0.0768378681668.issue46200@roundup.psfhosted.org>


Arie Bovenberg <a.c.bovenberg at gmail.com> added the comment:

Absolutely agree! In practice I find some people are not swayed by this argument -- and prefer the readability of f-strings. 

My expectation is that a clear recommendation in the official docs will convince more people. Especially if there are security concerns.

Do you have an opinion on the 3 questions I highlighted?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46200>
_______________________________________

From report at bugs.python.org  Fri Dec 31 08:36:22 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 31 Dec 2021 13:36:22 +0000
Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+
In-Reply-To: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org>
Message-ID: <1640957782.63.0.194570623314.issue46208@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

Yep, it's a bug and should be fixed.

I'm still not back coding yet, but I'll get to it once I am if nobody else gets there first. This is going to affect getpath.py in the native implementation, so it ought to be fixed there (and we need tests for this case, since it's apparently a gap).

----------
priority: normal -> release blocker

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46208>
_______________________________________

From report at bugs.python.org  Fri Dec 31 08:40:47 2021
From: report at bugs.python.org (Jason R. Coombs)
Date: Fri, 31 Dec 2021 13:40:47 +0000
Subject: [issue46109] Separate resources docs from other importlib docs
In-Reply-To: <1639707006.6.0.710997331931.issue46109@roundup.psfhosted.org>
Message-ID: <1640958047.13.0.192531736181.issue46109@roundup.psfhosted.org>


Change by Jason R. Coombs <jaraco at jaraco.com>:


----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46109>
_______________________________________

From report at bugs.python.org  Fri Dec 31 08:47:55 2021
From: report at bugs.python.org (Steve Dower)
Date: Fri, 31 Dec 2021 13:47:55 +0000
Subject: [issue46171] venv module produces spurious warning that location has
 moved
In-Reply-To: <1640338191.84.0.15434906765.issue46171@roundup.psfhosted.org>
Message-ID: <1640958475.12.0.211926305204.issue46171@roundup.psfhosted.org>


Steve Dower <steve.dower at python.org> added the comment:

My VHDX mounted in a directory is affected by this, and actually broke a couple of tools until I also mounted it as a drive. (Using a VHDX helps bypass a lot of filesystem related perf impacts on Windows, so it's worth the occasional broken tool.)

I suspect (but haven't tested) that some file sharing handlers or attached devices could also hit it - thinking here of IoT devices that provide a filesystem-like interface.

Either way, I don't think the warning is spurious, and while it's not particularly helpful for people who pass in 8.3 names that are then expanded (it shouldn't ever happen the other way), that's easily fixed on the user's side. (And tempfile, which clearly needs fixing.)

I'm also *strongly against* warnings/errors that only occur based on a decision you made ages ago (or that someone else made for you), such as how you installed Python. Right now we have a warning that can be explained in exactly the same way on every platform and every circumstance, but Eryk's proposal/preference would suddenly make the case for the warning way too complex. Tutorials and teachers don't get to ignore it just because it only happens to some of their readers/students, and so we only make things worse for them by making it harder to understand. Better to have a simple, consistent message in this case.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46171>
_______________________________________

From report at bugs.python.org  Fri Dec 31 09:22:47 2021
From: report at bugs.python.org (Dennis Sweeney)
Date: Fri, 31 Dec 2021 14:22:47 +0000
Subject: [issue46192] Optimize builtin functions min() and max()
In-Reply-To: <1640772295.19.0.507214715597.issue46192@roundup.psfhosted.org>
Message-ID: <1640960567.38.0.543020193305.issue46192@roundup.psfhosted.org>


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

Kind of like what's mentioned at https://github.com/faster-cpython/ideas/discussions/131 , it may be interesting to explore implementing min()/max() in Pure python, considering recent specializations to COMPARE_OP, and potential future specializations of FOR_ITER.

----------
nosy: +Dennis Sweeney

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46192>
_______________________________________

From report at bugs.python.org  Fri Dec 31 11:11:15 2021
From: report at bugs.python.org (DonaldDuck313)
Date: Fri, 31 Dec 2021 16:11:15 +0000
Subject: [issue46213] webbrowser.open doesn't work in Termux
Message-ID: <1640967075.78.0.947803082888.issue46213@roundup.psfhosted.org>


New submission from DonaldDuck313 <kalle.anka.ank at gmail.com>:

In Termux, if I type the following code, I would expect it to open the URL in a browser, but it does nothing:

import webbrowser
webbrowser.open("http://example.com")

----------
components: Library (Lib)
messages: 409422
nosy: DonaldDuck1313
priority: normal
pull_requests: 28530
severity: normal
status: open
title: webbrowser.open doesn't work in Termux
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46213>
_______________________________________

From report at bugs.python.org  Fri Dec 31 11:29:25 2021
From: report at bugs.python.org (Tim Peters)
Date: Fri, 31 Dec 2021 16:29:25 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640968165.61.0.706517352536.issue46187@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

Suppose we added isqrt_rem(n), returning the integer pair (i, rem) such that

    n == i**2 + rem
    0 <= rem <= 2*i

Then:

- Want the floor of sqrt(n)? i.
- The ceiling? i + (rem != 0).
- Rounded? i + (rem > i).
- Is n a perfect square? not rem.

That's how mpz addresses these, although it has a different function to compute the floor without returning the remainder too.

I wouldn't object to that - just +0, though. Depending on implementation details, which I haven't investigated, it may or may not be materially faster than doing:

def isqrt_rem(n):
    return (i := isqrt(n)), n - i*i

myself.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Fri Dec 31 11:46:09 2021
From: report at bugs.python.org (Eryk Sun)
Date: Fri, 31 Dec 2021 16:46:09 +0000
Subject: [issue46171] venv module produces spurious warning that location has
 moved
In-Reply-To: <1640338191.84.0.15434906765.issue46171@roundup.psfhosted.org>
Message-ID: <1640969169.28.0.312849750307.issue46171@roundup.psfhosted.org>


Eryk Sun <eryksun at gmail.com> added the comment:

> My VHDX mounted in a directory is affected by this

I created a VHDX and mounted it in a directory. It's just a regular volume mount point with a junction (IO_REPARSE_TAG_MOUNT_POINT). That won't cause any problems, so I guess your setup must be different in some way.

> I suspect (but haven't tested) that some file sharing handlers or 
> attached devices could also hit it - thinking here of IoT devices
> that provide a filesystem-like interface.

My takeaway is that because filesystem filter drivers on some systems may arbitrarily redirect some paths in some cases, and redirect differently or not at all in some other context, then we need to always log a warning showing the real path and always embed the real path in pip.exe. The only clear example we have is bpo-45337, but we're erring on the side of caution instead of targeting the warning at the one known case. The generic approach happens to also include any common use of directory symbolic links or junctions, but it's not practical to handle them differently. You're open to special casing short DOS names, however, e.g. by comparing the real path to the long path name from GetLongPathNameW().

Note that if the user continues to use the path with a reparse point or redirection to access the virtual environment (if possible; it's not for bpo-45337), then running `python -m pip` will install scripts or executable script wrappers that refer to the accessed path, not the real path. pip uses distlib for entrypoint scripts. Apparently distlib doesn't resolve the real path of sys.executable when creating the script shebang.

For POSIX, including macOS, I don't know the range of possibilities for dependent filesystem redirection. Bind mounts (i.e. mounting an arbitrary path on a directory) can be an issue since they're temporary unless configured in /etc/fstab. However, we can't do anything to warn about them because POSIX realpath() doesn't resolve them.

> warning that can be explained in exactly the same way on every platform

I guess you mean every edition of Windows.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46171>
_______________________________________

From report at bugs.python.org  Fri Dec 31 12:07:49 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 31 Dec 2021 17:07:49 +0000
Subject: [issue46214] Remove unused opcode ROT_FOUR
Message-ID: <1640970469.6.0.457340037474.issue46214@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
assignee: iritkatriel
components: Interpreter Core
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Remove unused opcode ROT_FOUR
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46214>
_______________________________________

From report at bugs.python.org  Fri Dec 31 12:14:55 2021
From: report at bugs.python.org (Irit Katriel)
Date: Fri, 31 Dec 2021 17:14:55 +0000
Subject: [issue46214] Remove unused opcode ROT_FOUR
Message-ID: <1640970895.34.0.29724442658.issue46214@roundup.psfhosted.org>


Change by Irit Katriel <iritkatriel at gmail.com>:


----------
keywords: +patch
pull_requests: +28531
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30314

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46214>
_______________________________________

From report at bugs.python.org  Fri Dec 31 12:30:18 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 31 Dec 2021 17:30:18 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640971818.45.0.0494244780381.issue46187@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

A new function isqrt_rem seems like a reasonably natural addition. (Though I'd call it "isqrtrem", partly by analogy with "divmod", and partly because the math module isn't very good at doing underscores.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Fri Dec 31 12:33:21 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 31 Dec 2021 17:33:21 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640972001.46.0.886502787963.issue46187@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Mark didn't mention his use case for rounded isqrt

Mainly for emulation of floating-point sqrt. But the number of times I've needed rounded integer square root is small compared with the number of times I've needed rounded integer division.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Fri Dec 31 13:08:21 2021
From: report at bugs.python.org (Tim Peters)
Date: Fri, 31 Dec 2021 18:08:21 +0000
Subject: [issue46187] Optionally support rounding for math.isqrt()
In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org>
Message-ID: <1640974101.66.0.147147513834.issue46187@roundup.psfhosted.org>


Tim Peters <tim at python.org> added the comment:

The name "isqrtrem" works fine for me too, and, indeed, is even more reminiscent of mpz's workalike function.

> the number of times I've needed rounded integer square root
> is small compared with the number of times I've needed rounded
> integer division

Speaking of which, the analogy to divmod extends just beyond the lack of an underscore in the name ;-) divmod() allows easy emulation of any division rounding mode, and an instant answer to "was the division exact?". isqrtrem() would support the same for square roots.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46187>
_______________________________________

From report at bugs.python.org  Fri Dec 31 13:39:51 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 31 Dec 2021 18:39:51 +0000
Subject: [issue46204] Graphlib documentation (general cleanup)
In-Reply-To: <1640871752.23.0.818403233457.issue46204@roundup.psfhosted.org>
Message-ID: <1640975991.14.0.186656766085.issue46204@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

Could you say a little more about this?  Precisely: what are the problems you identified?

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46204>
_______________________________________

From report at bugs.python.org  Fri Dec 31 14:03:30 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 31 Dec 2021 19:03:30 +0000
Subject: [issue46196] documentation for cmd library should include columnize()
 function
In-Reply-To: <1640817357.67.0.539360584483.issue46196@roundup.psfhosted.org>
Message-ID: <1640977410.11.0.779713495617.issue46196@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

The method is called from one place only, but the fact that it is its own method and has dedicated tests seems to indicate that it was meant as standalone piece of functionality.  We can?t be sure of original intent given that no method in the class uses the `_` prefix naming convention, but I think it?s fine to document the function and so make it officially public now.

----------
nosy: +eric.araujo
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46196>
_______________________________________

From report at bugs.python.org  Fri Dec 31 14:12:04 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Fri, 31 Dec 2021 19:12:04 +0000
Subject: [issue46198] Duplicated test name `test_get_unstructured_invalid_ew`
 in `test__header_value_parser.py`
In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org>
Message-ID: <1640977924.02.0.891900303151.issue46198@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

Also fund a duplicate TestHelpers class in test_enum.

A warning for duplicate method is a false positive, because the two methods are used on different python versions.  But the first method uses `self.Grades.B` wrongly (should be `Grades.B`) so it will break when python 3.12 is started!

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46198>
_______________________________________

From report at bugs.python.org  Fri Dec 31 14:35:56 2021
From: report at bugs.python.org (Joshua Bronson)
Date: Fri, 31 Dec 2021 19:35:56 +0000
Subject: [issue45670] New .mapping attribute is broken for some existing uses
 of dict views
In-Reply-To: <1635525410.44.0.846161043783.issue45670@roundup.psfhosted.org>
Message-ID: <1640979356.97.0.461050303744.issue45670@roundup.psfhosted.org>


Joshua Bronson <jabronson at gmail.com> added the comment:

Dear Raymond,

Thanks so much for the detailed response!

I wonder if you could explain how this case is different from the following:

>>> c = collections.ChainMap({1: 1}, {1: 2})
>>> iter(c)
<dict_keyiterator object at ...>
>>> isinstance(c, dict)  # it's fine, we <3 duck typing!
False


Now suppose a new .mapping attribute were added to dict_keyiterator objects in a future version of Python, like the one that was added to dict view objects in Python 3.10. Then, wouldn't ChainMap find itself in a similar predicament as this issue is raising?

>>> iter(c).mapping
mappingproxy({1: None})


As in my example above, the {1: None} mapping here is an implementation detail of ChainMap.__iter__() that was never intended to be leaked to users. (Ref: <https://github.com/python/cpython/blob/e18d815/Lib/collections/__init__.py#L998-L1002>)

Note also that ChainMap.__iter__() returns a dict_keyiterator object even though issubclass(ChainMap, dict) is False. We consider this just fine though, because the dict_keyiterator object currently behaves exactly like the generator object we would get if the code had done a `yield from d` rather than a `return iter(d)`. Except for being faster.

This parallels the implementations of bidict.keys()/values()/items(), which currently return dict_keys/dict_values/dict_items objects generated from internal data, that behave exactly like KeysViews(b)/ValuesView(b)/ItemsView(b) would*, except for being faster. And, as this issue is raising, except for this new .mapping attribute in Python 3.10+ now leaking internal state.

* I even have the passing property-based tests to prove it: <https://github.com/jab/bidict/pull/217/files#diff-995af13b14fe897c5d200fa97ed88fad03e401b2fc0cc167624d482ea512ba96R431-R459> :)


(I also have counterpoints for your other feedback, but wanted to post this part first. And sorry for my delay in responding ? hope it's not too late! And finally thanks so much again for considering this and for the time you took to give feedback on bidict ??there's literally no better-qualified person in the world. I so appreciate it!)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45670>
_______________________________________

From report at bugs.python.org  Fri Dec 31 14:52:34 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 31 Dec 2021 19:52:34 +0000
Subject: [issue37295] Possible optimizations for math.comb()
In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org>
Message-ID: <1640980354.72.0.0728648732479.issue37295@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:


New changeset 0b58bac3e7877d722bdbd3c38913dba2cb212f13 by Mark Dickinson in branch 'main':
bpo-37295: More direct computation of power-of-two factor in math.comb (GH-30313)
https://github.com/python/cpython/commit/0b58bac3e7877d722bdbd3c38913dba2cb212f13


----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________

From report at bugs.python.org  Fri Dec 31 15:11:46 2021
From: report at bugs.python.org (Ned Deily)
Date: Fri, 31 Dec 2021 20:11:46 +0000
Subject: [issue46197] ensurepip bootstrap breaks out of isolated environment
In-Reply-To: <1640820251.78.0.719610352005.issue46197@roundup.psfhosted.org>
Message-ID: <1640981506.12.0.157867536773.issue46197@roundup.psfhosted.org>


Change by Ned Deily <nad at python.org>:


----------
nosy: +dstufft, ncoghlan, pradyunsg

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46197>
_______________________________________

From report at bugs.python.org  Fri Dec 31 15:34:19 2021
From: report at bugs.python.org (Mark Dickinson)
Date: Fri, 31 Dec 2021 20:34:19 +0000
Subject: [issue46199] Calculation influenced by print
In-Reply-To: <1640831002.13.0.0752515074236.issue46199@roundup.psfhosted.org>
Message-ID: <1640982859.79.0.392333481182.issue46199@roundup.psfhosted.org>


Mark Dickinson <dickinsm at gmail.com> added the comment:

When you do:

    FINUB = np.empty(len(close))
    FINLB = np.empty(len(close))

you're creating two *uninitialised* arrays of values. (See the NumPy documentation at https://numpy.org/doc/stable/reference/generated/numpy.empty.html.)

When you then do 

    FINUB[i] = UB[i] if UB[i] < FINUB[i-1] \
            	and close[i-1] > FINUB[i] else FINUB[i-1]

on the first iteration of the loop (i = 1), you make use of the (undefined) value in FINUB[0] to compute FINUB[1].

In other words, this is a bug in your code, rather than in Python or NumPy.

----------
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46199>
_______________________________________

From report at bugs.python.org  Fri Dec 31 15:46:44 2021
From: report at bugs.python.org (=?utf-8?q?beda_pi=C5=A1l?=)
Date: Fri, 31 Dec 2021 20:46:44 +0000
Subject: [issue46215] Wrong error line after using pdb
Message-ID: <1640983604.86.0.570920927154.issue46215@roundup.psfhosted.org>


New submission from beda pi?l <bedapisl at gmail.com>:

Consider simple script:
```
for i in range(1):
    import pdb
    pdb.set_trace()

x = y + z
```
After running it and pressing 'c' to continue:

```
test$ python test.py
> /Users/bedrich.pisl/test/test.py(1)<module>()
-> for i in range(1):
(Pdb) c
```
I get error, but with wrong error line
```
Traceback (most recent call last):
  File "/Users/bedrich.pisl/test/test.py", line 1, in <module>
    for i in range(1):
NameError: name 'y' is not defined
```
The error is actually on line 5 not 1.

----------
components: Library (Lib)
messages: 409434
nosy: bedapisl
priority: normal
severity: normal
status: open
title: Wrong error line after using pdb
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46215>
_______________________________________

From report at bugs.python.org  Fri Dec 31 15:57:57 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Fri, 31 Dec 2021 20:57:57 +0000
Subject: [issue25478] Consider adding a normalize() method to
 collections.Counter()
In-Reply-To: <1445826280.05.0.307309053044.issue25478@psf.upfronthosting.co.za>
Message-ID: <1640984277.45.0.632208928818.issue25478@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Withdrawing the suggestions for scaled_to() and scaled_by().  Am thinking that people are mostly better off with a dict comprehension where they can control the details of rounding and type conversions.

----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25478>
_______________________________________

From report at bugs.python.org  Fri Dec 31 16:37:11 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 31 Dec 2021 21:37:11 +0000
Subject: [issue46177] can't install launcher for all users
In-Reply-To: <1640458842.49.0.0625081718975.issue46177@roundup.psfhosted.org>
Message-ID: <1640986631.74.0.242440977747.issue46177@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


Removed file: https://bugs.python.org/file50521/Annotation 2021-12-25 165843.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46177>
_______________________________________

From report at bugs.python.org  Fri Dec 31 16:37:25 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 31 Dec 2021 21:37:25 +0000
Subject: [issue46177] can't install launcher for all users
In-Reply-To: <1640459320.22.0.0375171048131.issue46177@roundup.psfhosted.org>
Message-ID: <1640986645.58.0.12812292864.issue46177@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
Removed message: https://bugs.python.org/msg409173

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46177>
_______________________________________

From report at bugs.python.org  Fri Dec 31 16:39:45 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 31 Dec 2021 21:39:45 +0000
Subject: [issue46180] Button clicked failed when mouse hover tooltip and
 tooltip destroyed
In-Reply-To: <1640515148.68.0.766649384181.issue46180@roundup.psfhosted.org>
Message-ID: <1640986785.35.0.390991538942.issue46180@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
nosy: +serhiy.storchaka
stage:  -> test needed
type: crash -> behavior
versions: +Python 3.11 -Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46180>
_______________________________________

From report at bugs.python.org  Fri Dec 31 16:51:02 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 31 Dec 2021 21:51:02 +0000
Subject: [issue46181] Destroying an expaned Combobox prevents Entry focus
 until Alt+Tab
In-Reply-To: <1640521278.35.0.92599921807.issue46181@roundup.psfhosted.org>
Message-ID: <1640987462.03.0.321764659309.issue46181@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Win10, Py 3.11: run combobug.py, click down arrow, click entry.  'changed' is printed to stdout (console or IDLE Shell).
Cursor not visible and clicking on remaining entry box does nothing.
Click on another window and back to entry box.
Cursor is present in box and clicking keys enters characters.

I am not sure is this is tkinter bug or tk 8.6.12 bug or program bug.
On Windows, .focus_force is often needed to get focus properly.
I may be seeing same thing with IDLE entry boxes, but have not investigated thoroughly yet.

----------
nosy: +epaine, serhiy.storchaka, terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46181>
_______________________________________

From report at bugs.python.org  Fri Dec 31 17:29:58 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 31 Dec 2021 22:29:58 +0000
Subject: [issue46206] Crash when editing emoji containing strings
In-Reply-To: <1640890820.86.0.186821451382.issue46206@roundup.psfhosted.org>
Message-ID: <1640989798.83.0.321671554342.issue46206@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

On Win10 command prompt, ? is initially displayed as 2 boxes, subsequently as box-space.  Besides this, editing works fine and when Entered, the string is echoed.

----------
nosy: +pablogsal, terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46206>
_______________________________________

From report at bugs.python.org  Fri Dec 31 17:37:58 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Fri, 31 Dec 2021 22:37:58 +0000
Subject: [issue46213] webbrowser.open doesn't work in Termux
In-Reply-To: <1640967075.78.0.947803082888.issue46213@roundup.psfhosted.org>
Message-ID: <1640990278.53.0.763437704222.issue46213@roundup.psfhosted.org>


Terry J. Reedy <tjreedy at udel.edu> added the comment:

https://termux.com/ "Termux is an Android terminal emulator [on Android] and Linux environment app"

I don't believe that core devs (and b.p.o.) support running Python on Android.  If so, this should be closed here and your question redirected to whoever supplied your Android python installer.  They might just say that Termux is not a supported terminal.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46213>
_______________________________________

From report at bugs.python.org  Fri Dec 31 18:04:18 2021
From: report at bugs.python.org (Nikita Sobolev)
Date: Fri, 31 Dec 2021 23:04:18 +0000
Subject: [issue46198] Duplicated test name `test_get_unstructured_invalid_ew`
 in `test__header_value_parser.py`
In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org>
Message-ID: <1640991858.99.0.325132033412.issue46198@roundup.psfhosted.org>


Nikita Sobolev <mail at sobolevn.me> added the comment:

Eric, should I patch this as well in this issue? 
Or should I open a new one? Would be happy to fix it :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46198>
_______________________________________

From report at bugs.python.org  Fri Dec 31 18:55:38 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 31 Dec 2021 23:55:38 +0000
Subject: [issue46206] Crash when editing emoji containing strings
In-Reply-To: <1640890820.86.0.186821451382.issue46206@roundup.psfhosted.org>
Message-ID: <1640994938.16.0.742694805382.issue46206@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

This seems to be fixed on the main branch (at least I cannot reproduce it in the main branch). If so, this means that will be fixed in Python 3.10.2.

10maurycy10, could you please confirm that this is indeed the case?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46206>
_______________________________________

From report at bugs.python.org  Fri Dec 31 18:55:51 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 31 Dec 2021 23:55:51 +0000
Subject: [issue46206] Crash when editing emoji containing strings
In-Reply-To: <1640890820.86.0.186821451382.issue46206@roundup.psfhosted.org>
Message-ID: <1640994951.03.0.533338152171.issue46206@roundup.psfhosted.org>


Change by Pablo Galindo Salgado <pablogsal at gmail.com>:


----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46206>
_______________________________________

From report at bugs.python.org  Fri Dec 31 18:56:33 2021
From: report at bugs.python.org (Pablo Galindo Salgado)
Date: Fri, 31 Dec 2021 23:56:33 +0000
Subject: [issue46206] Crash when editing emoji containing strings
In-Reply-To: <1640890820.86.0.186821451382.issue46206@roundup.psfhosted.org>
Message-ID: <1640994993.12.0.202011912182.issue46206@roundup.psfhosted.org>


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Example:

>>> ___?
  File "<stdin>", line 1
    ___?
       ^
SyntaxError: invalid character '?' (U+1F600)
>>> __?
  File "<stdin>", line 1
    __?
      ^
SyntaxError: invalid character '?' (U+1F600)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46206>
_______________________________________

From report at bugs.python.org  Fri Dec 31 19:00:50 2021
From: report at bugs.python.org (Emery Berger)
Date: Sat, 01 Jan 2022 00:00:50 +0000
Subject: [issue46216] spurious link to os.system() from os.times()
 documentation entry
Message-ID: <1640995250.13.0.0626118666649.issue46216@roundup.psfhosted.org>


New submission from Emery Berger <emery.berger at gmail.com>:

This is a minor documentation nit.

Under the entry for `os.times()`, there is a description of the various fields it returns (e.g., `user`, `system`).

```os.times()
Returns the current global process times. The return value is an object with five attributes:

user - user time

system - system time
```

For the latter, the word `system` is hyperlinked to the `os.system()` entry. This probably goes without saying, but there's no logical relationship of system time (time spent in the kernel on behalf of the process) to the system command (which invokes a command via a shell), so the link should be removed.

----------
assignee: docs at python
components: Documentation
messages: 409442
nosy: docs at python, emery.berger
priority: normal
severity: normal
status: open
title: spurious link to os.system() from os.times() documentation entry
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46216>
_______________________________________

From report at bugs.python.org  Fri Dec 31 19:25:24 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 01 Jan 2022 00:25:24 +0000
Subject: [issue45670] New .mapping attribute is broken for some existing uses
 of dict views
In-Reply-To: <1635525410.44.0.846161043783.issue45670@roundup.psfhosted.org>
Message-ID: <1640996724.49.0.582091218707.issue45670@roundup.psfhosted.org>


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

To the list of four options I suggested for bidict, you can add one more.  Create a feature request for a C implementation of collections.abc.KeyView. ISTM that your core issue is that bidict won't use the intended and guaranteed solution because the KeysView ABC is thought to be too slow (you should test this -- the `yield from self._mapping` code is very fast).


> .mapping attribute in Python 3.10+ now leaking internal state.

We do not agree on this essential point.  The "leak", as in "all abstractions are leaky", is in the bidict code, not in the dict_keys code.  The .mapping attribute itself is accurately refers to its underlying mapping.

This is consistent with how other wrappers provide a __wrapped__ attribute (or __fget__, __func__, func, maps, etc).  If some class ever uses an lru_cache, cache, property, boundmethod, partial object, or chainmap, then it is possible for the user to unwrap one level of abstraction.


> Now suppose a new .mapping attribute were added to dict_keyiterator objects in a future version of Python

We don't do that for iterator objects.  If we did, then ChainMap would have the same options as bidict has.  Most likely, we would leave it as an undocumented, non-guaranteed implementation detail (much like random.randrange is a bound method with a __func__ attribute rather than an actual function).

If we thought users really cared about the exact object returned and its full API, then we would have several options:
1) Document that that aspect of the API is non-guaranteed,
2) Document that that aspect is guaranteed.  This would lock in our design choice forever, but all allow users the opportunity to exploit the new capability.
3) Wrap the iterator to hide parts of the API we don't want to expose.  For example, return `chain(d)` instead of `iter(d)`.


> I even have the passing property-based tests to prove it

That tests an invented property that isn't true and wasn't ever intended to be true: "The API of the concrete dict_keys type is the same as the API of KeysView ABC".  The correct property is: "The API of the concrete dict_keys type implements the KeysView ABC but may do other things as well". This is the common and normal relationship between ABCs and concrete classes.  It is no more surprising that Mapping not supporting __or__ while dict does.


> I also have counterpoints for your other feedback,

I fear that we have an asymmetry of time available to explore every possible nuance including the counterfactual you gave in the last post.  Doing so eats heavily into my limited time available for development.

I don't think there is more that can be done here.  We already have an official and supported API for your purpose. The dict_keys concrete API is unlikely to ever be built-out as a general purpose optimization of the KeysView ABC (that violates a number of design principles regarding separation of concerns, tight coupling, premature optimization, and the proper relationship between concrete and abstract classes).

Please consider using one of the four options (now up to five) that I suggested previously.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45670>
_______________________________________

From report at bugs.python.org  Fri Dec 31 19:31:31 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Sat, 01 Jan 2022 00:31:31 +0000
Subject: [issue46198] Duplicated test name `test_get_unstructured_invalid_ew`
 in `test__header_value_parser.py`
In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org>
Message-ID: <1640997091.11.0.0830428308178.issue46198@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

Sometimes people fix small things in multiple modules, sometimes they create separate tickets to have one patch per module with reviews from different maintainers and so on.  For this case, I check pyflakes and found a handful of true positives, so I would retitle the ticket to be about duplicate methods in tests.

----------
Added file: https://bugs.python.org/file50534/duplicate-test-methods.diff

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46198>
_______________________________________

From report at bugs.python.org  Fri Dec 31 20:16:06 2021
From: report at bugs.python.org (Marc Mueller)
Date: Sat, 01 Jan 2022 01:16:06 +0000
Subject: [issue46197] ensurepip bootstrap breaks out of isolated environment
In-Reply-To: <1640820251.78.0.719610352005.issue46197@roundup.psfhosted.org>
Message-ID: <1640999766.59.0.218070245373.issue46197@roundup.psfhosted.org>


Change by Marc Mueller <cdce8p at gmail.com>:


----------
nosy: +cdce8p

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46197>
_______________________________________

From report at bugs.python.org  Fri Dec 31 20:28:36 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 01 Jan 2022 01:28:36 +0000
Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes?
Message-ID: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org>


New submission from Terry J. Reedy <tjreedy at udel.edu>:

Installed 3.11.0a3 was built Dec  8 2021, 22:56:33.  My corresponding repository build is a bit older than that.  Rebuilding now I get
  fileutils.c
..\Python\fileutils.c(2132): error C2065: 'PATHCCH_FORCE_ENABLE_LONG_NAME_PROCE
SS': undeclared identifier [f:\dev\3x\PCbuild\_freeze_module.vcxproj]

I have likely seen this before today but mistook the error message for a warning and did not check the respository build date.  3.9 and 3.10 just update normally, so unique to 3.11 and apparently new freeze changes.

----------
components: Build
messages: 409445
nosy: terry.reedy
priority: normal
severity: normal
status: open
title: 3.11 build failure on Win10: new _freeze_module changes?
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46217>
_______________________________________

From report at bugs.python.org  Fri Dec 31 20:28:51 2021
From: report at bugs.python.org (Terry J. Reedy)
Date: Sat, 01 Jan 2022 01:28:51 +0000
Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes?
In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org>
Message-ID: <1641000531.46.0.432950564096.issue46217@roundup.psfhosted.org>


Change by Terry J. Reedy <tjreedy at udel.edu>:


----------
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46217>
_______________________________________

From report at bugs.python.org  Fri Dec 31 20:44:16 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 01 Jan 2022 01:44:16 +0000
Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library"
In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org>
Message-ID: <1641001456.66.0.354878002287.issue46079@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
keywords: +patch
pull_requests: +28532
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30315

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46079>
_______________________________________

From report at bugs.python.org  Fri Dec 31 20:45:43 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Sat, 01 Jan 2022 01:45:43 +0000
Subject: [issue24132] Direct sub-classing of pathlib.Path
In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za>
Message-ID: <1641001543.55.0.799873435657.issue24132@roundup.psfhosted.org>


Change by ?ric Araujo <merwok at netwok.org>:


----------
versions: +Python 3.11 -Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24132>
_______________________________________

From report at bugs.python.org  Fri Dec 31 20:46:40 2021
From: report at bugs.python.org (Tim Peters)
Date: Sat, 01 Jan 2022 01:46:40 +0000
Subject: [issue46218] Change long_pow() to sliding window algorithm
Message-ID: <1641001599.99.0.180996324134.issue46218@roundup.psfhosted.org>


New submission from Tim Peters <tim at python.org>:

As discussed on python-dev, it would be nice to break long_pow()'s reliance on that the number of bits in a CPython long "digit" is a multiple of 5.

Moving to the sliding-window algorithm would do that (it has to be able to cross digit boundaries to fill the current window), and would be better on some other counts too: the precomputed table can be half the size (or we can add an extra bit to the window for the same table size), and it can - depending on exponent bit patterns - sometimes reduce the number of multiplies needed too.

So I intend to do that, and bump the window size from 5 to 6 (which would yield a significant, although modest, speed improvement for giant-exponent cases).

----------
assignee: tim.peters
components: Interpreter Core
messages: 409446
nosy: tim.peters
priority: normal
severity: normal
stage: needs patch
status: open
title: Change long_pow() to sliding window algorithm
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46218>
_______________________________________

From report at bugs.python.org  Fri Dec 31 21:06:28 2021
From: report at bugs.python.org (Steven D'Aprano)
Date: Sat, 01 Jan 2022 02:06:28 +0000
Subject: [issue46213] webbrowser.open doesn't work in Termux
In-Reply-To: <1640967075.78.0.947803082888.issue46213@roundup.psfhosted.org>
Message-ID: <1641002788.48.0.848065065268.issue46213@roundup.psfhosted.org>


Steven D'Aprano <steve+python at pearwood.info> added the comment:

I think the existence of sys.getandroidapilevel is evidence that Android is somewhat supported, even if it is not supported to the same degree that Linux and Windows are.

https://docs.python.org/3/library/sys.html#sys.getandroidapilevel

See also:

https://mail.python.org/pipermail/python-dev/2017-December/151171.html

for a longer discussion. There's an Android build factory

https://github.com/python/buildmaster-config/pull/26

but I cannot see an official Android buildbot running.

https://buildbot.python.org/all/#/

The PR seems straightforward and simple to me, but I'm not an expert on the webbrowser module nor do I have an Android where I can test it to see if it works.

DonaldDuck1313, your NEWS entry needs to be re-written to use ReST (Restructured Text) rather than Markdown:

Change: [Termux](https://termux.com/)

to `Termux <https://termux.com/>`_

----------
nosy: +steven.daprano, xdegaye
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46213>
_______________________________________

From report at bugs.python.org  Fri Dec 31 21:09:23 2021
From: report at bugs.python.org (Raymond Hettinger)
Date: Sat, 01 Jan 2022 02:09:23 +0000
Subject: [issue46095] Improve SeqIter documentation
In-Reply-To: <1639648081.19.0.0569018631816.issue46095@roundup.psfhosted.org>
Message-ID: <1641002963.9.0.450413182072.issue46095@roundup.psfhosted.org>


Change by Raymond Hettinger <raymond.hettinger at gmail.com>:


----------
keywords: +patch
pull_requests: +28533
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30316

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46095>
_______________________________________

From report at bugs.python.org  Fri Dec 31 21:38:19 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 01 Jan 2022 02:38:19 +0000
Subject: [issue40236] datetime.datetime.strptime get day error
In-Reply-To: <1586426131.65.0.158262640104.issue40236@roundup.psfhosted.org>
Message-ID: <1641004699.14.0.329596777554.issue40236@roundup.psfhosted.org>


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

> I am open to discussion about trying to rationalize this behavior - it would be a bit tricky but if we moved to our own implementation of the algorithm to calculate %W we could detect this situation and throw an exception.

Paul: 

I'm guessing here but I think the design makes sense from a certain angle: consider that 0-th week is the first partial week of the year. For some date calculations you might want to go forward, and for others you may go back. If you're going back, it's easier to keep the year and the week the same and reference other days within that week, rather than decrementing the year and changing to 12th month.

This leaves the odd case of there being no partial week. Logically 0th week could refer to the last week of previous year, but that feels wrong because you're referring to it as a week of e.g. 2024 when all of its days are in 2023, so it's entirely a 2023 week.

So a precise definition would be to say that 0-th week is always the first week of the year, whether partial or full; while 1-th week is always the first full week. It follows from this definition that sometimes 0-th and 1-th are the same week.

I'll make a test PR to check if that's how time.strptime behaves on all platforms.

----------
nosy: +andrei.avk

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40236>
_______________________________________

From report at bugs.python.org  Fri Dec 31 21:48:20 2021
From: report at bugs.python.org (Andrei Kulakov)
Date: Sat, 01 Jan 2022 02:48:20 +0000
Subject: [issue40236] datetime.datetime.strptime get day error
In-Reply-To: <1586426131.65.0.158262640104.issue40236@roundup.psfhosted.org>
Message-ID: <1641005300.8.0.248210863758.issue40236@roundup.psfhosted.org>


Change by Andrei Kulakov <andrei.avk at gmail.com>:


----------
keywords: +patch
pull_requests: +28534
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30318

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40236>
_______________________________________

From report at bugs.python.org  Fri Dec 31 22:47:32 2021
From: report at bugs.python.org (Tim Peters)
Date: Sat, 01 Jan 2022 03:47:32 +0000
Subject: [issue46218] Change long_pow() to sliding window algorithm
In-Reply-To: <1641001599.99.0.180996324134.issue46218@roundup.psfhosted.org>
Message-ID: <1641008852.31.0.618250060476.issue46218@roundup.psfhosted.org>


Change by Tim Peters <tim at python.org>:


----------
keywords: +patch
pull_requests: +28535
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30319

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46218>
_______________________________________

From report at bugs.python.org  Fri Dec 31 23:40:17 2021
From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=)
Date: Sat, 01 Jan 2022 04:40:17 +0000
Subject: [issue46142] python --help output is too long
In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org>
Message-ID: <1641012017.03.0.79385042518.issue46142@roundup.psfhosted.org>


?ric Araujo <merwok at netwok.org> added the comment:

Do people think the man page should be shortened too?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46142>
_______________________________________