Commit graph

50438 commits

Author SHA1 Message Date
Eric Snow aa9707dda9
[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (#107751)
* Unrevert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)".

This reverts commit 6e4eec7606 (gh-107648).

* Initialize each interpreter's refchain properly.

* Skip test_basic_multiple_interpreters_deleted_no_reset on tracerefs builds.
2023-08-16 12:03:05 +02:00
Serhiy Storchaka bd2ef82a50
[3.12] gh-100061: Proper fix of the bug in the matching of possessive quantifiers (GH-102612) (#108003)
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>
2023-08-16 12:00:55 +02:00
Miss Islington (bot) 00bfed7cba
[3.12] gh-91051: fix segfault when using all 8 type watchers (GH-107853) (#107876)
* 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>
2023-08-16 11:58:54 +02:00
Miss Islington (bot) f0a583b6fb
[3.12] gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965) (#107975)
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>
2023-08-15 16:56:53 +02:00
Miss Islington (bot) d189480942
[3.12] gh-107967: Fix infinite recursion on invalid escape sequence warning (GH-107968) (#107970)
gh-107967: Fix infinite recursion on invalid escape sequence warning (GH-107968)
(cherry picked from commit d66bc9e8a7)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-08-15 13:41:55 +01:00
Miss Islington (bot) 431ce239d2
[3.12] gh-107810: Improve DeprecationWarning for metaclasses with custom tp_new (GH-107834) (#107864)
gh-107810: Improve DeprecationWarning for metaclasses with custom tp_new (GH-107834)

(cherry picked from commit 16dcce2176)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-08-11 16:12:50 +02:00
Miss Islington (bot) 81d3afae1a
[3.12] GH-107774: Add missing audit event for PEP 669 (GH-107775) (#107839)
GH-107774: Add missing audit event for PEP 669 (GH-107775)
(cherry picked from commit 494e3d4436)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2023-08-11 11:58:58 +02:00
Miss Islington (bot) ddca26188d
[3.12] GH-107724: Fix the signature of PY_THROW callback functions. (GH-107725) (#107802)
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>
2023-08-11 11:58:27 +02:00
Miss Islington (bot) 7853c76906
[3.12] GH-106684: Close asyncio.StreamWriter when asyncio.StreamWriter is not closed by application (GH-107650) (#107656)
GH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (GH-107650)
(cherry picked from commit 41178e4199)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-08-10 11:24:22 +02:00
Serhiy Storchaka 3bb43b7b1b
[3.12] gh-106052: Fix bug in the matching of possessive quantifiers (GH-106515) (#107796)
[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)
2023-08-09 12:26:51 +02:00
Thomas Wouters 63bcd91dac Python 3.12.0rc1 2023-08-05 14:11:50 +02:00
T. Wouters 310e1460c0
[3.12] Update the expected bytecode magic in test_importlib.test_util (#107626)
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.
2023-08-04 13:41:03 +00:00
Miss Islington (bot) 98902d6c05
[3.12] GH-107263: Increase C stack limit for most functions, except _PyEval_EvalFrameDefault() (GH-107535) (#107618)
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>
2023-08-04 12:25:51 +02:00
Miss Islington (bot) d2c7b25afb
[3.12] gh-107576: Ensure __orig_bases__ are our own in get_original_bases (GH-107584) (#107592)
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>
2023-08-03 17:07:43 +02:00
Miss Islington (bot) 12d1c494ae
[3.12] gh-107471: Fix Refleaks in test_import (gh-107569) (#107571)
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>
2023-08-02 23:23:15 +02:00
Miss Islington (bot) f66b992e27
[3.12] gh-106368: Add test for Argument Clinic misbehaving custom converter_init() (GH-107496) (#107499)
(cherry picked from commit 2c5d206b33)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-31 15:57:25 +00:00
Łukasz Langa 831fd19d30
[3.12] gh-105751: Remove obsolete object base class in some ctypes tests (GH-107460) (#107501)
(cherry picked from commit 520efecfc3)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2023-07-31 17:01:25 +02:00
Charlie Zhao 99518bbbf4
[3.12] gh-106263: Fix segfault in signaldict_repr in _decimal module (#… (#107491)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>

(cherry picked from commit 3979150a0d)
2023-07-31 14:34:16 +02:00
Łukasz Langa 54aaaadef8
[3.12] gh-46376: Return existing pointer when possible in ctypes (GH-107131) (#107487)
(cherry picked from commit 08447b5deb)

Co-authored-by: Konstantin <kpp.live+github@gmail.com>
2023-07-31 11:16:45 +02:00
Miss Islington (bot) 04bd8c76b2
[3.12] gh-104280: Add test cases for DTrace probes (GH-107125) (#107489)
gh-104280: Add test cases for DTrace probes (GH-107125)
(cherry picked from commit a1c737b73d)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2023-07-31 11:16:30 +02:00
Łukasz Langa 1d21c99e1d
[3.12] gh-105751, test_ctypes: Remove disabled tests (GH-105826) (#107483)
* 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>
2023-07-31 10:28:36 +02:00
Mark Shannon 3f167de440
[3.12] GH-106898: Add the exception as an argument to the PY_UNWIND event callback function. (GH-107347) (GH-107382) 2023-07-28 11:30:16 +01:00
Mark Shannon 0902afbae2
[3.12] GH-106895: Raise a ValueError when attempting to disable events that cannot be disabled. (GH-107337) (GH-107351) 2023-07-28 10:53:33 +01:00
Mark Shannon 3b1a4c1842
[3.12] GH-106897: Add RERAISE event to sys.monitoring. (GH-107291) (GH-107346)
* Ensures that exception handling events are balanced. Each [re]raise event has a matching unwind/handled event.
2023-07-28 09:48:35 +01:00
Miss Islington (bot) 4f72a9a2e0
[3.12] gh-106723: forward -Xfrozen_modules option to spawned process interpreters (GH-106724) (#107367)
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>
2023-07-28 06:24:29 +00:00
Miss Islington (bot) 2827ad2f31
[3.12] gh-106368: Argument clinic tests: improve failure message when tests in ClinicExternalTests fail (GH-107364) (#107365)
gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (GH-107364)
(cherry picked from commit 76c26eaca4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-28 00:39:51 +00:00
Miss Islington (bot) abaf89d908
[3.12] gh-104621: Check for Incompatible Extensions in import_find_extension() (gh-107184) (gh-107360)
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>
2023-07-27 21:51:34 +00:00
Miss Islington (bot) c580527d92
[3.12] gh-105699: Disable the Interpreters Stress Tests (gh-107354) (gh-107357)
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>
2023-07-27 20:09:05 +00:00
Miss Islington (bot) 4f6d7a5890
[3.12] gh-105002: [pathlib] Fix relative_to with walk_up=True using ".." (GH-107014) (#107315)
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>
2023-07-26 20:17:31 +00:00
Miss Islington (bot) ef808517f4
[3.12] gh-106368: Increase Argument Clinic CLI test coverage (GH-107277) (#107282)
(cherry picked from commit 579100f6d7)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-26 07:13:22 +00:00
Miss Islington (bot) 3d15c8b84b
[3.12] gh-106185: Deduplicate CPythonTracebackErrorCaretTests in test_traceback (GH-106187) (GH-107268)
(cherry picked from commit 7c89f11892)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-07-25 21:23:33 +00:00
Miss Islington (bot) 11d86c5c33
[3.12] gh-62519: Make pgettext search plurals when translation is not found (GH-107118) (GH-107134)
(cherry picked from commit b3c34e55c0)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-07-25 21:48:59 +03:00
Miss Islington (bot) ca42d67208
[3.12] gh-105699: Add some stress tests for subinterpreter creation (GH-106966) (gh-107012)
gh-105699: Add some stress tests for subinterpreter creation (GH-106966)
(cherry picked from commit adda43dc0b)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-25 09:42:46 -06:00
Miss Islington (bot) e788c0aeeb
[3.12] gh-107237: Fix test_udp_reconnection() of test_logging (GH-107238) (#107242)
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>
2023-07-25 13:43:11 +00:00
Miss Islington (bot) 2cdde10c5b
[3.12] gh-106774: Update bundled pip version to 23.2.1 (GH-106775) (gh-107222)
gh-106774: Update bundled pip version to 23.2.1 (GH-106775)
2023-07-25 11:32:45 +01:00
Carl Meyer 5fd028b677
[3.12] gh-106917: fix super classmethod calls to non-classmethods (GH-106977). (#107204)
(cherry picked from commit e5d5522612)
2023-07-24 21:13:17 +00:00
Miss Islington (bot) 69d4e8c090
[3.12] gh-106368: Increase Argument Clinic CLI test coverage (GH-107156) (#107189)
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>
2023-07-24 19:19:36 +00:00
Miss Islington (bot) bd72fb19ef
[3.12] bpo-18319: gettext() can retrieve a message even if a plural form exists (GH-19869) (#107108)
(cherry picked from commit 54632528ee)

Co-authored-by: Gilles Bassière <gbassiere@gmail.com>
2023-07-23 14:29:08 +02:00
Miss Islington (bot) af95a1da46
[3.12] gh-106186: Don't report MultipartInvariantViolationDefect for valid multipart emails when parsing header only (GH-107016) (#107111)
(cherry picked from commit c65592c4d6)

Co-authored-by: htsedebenham <31847376+htsedebenham@users.noreply.github.com>
2023-07-23 14:28:28 +02:00
Miss Islington (bot) dd431d791f
[3.12] gh-107028: tiny textual changes in logging docs and docstrings (GH-107029) (GH-107065)
(cherry picked from commit 5e5a34ac3a)
2023-07-22 22:11:29 +01:00
Miss Islington (bot) 713590f9b2
[3.12] gh-106714: Fix test_capi to not write a coredump (GH-107007) (#107009)
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>
2023-07-22 12:48:41 +00:00
Miss Islington (bot) 76fd98a675
[3.12] gh-106368: Increase coverage for Argument Clinic output directive (GH-106979) (#106994)
(cherry picked from commit ee5c01b473)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-22 12:48:35 +02:00
Miss Islington (bot) 67748f18c9
[3.12] gh-106970: Fix Argument Clinic 'destination <name> clear' command (GH-106972) (#106983)
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>
2023-07-22 11:06:46 +02:00
Miss Islington (bot) 807afdac41
[3.12] gh-106368: Increase Argument Clinic test coverage for IndentStack (GH-106933) (#106943)
(cherry picked from commit 8d228cf66f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-21 06:32:30 +00:00
Gregory P. Smith 656f62454b
[3.12] gh-106669: Revert "gh-102988: Detect email address parsing errors ... (GH-105127)" (GH-106733) (#106941)
This reverts commit 18dfbd0357.
Adds a regression test from the issue.

See https://github.com/python/cpython/issues/106669..
(cherry picked from commit a31dea1feb)
2023-07-21 04:05:46 +00:00
Miss Islington (bot) b1c50b80a6
[3.12] gh-104090: Fix unittest collectedDurations resources leak (GH-106795) (#106888)
gh-104090: Fix unittest collectedDurations resources leak (GH-106795)
(cherry picked from commit 70b961ed93)

Co-authored-by: Yonatan Bitton <bityob@gmail.com>
2023-07-19 11:34:54 +00:00
Miss Islington (bot) 941ac1e19d
[3.12] gh-106368: Increase Argument Clinic test coverage for cpp.Monitor (GH-106833) (#106838)
(cherry picked from commit 22379c60ab)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-17 21:20:59 +00:00
Miss Islington (bot) 497bfd5047
[3.12] gh-106687: _ssl: use uint64_t for SSL options (GH-106700) (#106827)
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>
2023-07-17 16:32:17 +00:00
Miss Islington (bot) 060f58d877
[3.12] gh-106752: Sync with zipp 3.16.2 (GH-106757) (#106777)
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>
2023-07-15 10:15:24 -04:00
Miss Islington (bot) 1fe841254e
[3.12] gh-106368: Increase Argument Clinic BlockParser test coverage (GH-106759) (#106769)
(cherry picked from commit 2d7d1aa4bc)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-15 09:55:25 +00:00