]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agogh-93761: Fix test_logging test_config_queue_handler() race condition (#93952)
Victor Stinner [Sun, 19 Jun 2022 09:49:35 +0000 (11:49 +0200)] 
gh-93761: Fix test_logging test_config_queue_handler() race condition (#93952)

Fix a race condition in test_config_queue_handler() of test_logging.

3 years agoWhat's new in 3.10: fix link to issue (#93968)
Hugo van Kemenade [Sun, 19 Jun 2022 09:04:26 +0000 (12:04 +0300)] 
What's new in 3.10: fix link to issue (#93968)

* What's new in 3.10: fix link to issue

* What's new in 3.10: fix link to GH issue

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agoGH-93990: fix refcounting bug in `add_subclass` in `typeobject.c` (GH-93989)
Kumar Aditya [Sun, 19 Jun 2022 06:06:37 +0000 (11:36 +0530)] 
GH-93990: fix refcounting bug in `add_subclass` in `typeobject.c` (GH-93989)

3 years agogh-93975: Nicer error reporting in test_venv (GH-93959)
Jason R. Coombs [Sat, 18 Jun 2022 20:47:27 +0000 (16:47 -0400)] 
gh-93975: Nicer error reporting in test_venv (GH-93959)

- gh-93957: Provide nicer error reporting from subprocesses in test_venv.EnsurePipTest.test_with_pip.
- Update changelog

This change does three things:

1. Extract a function for trapping output in subprocesses.
2. Emit both stdout and stderr when encountering an error.
3. Apply the change to `ensurepip._uninstall` check.

3 years agogh-91387: Fix tarfile test on WASI (GH-93984)
Christian Heimes [Sat, 18 Jun 2022 17:55:48 +0000 (19:55 +0200)] 
gh-91387: Fix tarfile test on WASI (GH-93984)

WASI's rmdir() syscall does not like the trailing slash.

3 years agogh-93955: Use unbound methods for slot `__getattr__` and `__getattribute__` (GH-93956)
Ken Jin [Sat, 18 Jun 2022 14:42:42 +0000 (22:42 +0800)] 
gh-93955: Use unbound methods for slot `__getattr__` and `__getattribute__` (GH-93956)

3 years agogh-84461: Fix pydebug Emscripten browser builds (GH-93982)
Christian Heimes [Sat, 18 Jun 2022 12:51:50 +0000 (14:51 +0200)] 
gh-84461: Fix pydebug Emscripten browser builds (GH-93982)

wasm_assets script did not take the ABIFLAG flag of sysconfigdata into
account.

3 years agogh-89828: Do not relay the __class__ attribute in GenericAlias (#93754)
Serhiy Storchaka [Sat, 18 Jun 2022 08:34:57 +0000 (11:34 +0300)] 
gh-89828: Do not relay the __class__ attribute in GenericAlias (#93754)

list[int].__class__ returned type, and isinstance(list[int], type)
returned True. It caused numerous problems in code that checks
isinstance(x, type).

3 years agogh-84461: Fix circulare dependency on BUILDPYTHON (GH-93977)
Christian Heimes [Sat, 18 Jun 2022 08:19:48 +0000 (10:19 +0200)] 
gh-84461: Fix circulare dependency on BUILDPYTHON (GH-93977)

3 years agoAdd jaraco as primary owner of importlib.metadata and importlib.resources. (#93960)
Jason R. Coombs [Sat, 18 Jun 2022 03:12:07 +0000 (23:12 -0400)] 
Add jaraco as primary owner of importlib.metadata and importlib.resources. (#93960)

* Add jaraco as primary owner of importlib.metadata and importlib.resources.

* Align indentation.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-91387: Strip trailing slash from tarfile longname directories (GH-32423)
Chris Fernald [Fri, 17 Jun 2022 22:38:41 +0000 (15:38 -0700)] 
gh-91387: Strip trailing slash from tarfile longname directories (GH-32423)

Co-authored-by: Brett Cannon <brett@python.org>
3 years agoGH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917)
Irit Katriel [Fri, 17 Jun 2022 22:28:23 +0000 (23:28 +0100)] 
GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917)

3 years agogh-92611: Add details on replacements for cgi utility funcs (GH-92792)
CAM Gerlach [Fri, 17 Jun 2022 21:05:21 +0000 (16:05 -0500)] 
gh-92611: Add details on replacements for cgi utility funcs (GH-92792)

Per @brettcannon 's [suggestions on the Discourse thread](https://discuss.python.org/t/pep-594-take-2-removing-dead-batteries-from-the-standard-library/13508/51), discussed in #92611 and as a followup to PR #92612 , this PR add additional specific per-function replacement information for the utility functions in the `cgi` module deprecated by PEP 594 (PEP-594).

@brettcannon , should this be backported (without the `deprecated-removed` , which I would update it accordingly and re-add in my other PR adding that to the others for 3.11+), or just go in 3.11+?

3 years agoGH-89858: Fix test_embed for out-of-tree builds (GH-93465)
Kumar Aditya [Fri, 17 Jun 2022 16:24:17 +0000 (21:54 +0530)] 
GH-89858: Fix test_embed for out-of-tree builds (GH-93465)

3 years agogh-92888: Fix memoryview bad `__index__` use after free (GH-92946)
Ken Jin [Fri, 17 Jun 2022 15:14:53 +0000 (23:14 +0800)] 
gh-92888: Fix memoryview bad `__index__` use after free (GH-92946)

Co-authored-by: chilaxan <35645806+chilaxan@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
3 years agogh-93911: Specialize `LOAD_ATTR_PROPERTY` (GH-93912)
Ken Jin [Fri, 17 Jun 2022 15:13:17 +0000 (23:13 +0800)] 
gh-93911: Specialize `LOAD_ATTR_PROPERTY` (GH-93912)

3 years agogh-77782: Deprecate global configuration variable (#93943)
Victor Stinner [Fri, 17 Jun 2022 14:12:00 +0000 (16:12 +0200)] 
gh-77782: Deprecate global configuration variable (#93943)

Deprecate global configuration variable like
Py_IgnoreEnvironmentFlag: the Py_InitializeFromConfig() API should be
instead.

Fix declaration of Py_GETENV(): use PyAPI_FUNC(), not PyAPI_DATA().

3 years agogh-74953: Fix PyThread_acquire_lock_timed() code recomputing the timeout (#93941)
Victor Stinner [Fri, 17 Jun 2022 14:11:25 +0000 (16:11 +0200)] 
gh-74953: Fix PyThread_acquire_lock_timed() code recomputing the timeout (#93941)

Set timeout, don't create a local variable with the same name.

3 years agogh-74953: Add _PyTime_FromMicrosecondsClamp() function (#93942)
Victor Stinner [Fri, 17 Jun 2022 14:11:13 +0000 (16:11 +0200)] 
gh-74953: Add _PyTime_FromMicrosecondsClamp() function (#93942)

3 years agogh-77782: Py_FdIsInteractive() now uses PyConfig.interactive (#93916)
Victor Stinner [Fri, 17 Jun 2022 13:19:28 +0000 (15:19 +0200)] 
gh-77782: Py_FdIsInteractive() now uses PyConfig.interactive (#93916)

3 years agogh-93852: Add test.support.create_unix_domain_name() (#93914)
Victor Stinner [Fri, 17 Jun 2022 11:16:51 +0000 (13:16 +0200)] 
gh-93852: Add test.support.create_unix_domain_name() (#93914)

test_asyncio, test_logging, test_socket and test_socketserver now
create AF_UNIX domains in the current directory to no longer fail
with OSError("AF_UNIX path too long") if the temporary directory (the
TMPDIR environment variable) is too long.

Modify the following tests to use create_unix_domain_name():

* test_asyncio
* test_logging
* test_socket
* test_socketserver

test_asyncio.utils: remove unused time import.

3 years agogh-89745: Avoid exact match when comparing program_name in test_embed on Windows...
neonene [Fri, 17 Jun 2022 10:06:49 +0000 (19:06 +0900)] 
gh-89745: Avoid exact match when comparing program_name in test_embed on Windows (GH-93888)

3 years agogh-91404: Revert "bpo-23689: re module, fix memory leak when a match is terminated...
Gregory P. Smith [Fri, 17 Jun 2022 08:19:44 +0000 (01:19 -0700)] 
gh-91404: Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or allocation failure (GH-32283) (#93882)

Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or memory allocation failure (GH-32283)"

This reverts commit 6e3eee5c11b539e9aab39cff783acf57838c355a.

Manual fixups to increase the MAGIC number and to handle conflicts with
a couple of changes that landed after that.

Thanks for reviews by Ma Lin and Serhiy Storchaka.

3 years agotest_logging: Fix BytesWarning in SysLogHandlerTest (GH-93920)
Victor Stinner [Fri, 17 Jun 2022 08:09:54 +0000 (10:09 +0200)] 
test_logging: Fix BytesWarning in SysLogHandlerTest (GH-93920)

3 years agoGH-83658: make multiprocessing.Pool raise an exception if maxtasksperchild is not...
Irit Katriel [Fri, 17 Jun 2022 07:14:26 +0000 (08:14 +0100)] 
GH-83658: make multiprocessing.Pool raise an exception if maxtasksperchild is not None or a positive int (GH-93364)

Closes #83658.

3 years agogh-91985: Ensure in-tree builds override platstdlib_dir in every path calculation...
neonene [Thu, 16 Jun 2022 21:41:57 +0000 (06:41 +0900)] 
gh-91985: Ensure in-tree builds override platstdlib_dir in every path calculation (GH-93641)

3 years agoGH-91389: Fix dis position information for CACHEs (GH-93663)
Brandt Bucher [Thu, 16 Jun 2022 20:49:32 +0000 (13:49 -0700)] 
GH-91389: Fix dis position information for CACHEs (GH-93663)

3 years agogh-93353: regrtest supports checking tmp files with -j2 (#93909)
Victor Stinner [Thu, 16 Jun 2022 19:48:26 +0000 (21:48 +0200)] 
gh-93353: regrtest supports checking tmp files with -j2 (#93909)

regrtest now also implements checking for leaked temporary files and
directories when using -jN for N >= 2. Use tempfile.mkdtemp() to
create the temporary directory. Skip this check on WASI.

3 years agogh-93847: Fix repr of enum of generic aliases (GH-93885)
Serhiy Storchaka [Thu, 16 Jun 2022 19:16:12 +0000 (22:16 +0300)] 
gh-93847: Fix repr of enum of generic aliases (GH-93885)

3 years agoFix BINARY_SUBSCR_GETITEM stats (GH-93903)
Ken Jin [Thu, 16 Jun 2022 14:02:07 +0000 (22:02 +0800)] 
Fix BINARY_SUBSCR_GETITEM stats (GH-93903)

3 years agogh-92547: Amend What's New (#93872)
Erlend Egeberg Aasland [Thu, 16 Jun 2022 14:00:43 +0000 (16:00 +0200)] 
gh-92547: Amend What's New (#93872)

3 years agogh-91577: SharedMemory move imports out of methods (#91579)
samtygier [Thu, 16 Jun 2022 13:41:51 +0000 (14:41 +0100)] 
gh-91577: SharedMemory move imports out of methods (#91579)

SharedMemory.unlink() uses the unregister() function from resource_tracker. Previously it was imported in the method, but this can fail if the method is called during interpreter shutdown, for example when unlink is part of a __del__() method.

Moving the import to the top of the file, means that the unregister() method is available during interpreter shutdown.

The register call in SharedMemory.__init__() can also use this imported resource_tracker.

3 years agogh-91321: Fix test_cppext for C++03 (#93902)
Victor Stinner [Thu, 16 Jun 2022 12:39:00 +0000 (14:39 +0200)] 
gh-91321: Fix test_cppext for C++03 (#93902)

Don't build _testcppext.cpp with -Wzero-as-null-pointer-constant when
testing C++03: only use this compiler flag with C++11.

3 years agogh-87347: Add parenthesis around PyXXX_Check() arguments (#92815)
Victor Stinner [Thu, 16 Jun 2022 11:49:43 +0000 (13:49 +0200)] 
gh-87347: Add parenthesis around PyXXX_Check() arguments (#92815)

3 years agoCall busy_retry() and sleeping_retry() with error=True (#93871)
Victor Stinner [Thu, 16 Jun 2022 11:44:58 +0000 (13:44 +0200)] 
Call busy_retry() and sleeping_retry() with error=True (#93871)

Tests no longer call busy_retry() and sleeping_retry() with
error=False: raise an exception if the loop times out.

3 years agogh-93820: Fix copy() regression in enum.Flag (GH-93876)
Christian Heimes [Thu, 16 Jun 2022 06:42:36 +0000 (08:42 +0200)] 
gh-93820: Fix copy() regression in enum.Flag (GH-93876)

GH-26658 introduced a regression in copy / pickle protocol for combined
`enum.Flag`s. `copy.copy(re.A | re.I)` would fail with
`AttributeError: ASCII|IGNORECASE`.

`enum.Flag` now has a `__reduce_ex__()` method that reduces flags by
combined value, not by combined name.

3 years agogh-84461: Document how to install SDKs manually (GH-93844)
Christian Heimes [Wed, 15 Jun 2022 19:28:34 +0000 (21:28 +0200)] 
gh-84461: Document how to install SDKs manually (GH-93844)

Co-authored-by: Brett Cannon <brett@python.org>
3 years agoTests call sleeping_retry() with SHORT_TIMEOUT (#93870)
Victor Stinner [Wed, 15 Jun 2022 16:49:14 +0000 (18:49 +0200)] 
Tests call sleeping_retry() with SHORT_TIMEOUT (#93870)

Tests now call busy_retry() and sleeping_retry() with SHORT_TIMEOUT
or LONG_TIMEOUT (of test.support), rather than hardcoded constants.

Add also WAIT_ACTIVE_CHILDREN_TIMEOUT constant to
_test_multiprocessing.

3 years agotest_asyncore: Optimize capture_server() (#93867)
Victor Stinner [Wed, 15 Jun 2022 16:28:31 +0000 (18:28 +0200)] 
test_asyncore: Optimize capture_server() (#93867)

Remove time.sleep(0.01) in test_asyncore capture_server(). The sleep
was redundant and inefficient, since the loop starts with
select.select() which also implements a sleep (poll for socket data
with a timeout).

3 years agotest_asyncio: run_until() implements exponential sleep (#93866)
Victor Stinner [Wed, 15 Jun 2022 16:28:00 +0000 (18:28 +0200)] 
test_asyncio: run_until() implements exponential sleep (#93866)

run_until() of test.test_asyncio.utils now uses an exponential sleep
delay (max: 1 second), rather than a fixed delay of 1 ms. Similar
design than support.sleeping_retry() wait strategy that applies
exponential backoff.

3 years agogh-93824: Reenable installation of shell extension on Windows ARM64 (GH-93825)
Steve Dower [Wed, 15 Jun 2022 16:07:55 +0000 (17:07 +0100)] 
gh-93824: Reenable installation of shell extension on Windows ARM64 (GH-93825)

3 years agoGH-93850: Fix test_asyncio exception ignored tracebacks (#93854)
Kumar Aditya [Wed, 15 Jun 2022 14:41:47 +0000 (20:11 +0530)] 
GH-93850: Fix test_asyncio exception ignored tracebacks (#93854)

3 years agogh-93857: Fix broken audit-event targets in sqlite3 docs (#93859)
Erlend Egeberg Aasland [Wed, 15 Jun 2022 14:01:27 +0000 (16:01 +0200)] 
gh-93857: Fix broken audit-event targets in sqlite3 docs (#93859)

Corrected targets for the following audit-events:

- sqlite3.enable_load_extension => sqlite3.Connection.enable_load_extension
- sqlite3.load_extension => sqlite3.Connection.load_extension

3 years agoUpdate includes in call.c (GH-93786)
Pamela Fox [Wed, 15 Jun 2022 12:24:12 +0000 (05:24 -0700)] 
Update includes in call.c (GH-93786)

3 years agoUse support.sleeping_retry() and support.busy_retry() (#93848)
Victor Stinner [Wed, 15 Jun 2022 12:09:56 +0000 (14:09 +0200)] 
Use support.sleeping_retry() and support.busy_retry() (#93848)

* Replace time.sleep(0.010) with sleeping_retry() to
  use an exponential sleep.
* support.wait_process(): reuse sleeping_retry().
* _test_eintr: remove unused variables.

3 years agotest_thread uses support.sleeping_retry() (#93849)
Victor Stinner [Wed, 15 Jun 2022 11:52:13 +0000 (13:52 +0200)] 
test_thread uses support.sleeping_retry() (#93849)

test_thread.test_count() now fails if it takes longer than
LONG_TIMEOUT seconds.

3 years agogh-87260: Update sqlite3 signature docs to reflect actual implementation (#93840)
Erlend Egeberg Aasland [Wed, 15 Jun 2022 10:28:24 +0000 (12:28 +0200)] 
gh-87260: Update sqlite3 signature docs to reflect actual implementation (#93840)

Align the docs for the following methods with the actual implementation:

- sqlite3.complete_statement()
- sqlite3.Connection.create_function()
- sqlite3.Connection.create_aggregate()
- sqlite3.Connection.set_progress_handler()

3 years agoAdd test.support.busy_retry() (#93770)
Victor Stinner [Wed, 15 Jun 2022 09:42:10 +0000 (11:42 +0200)] 
Add test.support.busy_retry() (#93770)

Add busy_retry() and sleeping_retry() functions to test.support.

3 years agogh-93829: In sqlite3, replace Py_BuildValue with faster APIs (#93830)
Erlend Egeberg Aasland [Wed, 15 Jun 2022 08:42:49 +0000 (10:42 +0200)] 
gh-93829: In sqlite3, replace Py_BuildValue with faster APIs (#93830)

- In Modules/_sqlite/connection.c, use PyLong_FromLong
- In Modules/_sqlite/microprotocols.c, use PyTuple_Pack

3 years agogh-93183: Adjust wording in socket docs (#93832)
Erlend Egeberg Aasland [Wed, 15 Jun 2022 08:36:37 +0000 (10:36 +0200)] 
gh-93183: Adjust wording in socket docs (#93832)

package => packet

Co-authored-by: Victor Norman
3 years agogh-93735: Split Docs CI to speed-up the build (GH-93736)
Adam Turner [Wed, 15 Jun 2022 07:56:16 +0000 (08:56 +0100)] 
gh-93735: Split Docs CI to speed-up the build (GH-93736)

3 years agogh-93814: Add infinite test for itertools.chain.from_iterable (GH-93815)
Jeong YunWon [Tue, 14 Jun 2022 20:45:50 +0000 (05:45 +0900)] 
gh-93814: Add infinite test for itertools.chain.from_iterable (GH-93815)

fix #93814

Automerge-Triggered-By: GH:rhettinger
3 years ago[docs] Fix LOAD_ATTR version changed (GH-93816)
Ken Jin [Tue, 14 Jun 2022 16:22:32 +0000 (00:22 +0800)] 
[docs] Fix LOAD_ATTR version changed (GH-93816)

3 years agogh-93353: Fix regrtest for -jN with N >= 2 (GH-93813)
Victor Stinner [Tue, 14 Jun 2022 16:04:53 +0000 (18:04 +0200)] 
gh-93353: Fix regrtest for -jN with N >= 2 (GH-93813)

3 years agoRename 'LOAD_METHOD' specialization stat consts to 'ATTR'. (GH-93812)
Mark Shannon [Tue, 14 Jun 2022 15:44:01 +0000 (16:44 +0100)] 
Rename 'LOAD_METHOD' specialization stat consts to 'ATTR'. (GH-93812)

3 years agoRemove LOAD_METHOD stats. (GH-93807)
Mark Shannon [Tue, 14 Jun 2022 14:03:15 +0000 (15:03 +0100)] 
Remove LOAD_METHOD stats. (GH-93807)

3 years agogh-93795: Use test.support TESTFN/unlink in sqlite3 tests (#93796)
Erlend Egeberg Aasland [Tue, 14 Jun 2022 14:02:52 +0000 (16:02 +0200)] 
gh-93795: Use test.support TESTFN/unlink in sqlite3 tests (#93796)

3 years agoInclude freelists in allocation total. (GH-93799)
Mark Shannon [Tue, 14 Jun 2022 13:44:26 +0000 (14:44 +0100)] 
Include freelists in allocation total. (GH-93799)

3 years agoGH-93429: Document `LOAD_METHOD` removal (GH-93803)
Ken Jin [Tue, 14 Jun 2022 13:43:28 +0000 (21:43 +0800)] 
GH-93429: Document `LOAD_METHOD` removal (GH-93803)

3 years agogh-91877: Fix WriteTransport.get_write_buffer_{limits,size} docs (#92338)
Sanket Shanbhag [Tue, 14 Jun 2022 12:46:18 +0000 (18:16 +0530)] 
gh-91877: Fix WriteTransport.get_write_buffer_{limits,size} docs (#92338)

- Amend docs for WriteTransport.get_write_buffer_limits
- Add docs for WriteTransport.get_write_buffer_size

3 years agoGH-93678: reduce boilerplate and code repetition in the compiler (GH-93682)
Irit Katriel [Tue, 14 Jun 2022 12:40:09 +0000 (13:40 +0100)] 
GH-93678: reduce boilerplate and code repetition in the compiler (GH-93682)

3 years agogh-79579: Improve DML query detection in sqlite3 (#93623)
Erlend Egeberg Aasland [Tue, 14 Jun 2022 11:56:36 +0000 (13:56 +0200)] 
gh-79579: Improve DML query detection in sqlite3 (#93623)

The fix involves using pysqlite_check_remaining_sql(), not only to check
for multiple statements, but now also to strip leading comments and
whitespace from SQL statements, so we can improve DML query detection.

pysqlite_check_remaining_sql() is renamed lstrip_sql(), to more
accurately reflect its function, and hardened to handle more SQL comment
corner cases.

3 years agogh-93353: regrtest checks for leaked temporary files (#93776)
Victor Stinner [Tue, 14 Jun 2022 11:43:02 +0000 (13:43 +0200)] 
gh-93353: regrtest checks for leaked temporary files (#93776)

When running tests with -jN, create a temporary directory per process
and mark a test as "environment changed" if a test leaks a temporary
file or directory.

3 years agoGH-93429: Merge `LOAD_METHOD` back into `LOAD_ATTR` (GH-93430)
Ken Jin [Tue, 14 Jun 2022 10:36:22 +0000 (18:36 +0800)] 
GH-93429: Merge `LOAD_METHOD` back into `LOAD_ATTR` (GH-93430)

3 years agogh-90473: Include stdlib dir in wasmtime PYTHONPATH (GH-93797)
Christian Heimes [Tue, 14 Jun 2022 10:15:13 +0000 (12:15 +0200)] 
gh-90473: Include stdlib dir in wasmtime PYTHONPATH (GH-93797)

3 years agoGH-93516: Store offset of first traceable instruction in code object (GH-93769)
Mark Shannon [Tue, 14 Jun 2022 10:09:30 +0000 (11:09 +0100)] 
GH-93516: Store offset of first traceable instruction in code object (GH-93769)

3 years agoGH-93662: Make sure that column offsets are correct in multi-line method calls. ...
Mark Shannon [Tue, 14 Jun 2022 10:08:12 +0000 (11:08 +0100)] 
GH-93662: Make sure that column offsets are correct in multi-line method calls. (GH-93673)

3 years agogh-91321: Fix compatibility with C++ older than C++11 (#93784)
Victor Stinner [Tue, 14 Jun 2022 09:43:08 +0000 (11:43 +0200)] 
gh-91321: Fix compatibility with C++ older than C++11 (#93784)

Fix the compatibility of the Python C API with C++ older than C++11.

_Py_NULL is only defined as nullptr on C++11 and newer.

3 years agogh-89546: Clean up PyType_FromMetaclass (GH-93686)
Petr Viktorin [Tue, 14 Jun 2022 09:13:29 +0000 (11:13 +0200)] 
gh-89546: Clean up PyType_FromMetaclass (GH-93686)

When changing PyType_FromMetaclass recently (GH-93012, GH-93466, GH-28748)
I found a bunch of opportunities to improve the code. Here they are.

Fixes: #89546
Automerge-Triggered-By: GH:encukou
3 years agogh-93761: Fix test to avoid simple delay when synchronizing. (GH-93779)
Vinay Sajip [Tue, 14 Jun 2022 05:41:16 +0000 (06:41 +0100)] 
gh-93761: Fix test to avoid simple delay when synchronizing. (GH-93779)

3 years agogh-91810: Fix regression with writing an XML declaration with encoding='unicode'...
Serhiy Storchaka [Tue, 14 Jun 2022 04:25:33 +0000 (07:25 +0300)] 
gh-91810: Fix regression with writing an XML declaration with encoding='unicode' (GH-93426)

Suppress writing an XML declaration in open files in ElementTree.write()
with encoding='unicode' and xml_declaration=None.

If file patch is passed to ElementTree.write() with encoding='unicode',
always open a new file in UTF-8.

3 years agogh-79512: Fixed names and __module__ value of weakref classes (GH-93719)
Serhiy Storchaka [Tue, 14 Jun 2022 04:18:03 +0000 (07:18 +0300)] 
gh-79512: Fixed names and __module__ value of weakref classes (GH-93719)

Classes ReferenceType, ProxyType and CallableProxyType have now correct
atrtributes __module__, __name__ and __qualname__.
It makes them (types, not instances) pickleable.

3 years agogh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742)
Serhiy Storchaka [Tue, 14 Jun 2022 04:15:26 +0000 (07:15 +0300)] 
gh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742)

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.

3 years agogh-93353: Add test.support.late_deletion() (#93774)
Victor Stinner [Mon, 13 Jun 2022 23:09:23 +0000 (01:09 +0200)] 
gh-93353: Add test.support.late_deletion() (#93774)

3 years agogh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766)
Victor Stinner [Mon, 13 Jun 2022 18:09:40 +0000 (20:09 +0200)] 
gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766)

Header files in the Include/cpython/ are only included if
the Py_LIMITED_API macro is not defined.

3 years agogh-84461: Fix parallel testing on WebAssembly (GH-93768)
Christian Heimes [Mon, 13 Jun 2022 17:51:04 +0000 (19:51 +0200)] 
gh-84461: Fix parallel testing on WebAssembly (GH-93768)

3 years agogh-93353: Fix importlib.resources._tempfile() finalizer (#93377)
Victor Stinner [Mon, 13 Jun 2022 17:24:00 +0000 (19:24 +0200)] 
gh-93353: Fix importlib.resources._tempfile() finalizer (#93377)

Fix the importlib.resources.as_file() context manager to remove the
temporary file if destroyed late during Python finalization: keep a
local reference to the os.remove() function. Patch by Victor Stinner.

3 years agogh-84623: Remove unused imports in tests (#93772)
Victor Stinner [Mon, 13 Jun 2022 14:56:03 +0000 (16:56 +0200)] 
gh-84623: Remove unused imports in tests (#93772)

3 years agogh-91731: Don't define 'static_assert' in C++11 where is a keyword to avoid UB (GH...
Pablo Galindo Salgado [Mon, 13 Jun 2022 14:49:08 +0000 (15:49 +0100)] 
gh-91731: Don't define 'static_assert' in C++11 where is a keyword to avoid UB (GH-93700)

3 years agogh-84623: Remove unused imports in stdlib (#93773)
Victor Stinner [Mon, 13 Jun 2022 14:28:41 +0000 (16:28 +0200)] 
gh-84623: Remove unused imports in stdlib (#93773)

3 years agoRemove ANY_VARARGS() macro from the C API (#93764)
Victor Stinner [Mon, 13 Jun 2022 14:24:19 +0000 (16:24 +0200)] 
Remove ANY_VARARGS() macro from the C API (#93764)

The macro was exposed by mistake.

3 years agogh-89653: PEP 670: Convert PyFunction macros (#93765)
Victor Stinner [Mon, 13 Jun 2022 13:15:27 +0000 (15:15 +0200)] 
gh-89653: PEP 670: Convert PyFunction macros (#93765)

Convert PyFunction macros to static inline functions.

3 years agoAdd more FOR_ITER specialization stats (GH-32151)
Dennis Sweeney [Mon, 13 Jun 2022 05:40:54 +0000 (01:40 -0400)] 
Add more FOR_ITER specialization stats (GH-32151)

3 years agoGH-90699: use statically allocated strings in typeobject.c (gh-93751)
Kumar Aditya [Sun, 12 Jun 2022 16:38:18 +0000 (22:08 +0530)] 
GH-90699: use statically allocated strings in typeobject.c (gh-93751)

3 years agogh-93747: Fix Refleak when handling multiple Py_tp_doc slots (gh-93749)
Dong-hee Na [Sun, 12 Jun 2022 15:55:01 +0000 (00:55 +0900)] 
gh-93747: Fix Refleak when handling multiple Py_tp_doc slots (gh-93749)

3 years agogh-93728: fix memory leak in deepfrozen code objects (GH-93729)
Kumar Aditya [Sun, 12 Jun 2022 14:42:18 +0000 (20:12 +0530)] 
gh-93728: fix memory leak in deepfrozen code objects (GH-93729)

3 years agogh-91162: Support splitting of unpacked arbitrary-length tuple over TypeVar and TypeV...
Serhiy Storchaka [Sun, 12 Jun 2022 13:22:01 +0000 (16:22 +0300)] 
gh-91162: Support splitting of unpacked arbitrary-length tuple over TypeVar and TypeVarTuple parameters (alt) (GH-93412)

For example:

  A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]]
  A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]

3 years agoRemove usage of _Py_IDENTIFIER from math module (#93739)
Dong-hee Na [Sun, 12 Jun 2022 09:45:02 +0000 (18:45 +0900)] 
Remove usage of _Py_IDENTIFIER from math module (#93739)

3 years agogh-84508: tool to generate cjk traditional chinese mappings (gh-93272)
Davide Rizzo [Sat, 11 Jun 2022 14:19:41 +0000 (16:19 +0200)] 
gh-84508: tool to generate cjk traditional chinese mappings (gh-93272)

3 years agoChange list to view object (#93661)
Pamela Fox [Sat, 11 Jun 2022 10:54:31 +0000 (03:54 -0700)] 
Change list to view object (#93661)

3 years agogh-86404: [doc] A make sucpicious false positive. (GH-93710)
Julien Palard [Sat, 11 Jun 2022 10:52:25 +0000 (12:52 +0200)] 
gh-86404: [doc] A make sucpicious false positive. (GH-93710)

3 years agogh-90153: whatsnew: "z" option in format spec (GH-93624)
John Belmonte [Sat, 11 Jun 2022 09:58:49 +0000 (18:58 +0900)] 
gh-90153:  whatsnew: "z" option in format spec (GH-93624)

Add what's new entry for PEP 682 in Python 3.11.

3 years agogh-90473: Skip test_queue when threading is not available (GH-93712)
Christian Heimes [Sat, 11 Jun 2022 09:55:11 +0000 (11:55 +0200)] 
gh-90473: Skip test_queue when threading is not available (GH-93712)

3 years agogh-84461: Use HOSTRUNNER to run regression tests (GH-93694)
Christian Heimes [Sat, 11 Jun 2022 06:42:23 +0000 (08:42 +0200)] 
gh-84461: Use HOSTRUNNER to run regression tests (GH-93694)

Co-authored-by: Brett Cannon <brett@python.org>
3 years agogh-92930: _pickle.c: Acquire strong references before calling save() (GH-92931) 93670/head
Dennis Sweeney [Sat, 11 Jun 2022 01:50:11 +0000 (21:50 -0400)] 
gh-92930: _pickle.c: Acquire strong references before calling save() (GH-92931)

3 years agogh-92886: Fix tests that fail when running with optimizations (`-O`) in `test_zipimpo...
jackh-ncl [Fri, 10 Jun 2022 22:57:04 +0000 (23:57 +0100)] 
gh-92886: Fix tests that fail when running with optimizations (`-O`) in `test_zipimport.py` (GH-93236)

3 years agogh-91317: Document that Path does not collapse initial `//` (GH-32193)
Oleg Iarygin [Fri, 10 Jun 2022 22:52:36 +0000 (01:52 +0300)] 
gh-91317: Document that Path does not collapse initial `//` (GH-32193)

Documentation for `pathlib` says:

> Spurious slashes and single dots are collapsed, but double dots ('..') are not, since this would change the meaning of a path in the face of symbolic links:

However, it omits that initial double slashes also aren't collapsed.

Later, in documentation of `PurePath.drive`, `PurePath.root`, and `PurePath.name` it mentions UNC but:

- this abbreviation says nothing to a person who is unaware about existence of UNC (Wikipedia doesn't help either by [giving a disambiguation page](https://en.wikipedia.org/wiki/UNC))
- it shows up only if a person needs to use a specific property or decides to fully learn what the module provides.

For context, see the BPO entry.

3 years agogh-93461: Invalidate sys.path_importer_cache entries with relative paths (GH-93653)
Christian Heimes [Fri, 10 Jun 2022 21:56:26 +0000 (23:56 +0200)] 
gh-93461: Invalidate sys.path_importer_cache entries with relative paths (GH-93653)

3 years agoGH-93621: reorder code in with/async-with exception exit path to reduce the size...
Irit Katriel [Fri, 10 Jun 2022 16:53:34 +0000 (17:53 +0100)] 
GH-93621: reorder code in with/async-with exception exit path to reduce the size of the exception table (GH-93622)

3 years agogh-81790: support "UNC" device paths in `ntpath.splitdrive()` (GH-91882)
Barney Gale [Fri, 10 Jun 2022 15:59:55 +0000 (16:59 +0100)] 
gh-81790: support "UNC" device paths in `ntpath.splitdrive()` (GH-91882)