]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agogh-84623: Remove unused imports in idlelib (#94143)
Victor Stinner [Wed, 22 Jun 2022 22:09:48 +0000 (00:09 +0200)] 
gh-84623: Remove unused imports in idlelib (#94143)

Remove commented code in test_debugger_r.py.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
3 years agoAdd ABI dump Makefile target (#94136)
Pablo Galindo Salgado [Wed, 22 Jun 2022 21:22:27 +0000 (22:22 +0100)] 
Add ABI dump Makefile target (#94136)

3 years agogh-84623: Move imports in doctests (#94133)
Victor Stinner [Wed, 22 Jun 2022 20:24:45 +0000 (22:24 +0200)] 
gh-84623: Move imports in doctests (#94133)

Move imports in doctests to prevent false alarms in pyflakes.

3 years agogh-54781: Move Lib/tkinter/test/test_ttk/ to Lib/test/test_ttk/ (#94070)
Victor Stinner [Wed, 22 Jun 2022 20:23:37 +0000 (22:23 +0200)] 
gh-54781: Move Lib/tkinter/test/test_ttk/ to Lib/test/test_ttk/ (#94070)

* Move Lib/tkinter/test/test_tkinter/ to Lib/test/test_tkinter/.
* Move Lib/tkinter/test/test_ttk/ to Lib/test/test_ttk/.
* Add Lib/test/test_ttk/__init__.py based on test_ttk_guionly.py.
* Add Lib/test/test_tkinter/__init__.py
* Remove old Lib/test/test_tk.py.
* Remove old Lib/test/test_ttk_guionly.py.
* Add __main__ sub-modules.
* Update imports and update references to rename files.

3 years agogh-84623: Remove unused imports (#94132)
Victor Stinner [Wed, 22 Jun 2022 17:14:27 +0000 (19:14 +0200)] 
gh-84623: Remove unused imports (#94132)

3 years agogh-94114: Remove obsolete reference to python.org mirrors (GH-94115)
partev [Wed, 22 Jun 2022 16:55:06 +0000 (12:55 -0400)] 
gh-94114: Remove obsolete reference to python.org mirrors (GH-94115)

* gh-94114

3 years agogh-91172: Create a workflow for verifying bundled pip and setuptools (GH-31885)
Illia Volochii [Wed, 22 Jun 2022 13:32:22 +0000 (16:32 +0300)] 
gh-91172: Create a workflow for verifying bundled pip and setuptools (GH-31885)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
3 years agogh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxiliary importers...
Jason R. Coombs [Wed, 22 Jun 2022 12:05:45 +0000 (08:05 -0400)] 
gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxiliary importers. (GH-93962)

Co-authored-by: Brett Cannon <brett@python.org>
3 years agoFix typo in _io.TextIOWrapper Clinic input (#94037)
fikotta [Wed, 22 Jun 2022 12:02:14 +0000 (14:02 +0200)] 
Fix typo in _io.TextIOWrapper Clinic input (#94037)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agogh-94101 Disallow instantiation of SSLSession objects (GH-94102)
chgnrdv [Wed, 22 Jun 2022 10:10:22 +0000 (13:10 +0300)] 
gh-94101 Disallow instantiation of SSLSession objects (GH-94102)

Fixes #94101

Automerge-Triggered-By: GH:tiran
3 years agogh-74696: Do not change the current working directory in shutil.make_archive() if...
Serhiy Storchaka [Wed, 22 Jun 2022 08:47:25 +0000 (11:47 +0300)] 
gh-74696: Do not change the current working directory in shutil.make_archive() if possible (GH-93160)

It is no longer changed when create a zip or tar archive.

It is still changed for custom archivers registered with shutil.register_archive_format()
if root_dir is not None.

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agoStats: Add summary of top instructions for misses and deferred specialization. (GH...
Mark Shannon [Wed, 22 Jun 2022 07:50:02 +0000 (08:50 +0100)] 
Stats: Add summary of top instructions for misses and deferred specialization. (GH-94072)

3 years agogh-88123: Implement new Enum __contains__ (GH-93298)
Carl Bordum Hansen [Wed, 22 Jun 2022 07:04:04 +0000 (09:04 +0200)] 
gh-88123: Implement new Enum __contains__ (GH-93298)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
3 years agobpo-30535: [doc] state that sys.meta_path is not empty by default (GH-94098)
Irit Katriel [Tue, 21 Jun 2022 22:03:08 +0000 (23:03 +0100)] 
bpo-30535: [doc] state that sys.meta_path is not empty by default (GH-94098)

Co-authored-by: Windson yang <wiwindson@outlook.com>
3 years agogh-89336: Remove configparser APIs that were deprecated for 3.12 (#92503)
Gregory P. Smith [Tue, 21 Jun 2022 21:31:25 +0000 (14:31 -0700)] 
gh-89336: Remove configparser APIs that were deprecated for 3.12 (#92503)

https://github.com/python/cpython/issue/89336: Remove configparser 3.12 deprecations.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
3 years agogh-87389: Fix an open redirection vulnerability in http.server. (#93879)
Gregory P. Smith [Tue, 21 Jun 2022 20:16:57 +0000 (13:16 -0700)] 
gh-87389: Fix an open redirection vulnerability in http.server. (#93879)

Fix an open redirection vulnerability in the `http.server` module when
an URI path starts with `//` that could produce a 301 Location header
with a misleading target.  Vulnerability discovered, and logic fix
proposed, by Hamza Avvan (@hamzaavvan).

Test and comments authored by Gregory P. Smith [Google].

3 years agoDOC: correct bytesarray -> bytearray in comments (GH-92410)
Thomas A Caswell [Tue, 21 Jun 2022 20:04:03 +0000 (16:04 -0400)] 
DOC: correct bytesarray -> bytearray in comments (GH-92410)

3 years agogh-82927: Update files related to HTML entities. (GH-92504)
Ezio Melotti [Tue, 21 Jun 2022 20:03:12 +0000 (22:03 +0200)] 
gh-82927: Update files related to HTML entities. (GH-92504)

3 years agogh-93021: Fix __text_signature__ for __get__ (GH-93023)
Jelle Zijlstra [Tue, 21 Jun 2022 19:45:38 +0000 (12:45 -0700)] 
gh-93021: Fix __text_signature__ for __get__ (GH-93023)

Because of the way wrap_descr_get is written, the second argument
to __get__ methods implemented through the wrapper is always
optional.

3 years agoTutorial: specify match cases don't fall through (GH-93615)
max [Tue, 21 Jun 2022 19:44:09 +0000 (21:44 +0200)] 
Tutorial: specify match cases don't fall through (GH-93615)

3 years agogh-93240: clarify wording in IO tutorial (GH-93276)
paulreece [Tue, 21 Jun 2022 19:40:11 +0000 (15:40 -0400)] 
gh-93240: clarify wording in IO tutorial (GH-93276)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
3 years agoMinor optimization for Fractions.limit_denominator (GH-93730)
Mark Dickinson [Tue, 21 Jun 2022 19:36:35 +0000 (20:36 +0100)] 
Minor optimization for Fractions.limit_denominator (GH-93730)

When we construct the upper and lower candidates in limit_denominator,
the numerator and denominator are already relatively prime (and the
denominator positive) by construction, so there's no need to go through
the usual normalisation in the constructor. This saves a couple of
potentially expensive gcd calls.

Suggested by Michael Scott Asato Cuthbert in GH-93477.

3 years agogh-93675: Fix typos in `Doc/` (GH-93676)
luzpaz [Tue, 21 Jun 2022 19:10:45 +0000 (15:10 -0400)] 
gh-93675: Fix typos in `Doc/` (GH-93676)

Closes #93675

3 years agogh-93851: Fix all broken links in Doc/ (GH-93853)
Oleg Iarygin [Tue, 21 Jun 2022 18:55:18 +0000 (21:55 +0300)] 
gh-93851: Fix all broken links in Doc/ (GH-93853)

3 years agoCloses gh-94038: Update Release Schedule in README.rst from PEP 664 to PEP 693 (GH...
MilanJuhas [Tue, 21 Jun 2022 18:08:21 +0000 (20:08 +0200)] 
Closes gh-94038: Update Release Schedule in README.rst from PEP 664 to PEP 693 (GH-94046)

3 years agogh-94068: Remove HVSOCKET_CONTAINER_PASSTHRU constant because it has been removed...
Steve Dower [Tue, 21 Jun 2022 17:27:21 +0000 (18:27 +0100)] 
gh-94068: Remove HVSOCKET_CONTAINER_PASSTHRU constant because it has been removed from Windows (GH-94069)

Fixes #94068

Automerge-Triggered-By: GH:zware
3 years agogh-86986: Drop compatibility support for Sphinx 2 (GH-93737)
Adam Turner [Tue, 21 Jun 2022 15:04:46 +0000 (16:04 +0100)] 
gh-86986: Drop compatibility support for Sphinx 2 (GH-93737)

* Revert "bpo-42843: Keep Sphinx 1.8 and Sphinx 2 compatibility (GH-24282)"

This reverts commit 5c1f15b4b1024cbf0acc85832f0c623d1a4605fd

* Revert "bpo-42579: Make workaround for various versions of Sphinx more robust (GH-23662)"

This reverts commit b63a620014b67a6e63d10783149c41baaf59def8.

3 years agoGH-93841: Allow stats to be turned on and off, cleared and dumped at runtime. (GH...
Mark Shannon [Tue, 21 Jun 2022 14:40:54 +0000 (15:40 +0100)] 
GH-93841: Allow stats to be turned on and off, cleared and dumped at runtime. (GH-93843)

3 years agogh-74953: _PyThread_cond_after() uses _PyTime_t (#94056)
Victor Stinner [Tue, 21 Jun 2022 13:45:49 +0000 (15:45 +0200)] 
gh-74953: _PyThread_cond_after() uses _PyTime_t (#94056)

pthread _PyThread_cond_after() implementation now uses the _PyTime_t
type to handle properly overflow: clamp to the maximum value.

Remove MICROSECONDS_TO_TIMESPEC() function.

3 years agogh-54781: Move Lib/lib2to3/tests/ to Lib/test/test_lib2to3/ (#94049)
Victor Stinner [Tue, 21 Jun 2022 13:21:22 +0000 (15:21 +0200)] 
gh-54781: Move Lib/lib2to3/tests/ to Lib/test/test_lib2to3/ (#94049)

* Move Lib/lib2to3/tests/ to Lib/test/test_lib2to3/.
* Remove Lib/test/test_lib2to3.py.
* Update imports.
* all_project_files(): use different paths and sort files
  to make the tests more reproducible.
* Update references to tests.

3 years agogh-93839: Use load_package_tests() for testmock (GH-94055)
Christian Heimes [Tue, 21 Jun 2022 12:51:39 +0000 (14:51 +0200)] 
gh-93839: Use load_package_tests() for testmock (GH-94055)

Fixes failing tests on WebAssembly platforms.

Automerge-Triggered-By: GH:tiran
3 years agogh-94052: Don't re-run failed tests with --python option (#94054)
Christian Heimes [Tue, 21 Jun 2022 12:42:32 +0000 (14:42 +0200)] 
gh-94052: Don't re-run failed tests with --python option (#94054)

3 years agogh-94028: Clear and reset sqlite3 statements properly in cursor iternext (GH-94042)
Erlend Egeberg Aasland [Tue, 21 Jun 2022 11:30:29 +0000 (13:30 +0200)] 
gh-94028: Clear and reset sqlite3 statements properly in cursor iternext (GH-94042)

3 years agoGH-91432: Specialize FOR_ITER (GH-91713)
Dennis Sweeney [Tue, 21 Jun 2022 10:19:26 +0000 (06:19 -0400)] 
GH-91432: Specialize FOR_ITER (GH-91713)

* Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations.

* Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.

3 years agogh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ (#94043)
Victor Stinner [Tue, 21 Jun 2022 08:27:59 +0000 (10:27 +0200)] 
gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ (#94043)

* Move Lib/unittest/test/ to Lib/test/test_unittest/
* Remove Lib/test/test_unittest.py
* Replace unittest.test with test.test_unittest
* Remove unittest.load_tests()
* Rewrite unittest __init__.py and __main__.py
* Update build system, CODEOWNERS, and wasm_assets.py

3 years agogh-93839: Move Lib/ctypes/test/ to Lib/test/test_ctypes/ (#94041)
Victor Stinner [Tue, 21 Jun 2022 08:24:33 +0000 (10:24 +0200)] 
gh-93839: Move Lib/ctypes/test/ to Lib/test/test_ctypes/ (#94041)

* Move Lib/ctypes/test/ to Lib/test/test_ctypes/
* Remove Lib/test/test_ctypes.py
* Update imports and build system.

3 years agoGH-93678: refactor compiler so that optimizer does not need the assembler and compile...
Irit Katriel [Tue, 21 Jun 2022 08:22:17 +0000 (09:22 +0100)] 
GH-93678: refactor compiler so that optimizer does not need the assembler and compiler structs (GH-93842)

3 years agogh-94021: Address unreachable code warning in specialize code (GH-94022)
Christian Heimes [Tue, 21 Jun 2022 06:34:11 +0000 (08:34 +0200)] 
gh-94021: Address unreachable code warning in specialize code (GH-94022)

3 years agoGH-93249: relax overly strict assertion on bounds->ar_start (GH-93961)
Irit Katriel [Mon, 20 Jun 2022 16:13:39 +0000 (17:13 +0100)] 
GH-93249: relax overly strict assertion on bounds->ar_start (GH-93961)

3 years agogh-93937: PyOS_StdioReadline() uses PyConfig.legacy_windows_stdio (#94024)
Victor Stinner [Mon, 20 Jun 2022 14:10:47 +0000 (16:10 +0200)] 
gh-93937: PyOS_StdioReadline() uses PyConfig.legacy_windows_stdio (#94024)

On Windows, PyOS_StdioReadline() now gets
PyConfig.legacy_windows_stdio from _PyOS_ReadlineTState, rather than
using the deprecated global Py_LegacyWindowsStdioFlag variable.

Fix also a compiler warning in Py_SetStandardStreamEncoding().

3 years agogh-87347: Add parenthesis around macro arguments (#93915)
Victor Stinner [Mon, 20 Jun 2022 14:04:52 +0000 (16:04 +0200)] 
gh-87347: Add parenthesis around macro arguments (#93915)

Add unit test on Py_MEMBER_SIZE() and some other macros.

3 years agogh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (#92754)
Matthias Köppe [Mon, 20 Jun 2022 13:58:02 +0000 (09:58 -0400)] 
gh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (#92754)

3 years agoGH-93516: Speedup line number checks when tracing. (GH-93763)
Mark Shannon [Mon, 20 Jun 2022 12:00:42 +0000 (13:00 +0100)] 
GH-93516: Speedup line number checks when tracing. (GH-93763)

* Use a lookup table to reduce overhead of getting line numbers during tracing.

3 years agoGH-93897: Store frame size in code object and de-opt if insufficient space on thread...
Mark Shannon [Mon, 20 Jun 2022 11:59:25 +0000 (12:59 +0100)] 
GH-93897: Store frame size in code object and de-opt if insufficient space on thread frame stack. (GH-93908)

3 years agogh-84461: Silence some compiler warnings on WASM (GH-93978)
Christian Heimes [Mon, 20 Jun 2022 11:34:40 +0000 (13:34 +0200)] 
gh-84461: Silence some compiler warnings on WASM (GH-93978)

3 years agogh-79009: sqlite3.iterdump now correctly handles tables with autoincrement (#9621)
itssme [Sun, 19 Jun 2022 22:59:24 +0000 (00:59 +0200)] 
gh-79009: sqlite3.iterdump now correctly handles tables with autoincrement (#9621)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
3 years agogh-61162: Clarify sqlite3 connection context manager docs (GH-93890)
Erlend Egeberg Aasland [Sun, 19 Jun 2022 20:17:43 +0000 (22:17 +0200)] 
gh-61162: Clarify sqlite3 connection context manager docs (GH-93890)

Explicitly note that transactions are only closed if there is an open
transation at `__exit__`, and that transactions are not implicitly
opened during `__enter__`.

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Automerge-Triggered-By: GH:erlend-aasland
3 years agogh-93925: Improve clarity of sqlite3 commit/rollback, and close docs (#93926)
Erlend Egeberg Aasland [Sun, 19 Jun 2022 19:17:28 +0000 (21:17 +0200)] 
gh-93925: Improve clarity of sqlite3 commit/rollback, and close docs (#93926)

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agogh-84461: Skip test_unwritable_directory again on Emscripten (GH-94007)
Christian Heimes [Sun, 19 Jun 2022 18:18:57 +0000 (20:18 +0200)] 
gh-84461: Skip test_unwritable_directory again on Emscripten (GH-94007)

GH-93992 removed geteuid() and enabled the test again on Emscripten.

3 years agogh-84461: Fix Emscripten umask and permission issues (GH-94002)
Christian Heimes [Sun, 19 Jun 2022 16:28:55 +0000 (18:28 +0200)] 
gh-84461: Fix Emscripten umask and permission issues (GH-94002)

- Emscripten's default umask is too strict, see
  https://github.com/emscripten-core/emscripten/issues/17269
- getuid/getgid and geteuid/getegid are stubs that always return 0
  (root). Disable effective uid/gid syscalls and fix tests that use
  chmod() current user.
- Cannot drop X bit from directory.

3 years agogh-93991: Use boolean instead of 0/1 for condition check (GH-93992)
Lei Zhang [Sun, 19 Jun 2022 14:12:59 +0000 (07:12 -0700)] 
gh-93991: Use boolean instead of 0/1 for condition check (GH-93992)

# gh-93991: Use boolean instead of 0/1 for condition check

3 years agogh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938)
Victor Stinner [Sun, 19 Jun 2022 10:02:33 +0000 (12:02 +0200)] 
gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938)

Move the follow functions and type from frameobject.h to pyframe.h,
so the standard <Python.h> provide frame getter functions:

* PyFrame_Check()
* PyFrame_GetBack()
* PyFrame_GetBuiltins()
* PyFrame_GetGenerator()
* PyFrame_GetGlobals()
* PyFrame_GetLasti()
* PyFrame_GetLocals()
* PyFrame_Type

Remove #include "frameobject.h" from many C files. It's no longer
needed.

3 years agogh-74953: Reformat PyThread_acquire_lock_timed() (#93947)
Victor Stinner [Sun, 19 Jun 2022 09:50:21 +0000 (11:50 +0200)] 
gh-74953: Reformat PyThread_acquire_lock_timed() (#93947)

Reformat the pthread implementation of PyThread_acquire_lock_timed()
using a mutex and a conditioinal variable.

* Add goto to avoid multiple indentation levels and exit quickly
* Use "while(1)" and make the control flow more obvious.
* PEP 7: Add braces around if blocks.

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()