Commit graph

51078 commits

Author SHA1 Message Date
Antoine Pitrou
fcb230180f
[3.12] gh-112536: Add --tsan test for reasonable TSAN execution times. (gh-116601) (#116929)
(cherry picked from commit ebf29b3)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-03-18 10:22:19 +01:00
Antoine Pitrou
2ac1b48a04
[3.12] gh-112536: Add support for thread sanitizer (TSAN) (gh-112648) (#116924)
* [3.12] gh-112536: Add support for thread sanitizer (TSAN) (gh-112648)
(cherry picked from commit 88cb972000)

* Remove doc for configure option (leave it hidden in this branch)

---------

Co-authored-by: Samet YASLAN <sametyaslan@gmail.com>
2024-03-17 16:33:35 +01:00
Nikita Sobolev
2dbc77e1ec
[3.12] gh-116780: Fix test_inspect in -OO mode (GH-116788) (#116799) 2024-03-17 13:33:38 +03:00
Miss Islington (bot)
04e6146634
[3.12] gh-116484: Fix collisions between Checkbutton and ttk.Checkbutton default names (GH-116495) (GH-116901)
Change automatically generated tkinter.Checkbutton widget names to
avoid collisions with automatically generated tkinter.ttk.Checkbutton
widget names within the same parent widget.
(cherry picked from commit c61cb507c1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-16 11:51:08 +00:00
Miss Islington (bot)
716d482ba4
[3.12] gh-116764: Fix regressions in urllib.parse.parse_qsl() (GH-116801) (GH-116894)
* Restore support of None and other false values.
* Raise TypeError for non-zero integers and non-empty sequences.

The regressions were introduced in gh-74668
(bdba8ef42b).
(cherry picked from commit 1069a462f6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-16 11:00:32 +00:00
Nikita Sobolev
32c775165f
[3.12] gh-116858: Add @cpython_only to several tests in test_cmd_line (GH-116859) (#116889) 2024-03-16 09:31:28 +00:00
Jason R. Coombs
8336cb2b6f
[3.12] gh-116811: Ensure MetadataPathFinder.invalidate_caches is reachable when delegated through PathFinder. (GH-116812) (#116864)
* Make MetadataPathFinder a proper classmethod.

* In PathFinder.invalidate_caches, also invoke MetadataPathFinder.invalidate_caches.

* Add blurb
(cherry picked from commit 5f52d20a93)
2024-03-15 09:59:28 -04:00
Miss Islington (bot)
abd079806d
[3.12] gh-90095: Ignore empty lines and comments in .pdbrc (GH-116834) (#116854)
gh-90095: Ignore empty lines and comments in `.pdbrc` (GH-116834)
(cherry picked from commit a50cf6c3d7)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-03-15 09:52:00 +00:00
Miss Islington (bot)
988246a17b
[3.12] gh-112795: Move the test for ZipFile into the core tests for zipfile. (GH-116823) (#116830)
gh-112795: Move the test for ZipFile into the core tests for zipfile. (GH-116823)

Move the test for ZipFile into the core tests for zipfile.
(cherry picked from commit fd8e30eb62)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-03-14 16:24:19 -04:00
Miss Islington (bot)
9d08e14a00
[3.12] gh-116731: libregrtest: Clear inspect & importlib.metadata caches in clear_caches (GH-116805) (GH-116820)
gh-116731: libregrtest: Clear inspect & importlib.metadata caches in clear_caches (GH-116805)
(cherry picked from commit bae6579b46)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-03-14 16:39:38 +00:00
Tian Gao
56a3c5f767
[3.12] gh-116626: Emit CALL events for all `INSTRUMENTED_CALL_FUNCTION_EX (GH-116732)
Backport of GH-116627
2024-03-14 16:23:15 +00:00
Miss Islington (bot)
c4a22ad899
[3.12] gh-116785: Fix direct invocation of test_inspect (GH-116787) (#116794)
gh-116785: Fix direct invocation of `test_inspect` (GH-116787)
(cherry picked from commit 66fb613d90)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-14 10:20:20 +00:00
Miss Islington (bot)
0cc504771f
[3.12] GH-115979: update test_importlib to work under WASI SDK 21 (GH-116754) (GH-116759)
GH-115979: update test_importlib to work under WASI SDK 21 (GH-116754)
(cherry picked from commit 61733a2fb9)

Co-authored-by: Brett Cannon <brett@python.org>
2024-03-13 21:31:09 +00:00
Miss Islington (bot)
734c5c4a09
[3.12] gh-100746: Improve test_named_expressions.py (GH-116713) (#116747)
gh-100746: Improve `test_named_expressions.py` (GH-116713)
(cherry picked from commit 25684e7131)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-13 22:03:55 +03:00
Miss Islington (bot)
283dda83ec
[3.12] gh-110918: Fix side effects of regrtest test_match_tests() (GH-116718) (#116726)
gh-110918: Fix side effects of regrtest test_match_tests() (GH-116718)

test_match_tests now saves and restores patterns.

Add get_match_tests() function to libregrtest.filter.

Previously, running test_regrtest multiple times in a row only ran
tests once: "./python -m test test_regrtest -R 3:3.
(cherry picked from commit 612f1ec988)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-13 14:16:23 +00:00
Serhiy Storchaka
9caad1f99b
[3.12] gh-116401: Fix blocking os.fwalk() and shutil.rmtree() on opening a named pipe (GH-116421) (GH-116716)
(cherry picked from commit aa7bcf284f)
2024-03-13 10:02:37 +00:00
Miss Islington (bot)
9ef84b46db
[3.12] gh-116491: Improve test_win32_ver (GH-116506) (#116708)
gh-116491: Improve `test_win32_ver` (GH-116506)
(cherry picked from commit ee0dbbc045)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-13 07:29:13 +00:00
Miss Islington (bot)
96c7604709
[3.12] gh-115264: Fix test_functools with -00 mode (GH-115276) (#116707)
gh-115264: Fix `test_functools` with `-00` mode (GH-115276)
(cherry picked from commit 27df81d564)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-13 07:10:59 +00:00
Miss Islington (bot)
84c8925e13
[3.12] gh-116682: stdout may be empty in test_cancel_futures_wait_false (GH-116683) (#116692)
If the `shutdown()` call happens before the worker thread starts executing
the task, then nothing will be printed to stdout.
(cherry picked from commit 7d1abe9502)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-03-13 00:28:21 +00:00
Pablo Galindo Salgado
dcfb21d8b4
[3.12] gh-116604: Correctly honor the gc status when calling _Py_RunGC (GH-116628) (#116653) 2024-03-12 23:38:20 +00:00
Miss Islington (bot)
f9d1ec8e80
[3.12] gh-116307: Proper fix for 'mod' leaking across importlib tests (GH-116680) (#116684)
gh-116307: Proper fix for 'mod' leaking across importlib tests (GH-116680)
(cherry picked from commit a254807761)


gh-116307: Create a new import helper 'isolated modules' and use that instead of 'Clean Import' to ensure that tests from importlib_resources don't leave modules in sys.modules.

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-03-12 19:33:23 -04:00
Miss Islington (bot)
b38c04e70c
[3.12] gh-116656: Fix test_capi test_py_config_isoloated_per_interpreter() (GH-116658) (#116668)
gh-116656: Fix test_capi test_py_config_isoloated_per_interpreter() (GH-116658)

Don't parse argv when setting the configuration, to avoid SystemExit if parsing argv fails.
(cherry picked from commit f6e7a6ce65)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-12 19:06:32 +01:00
Tian Gao
d19c2eb604
[3.12] gh-90095: Make .pdbrc work properly and add some reasonable te… (#116661)
[3.12] gh-90095: Make .pdbrc work properly and add some reasonable tests (GH-110496)
(cherry picked from commit 44f9a84b67)
2024-03-12 16:58:17 +00:00
Miss Islington (bot)
1fb661579d
[3.12] gh-116600: [Enum] fix global Flag repr (GH-116615) (GH-116629)
* and fix global flag repr

(cherry picked from commit 06e29a224f)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-03-11 17:36:00 -07:00
Miss Islington (bot)
8b3b5be934
[3.12] gh-116040: [Enum] fix test_empty_names test (GH-116508) (GH-116619)
* and fix _not_given usage

(cherry picked from commit 3c0dcef980)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2024-03-11 15:16:22 -07:00
Miss Islington (bot)
2c1a81778d
[3.12] gh-71052: Use raise_signal in ThreadSignals.test_signals (GH-116423) (#116618)
gh-71052: Use `raise_signal` in `ThreadSignals.test_signals` (GH-116423)

Use `raise_signal` rather than `kill` in `ThreadSignals.test_signals`
(cherry picked from commit 34920f3691)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-03-11 21:09:42 +00:00
Miss Islington (bot)
1ddd2f9036
[3.12] gh-88352: Make TimedRotatingFileHandler tests more stable (GH-116409) (GH-116585)
The tests failed (with less than 1% probability) if for example the file
was created at 11:46:03.999, but the record was emitted at 11:46:04.001,
with atTime=11:46:04, which caused an unexpected rollover. Ensure that the
tests are always run within the range of the same whole second.

Also share code between test_rollover_at_midnight and test_rollover_at_weekday.
(cherry picked from commit d8712fa0c7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-11 12:49:30 +02:00
Kirill Podoprigora
9f21f033c9
[3.12] gh-115142: Skip `test__xxsubinterpreters if _testcapi` is not available (#116543) 2024-03-09 14:06:24 +00:00
Miss Islington (bot)
a8a95135a2
[3.12] gh-116485: Fixed the typo (GH-116486) (#116489)
Co-authored-by: Varun Gole <59524264+varungole@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-08 08:24:40 +00:00
Ethan Furman
d771729679
[3.12] gh-116040: [Enum] fix by-value calls when second value is falsey (GH-116072) (GH-116476)
e.g. Cardinal(1, 0)

(cherry picked from commit 13ffd4bd9f)
2024-03-07 15:26:13 -08:00
Petr Viktorin
0ab2384c5f
[3.12] gh-115421: List all test subdirs in Makefile, and test them (GH-115813) (#116462)
* gh-115421: Test that our Makefile has all needed test folders (GH-115813)

* Update the list of installed test subdirectories

---------

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-07 15:55:57 +01:00
Miss Islington (bot)
01505953f2
[3.12] gh-88118: Fix some test_multiprocessing flakiness. (GH-116434) (GH-116440)
Fix some test_multiprocessing flakiness.

Potentially introduced by https://github.com/python/cpython/pull/25845

not joining that thread likely leads to recently observed "environment
changed" logically passing but overall failing tests seen on some
buildbots similar to:

```
1 test altered the execution environment (env changed):
    test.test_multiprocessing_fork.test_processes

2 re-run tests:
    test.test_multiprocessing_fork.test_processes
    test.test_multiprocessing_forkserver.test_processes
```
(cherry picked from commit ea1803e608)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-06 22:13:49 +00:00
Sebastian Pipping
0a01ed6c2a
[3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (GH-116248)
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:

- `xml.etree.ElementTree.XMLParser.flush`
- `xml.etree.ElementTree.XMLPullParser.flush`
- `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
- `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
- `xml.sax.expatreader.ExpatParser.flush`

Based on the "flush" idea from https://github.com/python/cpython/pull/115138#issuecomment-1932444270 .

- Please treat as a security fix related to CVE-2023-52425.

(cherry picked from commit 6a95676bb5)
(cherry picked from commit 73807eb634)
(cherry picked from commit eda2963378)

---------

Includes code suggested-by: Snild Dolkow <snild@sony.com>
and by core dev Serhiy Storchaka.
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-06 22:01:45 +00:00
Miss Islington (bot)
2528e46470
[3.12] gh-116143: Fix race condition in pydoc _start_server (GH-116144) (#116415)
gh-116143: Fix race condition in pydoc _start_server (GH-116144)
(cherry picked from commit 02ee475ee3)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2024-03-06 14:58:02 +00:00
Terry Jan Reedy
84b023d243
[3.12] chore: fix typos (#116345) (#116370)
Co-authored-by: cui fliter <imcusg@gmail.com>
(cherry picked from commit e7ba6e9dbe)
2024-03-05 18:51:17 +00:00
Miss Islington (bot)
55faaa5c36
[3.12] gh-74668: Fix support of bytes in urllib.parse.parse_qsl() (GH-115771) (GH-116366)
urllib.parse functions parse_qs() and parse_qsl() now support bytes
arguments containing raw and percent-encoded non-ASCII data.
(cherry picked from commit bdba8ef42b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-05 17:51:35 +00:00
Miss Islington (bot)
85c32ad9fd
[3.12] gh-76511: Fix email.Message.as_string() for non-ASCII message with ASCII charset (GH-116125) (GH-116364)
(cherry picked from commit f97f25ef5d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-05 17:27:22 +00:00
Miss Islington (bot)
6264c4f4b2
[3.12] gh-116325: Raise SyntaxError rather than IndexError on ForwardRef with empty string arg (GH-116341) (#116347)
gh-116325: Raise `SyntaxError` rather than `IndexError` on ForwardRef with empty string arg (GH-116341)
(cherry picked from commit a29998a06b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-05 10:08:27 +00:00
Miss Islington (bot)
3f830adf58
[3.12] gh-115809: Improve TimedRotatingFileHandler.getFilesToDelete() (GH-115812) (GH-116261)
Improve algorithm for computing which rolled-over log files to delete
in logging.TimedRotatingFileHandler. It is now reliable for handlers
without namer and with arbitrary deterministic namer that leaves
the datetime part in the file name unmodified.
(cherry picked from commit 87faec28c7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-03 07:59:10 +00:00
Miss Islington (bot)
6aadabcfe6
[3.12] gh-114494: Change logging docstring to bool for exec_info (GH=114558) (GH-114624)
(cherry picked from commit 07236f5b39)

Co-authored-by: Tristan Pank <tristanpank@gmail.com>
2024-03-02 14:33:15 +02:00
Miss Islington (bot)
90f75e1069
[3.12] gh-112281: Allow Union with unhashable Annotated metadata (GH-112283) (#116213)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-01 18:01:27 +00:00
Miss Islington (bot)
8dae3faab6
[3.12] gh-88352: Fix logging.TimedRotatingFileHandler (GH-116191) (GH-116208)
* Do not overwrite already rolled over files. It happened at midnight or
  during the DST change and caused the loss of data.
* computeRollover() now always return the timestamp larger than the
  specified time.
* Fix computation of the rollover time during the DST change.
(cherry picked from commit fee86fd9a4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-01 18:41:30 +02:00
Miss Islington (bot)
d341098c59
[3.12] gh-101293: Fix support of custom callables and types in inspect.Signature.from_callable() (GH-115530) (GH-116198)
Support callables with the __call__() method and types with
__new__() and __init__() methods set to class methods, static
methods, bound methods, partial functions, and other types of
methods and descriptors.

Add tests for numerous types of callables and descriptors.
(cherry picked from commit 59167c962e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-01 12:59:49 +00:00
Tian Gao
40e9295a58
[3.12] gh-87115: Set __main__.__spec__ to None in pdb (GH-116141) (#116154)
* gh-87115: Set `__main__.__spec__` to `None` in pdb (#116141)

(cherry picked from commit ccfc042bbf)

* [3.12] gh-87115: Set `__main__.__spec__` to `None` in pdb (GH-116141)
(cherry picked from commit ccfc042bbf)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-02-29 23:24:09 +00:00
Miss Islington (bot)
d49fdc8d16
[3.12] gh-72463: Fix ctypes/test_loading.py so that test_find reports skipped (GH-18312) (GH-116136)
(cherry picked from commit 04d1000071)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2024-02-29 19:39:00 +00:00
Miss Islington (bot)
845123d641
[3.12] gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error (GH-116105) (GH-116120)
gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error (GH-116105)
(cherry picked from commit 186fa93876)


gh-116103: Prevent error in WindowsLoadTracker.__del__ if there was a permission error

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-02-29 14:43:05 +00:00
Irit Katriel
6359141867
[3.12] gh-116034: fix location info on the error of a failed assertion (#116054) 2024-02-29 12:36:54 +00:00
Miss Islington (bot)
dec637a953
[3.12] gh-115197: Stop resolving host in urllib.request proxy bypass (GH-115210)
gh-115197: Stop resolving host in urllib.request proxy bypass (GH-115210)

Use of a proxy is intended to defer DNS for the hosts to the proxy itself, rather than a potential for information leak of the host doing DNS resolution itself for any reason.  Proxy bypass lists are strictly name based.  Most implementations of proxy support agree.
(cherry picked from commit c43b26d02e)

Co-authored-by: Weii Wang <weii.wang@canonical.com>
2024-02-28 20:47:25 +00:00
Miss Islington (bot)
9df6d1e033
[3.12] doc: Use super() in subclassed JSONEncoder examples (GH-115565) (GH-116047)
doc: Use super() in subclassed JSONEncoder examples (GH-115565)

Replace calls to `json.JSONEncoder.default(self, obj)`
by `super().default(obj)` within the examples of the documentation.
(cherry picked from commit 647053fed1)

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
2024-02-28 14:13:08 +00:00
Miss Islington (bot)
e5e98626a1
[3.12] gh-115961: Improve tests for compressed file-like objects (GH-115963) (GH-116032)
* Increase coverage for compressed file-like objects initialized with a
  file name, an open file object, a file object opened by file
  descriptor, and a file-like object without name and mode attributes
  (io.BytesIO)
* Increase coverage for name, fileno(), mode, readable(), writable(),
  seekable() in different modes and states
* No longer skip tests with bytes names
* Test objects implementing the path protocol, not just pathlib.Path.
(cherry picked from commit e72576c48b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-28 11:00:50 +02:00