[issue46576] test_peg_generator is extremely slow

2022-02-03 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

for my purposes those PRs make it reasonable, even though it remains one of our 
slowest tests.  we can reopen/reuse this issue for any further 
test_peg_generator performance improvements as needed.

--
assignee:  -> gregory.p.smith
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed
versions: +Python 3.10, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS.

2022-02-03 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Something I forgot to mention: I don't think this is a bug in Tk now that I've 
looked into this more deeply. 

The integration problem between Tk and other users of the Cocoa event loop is 
unfortunate but not a bug.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46623] test_zlib: test_pair() and test_speech128() fail with s390x hardware accelerator

2022-02-03 Thread STINNER Victor


New submission from STINNER Victor :

test_pair() and test_speech128() tests of test_zlib fail on the s390x 
architecture if zlib uses the s390x hardware accelerator.

RHEL8 downstream issues (with most details):
https://bugzilla.redhat.com/show_bug.cgi?id=1974658

Fedora downstream issues:
https://bugzilla.redhat.com/show_bug.cgi?id=2038848

The s390x has a hardware accelerator for zlib. Depending if the hardware 
accelerator is used or not, the output (compress data) is different.

Also, test_zlib compress data in two different ways and then expect the same 
output. test_zlib pass with the software implementation which creates a single 
(final) compressed block. test_zlib fails with the hardware implementation 
which creates multiple compressed blocks (the last one is a final block).

Another reason the output differs is the FHT/DHT heuristic. The zlib deflate 
algorithm can analyze the data distribution and decide whether it wants to use 
a fixed-Huffman table (FHT) or a dynamic-Huffman table (DHT) for the next 
block, but the accelerator can't. Furthermore, looking at data in software 
would kill the accelerator performance. Therefore the following heuristic is 
used on s390x: the first 4k are compressed with FHT and the rest of the data 
with DHT. So, compress() creates a single FHT block. compressobj() creates a 
FHT block, a DHT block and a trailing block.

It is *not a bug* in zlib: the decompression gives back the original content as 
expected in all cases. The issue is that Python test_zlib makes too many 
assumptions on how "streamed" data should be compressed. The test expected that 
compressed data using different ways to call zlib would return the exact same 
compressed data. If an accelarator is used, it's not always the case.

--
components: Tests
messages: 412426
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_zlib: test_pair() and test_speech128() fail with s390x hardware 
accelerator
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46524] test_peg_generator takes 8 minutes on Windows

2022-02-03 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

test_peg_generator is significantly less of the long tail on optimized builds 
now.  CI extremely noisy performance wise (times vary by 2-3x without any 
differences anways) so I can't easily judge if this made a notable difference 
in windows CI latency.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46623] test_zlib: test_pair() and test_speech128() fail with s390x hardware accelerator

2022-02-03 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46615] Use-after-free by mutating set during set operations

2022-02-03 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46610] assertCountEqual doesn't work as expected for dictionary elements

2022-02-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Concur with Eric and Raymond.

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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46565] Delete module-level loop variables when no longer needed

2022-02-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 0cbdd2131195b0d313762968f604e80a3e65ca9f by Nikita Sobolev in 
branch 'main':
bpo-46565: `del` loop vars that are leaking into module namespaces (GH-30993)
https://github.com/python/cpython/commit/0cbdd2131195b0d313762968f604e80a3e65ca9f


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-02-03 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-02-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7ffe7ba30fc051014977c6f393c51e57e71a6648 by Nikita Sobolev in 
branch 'main':
bpo-46483: Remove `__class_getitem__` from `pathlib.PurePath` (GH-30848)
https://github.com/python/cpython/commit/7ffe7ba30fc051014977c6f393c51e57e71a6648


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__

2022-02-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b4bd1e1422997de61faf506b4916e83013bc7d21 by Zackery Spytz in 
branch 'main':
bpo-44977: Deprecate delegation of int to __trunc__ (GH-31031)
https://github.com/python/cpython/commit/b4bd1e1422997de61faf506b4916e83013bc7d21


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44977] Deprecate delegation of int to __trunc__

2022-02-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thanks Zackery.

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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42238] Deprecate suspicious.py?

2022-02-03 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +29282
pull_request: https://github.com/python/cpython/pull/31097

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45773] Compiler hangs during jump elimination

2022-02-03 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset e0433c1e70254d4d0357a9e14596929a04bdf769 by Brandt Bucher in 
branch 'main':
bpo-45773: Remove invalid peephole optimizations (GH-31066)
https://github.com/python/cpython/commit/e0433c1e70254d4d0357a9e14596929a04bdf769


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46524] test_peg_generator takes 8 minutes on Windows

2022-02-03 Thread STINNER Victor


STINNER Victor  added the comment:

Duration of the "Tests" step of https://github.com/python/cpython/pull/30890 

* GHA win32: 14 min 11 sec (test_peg_generator: 8 min 16 sec)
* GHA win64: 21 min 2 sec (test_peg_generator: 16 min 38 sec)
* Azure win32: 9 min 34 sec (test_peg_generator: 5 min 30 sec)
* Azure win64: 13 min 56 sec (test_peg_generator: 8 min 3 sec)

Duration of the "Tests" step of https://github.com/python/cpython/pull/31096 
(which includes Gregory's change):

* GHA win32: 8 min 30 sec (test_peg_generator: 5 min 1 sec)
* GHA win64: 8 min 29 sec (test_peg_generator: 4 min 52 sec)
* Azure win32: 9 min 54 sec (test_peg_generator: 4 min 19 sec)
* Azure win64: 7 min 57 sec (test_peg_generator: 3 min 32 sec)

test_peg_generator is way faster, and the total tests duration is shorter 
especially the maximum time: 21 min (before) => 10 min (after).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45380] help() appears confused about the module of typing.Annotated

2022-02-03 Thread jack1142


Change by jack1142 :


--
nosy: +jack1142

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42222] Modernize integer test/conversion in randrange()

2022-02-03 Thread Petr Viktorin


Petr Viktorin  added the comment:

Since this is a user-visible change in 3.11, could you add a What's New entry?

--
nosy: +petr.viktorin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46624] random.randrange removed support for non-integer types after just one release of deprecation

2022-02-03 Thread Miro Hrončok

New submission from Miro Hrončok :

In 
https://github.com/python/cpython/commit/5afa0a411243210a30526c7459a0ccff5cb88494
 the support for non-integer types was removed from random.randrange().

This change is not backward-compatible and it breaks 3rd party code, for 
example:

simplewrap: https://bugzilla.redhat.com/show_bug.cgi?id=2050093
numpy-stl: https://bugzilla.redhat.com/show_bug.cgi?id=2050092 == 
https://github.com/WoLpH/numpy-stl/issues/188

That support was only deprecated in Python 3.10 and it needs to remain 
deprecated for at least two Python releases. Please revert this change from 
Python 3.11 and wait for at least Python 3.12.

See https://www.python.org/dev/peps/pep-0387/#making-incompatible-changes

When you do remove this from Python 3.12, please make sure to document it in 
the What's new document.

Thank you.

--
components: Library (Lib)
messages: 412436
nosy: hroncok, pablogsal, rhettinger
priority: normal
severity: normal
status: open
title: random.randrange removed support for non-integer types after just one 
release of deprecation
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46624] random.randrange removed support for non-integer types after just one release of deprecation

2022-02-03 Thread Miro Hrončok

Change by Miro Hrončok :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46624] random.randrange removed support for non-integer types after just one release of deprecation

2022-02-03 Thread Miro Hrončok

Miro Hrončok  added the comment:

Proposed the revert at https://github.com/python/cpython/pull/31098

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41962] Make threading._register_atexit public?

2022-02-03 Thread Simon Arlott


Simon Arlott  added the comment:

Another way to do this is to call threading.main_thread().join() in another 
thread and do the shutdown cleanup when it returns.

The main thread is stopped at shutdown just before the 
threading._threading_atexits are called.

--
nosy: +sa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44863] Allow TypedDict to inherit from Generics

2022-02-03 Thread Thomas Grainger


Thomas Grainger  added the comment:

there's a thread on typing-sig for this now: 
https://mail.python.org/archives/list/typing-...@python.org/thread/I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ/#I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ

--
nosy: +graingert

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38119] resource tracker destroys shared memory segments when other processes should still have valid access

2022-02-03 Thread timka


timka  added the comment:

On the long run: Maybe this could solve some win32api problems?

https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/

--
nosy: +timka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45885] Specialize COMPARE_OP

2022-02-03 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 674ab66ebdf06f187e193a3d7bde13b71ba0f9af by Dennis Sweeney in 
branch 'main':
bpo-45885: Add more stats for COMPARE_OP in specialize.c (GH-31040)
https://github.com/python/cpython/commit/674ab66ebdf06f187e193a3d7bde13b71ba0f9af


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46624] random.randrange removed support for non-integer types after just one release of deprecation

2022-02-03 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset 6baa98e538b2e26f16eaaf462f99496e98d2cfb1 by Miro Hrončok in 
branch 'main':
bpo-46624: Defer to 3.12: "Remove deprecated support for non-integer values" 
(GH-31098)
https://github.com/python/cpython/commit/6baa98e538b2e26f16eaaf462f99496e98d2cfb1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46624] random.randrange removed support for non-integer types after just one release of deprecation

2022-02-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46625] timeout option of socket.create_connection is not respected

2022-02-03 Thread Nicolas SURRIBAS


New submission from Nicolas SURRIBAS :

When passing to socket.create_connection a timeout option above (approximately) 
127 seconds, the timeout is not respected. 

Code to reproduce the issue :

import socket
from time import monotonic

print(socket.getdefaulttimeout())
start = monotonic()
try:
socket.create_connection(("1.1.1.1", 21), 300)
except Exception as exception:
print(exception)

print(monotonic() - start)

Output at execution:

None
[Errno 110] Connection timed out
129.3075186319984

Expected behavior would be that the "Connection timed out" exception is raised 
after 300 seconds, as given in argument, not 129.

Observed with Python 3.9.1

--
components: IO
messages: 412443
nosy: Nicolas SURRIBAS
priority: normal
severity: normal
status: open
title: timeout option of socket.create_connection is not respected
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46615] Use-after-free by mutating set during set operations

2022-02-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The likely culprit is the set_next() loop.  Perhaps it is never safe to use 
set_next() because any lookup can callback to __eq__ which can mutate the set.

Since set_isdisjoint() method isn't a mutating method, that is the easiest 
place to start investigating.  Try disabling the exact set fast path to see if 
the issue persists.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46569] final note on StrEnum documentation incorrectly refers to int.__format__ instead of str.__format__

2022-02-03 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 734b1f119be6f0dcd6845c78a9e0a71d88a90b59 by Nikita Sobolev in 
branch 'main':
bpo-46569: [Enum] fix typo in `StrEnum` docs (GH-31007)
https://github.com/python/cpython/commit/734b1f119be6f0dcd6845c78a9e0a71d88a90b59


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46569] final note on StrEnum documentation incorrectly refers to int.__format__ instead of str.__format__

2022-02-03 Thread Ethan Furman


Change by Ethan Furman :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45773] Compiler hangs during jump elimination

2022-02-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +29284
pull_request: https://github.com/python/cpython/pull/31101

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler

2022-02-03 Thread miss-islington

miss-islington  added the comment:


New changeset 2d080347d74078a55c47715d232d1ab8dc8cd603 by Géry Ogam in branch 
'main':
bpo-46436: Fix command-line option -d/--directory in module http.server 
(GH-30701)
https://github.com/python/cpython/commit/2d080347d74078a55c47715d232d1ab8dc8cd603


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler

2022-02-03 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler

2022-02-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29286
pull_request: https://github.com/python/cpython/pull/31103

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45773] Compiler hangs during jump elimination

2022-02-03 Thread miss-islington


miss-islington  added the comment:


New changeset ff6948b1286c854ee77dfc0b23b9d828b36873e4 by Miss Islington (bot) 
in branch '3.10':
bpo-45773: Remove invalid peephole optimizations (GH-31066)
https://github.com/python/cpython/commit/ff6948b1286c854ee77dfc0b23b9d828b36873e4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46285] protocol_version in http.server.test can be ignored

2022-02-03 Thread Éric Araujo

Change by Éric Araujo :


--
dependencies: +Pass the -d/--directory command-line option to 
http.server.CGIHTTPRequestHandler
versions:  -Python 3.10, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45773] Compiler hangs during jump elimination

2022-02-03 Thread Brandt Bucher


Change by Brandt Bucher :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46615] Use-after-free by mutating set during set operations

2022-02-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Presumably _PyDict_Next is also suspect.  Even the advertised "safe" calls to 
PyDict_SetItem() for existing keys would be a trigger.  Calling clear() in 
either __eq__ or __hash__ would suffice.

If the next loops are the culprint, the new challenge is figuring out how to 
fix it without wrecking code clarity and performance (and having to deprecate 
PyDict_Next() which is part of the stable ABI).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46621] Should map(function, iterable, ...) replace StopIteration with RuntimeError?

2022-02-03 Thread Vedran Čačić

Vedran Čačić  added the comment:

Just for the record, I consider PEP 479 one of (very rare) design bugs in 
Python, and would like it reversed some day. (So anything that helps this 
outcome, including -1 on this, is welcome.)

It subverts the natural property of exceptions (that they bubble through frames 
undisturbed until caught) for no benefit at all, and it has made me write 
almost every chained generator since then in a more complex way, adding 
boilerplate code that converts inner StopIteration to return. I'm sure many 
others have done so too. Ceterum censeo PEP479em esse delendam.

--
nosy: +veky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46072] Unify handling of stats in the CPython VM

2022-02-03 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29287
pull_request: https://github.com/python/cpython/pull/31104

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34486] "RuntimeError: release unlocked lock" when starting a thread

2022-02-03 Thread Géry

Change by Géry :


--
nosy: +maggyero

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46072] Unify handling of stats in the CPython VM

2022-02-03 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29288
pull_request: https://github.com/python/cpython/pull/31105

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46626] expose IP_BIND_ADDRESS_NO_PORT linux socket option

2022-02-03 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
components: Library (Lib)
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: expose IP_BIND_ADDRESS_NO_PORT linux socket option
type: enhancement
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46626] expose IP_BIND_ADDRESS_NO_PORT linux socket option

2022-02-03 Thread Benjamin Peterson


Change by Benjamin Peterson :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46627] Regex hangs indefinitely

2022-02-03 Thread J.B. Langston


New submission from J.B. Langston :

The following code will cause Python's regex engine to hang apparently 
indefinitely: 

import re
message = "Flushed to 
[BigTableReader(path='/data/cassandra/data/log/logEntry_202202-e68971800b2711ecaf770d5fa3f5ae87/md-112-big-Data.db')]
 (1 sstables, 8,650MiB), biggest 8,650MiB, smallest 8,650MiB"
regex = re.compile(r"Flushed to \[(?P[^]]+)+\] \((?P[^ 
]+) sstables, (?P[^)]+)\), biggest (?P[^,]+), 
smallest (?P[^ ]+)( \((?P\d+)ms\))?")
regex.match(message)

This may be a case of exponential backtracking similar to #35915 or #30973. 
Both of these issues have been closed as Wont Fix, and I suspect my issue is 
similar. The use of commas for decimal points in the input string was not 
anticipated but happened due to localization of the logs that the message came 
from.  The regex works properly when the decimal point is a period.

I will try to rewrite my regex to address this specific issue, but it's hard to 
anticipate every possible input and craft a bulletproof regex, so something 
like this kind of thing can be used for a denial of service attack (intentional 
or not). In this case the regex was used in an automated import process and 
caused the process to back up for many hours before someone noticed.  Maybe a 
solution could be to add a timeout option to the regex engine so it will give 
up and throw an exception if the regex executes for longer than the configured 
timeout.

--
components: Regular Expressions
messages: 412450
nosy: ezio.melotti, jblangston, mrabarnett
priority: normal
severity: normal
status: open
title: Regex hangs indefinitely
type: behavior
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46626] expose IP_BIND_ADDRESS_NO_PORT linux socket option

2022-02-03 Thread Benjamin Peterson


New submission from Benjamin Peterson :


New changeset 1aa6be06c4cb7f04a340adb1c7b16b89803ef254 by Benjamin Peterson in 
branch 'main':
closes bpo-46626: Expose IP_BIND_ADDRESS_NO_PORT socket option. (GH-31106)
https://github.com/python/cpython/commit/1aa6be06c4cb7f04a340adb1c7b16b89803ef254


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45975] Simplify some while-loops with walrus operator

2022-02-03 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +29290
pull_request: https://github.com/python/cpython/pull/31107

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46072] Unify handling of stats in the CPython VM

2022-02-03 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29291
pull_request: https://github.com/python/cpython/pull/31108

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46627] Regex hangs indefinitely

2022-02-03 Thread Matthew Barnett


Matthew Barnett  added the comment:

That pattern has:

(?P[^]]+)+

Is that intentional? It looks wrong to me.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46628] Can't install YARL

2022-02-03 Thread Paul Koning


New submission from Paul Koning :

Trying to install "aiohttp" with pip I get a compile error installing "yarl".  
I get the same error when I install just that module.  But it installs fine on 
3.10.  This is on an Apple M1 (ARM64) machine.

--
components: macOS
files: yarl.log
messages: 412453
nosy: ned.deily, pkoning, ronaldoussoren
priority: normal
severity: normal
status: open
title: Can't install YARL
type: compile error
versions: Python 3.11
Added file: https://bugs.python.org/file50602/yarl.log

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46524] test_peg_generator takes 8 minutes on Windows

2022-02-03 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks to Kumar for contributing Windows compiler flags side of this (the point 
of this issue).

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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46628] Can't install YARL

2022-02-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

It looks like you're missing dependencies required to compile yarl. Since this 
isn't a bug with Python, I'm going to close this.

I suggest you ask the yarl community for help. Their home page is 
https://github.com/aio-libs/yarl/

Good luck!

--
nosy: +eric.smith
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46627] Regex hangs indefinitely

2022-02-03 Thread J.B. Langston


J.B. Langston  added the comment:

Yes, it is supposed to match everything up to the closing ] in this substring: 

[BigTableReader(path='/data/cassandra/data/log/logEntry_202202-e68971800b2711ecaf770d5fa3f5ae87/md-112-big-Data.db')]

Quoting from the re docs:

To match a literal ']' inside a set, precede it with a backslash, or place it 
at the beginning of the set. For example, both [()[\]{}] and []()[{}] will both 
match a parenthesis.

The docs don't specifically state the case of a negated set using ^, but I have 
used this construction many times and never had a problem with it.

Furthermore, it is not what caused the regex to hang.  That was caused by 
"(?P[^,]+)," and changing it to "(?P.+?)," fixed 
the problem.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46628] Can't install YARL

2022-02-03 Thread Paul Koning


Paul Koning  added the comment:

The only dependency mentioned by the yarl documentation is multidict and 
installing that makes no difference.  I see I can tell yarl to build a 
pure-python version to avoid compiling stuff.  If I do that it installs.  But 
what I actually wanted to do is install aiohttp, and that step fails with the 
exact same error message.

Given that it works in 3.10 but fails in 3.11a4, it does seem there is 
something about the new code that is involved here.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46627] Regex hangs indefinitely

2022-02-03 Thread J.B. Langston


J.B. Langston  added the comment:

Sorry, on rereading your message I guess you were referring to the extra +, not 
the [^]]. The extra + after the ) was not intentional, and after removing it, 
the regex no longer hangs.

I still think it would be nice to have a timeout setting on the regex so it 
can't hang up an entire process.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45975] Simplify some while-loops with walrus operator

2022-02-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 916d0d822c79933f4c420f7a36f16f3eb788646b by Terry Jan Reedy in 
branch 'main':
bpo-45975: IDLE - Remove extraneous parens (GH-31107)
https://github.com/python/cpython/commit/916d0d822c79933f4c420f7a36f16f3eb788646b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45975] Simplify some while-loops with walrus operator

2022-02-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29292
pull_request: https://github.com/python/cpython/pull/31109

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45975] Simplify some while-loops with walrus operator

2022-02-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29293
pull_request: https://github.com/python/cpython/pull/31110

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46628] Can't install YARL

2022-02-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

Ah. longintrepr.h is an internal Python file, not meant for external 
consumption. This file moved in Python 3.11. So this is still a yarl issue: 
they'll need to adjust how they read that file. But my recommendation is that 
they find another way to do what they want without including it.

See https://github.com/python/cpython/blob/main/Include/README.rst. Files in 
the cpython directory (which longintrepr.h is) are a CPython implementation 
detail, and can change or move at any time.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46629] Cannot sideload MSIX package on Windows

2022-02-03 Thread Steve Dower


New submission from Steve Dower :

We need to update PC/classicAppCompat.can.xml for our new certificate and email 
Microsoft to get it signed again.

--
assignee: steve.dower
messages: 412461
nosy: steve.dower
priority: normal
severity: normal
status: open
title: Cannot sideload MSIX package on Windows
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46628] Can't install YARL

2022-02-03 Thread Paul Koning


Paul Koning  added the comment:

Thanks, I'll pass the word to the yarl and aiohttp team (both have this issue).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46629] Cannot sideload MSIX package on Windows

2022-02-03 Thread Steve Dower


Change by Steve Dower :


--
components: +Windows
nosy: +paul.moore, tim.golden, zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23041] csv needs more quoting rules

2022-02-03 Thread Miha Šetina

Miha Šetina  added the comment:

Is this still on track for python 3.11?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-02-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It does not have a use case of T[int] in mind. It is an implementation detail 
which simplifies the code, makes runtime checks more strict and makes 
types.GenericAlias more similar to typing._GenericAlias.

For example, currently:

>>> A = List[T]
>>> B = list[T]
>>> A[None]
typing.List[NoneType]
>>> B[None]
list[None]
>>> A['X']
typing.List[ForwardRef('X')]
>>> B['X']
list['X']

With the proposed change:

>>> B[None]
list[NoneType]
>>> B['X']
list[ForwardRef('X')]

Meanless expressions like A[42], A[Final], A[Final[int]], A[ClassVar], 
A[ClassVar[int]], etc which are silently accepted will now be errors.

The code simplification (especially for the C code) is my primary goal, and the 
rest is a nice side effect. It is possible to add more strict runtime checks 
and conversions without making TypeVar and ParamSpec subscriptable, but the 
code will not be so simple.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46630] IDLE: Set query focus to entry box on Windows

2022-02-03 Thread Terry J. Reedy


New submission from Terry J. Reedy :

On Mac, and I presume *nix in general, query boxes open with the focus on the 
first entry box, with the cursor displayed.  One can immediate enter a line 
number, dotted module name, or whatever. On Windows, since 3.9, one must hit 
Tab or click on the entry box to set the focus.  If a blank entry is an error, 
one can even click on OK or hit Enter and the focus will move after an error 
message.

idlelib/query.py already has self.entry.focus_set.  Why did that stop working 
in 3.9?  All patches to query.py were before May 2021 and backported to 3.8.  
Perhaps the upgrade from tk 8.6.9 to 8.6.12 had an effect given the code as it 
is.  Text widgets have the same issue and Editor window has 'text.focus_set' in 
'__init__' and that works.  Whatever, moving entry.focus_set() to just after 
self.deiconify() works without affecting unittests both in Windows repository 
and 3.11 installed on macOS.

--
assignee: terry.reedy
components: IDLE
messages: 412465
nosy: terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Set query focus to entry box on Windows
type: behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46629] Cannot sideload MSIX package on Windows

2022-02-03 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45975] Simplify some while-loops with walrus operator

2022-02-03 Thread miss-islington


miss-islington  added the comment:


New changeset 63523e7b2a631f28134b25a8063d50e08c741db6 by Miss Islington (bot) 
in branch '3.10':
bpo-45975: IDLE - Remove extraneous parens (GH-31107)
https://github.com/python/cpython/commit/63523e7b2a631f28134b25a8063d50e08c741db6


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46629] Cannot sideload MSIX package on Windows

2022-02-03 Thread Steve Dower


Steve Dower  added the comment:

Posted the PR for openness, but it's not ready to merge yet.

The file that's been updated there (which unfortunately is not very Unix 
friendly) now has the SHA256 hash of our signing certificate, and I've emailed 
the file to storeops at Microsoft to request them to sign it. The signed one 
will replace classicAppCompat.sccd

The reason we need this file is because we set globally readable registry keys 
on install for PEP 514 (these appear in the appxmanifest file generated by 
PC/layout). That's not a normal app permission, and so we have to request 
special permissions to do it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45975] Simplify some while-loops with walrus operator

2022-02-03 Thread miss-islington


miss-islington  added the comment:


New changeset cf7cb1a2bf40516dc571d1d90c12b632dcd9b8c8 by Miss Islington (bot) 
in branch '3.9':
bpo-45975: IDLE - Remove extraneous parens (GH-31107)
https://github.com/python/cpython/commit/cf7cb1a2bf40516dc571d1d90c12b632dcd9b8c8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46630] IDLE: Set query focus to entry box on Windows

2022-02-03 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS.

2022-02-03 Thread Ned Deily


Ned Deily  added the comment:

Thanks, Marc and Ronald, for the analysis.

And thanks for bringing up the issue, Remy. Perhaps you can verify that 
Ronald's suggestion of importing and launching Tk before calling pyglet or 
pygame works for you and, if so, follow up with those projects to, if nothing 
else, document that requirement for their users on macOS (I would guess it 
wouldn't hurt on other platforms as well but I've guessed wrong before). In any 
case, I'm closing this issue now.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41962] Make threading._register_atexit public?

2022-02-03 Thread Eric Snow


Eric Snow  added the comment:

> I'm running some long-running (possibly infinite) tasks in the thread pool,
> and I cancel them in an `atexit` callback

To be clear, by "cancel" you are not talking about Future.cancel().  Rather, 
your handler causes all running tasks to finish (by sending a special message 
on the socket corresponding to each running task).  Is that right?

Some other things I inferred from your atexit handler:

* it does not make sure the task associated with the socket finishes (no way of 
knowing?)
* so if a task hangs while trying to stop then the running thread in the 
ThreadPoolExecutor would block shutdown forever
* similarly, if a task is stuck handling a request then it will never receive 
the special message on the socket, either blocking the send() in your handler 
or causing ThreadPoolExecutor shutdown/atexit to wait forever
* it vaguely implies a 1-to-1 relationship between sockets and *running* tasks
* likewise that pending (queued) tasks do not have an associated socket (until 
started)
* so once your handler finishes, any tasks pending in the ThreadPoolExecutor 
queue will eventually get started but never get stopped by your handler; thus 
you're back to the deadlock situation

Does all that sound right?  Most of that is relevant to some possible solutions 
I have in mind.

--
nosy: +eric.snow

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41962] Make threading._register_atexit public?

2022-02-03 Thread Eric Snow


Eric Snow  added the comment:

> I'm running some long-running (possibly infinite) tasks in the thread pool,
> and I cancel them in an `atexit` callback

Alternately, perhaps ThreadPoolExecutor isn't the right fit here, as implied by 
the route you ended up going.  It seems like it's not well-suited for 
long-running (or infinite) tasks.  In that case, perhaps the concurrent.futures 
docs could be more clear about when ThreadPoolExecutor is not a good fit and 
what the alternatives are.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41962] Make threading._register_atexit public?

2022-02-03 Thread Eric Snow


Eric Snow  added the comment:

FWIW, here's a brain dump about ThreadPoolExecutor and its atexit handler after 
having looked at the code.



First, the relationship between the objects involved:

* work item -> Future
* work item -> task (e.g. function)
* queue -> [work item]
* worker -> executor
* worker -> queue
* worker -> currently running work item
* thread -> worker
* ThreadPoolExecutor -> [thread]
* ThreadPoolExecutor -> queue
* global state -> {thread: queue}

Observations:

* a work item's future and task are not aware of each other, and operations on 
either have no effect on the other



Next, let's look at the relevant ways the objects can be used:

* publicly
   * ThreadPoolExecutor.submit(task) -> Future
   * ThreadPoolExecutor.shutdown()
   * Future.result() and Future.exception()
   * Future.cancel()
   * Future.add_done_callback()
* internally
   * queue.pop() -> work item
   * .run()
   * thread.join()
   * Future.set_running_or_notify_cancel()
   * Future.set_result() and Future.set_exception()

Observations:

* nothing interacts with a worker directly; it is waited on via its thread and 
it receives work (or None) via the queue it was given
* once a worker pops the next work item off the queue, nothing else has access 
to that work item (the original ThreadPoolExecutor().submit() caller has the 
Future, but that's it)
* there is no cancelation mechanism for tasks
* there is no simple way to interact with the queued tasks
* realistically, there is no way to interact with the currently running task
* there is no reliable way to "kill" a thread



Regarding how tasks run:

* ThreadPoolExecutor.submit(task) -> Future
* ThreadPoolExecutor.submit(task) -> work item (Future, task) -> queue
* ThreadPoolExecutor.submit(task) -> thread (worker)
* thread -> worker -> ( queue -> work item -> task )

Observations::

* the worker loop exits if the next item in the queue is None (and the executor 
is shutting down)



Now lets look more closely at the atexit handler.

* as you noted, since 3.9 it is registered with threading._register_atexit() 
instead of atexit.register()
* the threading atexit handlers run before the regular atexit handlers
* the ThreadPoolExecutor handler does not actually interact with 
ThreadPoolExecutor instances directly
* it only deals with a module-global list of (thread, [work item]) pairs, to 
which ThreadPoolExecutor instances add items as they go

The handler does the following:

1. disables ThreadPoolExecutor.submit() (for all instances)
2. (indirectly) tells each worker to stop ASAP
3. lets every pending task run (and lets every running task keep running)
4. waits until all tasks have finished

It does not:

* call any ThreadPoolExecutor.shutdown()
* otherwise deal with the ThreadPoolExecutor instances directly
* call Future.cancel() for any of the tasks
* use any timeout in step 4, so it may block forever
* notify tasks that they should finish
* deal well with any long-running (or infinite) task

ThreadPoolExecutor.shutdown() basically does the same thing.  However, it only 
does the steps above for its own tasks.  It also optionally calls 
Future.cancel() for each queued task (right before step 2).  However, all that 
does is keep any queued-but-not-running tasks from starting.  Also, you can 
optionally skips step 4.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46200] Discourage logging f-strings due to security considerations

2022-02-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Eric is absolutely right, due to function calls being 
> somewhat slow in Python the performance argument in
> practice falls in favor of f-strings.

Also f-strings can evaluate expressions in the template which is also a big win:

   f('Pending {len(req)} requests: {req[0]!r} ... {req[-1]!r}')

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46200] Discourage logging f-strings due to security considerations

2022-02-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

In a favor of deferred substitution, the cookbook should have a recipe where 
substituted messages are logged to a file and the unsubstituted message stored 
in SQLite3 database with the parameters stored as JSON.This gives both 
human readable output and queryable, preparsed data for automated analysis.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41962] Make threading._register_atexit public?

2022-02-03 Thread Eric Snow


Eric Snow  added the comment:

> This means that ThreadPoolExecutor's atexit runs before mine,
> and since I never get a chance to cancel my tasks, it deadlocks.

(assuming we want to support long-running tasks here)

With all the above in mind, there are a few things that may help.

The first that comes to mind is to have the atexit handler call 
ThreadPoolExecutor.shutdown() for each instance.

So something like this:


def _python_exit():
global _shutdown
with _global_shutdown_lock:
_shutdown = True
for executor in list(_executors):
executor.shutdown()


That would require a little refactoring to make it work.  However, the change 
is simpler if each executor has its own atexit handler:


class ThreadPoolExecutor(_base.Executor):

def __init__(self, ...):
...
threading._register_atexit(self._atexit())

def _atexit(self):
global _shutdown
_shutdown = True
self.shutdown()


The value of either approach is that you can then subclass ThreadPoolExecutor 
to get what you want:


class MyExecutor(ThreadPoolExecutor):
def shutdown(self, *args, **kwargs):
stop_my_tasks()
super().shutdown(*args, **kwwargs)




One thing I thought about was supporting a per-task finalizer instead, since 
that aligns more closely with the way ThreadPoolExecutor works.  It would only 
apply  So something like one of the following:

* ThreadPoolExecutor(finalize_task=)
* ThreadPoolExecutor.submit(finalize=)
* ThreadPoolExecutor.register_atexit()
* (classmethod) ThreadPoolExecutor.register_atexit()
* concurrent.futures.register_atexit()

(It would probably make sense to pass the list of currently running tasks to 
the callable.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33125] Windows 10 ARM64 platform support

2022-02-03 Thread Steve Dower


Steve Dower  added the comment:

Closing this issue, as we have others to track individual tasks.

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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46630] IDLE: Set query focus to entry box on Windows

2022-02-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset d1df81a730499cc6286d02afa6028a1e9c22bbbf by Terry Jan Reedy in 
branch 'main':
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
https://github.com/python/cpython/commit/d1df81a730499cc6286d02afa6028a1e9c22bbbf


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46630] IDLE: Set query focus to entry box on Windows

2022-02-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29297
pull_request: https://github.com/python/cpython/pull/31115

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46630] IDLE: Set query focus to entry box on Windows

2022-02-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +29296
pull_request: https://github.com/python/cpython/pull/31114

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42926] Split compiler into code-gen, optimizer and assembler.

2022-02-03 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33125] Windows 10 ARM64 platform support

2022-02-03 Thread Tommy Vercetti


Tommy Vercetti  added the comment:

Thank you Steve!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46630] IDLE: Set query focus to entry box on Windows

2022-02-03 Thread miss-islington


miss-islington  added the comment:


New changeset dc315f30f86a1dc7c4607398b379d7c0b55c7549 by Miss Islington (bot) 
in branch '3.9':
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
https://github.com/python/cpython/commit/dc315f30f86a1dc7c4607398b379d7c0b55c7549


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46630] IDLE: Set query focus to entry box on Windows

2022-02-03 Thread miss-islington


miss-islington  added the comment:


New changeset 4f76b3667d856a13107c65d44d802d0e73c3f104 by Miss Islington (bot) 
in branch '3.10':
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
https://github.com/python/cpython/commit/4f76b3667d856a13107c65d44d802d0e73c3f104


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-02-03 Thread Tommy Vercetti


Tommy Vercetti  added the comment:

PEP 514 looks good to me

--
nosy: +TommyVCT

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46630] IDLE: Set query focus to entry box on Windows

2022-02-03 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46433] _PyType_GetModuleByDef optimization is incorrect

2022-02-03 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

It looks like this can be closed. Petr?

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-02-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

I don't think that changing list[None] to list[NoneType] in the output is an 
improvement. I do appreciate the reduction in C code though!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-02-03 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood, sobolevn

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-02-03 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

I'd also be wary about making changes that introduce additional runtime checks. 
As we've seen with the PEP 612 and 646 implementations, those can impede future 
iteration on typing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45380] help() appears confused about the module of typing.Annotated

2022-02-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

It looks like __metadata__ was *meant* to be a public attribute, but somehow 
overseen when the PEP and docs were written. :-(

I don't know anything about this class, really.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2022-02-03 Thread miss-islington


miss-islington  added the comment:


New changeset 91e888904478271c27c52c773863b41f5a8f7f30 by Miss Islington (bot) 
in branch '3.10':
bpo-14916: use specified tokenizer fd for file input (GH-31006)
https://github.com/python/cpython/commit/91e888904478271c27c52c773863b41f5a8f7f30


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x

2022-02-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29299
pull_request: https://github.com/python/cpython/pull/31118

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33178] Add support for BigEndianUnion and LittleEndianUnion in ctypes

2022-02-03 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
versions: +Python 3.11 -Python 2.7, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46588] fix typo in test_calltip.py

2022-02-03 Thread Caio Agiani


Change by Caio Agiani :


--
pull_requests: +29300
pull_request: https://github.com/python/cpython/pull/31119

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46615] Use-after-free by mutating set during set operations

2022-02-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Marking as low priority given that ehe next loop code has been deployed without 
incident for two decades (a little less for sets and a little more for dicts).

--
priority: normal -> low

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46615] Use-after-free by mutating set during set operations

2022-02-03 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

It looks like usages of the PyDict_Next API assume the resulting references are 
borrowed and so INCREF them.

Usages of set_next do not, but should.

It should hopefully be a straightforward fix of adding INCREF/DECREFs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46588] fix typo in test_calltip.py

2022-02-03 Thread Terry J. Reedy


New submission from Terry J. Reedy :


New changeset 222865daabfa7a8b12ca9a5e9c23b9ce217448f1 by Caio Agiani in branch 
'main':
bpo-46588: fix typo in test_calltip.py  (GH-31119)
https://github.com/python/cpython/commit/222865daabfa7a8b12ca9a5e9c23b9ce217448f1


--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46588] fix typo in test_calltip.py

2022-02-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +29302
pull_request: https://github.com/python/cpython/pull/31121

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >