]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agoGH-109408: Move the C file whitespace check from patchcheck to pre-commit (#109890)
Adam Turner [Tue, 10 Oct 2023 13:40:08 +0000 (14:40 +0100)] 
GH-109408: Move the C file whitespace check from patchcheck to pre-commit (#109890)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoDon't doubly-parallelise sphinx-lint (#110617)
Adam Turner [Tue, 10 Oct 2023 12:51:20 +0000 (13:51 +0100)] 
Don't doubly-parallelise sphinx-lint (#110617)

2 years agogh-110050: Adjust the newline position in the TypeError message of the random.seed...
Yilei Yang [Tue, 10 Oct 2023 12:16:26 +0000 (05:16 -0700)] 
gh-110050: Adjust the newline position in the TypeError message of the random.seed call. (#110051)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2 years agogh-101100: Fix sphinx warnings in `library/socketserver.rst` (GH-110207)
Nikita Sobolev [Tue, 10 Oct 2023 11:44:19 +0000 (14:44 +0300)] 
gh-101100: Fix sphinx warnings in `library/socketserver.rst` (GH-110207)

2 years agogh-110388: Add tests for tty (GH-110394)
Serhiy Storchaka [Tue, 10 Oct 2023 11:42:25 +0000 (14:42 +0300)] 
gh-110388: Add tests for tty (GH-110394)

2 years agogh-81002: Add tests for termios (GH-110386)
Serhiy Storchaka [Tue, 10 Oct 2023 11:35:15 +0000 (14:35 +0300)] 
gh-81002: Add tests for termios (GH-110386)

2 years agogh-110590: Fix a bug where _sre.compile would overwrite exceptions (#110591)
Nikita Sobolev [Tue, 10 Oct 2023 10:15:12 +0000 (13:15 +0300)] 
gh-110590: Fix a bug where _sre.compile would overwrite exceptions (#110591)

TypeError would be overwritten by OverflowError
if 'code' param contained non-ints.

2 years agogh-109595: Add -Xcpu_count=<n> cmdline for container users (#109667)
Donghee Na [Tue, 10 Oct 2023 10:00:09 +0000 (19:00 +0900)] 
gh-109595: Add -Xcpu_count=<n> cmdline for container users (#109667)

---------

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2 years agogh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async...
Serhiy Storchaka [Tue, 10 Oct 2023 09:38:40 +0000 (12:38 +0300)] 
gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async (#110500)

It now fails if the original bug is not fixed, and no longer produce ResourceWarning with fixed code.

2 years agogh-110558: Enable ruff's pyupgrade rules when running on Argument Clinic (#110603)
Alex Waygood [Tue, 10 Oct 2023 09:35:36 +0000 (11:35 +0200)] 
gh-110558: Enable ruff's pyupgrade rules when running on Argument Clinic (#110603)

2 years agogh-84570: Implement Waiting in SendChannel.send() (gh-110565)
Eric Snow [Tue, 10 Oct 2023 09:35:14 +0000 (03:35 -0600)] 
gh-84570: Implement Waiting in SendChannel.send() (gh-110565)

We had been faking it (poorly).

We will add timeouts separately.

2 years agogh-107652: Fix CIFuzz typo (#110602)
Nikita Sobolev [Tue, 10 Oct 2023 09:34:48 +0000 (12:34 +0300)] 
gh-107652: Fix CIFuzz typo (#110602)

2 years agoGH-109408: Move the Python file whitespace check from patchcheck to pre-commit (...
Adam Turner [Tue, 10 Oct 2023 09:17:53 +0000 (10:17 +0100)] 
GH-109408: Move the Python file whitespace check from patchcheck to pre-commit (#109891)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoRemove an old macro from executor.c (#110597)
Brandt Bucher [Tue, 10 Oct 2023 08:45:23 +0000 (10:45 +0200)] 
Remove an old macro from executor.c (#110597)

2 years agoGH-104584: Fix refleak when tracing through calls (GH-110593)
Brandt Bucher [Tue, 10 Oct 2023 08:29:48 +0000 (10:29 +0200)] 
GH-104584: Fix refleak when tracing through calls (GH-110593)

2 years agoAdd some 'meta hooks' to our pre-commit config (#110587)
Alex Waygood [Tue, 10 Oct 2023 08:21:58 +0000 (10:21 +0200)] 
Add some 'meta hooks' to our pre-commit config (#110587)

2 years agogh-109408: Add the docs whitespace check from patchcheck to pre-commit (#109854)
Hugo van Kemenade [Tue, 10 Oct 2023 08:11:51 +0000 (10:11 +0200)] 
gh-109408: Add the docs whitespace check from patchcheck to pre-commit (#109854)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agogh-110558: Run ruff on Argument Clinic in CI (#110559)
Alex Waygood [Tue, 10 Oct 2023 07:52:39 +0000 (09:52 +0200)] 
gh-110558: Run ruff on Argument Clinic in CI (#110559)

2 years agogh-110378: Close invalid generators in contextmanager and asynccontextmanager (GH...
Serhiy Storchaka [Tue, 10 Oct 2023 07:43:04 +0000 (10:43 +0300)] 
gh-110378: Close invalid generators in contextmanager and asynccontextmanager (GH-110499)

contextmanager and asynccontextmanager context managers now close an invalid
underlying generator object that yields more then one value.

2 years agoFix CIFuzz build (#110576)
Nikita Sobolev [Tue, 10 Oct 2023 06:44:57 +0000 (09:44 +0300)] 
Fix CIFuzz build (#110576)

2 years agogh-109693: Use pyatomic.h for signal module (gh-110480)
Donghee Na [Mon, 9 Oct 2023 23:26:29 +0000 (08:26 +0900)] 
gh-109693: Use pyatomic.h for signal module (gh-110480)

2 years agoRemove unused `SPHINXLINT` var from `Doc/Makefile`. (#110570)
Ezio Melotti [Mon, 9 Oct 2023 22:30:23 +0000 (00:30 +0200)] 
Remove unused `SPHINXLINT` var from `Doc/Makefile`. (#110570)

Remove unused `SPHINXLINT` var.

2 years agogh-78469: Declare missing sethostname for Solaris 10 (#109447)
Jakub Kulík [Mon, 9 Oct 2023 21:18:05 +0000 (23:18 +0200)] 
gh-78469: Declare missing sethostname for Solaris 10 (#109447)

Add OS version specific macro for Solaris: Py_SUNOS_VERSION.

2 years agogh-106765: Updates Windows installer build instructions to clarify system requirement...
Ashish Shirodkar [Mon, 9 Oct 2023 21:15:19 +0000 (02:45 +0530)] 
gh-106765: Updates Windows installer build instructions to clarify system requirements (GH-110566)

2 years agogh-107652: Set up CIFuzz to run fuzz targets continuously (#107653)
Illia Volochii [Mon, 9 Oct 2023 15:30:10 +0000 (18:30 +0300)] 
gh-107652: Set up CIFuzz to run fuzz targets continuously (#107653)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-110519: Improve deprecation warning in the gettext module (#110520)
Serhiy Storchaka [Mon, 9 Oct 2023 13:45:22 +0000 (16:45 +0300)] 
gh-110519: Improve deprecation warning in the gettext module (#110520)

Deprecation warning about non-integer numbers in gettext now always refers
to the line in the user code where gettext function or method is used.
Previously, it could refer to a line in gettext code.

Also, increase test coverage for NullTranslations and domain-aware functions
like dngettext().

2 years agogh-76785: Add SendChannel.send_buffer() (#110246)
Eric Snow [Mon, 9 Oct 2023 13:39:51 +0000 (07:39 -0600)] 
gh-76785: Add SendChannel.send_buffer() (#110246)

(This is still a test module.)

2 years agogh-109191: Fix build with newer editline (gh-110239)
Bo Anderson [Mon, 9 Oct 2023 13:21:20 +0000 (14:21 +0100)] 
gh-109191: Fix build with newer editline (gh-110239)

2 years agogh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of DLLs...
Steve Dower [Mon, 9 Oct 2023 11:17:42 +0000 (12:17 +0100)] 
gh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of DLLs to bundle (GH-110470)

2 years agogh-110525: Cover PySet_Add corner case with frozenset objects (GH-110544)
Nikita Sobolev [Mon, 9 Oct 2023 11:04:49 +0000 (14:04 +0300)] 
gh-110525: Cover PySet_Add corner case with frozenset objects (GH-110544)

2 years agogh-110549: Remove unused includes of <stddef.h> in _testcapi (GH-110552)
Nikita Sobolev [Mon, 9 Oct 2023 10:37:57 +0000 (13:37 +0300)] 
gh-110549: Remove unused includes of <stddef.h> in _testcapi (GH-110552)

2 years agogh-109286: Update macOS installer to use SQLite 3.43.1 (#110482)
jtranquilli [Mon, 9 Oct 2023 10:05:50 +0000 (06:05 -0400)] 
gh-109286: Update macOS installer to use SQLite 3.43.1 (#110482)

2 years agogh-110497: Add note about `OSError` being an alias to `IOError` in docs (#110498)
Nikita Sobolev [Mon, 9 Oct 2023 09:18:06 +0000 (12:18 +0300)] 
gh-110497: Add note about `OSError` being an alias to `IOError` in docs (#110498)

2 years agogh-110525: Add CAPI tests for set and frozenset objects (GH-110526)
Nikita Sobolev [Mon, 9 Oct 2023 08:57:48 +0000 (11:57 +0300)] 
gh-110525: Add CAPI tests for set and frozenset objects (GH-110526)

2 years agogh-110514: Add PY_THROW to `sys.setprofile` events (GH-110524)
Tian Gao [Mon, 9 Oct 2023 08:38:45 +0000 (01:38 -0700)] 
gh-110514: Add PY_THROW to `sys.setprofile` events (GH-110524)

2 years agogh-106670: Set convenience variable for post mortem debugging (#110493)
Tian Gao [Mon, 9 Oct 2023 08:17:24 +0000 (01:17 -0700)] 
gh-106670: Set convenience variable for post mortem debugging (#110493)

2 years agoRemove unused imports in multiprocessing docs example (#109984)
Albert Villanova del Moral [Mon, 9 Oct 2023 05:36:01 +0000 (07:36 +0200)] 
Remove unused imports in multiprocessing docs example (#109984)

2 years agogh-110534 fix a URL redirect to wikipedia article on Fibonacci numbers (#110535)
partev [Mon, 9 Oct 2023 04:44:15 +0000 (00:44 -0400)] 
gh-110534 fix a URL redirect to wikipedia article on Fibonacci numbers (#110535)

2 years agogh-108277: Fix test_os TimerfdTests (#110515)
Victor Stinner [Sun, 8 Oct 2023 11:26:18 +0000 (13:26 +0200)] 
gh-108277: Fix test_os TimerfdTests (#110515)

* test_timerfd_TFD_TIMER_ABSTIME() and
  test_timerfd_ns_TFD_TIMER_ABSTIME() tolerate a difference of 50 us.
* test_timerfd_negative() checks if os.TFD_TIMER_CANCEL_ON_SET is
  defined.

2 years agogh-89902: Deprecate non-standard format specifier "N" for Decimal (GH-110508)
Serhiy Storchaka [Sun, 8 Oct 2023 07:01:39 +0000 (10:01 +0300)] 
gh-89902: Deprecate non-standard format specifier "N" for Decimal (GH-110508)

It was not documented and only supported in the C implementation.

2 years agogh-110378: Move to `IsolatedAsyncTestCase` in `test_contextlib_async.py` (#110379)
Nikita Sobolev [Sun, 8 Oct 2023 06:14:56 +0000 (09:14 +0300)] 
gh-110378: Move to `IsolatedAsyncTestCase` in `test_contextlib_async.py` (#110379)

2 years agoUpdate floatingpoint.rst (#110509)
zipperer [Sun, 8 Oct 2023 00:07:36 +0000 (19:07 -0500)] 
Update floatingpoint.rst (#110509)

This commit removes a ':'. I believe the extra colon causes a display error.

What I believe to be an error:
Above this expression
`round(math.pi, ndigits=2) == round(22 / 7, ndigits=2)`
the page displays `.. doctest::`.

What I observed:
After I remove the extra colon, the page does not display `.. doctest::`

2 years agogh-110237: Check `PyList_Append` for errors in `_PyEval_MatchClass` (#110238)
denballakh [Sun, 8 Oct 2023 00:04:51 +0000 (03:04 +0300)] 
gh-110237: Check `PyList_Append` for errors in `_PyEval_MatchClass` (#110238)

2 years agogh-108277: Add os.timerfd_create() function (#108382)
Masaru Tsuchiyama [Sat, 7 Oct 2023 17:33:22 +0000 (02:33 +0900)] 
gh-108277: Add os.timerfd_create() function (#108382)

Add wrapper for timerfd_create, timerfd_settime, and timerfd_gettime to os module.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-110397: Add Py_IsFinalizing() to the stable ABI (#110441)
Victor Stinner [Sat, 7 Oct 2023 15:59:16 +0000 (17:59 +0200)] 
gh-110397: Add Py_IsFinalizing() to the stable ABI (#110441)

2 years agogh-109848: Make test_rot13_func in test_codecs independent (GH-109850)
Serhiy Storchaka [Sat, 7 Oct 2023 13:01:39 +0000 (16:01 +0300)] 
gh-109848: Make test_rot13_func in test_codecs independent (GH-109850)

2 years agogh-109864: Make test_gettext tests order independent (GH-109866)
Serhiy Storchaka [Sat, 7 Oct 2023 13:00:28 +0000 (16:00 +0300)] 
gh-109864: Make test_gettext tests order independent (GH-109866)

2 years agogh-76785: Support Running Some Functions in Subinterpreters (gh-110251)
Eric Snow [Fri, 6 Oct 2023 23:52:22 +0000 (17:52 -0600)] 
gh-76785: Support Running Some Functions in Subinterpreters (gh-110251)

This specifically refers to `test.support.interpreters.Interpreter.run()`.

2 years agogh-106078: Suppress the warning caused by multi-phase initialization of `decimal...
Charlie Zhao [Fri, 6 Oct 2023 23:15:19 +0000 (07:15 +0800)] 
gh-106078: Suppress the warning caused by multi-phase initialization of `decimal` (#107524)

2 years agoGH-110455: Guard `assert(tstate->thread_id > 0)` with `#ifndef HAVE_PTHREAD_STUBS...
Brett Cannon [Fri, 6 Oct 2023 23:12:19 +0000 (16:12 -0700)] 
GH-110455: Guard `assert(tstate->thread_id > 0)` with `#ifndef HAVE_PTHREAD_STUBS` (GH-110487)

2 years agogh-110489: Optimise math.ceil for known exact float (#108801)
Shantanu [Fri, 6 Oct 2023 22:57:18 +0000 (15:57 -0700)] 
gh-110489: Optimise math.ceil for known exact float (#108801)

This matches a similar optimisation done for math.floor in
https://github.com/python/cpython/pull/21072

2 years agogh-109286: Update Windows installer to use SQLite 3.43.1 (#110403)
jtranquilli [Fri, 6 Oct 2023 15:12:15 +0000 (11:12 -0400)] 
gh-109286: Update Windows installer to use SQLite 3.43.1 (#110403)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years agoFix typo in Doc/library/textwrap.rst (#110328)
InSync [Fri, 6 Oct 2023 14:25:02 +0000 (21:25 +0700)] 
Fix typo in Doc/library/textwrap.rst (#110328)

"One problem with this is algorithm is that [...]" -> "One problem with this algorithm is that [...]"

2 years agogh-110184: Fix subprocess test_pipesize_default() (#110465)
Victor Stinner [Fri, 6 Oct 2023 13:44:53 +0000 (15:44 +0200)] 
gh-110184: Fix subprocess test_pipesize_default() (#110465)

For proc.stdin, get the size of the read end of the test pipe.

Use subprocess context manager ("with proc:").

2 years agogh-103053: Fix test_tools.test_freeze on FreeBSD (#110451)
Victor Stinner [Fri, 6 Oct 2023 01:08:34 +0000 (03:08 +0200)] 
gh-103053: Fix test_tools.test_freeze on FreeBSD (#110451)

Fix test_tools.test_freeze on FreeBSD: run "make distclean" instead
of "make clean" in the copied source directory to remove also the
"python" program.

Other test_freeze changes:

* Log executed commands and directories, and the current directory.
* No longer uses make -C option to change the directory, instead use
  subprocess cwd parameter.

2 years agogh-103053: Fix make check-clean-src: check "python" program (#110449)
Victor Stinner [Fri, 6 Oct 2023 00:46:52 +0000 (02:46 +0200)] 
gh-103053: Fix make check-clean-src: check "python" program (#110449)

"make check-clean-src" now also checks if the "python" program is
found in the source directory: fail with an error if it does exist.

2 years agoAdd support.MS_WINDOWS constant (#110446)
Victor Stinner [Fri, 6 Oct 2023 00:37:28 +0000 (02:37 +0200)] 
Add support.MS_WINDOWS constant (#110446)

2 years agogh-109287: fix overrides in cases generator (#110419)
Carl Meyer [Thu, 5 Oct 2023 22:05:29 +0000 (15:05 -0700)] 
gh-109287: fix overrides in cases generator (#110419)

2 years agogh-85283: Add PySys_AuditTuple() function (#108965)
Victor Stinner [Thu, 5 Oct 2023 21:59:35 +0000 (23:59 +0200)] 
gh-85283: Add PySys_AuditTuple() function (#108965)

sys.audit() now has assertions to check that the event argument is
not NULL and that the format argument does not use the "N" format.

Add tests on PySys_AuditTuple().

2 years agogh-109888: Fix test_os _kill_with_event() on Windows (#110421)
Victor Stinner [Thu, 5 Oct 2023 21:40:49 +0000 (23:40 +0200)] 
gh-109888: Fix test_os _kill_with_event() on Windows (#110421)

Replace os.kill() with proc.kill() which catchs PermissionError.

Rewrite _kill_with_event():

* Use subprocess context manager ("with proc:").
* Use sleeping_retry() to wait until the child process is ready.
* Replace SIGINT with proc.kill() on error.
* Replace 10 seconds with SHORT_TIMEOUT to wait until the process is
  ready.
* Replace 0.5 seconds with SHORT_TIMEOUT to wait for the process
  exit.

2 years agogh-110429: Fix race condition in "make regen-all" (#110433)
Victor Stinner [Thu, 5 Oct 2023 20:26:37 +0000 (22:26 +0200)] 
gh-110429: Fix race condition in "make regen-all" (#110433)

"make regen-pegen" now creates a temporary file called "parser.c.new"
instead of "parser.new.c". Previously, if "make clinic" was run in
parallel with "make regen-all", clinic may try but fail to open
"parser.new.c" if the temporay file was removed in the meanwhile.

2 years agogh-110383: Swap 'the all' -> 'all the' in socket docs (#110434)
Bradley Reynolds [Thu, 5 Oct 2023 19:55:44 +0000 (14:55 -0500)] 
gh-110383: Swap 'the all' -> 'all the' in socket docs (#110434)

2 years agogh-110119: Fix test_importlib `--disable-gil` Windows test failures (#110422)
Sam Gross [Thu, 5 Oct 2023 19:51:17 +0000 (19:51 +0000)] 
gh-110119: Fix test_importlib `--disable-gil` Windows test failures (#110422)

Use "t" in the expected tag for `--disable-gil` builds in test_tagged_suffix.

2 years agogh-109840: Fix multiprocessing test_waitfor_timeout() (#110428)
Victor Stinner [Thu, 5 Oct 2023 19:32:06 +0000 (21:32 +0200)] 
gh-109840: Fix multiprocessing test_waitfor_timeout() (#110428)

Don't measure the CI performance: don't fail if cond.wait_for() takes
longer than 1 second on a slow CI.

2 years agogh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (#110413)
Victor Stinner [Thu, 5 Oct 2023 18:54:27 +0000 (20:54 +0200)] 
gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (#110413)

Increase support.LOOPBACK_TIMEOUT from 5 to 10 seconds. Also increase
the timeout depending on the --timeout option. For example, for a
test timeout of 40 minutes (ARM Raspbian 3.x), use LOOPBACK_TIMEOUT
of 20 seconds instead of 5 seconds before.

2 years agogh-110167: Fix test_socket deadlock in doCleanups() (#110416)
Victor Stinner [Thu, 5 Oct 2023 18:53:03 +0000 (20:53 +0200)] 
gh-110167: Fix test_socket deadlock in doCleanups() (#110416)

Fix a deadlock in test_socket when server fails with a timeout but
the client is still running in its thread. Don't hold a lock to call
cleanup functions in doCleanups(). One of the cleanup function waits
until the client completes, whereas the client could deadlock if it
called addCleanup() in such situation.

doCleanups() is called when the server completed, but the client can
still be running in its thread especially if the server failed with a
timeout. Don't put a lock on doCleanups() to prevent deadlock between
addCleanup() called in the client and doCleanups() waiting for
self.done.wait of ThreadableTest._setUp().

2 years agogh-110147: test_msvcrt: run console I/O tests in new processes (#110268)
AN Long [Thu, 5 Oct 2023 17:52:26 +0000 (01:52 +0800)] 
gh-110147: test_msvcrt: run console I/O tests in new processes (#110268)

2 years agoFix env var typo in perf profiling docs (#110404)
Harmen Stoppels [Thu, 5 Oct 2023 17:27:19 +0000 (19:27 +0200)] 
Fix env var typo in perf profiling docs (#110404)

Fix typo in docs

2 years agogh-110383 TimeIt Docs Spelling Fix (#110407)
Towster15 [Thu, 5 Oct 2023 17:01:35 +0000 (18:01 +0100)] 
gh-110383 TimeIt Docs Spelling Fix (#110407)

Make 0.2 second plural

2 years agogh-110391: socket NetworkConnectionAttributesTest always declare cli (#110401)
Victor Stinner [Thu, 5 Oct 2023 16:31:02 +0000 (18:31 +0200)] 
gh-110391: socket NetworkConnectionAttributesTest always declare cli (#110401)

NetworkConnectionAttributesTest of test_socket now always declare the
'cli' attribute, so clientTearDown() cannot fail with AttributeError.

2 years agogh-109549: Add new states to PyThreadState to support PEP 703 (gh-109915)
Sam Gross [Thu, 5 Oct 2023 15:46:33 +0000 (15:46 +0000)] 
gh-109549: Add new states to PyThreadState to support PEP 703 (gh-109915)

This adds a new field 'state' to PyThreadState that can take on one of three values: _Py_THREAD_ATTACHED, _Py_THREAD_DETACHED, or _Py_THREAD_GC.  The "attached" and "detached" states correspond closely to acquiring and releasing the GIL.  The "gc" state is current unused, but will be used to implement stop-the-world GC for --disable-gil builds in the near future.

2 years agogh-109329: Add stat for "trace too short" (GH-110402)
Michael Droettboom [Thu, 5 Oct 2023 15:12:06 +0000 (11:12 -0400)] 
gh-109329: Add stat for "trace too short" (GH-110402)

2 years agogh-110393: Remove watchdog with hardcoded timeout (#110400)
Victor Stinner [Thu, 5 Oct 2023 15:02:48 +0000 (17:02 +0200)] 
gh-110393: Remove watchdog with hardcoded timeout (#110400)

test_builtin and test_socketserver no longer use signal.alarm() to
implement a watchdog with a hardcoded timeout (2 and 60 seconds).
Python test runner regrtest has two watchdogs: faulthandler and
timeout on running worker processes. Tests using short hardcoded
timeout can fail on slowest buildbots just because the timeout is too
short.

2 years agogh-82367: Use `FindFirstFile` Win32 API in `ntpath.realpath()` (GH-110298)
박문식 [Thu, 5 Oct 2023 14:49:07 +0000 (23:49 +0900)] 
gh-82367: Use `FindFirstFile` Win32 API in `ntpath.realpath()` (GH-110298)

* Use `FindFirstFile` Win32 API to fix a bug where `ntpath.realpath()`
breaks out of traversing a series of paths where a (handled)
`ERROR_ACCESS_DENIED` or `ERROR_SHARING_VIOLATION` occurs.
* Update docs to reflect that `ntpath.realpath()` eliminates MS-DOS
style names.

2 years agogh-110309: Prune empty constant in format specs (#110320)
sunmy2019 [Thu, 5 Oct 2023 14:08:42 +0000 (22:08 +0800)] 
gh-110309: Prune empty constant in format specs (#110320)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years agogh-110259: Fix f-strings with multiline expressions and format specs (#110271)
Pablo Galindo Salgado [Thu, 5 Oct 2023 13:26:44 +0000 (14:26 +0100)] 
gh-110259: Fix f-strings with multiline expressions and format specs (#110271)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2 years agogh-110367: Fix regrtest test_worker_output_on_failure() on ASAN build (#110387)
Victor Stinner [Thu, 5 Oct 2023 12:42:36 +0000 (14:42 +0200)] 
gh-110367: Fix regrtest test_worker_output_on_failure() on ASAN build (#110387)

Set ASAN_OPTIONS="handle_segv=0" env var to run the test.

2 years agogh-110365: Fix error overwrite in `termios.tcsetattr` (#110366)
Nikita Sobolev [Thu, 5 Oct 2023 11:02:52 +0000 (14:02 +0300)] 
gh-110365: Fix error overwrite in `termios.tcsetattr` (#110366)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years agogh-110367: Enhance regrtest -jN --verbose3 (#110368)
Victor Stinner [Thu, 5 Oct 2023 06:24:43 +0000 (08:24 +0200)] 
gh-110367: Enhance regrtest -jN --verbose3 (#110368)

When using worker processes (-jN) with --verbose3 option, regrtest
can now display the worker output even if a worker process does
crash.  Previously, sys.stdout and sys.stderr were replaced and so
the worker output was lost on a crash.

2 years agoRemove duplicate word. (#110376)
Benjamin Peterson [Thu, 5 Oct 2023 04:18:17 +0000 (15:18 +1100)] 
Remove duplicate word. (#110376)

2 years agogh-88402: Add new sysconfig variables on Windows (GH-110049) 110252/head
Sam Gross [Wed, 4 Oct 2023 22:50:29 +0000 (22:50 +0000)] 
gh-88402: Add new sysconfig variables on Windows (GH-110049)

Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>
2 years agogh-110310: Add a Per-Interpreter XID Registry for Heap Types (gh-110311)
Eric Snow [Wed, 4 Oct 2023 22:35:27 +0000 (16:35 -0600)] 
gh-110310: Add a Per-Interpreter XID Registry for Heap Types (gh-110311)

We do the following:

* add a per-interpreter XID registry (PyInterpreterState.xidregistry)
* put heap types there (keep static types in _PyRuntimeState.xidregistry)
* clear the registries during interpreter/runtime finalization
* avoid duplicate entries in the registry (when _PyCrossInterpreterData_RegisterClass() is called more than once for a type)
* use Py_TYPE() instead of PyObject_Type() in _PyCrossInterpreterData_Lookup()

The per-interpreter registry helps preserve isolation between interpreters.  This is important when heap types are registered, which is something we haven't been doing yet but I will likely do soon.

2 years agoGH-109329: Add tier 2 stats (GH-109913)
Michael Droettboom [Wed, 4 Oct 2023 21:52:28 +0000 (17:52 -0400)] 
GH-109329: Add tier 2 stats (GH-109913)

2 years agoAdd back bltin-boolean-values ref tag (#110371)
P. L. Lim [Wed, 4 Oct 2023 19:56:11 +0000 (15:56 -0400)] 
Add back bltin-boolean-values ref tag (#110371)

To avoid breaking downstream intersphinx via numpydoc

2 years agogh-76785: Print the Traceback from Interpreter.run() (gh-110322)
Eric Snow [Wed, 4 Oct 2023 17:57:03 +0000 (11:57 -0600)] 
gh-76785: Print the Traceback from Interpreter.run() (gh-110322)

This is a temporary solution.  The full fix may involve serializing the traceback in some form.

(FYI, I merged this yesterday and the reverted it due to buildbot failures.  See gh-110248.)

2 years agogh-110222: Add support of PyStructSequence in copy.replace() (GH-110223)
Xuehai Pan [Wed, 4 Oct 2023 16:47:41 +0000 (00:47 +0800)] 
gh-110222: Add support of PyStructSequence in copy.replace() (GH-110223)

2 years agogh-110235: Raise TypeError for duplicate/unknown fields in PyStructSequence construct...
Xuehai Pan [Wed, 4 Oct 2023 16:44:17 +0000 (00:44 +0800)] 
gh-110235: Raise TypeError for duplicate/unknown fields in PyStructSequence constructor (GH-110258)

2 years agoGH-109369: Merge all eval-breaker flags and monitoring version into one word. (GH...
Mark Shannon [Wed, 4 Oct 2023 15:09:48 +0000 (16:09 +0100)] 
GH-109369: Merge all eval-breaker flags and monitoring version into one word. (GH-109846)

2 years agogh-104909: Split more LOAD_ATTR specializations (GH-110317)
Guido van Rossum [Wed, 4 Oct 2023 15:08:02 +0000 (08:08 -0700)] 
gh-104909: Split more LOAD_ATTR specializations (GH-110317)

* Split LOAD_ATTR_MODULE

* Split LOAD_ATTR_WITH_HINT

* Split _GUARD_TYPE_VERSION out of the latter

* Split LOAD_ATTR_CLASS

* Split LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES

* Fix indent of DEOPT_IF in macros

* Split LOAD_ATTR_METHOD_LAZY_DICT

* Split LOAD_ATTR_NONDESCRIPTOR_NO_DICT

* Fix omission of _CHECK_ATTR_METHOD_LAZY_DICT

2 years agoLint: Remove files that no longer fail to parse or with F811 (#110356)
Hugo van Kemenade [Wed, 4 Oct 2023 13:11:32 +0000 (07:11 -0600)] 
Lint: Remove files that no longer fail to parse or with F811 (#110356)

2 years agogh-110260: Check for PyList_SetItem() errors in termios module (GH-110261)
Nikita Sobolev [Wed, 4 Oct 2023 12:42:17 +0000 (15:42 +0300)] 
gh-110260: Check for PyList_SetItem() errors in termios module (GH-110261)

2 years agogh-109151: Enable readline in the sqlite3 CLI (GH-109152)
Serhiy Storchaka [Wed, 4 Oct 2023 11:16:44 +0000 (14:16 +0300)] 
gh-109151: Enable readline in the sqlite3 CLI (GH-109152)

2 years agogh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (#110334)
Nikita Sobolev [Wed, 4 Oct 2023 10:51:45 +0000 (13:51 +0300)] 
gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (#110334)

2 years agogh-109276: regrtest: shorter list of resources (#110326)
Victor Stinner [Wed, 4 Oct 2023 09:39:50 +0000 (11:39 +0200)] 
gh-109276: regrtest: shorter list of resources (#110326)

2 years agogh-110335: asyncio test_unix_events cleans multiprocessing (#110336)
Victor Stinner [Wed, 4 Oct 2023 09:19:08 +0000 (11:19 +0200)] 
gh-110335: asyncio test_unix_events cleans multiprocessing (#110336)

test_unix_events tests using the multiprocessing module now call
multiprocessing.util._cleanup_tests().

2 years agogh-110166: Fix gdb CFunctionFullTests on ppc64le clang build (#110331)
Victor Stinner [Wed, 4 Oct 2023 08:57:35 +0000 (10:57 +0200)] 
gh-110166: Fix gdb CFunctionFullTests on ppc64le clang build (#110331)

CFunctionFullTests now also runs "bt" command before "py-bt-full",
similar to CFunctionTests which also runs "bt" command before
"py-bt". So test_gdb can skip the test if patterns like "?? ()" are
found in the gdb output.

2 years agogh-110171: `libregrtest` always sets `random.seed` (#110172)
Nikita Sobolev [Wed, 4 Oct 2023 06:42:12 +0000 (09:42 +0300)] 
gh-110171: `libregrtest` always sets `random.seed`  (#110172)

2 years agogh-110273: dataclasses.replace() now raise TypeError for all invalid arguments (GH...
Serhiy Storchaka [Wed, 4 Oct 2023 06:20:14 +0000 (09:20 +0300)] 
gh-110273: dataclasses.replace() now raise TypeError for all invalid arguments (GH-110274)

dataclasses.replace() now raises TypeError instead of ValueError if
specify keyword argument for a field declared with init=False or miss keyword
argument for required InitVar field.

2 years agogh-109653: Defer importing `warnings` in several modules (#110286)
Alex Waygood [Wed, 4 Oct 2023 05:09:43 +0000 (06:09 +0100)] 
gh-109653: Defer importing `warnings` in several modules (#110286)

2 years agogh-85984: Document change in return type of tty functions (#110028)
Jelle Zijlstra [Wed, 4 Oct 2023 03:46:38 +0000 (20:46 -0700)] 
gh-85984: Document change in return type of tty functions (#110028)