Restore the global Input Stream pointer after trying to match a sub-pattern.
.
(cherry picked from commit abd9cc52d9)
Co-authored-by: SKO <41810398+uyw4687@users.noreply.github.com>
* gh-91051: fix segfault when using all 8 type watchers (GH-107853)
(cherry picked from commit 66e4edd734)
Co-authored-by: Carl Meyer <carl@oddbird.net>
gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965)
(cherry picked from commit 6515ec3d3d)
gh-107963: Fix set_forkserver_preload to check the type of given list
Co-authored-by: Dong-hee Na <donghee.na@python.org>
GH-107724: Fix the signature of `PY_THROW` callback functions. (GH-107725)
(cherry picked from commit 52fbcf61b5)
Co-authored-by: Mark Shannon <mark@hotpy.org>
[3.12] gh-106052: Fix bug in the matching of possessive quantifiers (gh-106515)
It did not work in the case of a subpattern containing backtracking.
Temporary implement possessive quantifiers as equivalent greedy qualifiers
in atomic groups..
(cherry picked from commit 7b6e34e5ba)
Update the expected bytecode magic in test_importlib.test_util to the final
3.12 magic number. From now on it's not allowed to change for any 3.12
release.
GH-107263: Increase C stack limit for most functions, except `_PyEval_EvalFrameDefault()` (GH-107535)
* Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.
(cherry picked from commit fa45958450)
Co-authored-by: Mark Shannon <mark@hotpy.org>
gh-107576: Ensure `__orig_bases__` are our own in `get_original_bases` (GH-107584)
(cherry picked from commit ed4a978449)
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
Co-authored-by: Chris Bouchard <chris@upliftinglemma.net>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-107471: Fix Refleaks in test_import (gh-107569)
gh-107184 introduced a refleak in test_import.SubinterpImportTests (specifically test_singlephase_check_with_setting_and_override and test_single_init_extension_compat). We fix it here by making sure _testsinglephase is removed from sys.modules whenever we clear the runtime's internal state for the module.
The underlying problem is strictly contained in the internal function _PyImport_ClearExtension() (AKA _testinternalcapi.clear_extension()), which is only used in tests.
(This also fixes an intermittent segfault introduced in the same place, in test_disallowed_reimport.)
(cherry picked from commit 017f047183)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-104280: Add test cases for DTrace probes (GH-107125)
(cherry picked from commit a1c737b73d)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
* The following tests were disabled since the initial ctypes commit
in 2006, commit babddfca75:
* Callbacks.test_char_p()
* DeletePointerTestCase.test_X()
* NumberTestCase.test_perf()
* StructureTestCase.test_subclass_creation()
* Tests.test_X() of test_byteswap
* NumberTestCase.test_bool_from_address() was disabled in 2007 by
commit 5dc4fe09b7.
* Remove check_perf() and run_test() of test_numbers.
(cherry picked from commit 8f10140e74)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-106723: forward -Xfrozen_modules option to spawned process interpreters (GH-106724)
(cherry picked from commit 3dcac78581)
Co-authored-by: Felipe A. Hernandez <ergoithz@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-104621: Check for Incompatible Extensions in import_find_extension() (gh-107184)
This fixes a bug where incompatible modules could still be imported if attempted multiple times.
(cherry picked from commit 75c974f535)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-105699: Disable the Interpreters Stress Tests (gh-107354)
The two tests are crashing periodically in CI and on buildbots. I suspect the problem is in the _xxsubinterpreters module.
Regardless, I'm disabling the tests temporarily, to reduce the noise as we approach 3.12rc1. I'll be investigating the crashes separately.
(cherry picked from commit 4f67921ad2)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-105002: [pathlib] Fix relative_to with walk_up=True using ".." (GH-107014)
It makes sense to raise an Error because ".." can not
be resolved and the current working directory is unknown.
(cherry picked from commit e7e6e4b035)
Co-authored-by: János Kukovecz <kukoveczjanos@gmail.com>
gh-105699: Add some stress tests for subinterpreter creation (GH-106966)
(cherry picked from commit adda43dc0b)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-107237: Fix test_udp_reconnection() of test_logging (GH-107238)
test_logging: Fix test_udp_reconnection() by increasing the timeout
from 100 ms to 5 minutes (LONG_TIMEOUT).
Replace also blocking wait() with wait(LONG_TIMEOUT) in
test_output() to prevent the test to hang.
(cherry picked from commit ed08238327)
Co-authored-by: Victor Stinner <vstinner@python.org>
Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.
(cherry picked from commit 83a2837b32)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
gh-106714: Fix test_capi to not write a coredump (GH-107007)
test_capi: Fix test_no_FatalError_infinite_loop() to no longer write
a coredump, by using test.support.SuppressCrashReport.
(cherry picked from commit 4a1026d764)
Co-authored-by: Victor Stinner <vstinner@python.org>
Add test for the 'destination <name> clear' command,
and the 'destination' directive in general.
Fix two bugs in 'destination <name> clear' command:
1. The text attribute of the allocator is called 'text', not '_text'
2. Return after processing the 'clear' command,
instead of proceeding directly to the fail().
(cherry picked from commit 3372bcba98)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
gh-106687: _ssl: use uint64_t for SSL options (GH-106700)
SSL_CTX_get_options() uses uint64_t for options:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html
Fix this compiler warning on Windows with MSC:
conversion from 'uint64_t' to 'long', possible loss of data
(cherry picked from commit ad95c7253a)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-106752: Sync with zipp 3.16.2 (GH-106757)
* gh-106752: Sync with zipp 3.16.2
* Add blurb
(cherry picked from commit 22980dc7c9)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>