Commit graph

47898 commits

Author SHA1 Message Date
Serhiy Storchaka
400d41b8ea
[3.10] gh-99645: Fix a bug in handling class cleanups in unittest.TestCase (GH-99646) (GH-99699)
Now addClassCleanup() uses separate lists for different TestCase subclasses,
and doClassCleanups() only cleans up the particular class.

(cherry picked from commit c2102136be)
2022-11-22 19:11:57 +02:00
Serhiy Storchaka
190331ed28
[3.10] Add more details in test_unittest (GH-99626). (GH-99692)
(cherry picked from commit 653e563d80)
2022-11-22 17:13:37 +02:00
Miss Islington (bot)
99e852c28f
gh-99341: Cover type ignore nodes when incrementing line numbers (GH-99422)
(cherry picked from commit 1acdfec359)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-11-22 03:06:26 -08:00
Miss Islington (bot)
37dbbb208f
gh-99578: Fix refleak in _imp.create_builtin() (GH-99642)
Fix a reference bug in _imp.create_builtin() after the creation of
the first sub-interpreter for modules "builtins" and "sys".
(cherry picked from commit cb2ef8b2ac)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-11-21 03:44:56 -08:00
Pablo Galindo Salgado
ad47c7d926
[3.10] gh-99581: Fix a buffer overflow in the tokenizer when copying lines that fill the available buffer (GH-99605). (#99630) 2022-11-20 22:30:15 +00:00
Miss Islington (bot)
88b101ff52
[3.10] gh-98086: Now `patch.dict` can decorate async functions (GH-98095) (GH-99366)
gh-98086: Now ``patch.dict`` can decorate async functions (GH-98095)
(cherry picked from commit 67b4d2772c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Chris Withers <chris@withers.org>
2022-11-20 21:36:57 +05:30
Serhiy Storchaka
42b7b2179e
[3.10] gh-78453: Move Unicode C API tests from test_unicode to test_capi.test_unicode (GH-99431). (GH-99617)
(cherry picked from commit 06d4e02c3b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-20 12:45:50 +02:00
Miss Islington (bot)
e470803295
gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373)
(cherry picked from commit 4e4b13e8f6)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-15 12:52:14 -08:00
Kamil Turek
bc2cdfc815
[3.10] gh-92119: ctypes: Print exception class name instead of its representation (GH-98302) (#99452)
gh-92119: ctypes: Print exception class name instead of its representation (#98302)

(cherry picked from commit b9dedfe61d)
2022-11-13 15:55:58 -08:00
Miss Islington (bot)
14c13955c5
gh-99275: Fix SystemError in ctypes during __initsubclass__ (GH-99283)
(cherry picked from commit 343eb0f94b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-13 11:40:18 -08:00
Miss Islington (bot)
535027f470
bpo-34272: Reorganize C API tests. (GH-8551)
Move some C API tests into Lib/test/test_capi/.
(cherry picked from commit f883b7f8ee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-12 09:36:49 -08:00
Miss Islington (bot)
8d27e6294b
gh-80448: argparse: Fix IndexError on store_true action (GH-15656)
(cherry picked from commit e02cc6d42a)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-11 18:16:18 -08:00
Jason R. Coombs
9a5ca31af0
[3.10] gh-99130: Apply bugfixes from importlib_metadata 4.11.4. (#99132) 2022-11-10 16:59:38 +01:00
Miss Islington (bot)
e6f066af2e
gh-74044: inspect.signature for wrappers around decorated bound methods (GH-736)
(cherry picked from commit dbf2faf579)

Co-authored-by: Anton Ryzhov <anton@ryzhov.me>
2022-11-10 04:59:25 -08:00
Miss Islington (bot)
ee405e3b23
gh-99320: remove tests for old-style class from test_complex (GH-99321)
(cherry picked from commit 26726c7649)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-10 03:19:30 -08:00
Miss Islington (bot)
9bb8e18ca4
[3.11] gh-98433: Fix quadratic time idna decoding. (GH-99092) (GH-99222)
There was an unnecessary quadratic loop in idna decoding. This restores
the behavior to linear.

(cherry picked from commit d315722564)

(cherry picked from commit a6f6c3a3d6)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-11-07 19:23:16 -08:00
Miss Islington (bot)
e7781fd695
gh-99124: use concrete exception types in test_builtin (GH-99125)
(cherry picked from commit c32bc1bffd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-07 18:30:38 -08:00
Miss Islington (bot)
a5d3e1dd04
gh-98513: Test abstract methods of some collections types (GH-98516)
(cherry picked from commit a309ad9f76)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-07 18:19:33 -08:00
Miss Islington (bot)
eb0e942ca8
bpo-38523: ignore_dangling_symlinks does not apply recursively (GH-22937)
(cherry picked from commit 5ff81da6d3)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-11-07 04:08:39 -08:00
Miss Islington (bot)
ea2316a220
[3.10] [ GH-99155: Fix NormalDist pickle with 0 and 1 protocols (GH-99156). (GH-99188) (GH-99190) 2022-11-07 04:16:54 -06:00
Miss Islington (bot)
cd6fe96689
gh-99051: remove duplicated test from test_weakref (GH-99052)
(cherry picked from commit 8463cb55da)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-06 11:50:12 -08:00
Miss Islington (bot)
92cc215518
test_typing: use all pickle protocols (GH-99154)
(cherry picked from commit a0bc75e2fd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-06 04:15:29 -08:00
Miss Islington (bot)
982273ae79
gh-99134: Update bundled pip to 22.3.1 (gh-99135)
Update bundled pip to 22.3.1
(cherry picked from commit 47ab8480e7)

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2022-11-05 12:00:12 -07:00
Miss Islington (bot)
ae5317d309
[3.11] gh-90867: test.support.wait_process() uses LONG_TIMEOUT (GH-99071) (GH-99098)
The test.support.wait_process() function now uses a timeout of
LONG_TIMEOUT seconds by default, instead of SHORT_TIMEOUT.  It
doesn't matter if a Python buildbot is slower, it only matters that
the process completes. The timeout should just be shorter than
"forever".

(cherry picked from commit a9a8c87126)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit f09da28768)
2022-11-04 08:20:35 -07:00
Serhiy Storchaka
22bbb0c4c7
[3.10] gh-98740: Fix validation of conditional expressions in RE (GH-98764) (GH-99046)
In very rare circumstances the JUMP opcode could be confused with the
argument of the opcode in the "then" part which doesn't end with the
JUMP opcode. This led to incorrect detection of the final JUMP opcode
and incorrect calculation of the size of the subexpression.

NOTE: Changed return value of functions _validate_inner() and
_validate_charset() in Modules/_sre/sre.c.  Now they return 0 on success,
-1 on failure, and 1 if the last op is JUMP (which usually is a failure).
Previously they returned 1 on success and 0 on failure.
(cherry picked from commit e9ac890c02)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-03 12:18:50 +02:00
Miss Islington (bot)
27dc6dbafe
gh-98512: Add more tests for ValuesView (GH-98515)
(cherry picked from commit 29e027c3e6)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-02 19:33:01 -07:00
Miss Islington (bot)
c23862fc6c
gh-98415: Fix uuid.getnode() ifconfig implementation (GH-98423)
The uuid.getnode() function has multiple implementations, tested sequentially.
The ifconfig implementation was incorrect and always failed: fix it.

In practice, functions of libuuid library are preferred, if available:
uuid_generate_time_safe(), uuid_create() or uuid_generate_time().

(cherry picked from commit e3ec272f57)

Co-authored-by: Chaim Sanders <csanders-git@users.noreply.github.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2022-11-02 12:22:19 -07:00
Serhiy Storchaka
9ca7b1561f
[3.10] gh-98852: Fix subscription of types.GenericAlias instances (GH-98920) (GH-98969)
Fix subscription of types.GenericAlias instances containing bare generic types:
for example tuple[A, T][int], where A is a generic type, and T is a type
variable.
2022-11-01 20:14:38 +02:00
Miss Islington (bot)
078ce6891c
GH-98897: fix memory leak if math.dist raises exception (GH-98898)
(cherry picked from commit ab57505070)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-31 19:47:29 -07:00
Charlie Zhao
d3d1738acd
[3.10] gh-98793: Fix typecheck in overlapped.c (GH-98835) (#98890)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 3ac8c0ab6e)
2022-10-31 11:22:02 -07:00
Miss Islington (bot)
789d1322f6
[3.10] gh-96151: Use a private name for passing builtins to dataclass. This now allows for a field named BUILTIN (gh-98143) (gh-98899)
gh-96151: Use a private name for passing builtins to dataclass. This now allows for a field named BUILTIN (gh-98143)
(cherry picked from commit 29f98b46b7)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-10-31 10:59:18 -04:00
Miss Islington (bot)
3f0f74387b
[3.10] gh-98624 Add mutex to unittest.mock.NonCallableMock (GH-98688) (#98798)
(cherry picked from commit 0346eddbe9)

Co-authored-by: noah-weingarden <33741795+noah-weingarden@users.noreply.github.com>
2022-10-28 12:16:53 +02:00
Miss Islington (bot)
97106d3136
[3.10] Add more tkinter.Canvas tests (GH-98475) (#98477)
Add more tkinter.Canvas tests (GH-98475)

It is a prerequisite for GH-94473. Add tests for the coords() method and
for creation of some Canvas items.
(cherry picked from commit ff173ed2f6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-10-28 12:10:41 +02:00
Miss Islington (bot)
9338e9a5f4
gh-98703: Add tests for closing _ProactorSocketTransport with proactor event loop (GH-98730)
(cherry picked from commit 96ae80f1d0)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-26 20:35:07 -07:00
Miss Islington (bot)
bb80f6ad92
gh-98703: Fix asyncio proactor_events calling _call_connection_lost multiple times (GH-98704)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 8a755423eb)

Co-authored-by: Ken Jin <kenjin@python.org>
2022-10-26 20:03:58 -07:00
Miss Islington (bot)
fd9bdde769
gh-94808: cover PyMapping_HasKeyString and PyMapping_HasKey (GH-98486)
(cherry picked from commit 5d30544485)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-25 21:53:36 -07:00
Miss Islington (bot)
cb323a8612
gh-94808: Improve coverage of unicode_find and unicode_rfind (GH-98648)
(cherry picked from commit b1783bc124)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-25 17:02:48 -07:00
Miss Islington (bot)
750e504800
Use more precise exception types in assertRaises in typing tests (GH-98650)
(cherry picked from commit 45c89358b7)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-25 07:12:59 -07:00
Miss Islington (bot)
a86a7b827b
gh-93696: Locate frozen module source with __file__ (GH-93697)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit d91de288e7)

Co-authored-by: James Gerity <snoopjedi@gmail.com>
2022-10-25 06:48:41 -07:00
Miss Islington (bot)
8ba086f70b
GH-89237: fix hang in proactor subprocess.wait_closed() (GH-98572)
(cherry picked from commit ad1dc3ebb6)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-24 13:42:20 -07:00
Miss Islington (bot)
dcb342b5f9
gh-51511: Note that codecs.open()'s encoding parameter affects automatic conversion to binary mode (GH-94370)
(cherry picked from commit d9407b174c)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-10-21 16:28:25 -07:00
Theo Buehler
0e4e058602
[3.10] gh-98517: Fix buffer overflows in _sha3 module (#98519)
This is a port of the applicable part of XKCP's fix [1] for
CVE-2022-37454 and avoids the segmentation fault and the infinite
loop in the test cases published in [2].

[1]: fdc6fef075
[2]: https://mouha.be/sha-3-buffer-overflow/

Regression test added by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2022-10-21 12:26:01 -07:00
Miss Islington (bot)
eae692eed1
[3.10] gh-97514: Don't use Linux abstract sockets for multiprocessing (GH-98501) (GH-98503)
Linux abstract sockets are insecure as they lack any form of filesystem
permissions so their use allows anyone on the system to inject code into
the process.

This removes the default preference for abstract sockets in
multiprocessing introduced in Python 3.9+ via
https://github.com/python/cpython/pull/18866 while fixing
https://github.com/python/cpython/issues/84031.

Explicit use of an abstract socket by a user now generates a
RuntimeWarning.  If we choose to keep this warning, it should be
backported to the 3.7 and 3.8 branches.
(cherry picked from commit 49f61068f4)


Co-authored-by: Gregory P. Smith <greg@krypto.org>

Automerge-Triggered-By: GH:gpshead
2022-10-20 16:55:51 -07:00
Miss Islington (bot)
0db4c5990c
gh-96035: Make urllib.parse.urlparse reject non-numeric ports (GH-98273)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 6f15ca8c7a)

Co-authored-by: Ben Kallus <49924171+kenballus@users.noreply.github.com>
2022-10-20 14:29:21 -07:00
Miss Islington (bot)
eee8b99dc3
gh-97928: Fix handling options starting with "-" in tkinter.Text.count() (GH-98436)
Previously they were silently ignored. Now they are errors.
(cherry picked from commit e4ec8de6fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-10-19 02:57:18 -07:00
Miss Islington (bot)
d0ed05c018
gh-97928: Add tests for tkinter.Text.count() (GH-98269)
(cherry picked from commit 1b684c8f5f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-10-18 23:40:40 -07:00
Miss Islington (bot)
ce87ab4dc5
[3.10] gh-93858: Prevent error when activating venv in nested fish instances (GH-93931) (GH-98403)
Co-authored-by: Thomas B. Brunner <thomasbbrunner@gmail.com>
2022-10-18 16:39:06 +01:00
Miss Islington (bot)
676cdea18f
[3.10] gh-98331: Update bundled pip to 22.3 (GH-98332) (gh-98399) 2022-10-18 16:36:23 +01:00
Miss Islington (bot)
3adf23471e
gh-98174: Handle EPROTOTYPE under macOS in test_sendfile_fallback_close_peer_in_the_middle_of_receiving (GH-98316)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
(cherry picked from commit 3e82ad05b1)

Co-authored-by: fancidev <fancidev@gmail.com>
2022-10-17 09:13:37 -07:00
Miss Islington (bot)
928b5f1bde
gh-97527: IDLE - fix buggy macosx patch (GH-98313)
GH-97530 fixed IDLE tests possibly crashing on a Mac without a GUI.
But it resulted in IDLE not starting in 3.10.8, 3.12.0a1, and
Microsoft Python 3.10.2288.0 when test/* is not installed.
After this patch, test.* is only imported when testing on Mac.
(cherry picked from commit 35fa5d5e7f)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-10-16 08:33:33 -07:00