| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
[3.12] (GH-108553) (#108960)
Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
(GH-108929) (#108954)
gh-108927: Fix test_import + test_importlib + test_unittest problem (GH-108929)
(cherry picked from commit 3f89b257639dd817a32079da2ae2c4436b8e82eb)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
|
| |
`sys.monitoring.set_local_events()` (GH-108420) (#108899)
* GH-108390: Prevent non-local events being set with `sys.monitoring.set_local_events()` (GH-108420)
* Restore generated objects
* Restore size of monitoring arrays in code object for 3.12 ABI compatibility.
* Update ABI file
|
|
|
|
|
|
|
|
|
| |
(#108897)
[3.12] gh-89392: Remove support of test_main() in libregrtest (GH-108876).
(cherry picked from commit 04a0830b00879efe057e3dfe75e9aa9c0caf1a26)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
| |
[3.12] bpo-45229: Make ElementTree tests discoverable (GH-108859).
(cherry picked from commit 074ac1f72e392a576516639f650bac0519d1cb52)
|
|
|
|
|
|
| |
[3.12] gh-89392: Remove test_main() in test_netrc (GH-108860).
(cherry picked from commit 76f3c043b6c5971d5a13fc6decf87a80ddf7ef95)
Co-authored-by: T. Wouters <thomas@python.org>
|
|
|
|
|
|
| |
Disable `differing_test_runners` health check (GH-108886)
(cherry picked from commit 6ead5bd6ae20b902e6c11a3c0acede22632dc0d5)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
| |
* [3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861).
(cherry picked from commit d0b22f6bd84239e50b43709f98f2bb950222cfe5)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Add "import unittest".
|
|
|
|
|
|
|
| |
(GH-107131) (GH-107487)" (#108864)
This reverts commit 54aaaadef8a44324f6be674707c67a3516470ff6.
Co-authored-by: T. Wouters <thomas@python.org>
|
|
|
|
|
|
|
|
|
| |
Reorder some test's decorators (GH-108804)
For example, do not demand the 'cpu' resource if the test cannot be run
due to non-working threads.
(cherry picked from commit 509bb61977cc8a4487efd3f9cdd63d9f7b86be62)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gh-108822: regrtest computes statistics (#108793)
test_netrc, test_pep646_syntax and test_xml_etree now return results
in the test_main() function.
Changes:
* Rewrite TestResult as a dataclass with a new State class.
* Add test.support.TestStats class and Regrtest.stats_dict attribute.
* libregrtest.runtest functions now modify a TestResult instance
in-place.
* libregrtest summary lists the number of run tests and skipped
tests, and denied resources.
* Add TestResult.has_meaningful_duration() method.
* Compute TestResult duration in the upper function.
* Use time.perf_counter() instead of time.monotonic().
* Regrtest: rename 'resource_denieds' attribute to 'resource_denied'.
* Rename CHILD_ERROR to MULTIPROCESSING_ERROR.
* Use match/case syntadx to have different code depending on the
test state.
Notes on the backport: doctest.TestResults.skipped is a new feature
in Python 3.13, so don't use it in the backport.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit d4e534cbb35678c82b3a1276826af55d7bfc23b6)
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-108421) (#108798)
gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421)
Only mark tests which spend significant system or user time,
by itself or in subprocesses.
(cherry picked from commit f3ba0a74cd50274acdcd592d4ce8395b92492b7c)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
(#108792)
gh-106392: Fix inconsistency in deprecation warnings (GH-106436)
They used "datetime" to refer to both the object and the module.
(cherry picked from commit d5c5d4bfd3260219397326795d3b2ff62a9ab8cb)
Co-authored-by: William Andrea <william.j.andrea@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Make test_fcntl quiet (GH-108758)
Running test_fcntl logs two "struct.pack: ..." lines because
multiprocessing imports test_fcntl twice with
test.support.verbose=1. Move get_lockdata() inside TestFcntl test
case and only call it where it's needed, to stop logging these lines.
(cherry picked from commit 23f54c120067c96973619b9501fe4dff1b055188)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
| |
`turtle` (GH-107807) (#108749)
gh-107805: Fix signatures of module-level generated functions in `turtle` (GH-107807)
(cherry picked from commit 044b8b3b6a65e6651b161e3badfa5d57c666db19)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__new__ (GH-108704) (#108733)
gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704)
When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. .
member = object.__new__(cls)
member = int.__new__(cls, value)
member = str.__new__(cls, value)
Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected.
(cherry picked from commit d48760b2f1e28dd3c1a35721939f400a8ab619b8)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
|
|
|
|
|
|
|
|
|
| |
(GH-108659) (#108700)
gh-108654: restore comprehension locals before handling exception (GH-108659)
(cherry picked from commit d52c4482a82f3f98f1a78efa948144a1fe3c52b2)
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-108568) (#108691)
gh-108520: Fix bad fork detection in nested multiprocessing use case (GH-108568)
gh-107275 introduced a regression where a SemLock would fail being passed along nested child processes, as the `is_fork_ctx` attribute would be left missing after the first deserialization.
---------
(cherry picked from commit add8d45cbe46581b9748909fbbf60fdc8ee8f71e)
Co-authored-by: albanD <desmaison.alban@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
|
|
|
|
|
|
|
|
|
| |
(#108626)
gh-108617: Extend interactive session tests for sqlite3 (GH-108556)
(cherry picked from commit ecb2bf02a4a564b638f756ce6e644ec17b6edf16)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gh-108558: Improve sqlite3 row factory tests (GH-108578)
Add test_sqlite_row_keys() to explicitly test sqlite3.Row.keys().
Cleanups:
- Reduce test noise by converting docstrings to regular comments
- Reduce boilerplate code by adding a setUp() method to RowFactoryTests
(cherry picked from commit 6eaddc10e972273c1aed8b88c538e65e4773496e)
Co-authored-by: Edward Schauman-Haigh <142528725+EddInSverige@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
* Fix backport
---------
Co-authored-by: Edward Schauman-Haigh <142528725+EddInSverige@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
|
|
|
|
|
|
|
|
| |
(#108621)
gh-108550: Fix sqlite3 CLI regression from gh-108551 (GH-108618)
(cherry picked from commit c8847841cc5629cbceead0c09dc6f537d7b92612)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
|
|
|
|
|
|
|
|
| |
multiple threads (GH-108497) (#108612)
GH-106176, GH-104702: Fix reference leak when importing across multiple threads (GH-108497)
(cherry picked from commit 5f85b443f7119e1c68a15fc9a342655e544d2852)
Co-authored-by: Brett Cannon <brett@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gh-108550: Speed up sqlite3 tests (GH-108551)
Refactor the CLI so we can easily invoke it and mock command-line
arguments. Adapt the CLI tests so we no longer have to launch a
separate process.
Disable the busy handler for all concurrency tests; we have full
control over the order of the SQLite C API calls, so we can safely
do this.
The sqlite3 test suite now completes ~8 times faster than before.
(cherry picked from commit 0e8b3fc718c8a1c4de558c553d9e05049c1dbec6)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#108340) (#108563)
* [3.12] gh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340)
(cherry picked from commit d0160c7c22c8dff0a61c49b5304244df6e36465e)
Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
* The _quote_value helper is not part of 3.12; spell out the replacement
* With quotes
* Ok, let's use explicit quoting
---------
Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
|
|
|
|
|
|
|
|
|
| |
gh-105052:update timeit function's description (GH-105060)
---------
(cherry picked from commit 7096a2be33619dc02c06a6dc30aac414a9eba462)
Co-authored-by: R <cherrymelon@foxmail.com>
|
|
|
|
|
|
| |
gh-108295: Fix crashes with TypeVar weakrefs (GH-108517)
(cherry picked from commit 482fad7f01567447b7259ebf58d62999fcdc5964)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
|
| |
gh-108388: Convert test_concurrent_futures to package (#108401)
Convert test_concurrent_futures to a package of sub-tests.
(cherry picked from commit aa6f787faa4bc45006da4dc2f942fb9b82c98836)
|
|
|
|
|
|
|
|
|
|
| |
(#108473)
gh-108418: Speed up bigmem compression tests in dry mode (GH-108419)
Only generate and compress small amount of random data in dry run.
(cherry picked from commit 4ae3edf3008b70e20663143553a736d80ff3a501)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#108446)
gh-80527: Change support.requires_legacy_unicode_capi() (GH-108438)
The decorator now requires to be called with parenthesis:
@support.requires_legacy_unicode_capi()
instead of:
@support.requires_legacy_unicode_capi
The implementation now only imports _testcapi when the decorator is
called, so "import test.support" no longer imports the _testcapi
extension.
(cherry picked from commit 995f4c48e11349fbfb9233e02b732d4534d3008e)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
| |
gh-108388: Split test_multiprocessing_spawn (GH-108396)
Split test_multiprocessing_fork, test_multiprocessing_forkserver and
test_multiprocessing_spawn into test packages. Each package is made
of 4 sub-tests: processes, threads, manager and misc. It allows
running more tests in parallel and so reduce the total test duration.
(cherry picked from commit aa9a359ca2663195b0f04eef46109c28c4ff74d3)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
| |
(GH-108341) (#108402)
gh-108111: Flush gzip write buffer before seeking, fixing bad writes (GH-108341)
(cherry picked from commit 2eb60c1934f47671e6b3c9b90b6d9f1912d829a0)
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#108404)
* In preauth tests of test_ssl, explicitly break reference cycles
invoving SingleConnectionTestServerThread to make sure that the
thread is deleted. Otherwise, the test marks the environment as
altered because the threading module sees a "dangling thread"
(SingleConnectionTestServerThread). This test leak was introduced
by the test added for the fix of issue gh-108310.
* Use support.SHORT_TIMEOUT instead of hardcoded 1.0 or 2.0 seconds
timeout.
* SingleConnectionTestServerThread.run() catchs TimeoutError
* Fix a race condition (missing synchronization) in
test_preauth_data_to_tls_client(): the server now waits until the
client connect() completed in call_after_accept().
* test_https_client_non_tls_response_ignored() calls server.join()
explicitly.
* Replace "localhost" with server.listener.getsockname()[0].
(cherry picked from commit 592bacb6fc0833336c0453e818e9b95016e9fd47)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gh-108388: regrtest splits test_asyncio package (GH-108393)
Currently, test_asyncio package is only splitted into sub-tests when
using command "./python -m test". With this change, it's also
splitted when passing it on the command line:
"./python -m test test_asyncio".
Remove the concept of "STDTESTS". Python is now mature enough to not
have to bother with that anymore. Removing STDTESTS simplify the
code.
(cherry picked from commit 174e9da0836844a2138cc8915dd305cb2cd7a583)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Process before serializing it (GH-107275) (#108377)
gh-77377: Ensure multiprocessing SemLock is valid for spawn-based Process before serializing it (GH-107275)
Ensure multiprocessing SemLock is valid for spawn Process before serializing it.
Creating a multiprocessing SemLock with a fork context, and then trying to pass it to a spawn-created Process, would segfault if not detected early.
---------
(cherry picked from commit 1700d34d314f5304a7a75363bda295a8c15c371f)
Co-authored-by: albanD <desmaison.alban@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-108343) (#108345)
gh-105776: Fix test_cppext when CC contains -std=c11 option (GH-108343)
Fix test_cppext when the C compiler command has the "-std=c11" option.
Remove "-std=" options from the compiler command.
(cherry picked from commit 9173b2bbe13aeccc075b571da05c653a2a91de1b)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#108348)
Explicitly break a reference cycle when SSLSocket._create() raises an
exception. Clear the variable storing the exception, since the
exception traceback contains the variables and so creates a reference
cycle.
This test leak was introduced by the test added for the fix of GH-108310.
(cherry picked from commit 64f99350351bc46e016b2286f36ba7cd669b79e3)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
| |
gh-108303: Add Lib/test/test_cppext/ sub-directory (GH-108325)
* Move test_cppext to its own directory
* Rename setup_testcppext.py to setup.py
* Rename _testcppext.cpp to extension.cpp
* The source (extension.cpp) is now also copied by the test.
(cherry picked from commit 21dda09600848ac280481f7c64f8d9516dc69bb2)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
| |
gh-106016: Add Lib/test/test_module/ directory (#108293)
* Move Python scripts related to test_module to this new directory:
good_getattr.py and bad_getattrX.py scripts.
* Move Lib/test/test_module.py to Lib/test/test_module/__init__.py.
(cherry picked from commit adfc118fdab66882599e01a84c22bd897055f3f1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
flaw (#108316)
Instances of `ssl.SSLSocket` were vulnerable to a bypass of the TLS handshake
and included protections (like certificate verification) and treating sent
unencrypted data as if it were post-handshake TLS encrypted data.
The vulnerability is caused when a socket is connected, data is sent by the
malicious peer and stored in a buffer, and then the malicious peer closes the
socket within a small timing window before the other peers’ TLS handshake can
begin. After this sequence of events the closed socket will not immediately
attempt a TLS handshake due to not being connected but will also allow the
buffered data to be read as if a successful TLS handshake had occurred.
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
|
|
|
|
|
|
|
|
| |
for loop (GH-108242) (#108275)
gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop (GH-108242)
(cherry picked from commit a1cc74c4eebc55795877eb3be019a1bec34402f8)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
(#108263)
gh-108179: Add error message for parser stack overflows (GH-108256)
(cherry picked from commit 86617518c4ac824e2b6dc20691ba5a08df04f285)
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
there are embedded nulls (GH-108248) (#108251)
gh-106242: Make ntpath.realpath errors consistent with abspath when there are embedded nulls (GH-108248)
* gh-106242: Make ntpath.realpath errors consistent with abspath when there are embedded nulls
* Update 2023-08-22-00-36-57.gh-issue-106242.q24ITw.rst
mention Windows and the former incorrect ValueError.
---------
(cherry picked from commit de33b5c662ea8d35d81ed857c6a39e34ab94c510)
Co-authored-by: Steve Dower <steve.dower@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
|
|
| |
Fix test_generators: save/restore warnings filters (GH-108246)
Previously, depending on existing filters, the test
could modify the warnings and so fail as "env changed".
(cherry picked from commit 531930f47f6b2a548d31e62cb4ad3e215a24bf53)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
| |
(#108217)
gh-107905: Test raising `__value__` for `TypeAliasType` (GH-107997)
(cherry picked from commit 13104f3b7412dce9bf7cfd09bf2d6dad1f3cc2ed)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
|
| |
(#108211)
gh-107845: Fix symlink handling for tarfile.data_filter (GH-107846)
(cherry picked from commit acbd3f9c5c5f23e95267714e41236140d84fe962)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-107485) (#108207)
gh-107396: tarfiles: set self.exception before _init_read_gz() (GH-107485)
In the stack call of: _init_read_gz()
```
_read, tarfile.py:548
read, tarfile.py:526
_init_read_gz, tarfile.py:491
```
a try;except exists that uses `self.exception`, so it needs to be set before
calling _init_read_gz().
(cherry picked from commit 37135d25e269ede92bc7da363bebfa574782e59a)
Co-authored-by: balmeida-nokia <83089745+balmeida-nokia@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
| |
(GH-108098) (#108200)
gh-105736: Sync pure python version of OrderedDict with the C version (GH-108098)
(cherry picked from commit 20cc90c0df3e368fe7cb63d958f0b17a78fa9d0a)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
"development mode" (GH-108168) (#108196)
gh-107895: Fix test_asyncio.test_runners when run it in CPython's "development mode" (GH-108168)
(cherry picked from commit 014a5b71e7538926ae1c03c8c5ea13c96e741be3)
Co-authored-by: Joon Hwan 김준환 <xncbf12@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyErr_Format() (GH-107918) (#108134)
* gh-107915: Handle errors in C API functions PyErr_Set*() and PyErr_Format() (GH-107918)
Such C API functions as PyErr_SetString(), PyErr_Format(),
PyErr_SetFromErrnoWithFilename() and many others no longer crash or
ignore errors if it failed to format the error message or decode the
filename. Instead, they keep a corresponding error.
(cherry picked from commit 633ea217a85f6b6ba5bdbc73094254d5811b3485)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Define PY_SSIZE_T_CLEAN.
---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|