Commit graph

51131 commits

Author SHA1 Message Date
Miss Islington (bot)
aa26dc3c4a
[3.12] gh-117691: Add an appropriate stacklevel for PEP-706 tarfile deprecation warnings (GH-117872) (GH-117930)
gh-117691: Add an appropriate stacklevel for PEP-706 tarfile deprecation warnings (GH-117872)
(cherry picked from commit cff0a2db00)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-16 11:54:01 +00:00
Inada Naoki
2a58923687
gh-77102: site: try utf-8 and locale encoding when reading .pth file (GH-117802)
(cherry picked from commit 6dc661bc9f)
2024-04-16 18:51:06 +09:00
Miss Islington (bot)
44eab29cbd
[3.12] gh-117797: Improve test_descr.test_not_implemented (GH-117798) (#117921)
gh-117797: Improve `test_descr.test_not_implemented` (GH-117798)
(cherry picked from commit 1a1e013a4a)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-04-16 12:50:10 +03:00
Steve Dower
1a45659064
gh-90329: Add _winapi.GetLongPathName and GetShortPathName and use in venv to reduce warnings (GH-117817) 2024-04-15 16:43:41 +01:00
Steve Dower
667a574c8f
gh-112278: Improve error handling in wmi module and tests (GH-117818) 2024-04-15 16:43:28 +01:00
Miss Islington (bot)
6a4c06bcb3
[3.12] gh-117889: Fix PGO test in test_peg_generator (GH-117893) (#117895)
Reuse support.check_cflags_pgo() in test_peg_generator to check for
PGO build.

Log PGO_PROF_USE_FLAG in test.pythoninfo.
(cherry picked from commit 64cd6fc9a6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-04-15 14:15:30 +00:00
Miss Islington (bot)
e7c774996a
[3.12] gh-91565: Replace bugs.python.org links with Devguide/GitHub ones (GH-91568) (GH-117890)
gh-91565: Replace bugs.python.org links with Devguide/GitHub ones  (GH-91568)

(cherry picked from commit 3de09cadde)

Co-authored-by: Steve (Gadget) Barnes <gadgetsteve@hotmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2024-04-15 12:59:34 +00:00
Hugo van Kemenade
a844e83b06
[3.12] Add 'The Python 2.3 Method Resolution Order' (GH-116435) (#117885)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-15 14:14:16 +03:00
Miss Islington (bot)
50b94b150e
[3.12] gh-117694: Improve tests for PyEval_EvalCodeEx() (GH-117695) (GH-117884)
(cherry picked from commit 57bdb75975)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-15 10:02:43 +00:00
Miss Islington (bot)
0c0b2309fb
[3.12] gh-115692: Add tests to increase json coverage (GH-115693) (#117867)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-04-14 12:27:29 +00:00
Miss Islington (bot)
a3f1e980c3
[3.12] gh-101549: fix documentation of xml.etree.ElementInclude (GH-101550) (#117754)
Co-authored-by: Mikhail B <55960560+mbel0@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-11 14:53:27 +00:00
Kirill Podoprigora
8c1c71ee38
[3.12] gh-115142: Skip test_capi.test_dict.py if _testcapi is not available (GH-117588) (GH-117718)
(cherry picked from commit dfcae4379f)
2024-04-11 16:18:28 +02:00
Miss Islington (bot)
5b681d60a6
[3.12] gh-117711: Only check for 'test/wheeldata' when it's actually used (GH-117712) (#117749)
gh-117711: Only check for 'test/wheeldata' when it's actually used (GH-117712)

It's possible to build Python with option `--with-wheel-pkg-dir`
pointing to a custom wheel directory. Don't include the directory in the test
set if the wheels are used from a different location.

(cherry picked from commit d4963871b0)

Co-authored-by: Karolina Surma <33810531+befeleme@users.noreply.github.com>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2024-04-11 10:22:17 +00:00
Miss Islington (bot)
2a508572ab
[3.12] gh-117606: Truncate extremely long error message in test_exceptions (GH-117670) (#117745)
gh-117606: Truncate extremely long error message in `test_exceptions` (GH-117670)
(cherry picked from commit 02f1385f8a)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-11 07:53:26 +00:00
Miss Islington (bot)
653ed76442
[3.12] gh-117692: Fix AttributeError in DocTestFinder on wrapped builtin_or_method (GH-117699) (#117708)
* gh-117692: Fix `AttributeError` in `DocTestFinder` on wrapped `builtin_or_method` (GH-117699)
(cherry picked from commit 4bb7d121bc)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-10 14:17:15 +00:00
Miss Islington (bot)
af034dd150
[3.12] gh-117534: Add checking for input parameter in iso_to_ymd (GH-117543) (#117689)
gh-117534: Add checking for input parameter in iso_to_ymd (GH-117543)

Moves the validation for invalid years in the C implementation of the `datetime` module into a common location between `fromisoformat` and `fromisocalendar`, which improves the error message and fixes a failed assertion when parsing invalid ISO 8601 years using one of the "ISO weeks" formats.

---------

(cherry picked from commit d5f1139c79)

Co-authored-by: Vlad4896 <166005126+Vlad4896@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2024-04-09 18:17:21 +00:00
Thomas Wouters
f6650f9ad7 Python 3.12.3 2024-04-09 10:09:14 +02:00
Donghee Na
2449441242
[3.12] gh-117594: Require cpu resource to test_search_anchor_at_beginning (g… (gh-117616)
gh-117594: Require cpu resource to test_search_anchor_at_beginning (gh-117595)

(cherry picked from commit 784623c63c)
2024-04-08 00:23:55 +00:00
Grigoriev Semyon
a49426afaa
[3.12] gh-109120: Fix syntax error in handlinh of incorrect star expressions… (#117465)
gh-109120: Fix syntax error in handlinh of incorrect star expressions (#117444)

(cherry picked from commit c97d3af239)
2024-04-04 11:22:43 -04:00
Miss Islington (bot)
b5e12aa9ff
[3.12] gh-117521: Improve typing.TypeGuard docstring (GH-117522) (#117538)
(cherry picked from commit b32789ccb9)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-04 11:04:16 +00:00
Miss Islington (bot)
14aef56ebb
[3.12] gh-117467: Add preserving of mailbox owner on flush (GH-117510) (GH-117537)
(cherry picked from commit 3f5bcc86d0)

Co-authored-by: Tony Mountifield <tony@mountifield.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-04 10:55:42 +00:00
Miss Islington (bot)
fad48ea181
[3.12] gh-117166: Ignore empty and temporary dirs in test_makefile (GH-117190) (GH-117367)
gh-117166: Ignore empty and temporary dirs in `test_makefile` (GH-117190)
(cherry picked from commit d9cfe7e565)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-04-03 15:32:55 +02:00
Miss Islington (bot)
75b3139b53
[3.12] gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076)
gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076)
(cherry picked from commit 52f5b7f9e0)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-04-02 13:29:32 +00:00
Miss Islington (bot)
0b23bc334c
[3.12] gh-102190: Add additional zipfile pwd= arg docstrings (gh-102195) (GH-117408)
gh-102190: Add additional zipfile `pwd=` arg docstrings (gh-102195)

This just documents the parameter that already exists.

---------

(cherry picked from commit a32d693948)

Co-authored-by: Deborah <32307299+dlwrnc@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-03-31 18:53:51 -07:00
Miss Islington (bot)
b912d2b24a
[3.12] gh-117387 Remove hash mark from introductory text (GH-117409) (#gh- 2024-03-31 21:24:28 +00:00
Victor Stinner
c80d13838d
[3.12] gh-117347: Fix test_clinic side effects (#117363) (#117365)
gh-117347: Fix test_clinic side effects (#117363)

Save/restore converters in ClinicWholeFileTest and
ClinicExternalTest.

(cherry picked from commit 35b6c4a4da)
2024-03-29 12:04:25 +01:00
Miss Islington (bot)
2a18945dc6
[3.12] Fix reversed assertRegex checks in test_ssl. (GH-117351) (#117359)
Fix reversed assertRegex checks in test_ssl. (GH-117351)
(cherry picked from commit 2e9be80c99)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-29 01:19:04 +00:00
Miss Islington (bot)
9f831f442c
[3.12] gh-117110: Fix subclasses of typing.Any with custom constructors (GH-117111) (#117357)
gh-117110: Fix subclasses of typing.Any with custom constructors (GH-117111)
(cherry picked from commit 8eec7ed714)

Co-authored-by: 傅立业(Chris Fu) <17433201@qq.com>
2024-03-29 00:36:14 +00:00
Miss Islington (bot)
1e48de61ac
[3.12] gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (GH-117326) (#117327)
gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (GH-117326)
(cherry picked from commit 6702d2bf6e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-28 18:28:20 +01:00
Miss Islington (bot)
552b2646b7
[3.12] gh-117178: Recover lazy loading of self-referential modules (GH-117179) (#117319)
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
2024-03-28 11:15:16 +00:00
AN Long
17a82a1d16
[3.12] gh-104242: Enable test_is_char_device_true in pathlib test on all platform (GH-116983) (GH-117277)
(cherry picked from commit af1b0e9440)
2024-03-27 10:42:37 +02:00
AN Long
ca0793980b
[3.12] gh-115538: Use isolate mode when running venv test_multiproces… (#117264)
[3.12] gh-115538: Use isolate mode when running venv test_multiprocessing_recursion() (GH-117116)
(cherry picked from commit 4ec347760f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-26 17:53:37 +01:00
Miss Islington (bot)
36b1a20851
[3.12] gh-66543: Fix mimetype.guess_type() (GH-117217) (GH-117256)
Fix parsing of the following corner cases:

* URLs with only a host name
* URLs containing a fragment
* URLs containing a query
* filenames with only a UNC sharepoint on Windows

(cherry picked from commit 9654daf793)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2024-03-26 11:43:36 +00:00
Miss Islington (bot)
54514467c2
[3.12] gh-83845: Add tests for operator module (GH-115883) (#117253)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2024-03-26 09:37:41 +00:00
Victor Stinner
477ef9015c
[3.12] gh-83434: Sync libregrtest and test_regrtest with the main branch (#117250)
* gh-115122: Add --bisect option to regrtest (#115123)

* test.bisect_cmd now exit with code 0 on success, and code 1 on
  failure. Before, it was the opposite.
* test.bisect_cmd now runs the test worker process with
  -X faulthandler.
* regrtest RunTests: Add create_python_cmd() and bisect_cmd()
  methods.

(cherry picked from commit 1e5719a663)

* gh-115720: Show number of leaks in huntrleaks progress reports (GH-115726)

Instead of showing a dot for each iteration, show:
- '.' for zero (on negative) leaks
- number of leaks for 1-9
- 'X' if there are more leaks

This allows more rapid iteration: when bisecting, I don't need
to wait for the final report to see if the test still leaks.

Also, show the full result if there are any non-zero entries.
This shows negative entries, for the unfortunate cases where
a reference is created and cleaned up in different runs.

Test *failure* is still determined by the existing heuristic.

(cherry picked from commit af5f9d682c)

* gh-83434: Disable XML in regrtest when -R option is used (#117232)

(cherry picked from commit d52bdfb19f)

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-03-26 08:04:28 +00:00
Miss Islington (bot)
1c72265a31
[3.12] gh-117187: Fix XML tests for vanilla Expat <2.6.0 (GH-117203) (GH-117244)
gh-117187: Fix XML tests for vanilla Expat <2.6.0 (GH-117203)

This fixes XML unittest fallout from the https://github.com/python/cpython/issues/115398 security fix.  When configured using `--with-system-expat` on systems with older pre 2.6.0 versions of libexpat, our unittests were failing.

* sax|etree: Simplify Expat version guard where simplifiable

Idea by Matěj Cepl

* sax|etree: Fix reparse deferral tests for vanilla Expat <2.6.0

This *does not fix* the case of distros with an older version of libexpat with the 2.6.0 feature backported as a security fix.  (Ubuntu is a known example of this with its libexpat1 2.5.0-2ubunutu0.1 package)
(cherry picked from commit 9f74e86c78)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2024-03-26 02:08:23 +00:00
Miss Islington (bot)
bd2c60f8c2
[3.12] gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (GH-32011) (GH-117209)
(cherry picked from commit f11d0d8be8)

Co-authored-by: Erik Soma <stillusingirc@gmail.com>
2024-03-25 12:21:31 +02:00
Serhiy Storchaka
f3fee231d3
[3.12] gh-117084: Fix ZIP file extraction for directory entry names with backslashes on Windows (GH-117129) (GH-117162)
(cherry picked from commit 567ab3bd15)
2024-03-22 18:35:12 +00:00
Miss Islington (bot)
135a698d5c
[3.12] [docs] Fix typo in docstring and add example to logging cookbook. (GH-117157) (GH-117159)
(cherry picked from commit 00baaa21de)
2024-03-22 17:50:02 +00:00
Miss Islington (bot)
d99ffc5a4b
[3.12] gh-117127: glob tests: Reopen dir_fd to pick up directory changes (GH-117128) (GH-117150)
gh-117127: glob tests: Reopen dir_fd to pick up directory changes (GH-117128)
(cherry picked from commit 42ae924d27)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-03-22 10:24:06 +00:00
infohash
ad0ff86034
[3.12] gh-75988: Fix issues with autospec ignoring wrapped object (GH-115223) (#117119)
gh-75988: Fix issues with autospec ignoring wrapped object (#115223)

* set default return value of functional types as _mock_return_value

* added test of wrapping child attributes

* added backward compatibility with explicit return

* added docs on the order of precedence

* added test to check default return_value

(cherry picked from commit 735fc2cbbc)
2024-03-22 09:47:52 +00:00
Miss Islington (bot)
d3de3a251e
[3.12] gh-117061: Fix test_posix.test_sched_setaffinity() on RHEL9 (GH-117126) (#117137)
gh-117061: Fix test_posix.test_sched_setaffinity() on RHEL9 (GH-117126)

On RHEL9, sched_setaffinity(0, []) does not fail.
(cherry picked from commit 50f9b0b1e0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-21 22:37:06 +00:00
Miss Islington (bot)
05c5bece78
[3.12] gh-116333: Relax error string text expectations in SSL-related tests (GH-116334) (GH-117136)
gh-116333: Relax error string text expectations in SSL-related tests (GH-116334)

* Relax error string text expectations in SSL-related tests

As suggested [here][1], this change relaxes the OpenSSL error string
text expectations in a number of tests. This was specifically done in
support of more easily building CPython [AWS-LC][2], but because AWS-LC
is a fork of [BoringSSL][3], it should increase compatibility with that
library as well.

In addition to the error string relaxations, we also add some guards
around the `tls-unique` channel binding being used with TLSv1.3, as that
feature (described in [RFC 6929][4]) is [not defined][5] for TLSv1.3.

[1]: https://discuss.python.org/t/support-building-ssl-and-hashlib-modules-against-aws-lc/44505/4
[2]: https://github.com/aws/aws-lc
[3]: https://github.com/google/boringssl
[4]: https://datatracker.ietf.org/doc/html/rfc5929GH-section-3
[5]: https://datatracker.ietf.org/doc/html/rfc8446GH-appendix-C.5
(cherry picked from commit c85d84166a)

Co-authored-by: Will Childs-Klein <willck93@gmail.com>
2024-03-21 20:46:20 +00:00
jkriegshauser
d69c51520e
[3.12] gh-116773: Fix overlapped memory corruption crash (GH-116774) (#117078)
Manual backport of gh-116774.
2024-03-20 13:10:15 -07:00
Serhiy Storchaka
da2f9d1417
[3.12] gh-117021: Fix integer overflow in PyLong_AsPid() on non-Windows 64-bit platforms (GH-117064) (GH-117070)
(cherry picked from commit 519b2ae22b)
2024-03-20 16:44:05 +02:00
Sam Gross
92564331de
[3.12] gh-113964: Don't prevent new threads until all non-daemon threads exit (GH-116677) (#117029)
Starting in Python 3.12, we prevented calling fork() and starting new threads
during interpreter finalization (shutdown). This has led to a number of
regressions and flaky tests. We should not prevent starting new threads
(or `fork()`) until all non-daemon threads exit and finalization starts in
earnest.

This changes the checks to use `_PyInterpreterState_GetFinalizing(interp)`,
which is set immediately before terminating non-daemon threads.

(cherry picked from commit 60e105c1c1)
2024-03-19 15:22:42 -04:00
David Röthlisberger
0fc8ae4e28
[3.12] gh-116957: configparser: Do post-process values after DuplicateOptionError (GH-116958) (GH-117013)
If you catch DuplicateOptionError / DuplicateSectionError when reading a
config file (the intention is to skip invalid config files) and then
attempt to use the ConfigParser instance, any values it *had* read
successfully so far, were stored as a list instead of string! Later
`get` calls would raise "AttributeError: 'list' object has no attribute
'find'" from somewhere deep in the interpolation code.

(cherry picked from commit b1bc37597f)
2024-03-19 18:18:50 +01:00
Tian Gao
688623d402
[3.12] gh-116735: Use MISSING for CALL event if argument is absen… (#116873)
[3.12] gh-116735: Use `MISSING` for `CALL` event if argument is absent (GH-116737)
2024-03-19 17:00:54 +00:00
Victor Stinner
35e8f04f1b
[3.12] gh-90872: Fix subprocess.Popen.wait() for negative timeout (#116989) (#117002)
gh-90872: Fix subprocess.Popen.wait() for negative timeout (#116989)

On Windows, subprocess.Popen.wait() no longer calls
WaitForSingleObject() with a negative timeout: pass 0 ms if the
timeout is negative.

(cherry picked from commit 27cf3ed00c)
2024-03-19 14:15:05 +00:00
Miss Islington (bot)
23f97327fe
[3.12] gh-105866: fix dataclass with slots=True, weakref_slot=True (GH-105870) (GH-116978)
(cherry picked from commit a22d05f04c)

Co-authored-by: Aviel Boag <avboag@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2024-03-19 11:57:31 +01:00