Commit Graph

29015 Commits

Author SHA1 Message Date
Miss Islington (bot) 6e25228b2e
[3.11] gh-81403: Fix for CacheFTPHandler in urllib (GH-13951) (#103705)
* gh-81403: Fix for CacheFTPHandler in urllib (GH-13951)

bpo-37222: Fix for CacheFTPHandler in urllib

A call to FTP.ntransfercmd must be followed by FTP.voidresp to clear
the "end transfer" message. Without this, the client and server get
out of sync, which will result in an error if the FTP instance is
reused to open a second URL. This scenario occurs for even the most
basic usage of CacheFTPHandler.

Reverts the patch merged as a resolution to bpo-16270 and adds a test
case for the CacheFTPHandler in test_urllib2net.py.

(cherry picked from commit e38bebb9ee)

Co-authored-by: Dan Hemberger <846186+hemberger@users.noreply.github.com>
Co-authored-by: Senthil Kumaran <senthil@python.org>

* Added NEWS entry.

---------

Co-authored-by: Dan Hemberger <846186+hemberger@users.noreply.github.com>
Co-authored-by: Senthil Kumaran <senthil@python.org>
2023-04-23 05:20:34 -07:00
Miss Islington (bot) b2fdae9d86
[3.11] gh-103556: [inspect.Signature] disallow pos-or-kw params without default after pos-only with default (GH-103557) (#103675) 2023-04-22 09:13:02 -06:00
Miss Islington (bot) 9f3f109dd2
gh-103553: Improve `test_inspect`: add more assertions, remove unused (GH-103554)
(cherry picked from commit 4fe1c4b97e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-04-15 14:15:45 -07:00
Miss Islington (bot) 2e0ead5f22
gh-103406: Modernize pos-only arguments usage in `test_signature` (GH-103407)
(cherry picked from commit 7569781176)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-04-14 00:30:38 -07:00
Ethan Furman 3b929a7b32
[3.11] gh-103479: [Enum] require __new__ to be considered a data type (GH-103495) (GH-103514)
a mixin must either have a __new__ method, or be a dataclass, to be interpreted as a data-type; an __init__ method is not enough (restores pre-3.11 behavior for non-dataclasses).

(cherry picked from commit a6f95941a3)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-04-13 12:04:06 -07:00
Miss Islington (bot) 804a973d8e
gh-103365: [Enum] STRICT boundary corrections (GH-103494)
STRICT boundary:

- fix bitwise operations
- make default for Flag
(cherry picked from commit 2194071540)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-04-13 08:55:53 -07:00
Miss Islington (bot) 254494c4b9
gh-99553: add tests for ExceptionGroup wrapping (GH-99615)
(cherry picked from commit 4cd1cc843a)

Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
2023-04-11 00:07:25 -07:00
Miss Islington (bot) 4e284ffa2e
gh-103395: Improve `typing._GenericAlias.__dir__` coverage (GH-103396)
(cherry picked from commit a28e2ce3fb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-04-10 04:37:40 -07:00
Miss Islington (bot) b4f3318207
gh-75729: Fix os.spawn tests not handling spaces on Windows (GH-99150)
* Quote paths in os.spawn tests on Windows so they work with spaces

* Add NEWS entry for os spawn test fix

* Fix code style to avoid double negative in os.spawn tests

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

---------

(cherry picked from commit a34c796238)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-04-08 01:03:58 -07:00
Miss Islington (bot) 70bc8c936d
[3.11] GH-88013: Fix TypeError raised by ntpath.realpath in some cases (GH-102813, GH-103343)
(cherry picked from commit 4dc339b4d6)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2023-04-07 21:38:56 +01:00
Miss Islington (bot) b8d1623f73
gh-103272: regression test for getattr exception in property (GH-103336)
(cherry picked from commit 5d7d86f2fd)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
2023-04-07 12:36:10 -07:00
Miss Islington (bot) 1b1f0164cb
gh-74690: Add more tests for runtime-checkable protocols (GH-103347)
(cherry picked from commit 800382a2b0)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-04-07 10:47:49 -07:00
Łukasz Langa ecb09a8496
[3.11] bpo-46523: fix tests rerun when `setUp[Class|Module]` fails (GH-30895) (GH-103342)
(cherry picked from commit 995386071f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-04-07 19:35:16 +02:00
Miss Islington (bot) 8740fd855c
gh-103256: Fix hmac algorithm to support fallback implementation (gh-103286)
(cherry picked from commit efb0a2cf3a)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-04-06 19:27:46 -07:00
Miss Islington (bot) 123680f9aa
[3.11] GH-102700: allow built-in modules to be submodules (GH-103162) (GH-103322)
GH-102700: allow built-in modules to be submodules (GH-103162)
(cherry picked from commit 5d08c3ff7d)

Co-authored-by: Brett Cannon <brett@python.org>
2023-04-06 16:06:02 -07:00
Ethan Furman 58e330ac9c
[3.11] gh-93910: [Enum] remove member.member deprecation (GH-103236) (GH-103299)
i.e. Color.RED.BLUE is now officially supported..
(cherry picked from commit 4ec8dd10bd)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-04-05 21:29:14 -07:00
Miss Islington (bot) 5342f5e713
gh-102549: [Enum] fail enum creation when data type raises in __init__ (GH-103149)
(cherry picked from commit 2a4d8c0a9e)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-04-03 16:01:31 -07:00
Miss Islington (bot) 0854bdf15f
gh-103109: Document ignore_warnings() test support helper (GH-103110)
(cherry picked from commit 32937d6aa4)

Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-04-02 15:42:43 -07:00
Miss Islington (bot) 766038d995
gh-103054: typing: Improve `Callable` type substitution tests (GH-103055)
(cherry picked from commit 60bdc16b45)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
2023-03-28 20:28:34 -07:00
Miss Islington (bot) 5ba5ce47f6
gh-102558: [Enum] better handling of non-Enum EnumType classes (GH-103060)
(cherry picked from commit f4ed2c6ae5)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-03-27 16:49:15 -07:00
Miss Islington (bot) 13df5d3497
[3.11] GH-95494: Fix transport EOF handling in OpenSSL 3.0 (GH-95495) (#103006)
GH-25309 enabled SSL_OP_IGNORE_UNEXPECTED_EOF by default, with a comment
that it restores OpenSSL 1.1.1 behavior, but this wasn't quite right.
That option causes OpenSSL to treat transport EOF as the same as
close_notify (i.e. SSL_ERROR_ZERO_RETURN), whereas Python actually has
distinct SSLEOFError and SSLZeroReturnError exceptions. (The latter is
usually mapped to a zero return from read.) In OpenSSL 1.1.1, the ssl
module would raise them for transport EOF and close_notify,
respectively. In OpenSSL 3.0, both act like close_notify.

Fix this by, instead, just detecting SSL_R_UNEXPECTED_EOF_WHILE_READING
and mapping that to the other exception type.

There doesn't seem to have been any unit test of this error, so fill in
the missing one. This had to be done with the BIO path because it's
actually slightly tricky to simulate a transport EOF with Python's fd
based APIs. (If you instruct the server to close the socket, it gets
confused, probably because the server's SSL object is still referencing
the now dead fd?)
(cherry picked from commit 420bbb783b)

Co-authored-by: David Benjamin <davidben@google.com>
2023-03-27 16:14:01 +02:00
Miss Islington (bot) a08b65faa0
gh-102980: Add tests for pdf's display, alias and where commands (GH-102981)
(cherry picked from commit ded9a7fc19)

Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
2023-03-24 14:17:20 -07:00
Miss Islington (bot) e075631f67
[3.11] gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (GH-96932) (#102918)
gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (GH-96932)
(cherry picked from commit af9c34f6ef)

Co-authored-by: Benjamin Fogle <benfogle@gmail.com>
2023-03-24 13:33:24 +01:00
Miss Islington (bot) 8132aefa0f
gh-102558: [Enum] fix AttributeError during member repr() (GH-102601)
(cherry picked from commit bd063756b3)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2023-03-23 13:56:38 -07:00
Miss Islington (bot) 1645a40b5e
gh-88965: typing: fix type substitution of a list of types after initial `ParamSpec` substitution (GH-102808)
Previously, this used to fail:

```py
from typing import *
T = TypeVar("T")
P = ParamSpec("P")

class X(Generic[P]):
    f: Callable[P, int]

Y = X[[int, T]]
Z = Y[str]
```

(cherry picked from commit adb0621652)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-23 09:54:07 -07:00
Miss Islington (bot) 6ffeeb2199
gh-102947: Improve traceback when calling `fields()` on a non-dataclass (GH-102948)
(cherry picked from commit baf4eb083c)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-23 07:45:59 -07:00
Miss Islington (bot) a9ece4a839
gh-102780: Fix uncancel() call in asyncio timeouts (GH-102815)
Also use `raise TimeOut from <CancelledError instance>` so that the CancelledError is set
in the `__cause__` field rather than in the `__context__` field.

(cherry picked from commit 04adf2df39)

Co-authored-by: Kristján Valur Jónsson <sweskman@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-22 11:23:47 -07:00
Miss Islington (bot) b9304beda0
gh-101947: Remove size check from sqlite3 serialize test (GH-102914)
The size of the returned data is too implementation specific.
(cherry picked from commit 61405da9a5)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-03-22 06:45:28 -07:00
Nikita Sobolev 045c8a1779
[3.11] gh-102721: Improve coverage of `_collections_abc._CallableGenericAlias` (GH-102788)
This is a backport of https://github.com/python/cpython/pull/102722 without the `typing.py` changes.

Automerge-Triggered-By: GH:AlexWaygood
2023-03-17 12:48:06 -07:00
Miss Islington (bot) f967aee4fb
gh-102701: Fix overflow in dictobject.c (GH-102750)
(cherry picked from commit 65fb7c4055)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2023-03-17 07:54:18 -07:00
Miss Islington (bot) 0560fe3c10
gh-94440: Fix issue of ProcessPoolExecutor shutdown hanging (GH-94468)
Fix an issue of concurrent.futures ProcessPoolExecutor shutdown hanging.

(cherry picked from commit 2dc94634b5)

Co-authored-by: yonatanp <yonatan.perry@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-15 22:09:20 -07:00
Miss Islington (bot) 8aa07b9c8a
gh-101377: improving test_locale_calendar_formatweekday of calendar (GH-101378)
---------

(cherry picked from commit 5e0865f22e)

Co-authored-by: Andre Hora <andrehora@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-03-14 20:00:28 -07:00
Miss Islington (bot) 1649f3e591
Rename redundant enum tests so that they run (GH-102535)
(cherry picked from commit a028778d4c)

Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com>
2023-03-14 15:46:01 -07:00
Miss Islington (bot) b0e221cfc8
[3.11] gh-102069: Fix `__weakref__` descriptor generation for custom dataclasses (GH-102075) (#102662)
gh-102069: Fix `__weakref__` descriptor generation for custom dataclasses (GH-102075)
(cherry picked from commit d97757f793)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-03-13 16:17:46 -06:00
Miss Islington (bot) 8a99debc12
Fix broken link to MSDN (GH-102355)
(cherry picked from commit 9a8b66b58c)

Co-authored-by: 谭九鼎 <109224573@qq.com>
2023-03-13 06:42:30 -07:00
Miss Islington (bot) 78560261a2
GH-101673: Fix pdb bug where local variable changes are lost after longlist (GH-101674)
(cherry picked from commit 5d677c556f)

Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
2023-03-12 16:40:56 -07:00
Irit Katriel fcafc37411
[3.11] gh-102493: backport unit test for PyErr_SetObject (#102602)
gh-102493: backport unit test for PyErr_SetObject
2023-03-11 15:01:01 +00:00
Miss Islington (bot) e467cb3a69
gh-102433: Add tests for how classes with properties interact with `isinstance()` checks on `typing.runtime_checkable` protocols (GH-102449)
(cherry picked from commit 5ffdaf748d)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-03-10 17:46:04 -08:00
Miss Islington (bot) 123119ff88
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH-102538)
It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action.

Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.
(cherry picked from commit 64bde502cf)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2023-03-10 07:54:45 -08:00
Miss Islington (bot) 7905ae7b1a
GH-102397: Fix segfault from race condition in signal handling (GH-102399)
(cherry picked from commit 1a84cc007e)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-03-08 00:26:20 -08:00
Miss Islington (bot) a7ec32e7d4
gh-102444: Fix minor bugs in `test_typing` highlighted by pyflakes (GH-102445)
(cherry picked from commit 96e1022929)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-05 14:00:56 -08:00
Miss Islington (bot) db8d10beb3
GH-102341: Improve the test function for pow (GH-102342)
(cherry picked from commit 32220543e2)

Co-authored-by: Partha P. Mukherjee <ppm.floss@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-03-05 09:55:18 -08:00
Miss Islington (bot) c957128b48
Fix unused classes in a typing test (GH-102437)
As part of investigation issue https://github.com/python/cpython/issues/102433, I discovered what I believe to be an error where two classes `CI` and `DI` are not being used. The assertions beneath them act on `C` and `D`, duplicating existing assertions in this test.
(cherry picked from commit 7894bbe94b)

Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com>
Automerge-Triggered-By: GH:AlexWaygood
2023-03-05 07:31:42 -08:00
Miss Islington (bot) e748f9e270
gh-101979: argparse: fix a bug where parentheses in metavar argument of add_argument() were dropped (GH-102318)
(cherry picked from commit 9a478be1a4)

Co-authored-by: Yeojin Kim <yeojin.dev@gmail.com>
2023-03-05 07:18:34 -08:00
Miss Islington (bot) 63fd954100
gh-102356: Add thrashcan macros to filter object dealloc (GH-102426)
Add thrashcan macros to the deallocator of the filter objects to protect against deeply nested destruction of chains of nested filters.
(cherry picked from commit 66aa78cbe6)

Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
2023-03-05 03:25:48 -08:00
Miss Islington (bot) cc6ce90206
gh-102179: Fix `os.dup2` error reporting for negative fds (GH-102180)
(cherry picked from commit c2bd55d26f)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2023-03-04 06:55:02 -08:00
Miss Islington (bot) 06a3bb8c94
gh-101892: Fix `SystemError` when a callable iterator call exhausts the iterator (GH-101896)
(cherry picked from commit 705487c655)

Co-authored-by: Raj <51259329+workingpayload@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-03-04 06:46:17 -08:00
Miss Islington (bot) 3effccee48
[3.11] gh-102088 Optimize iter_index itertools recipe (GH-102360) (GH-102363) 2023-03-01 21:52:37 -06:00
Miss Islington (bot) 3fe74199fd
gh-102252: Improve coverage of test_bool.py (GH-102253)
Add tests for conversion from bool to complex.
(cherry picked from commit 4197043637)

Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
2023-02-25 13:15:45 -08:00
Ionite 5d461225a5
[3.11] gh-101765: Fix SystemError / segmentation fault in iter `__reduce__` when internal access of `builtins.__dict__` exhausts the iterator (GH-101769) (#102228)
(cherry picked from commit 54dfa14c5a)
2023-02-24 19:49:59 -08:00
Miss Islington (bot) 9da3e7f389
[3.11] gh-95675: fix uid and gid at test_add_dir_getmember (gh-102207) (gh-102231)
gh-95675: fix uid and gid at test_add_dir_getmember (gh-102207)
(cherry picked from commit 56e93c8020)

Co-authored-by: Seonkyo Ok <seonkyo.ok@linecorp.com>
2023-02-25 11:55:48 +09:00
Miss Islington (bot) dd0843ac1d
gh-102158: Add tests for `softkwlist` (GH-102159)
---------

(cherry picked from commit 9f3ecd1aa3)

Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-02-23 18:54:47 -08:00
Miss Islington (bot) edbde8feb7
[3.11] gh-101936: Update the default value of fp from io.StringIO to io.BytesIO (gh-102100) (gh-102117)
gh-101936: Update the default value of fp from io.StringIO to io.BytesIO (gh-102100)
(cherry picked from commit 0d4c7fcd4f)

Co-authored-by: Long Vo <long.vo@linecorp.com>
2023-02-22 20:42:04 +09:00
Miss Islington (bot) 5d47150eac
[3.11] gh-95672 fix typo SkitTest to SkipTest (gh-102119) (#102121)
gh-95672 fix typo SkitTest to SkipTest (gh-102119)
(cherry picked from commit d5c7954d0c)

Co-authored-by: HyunKyun Moon <hyunkyun.moon@linecorp.com>
2023-02-22 10:34:51 +09:00
Miss Islington (bot) 3bfa608cbe
gh-102008: simplify test_except_star by using sys.exception() instead of sys.exc_info() (GH-102009)
(cherry picked from commit c2b85a95a5)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-02-21 07:38:27 -08:00
Miss Islington (bot) 5bc6927c68
[3.11] gh-101961 fileinput.hookcompressed should not set the encoding value for the binary mode (gh-102068) (#102098)
gh-101961 fileinput.hookcompressed should not set the encoding value for the binary mode (gh-102068)
(cherry picked from commit 6f25657b83)

Co-authored-by: Gihwan Kim <gihwan.kim@linecorp.com>
2023-02-21 12:39:16 +09:00
Jason R. Coombs d15e9589f3
[3.11] gh-101566: Sync with zipp 3.14. (GH-102018). (GH-102090)
(cherry picked from commit 36854bbb24)

Backport of bugfix only.

Automerge-Triggered-By: GH:jaraco
2023-02-20 15:22:03 -08:00
Miss Islington (bot) 62c0327487
gh-88233: zipfile: handle extras after a zip64 extra (GH-96161)
Previously, any data _after_ the zip64 extra would be removed.

With many new tests.

Fixes GH-88233
(cherry picked from commit 59e86caca8)

Co-authored-by: Tim Hatch <tim@timhatch.com>
Automerge-Triggered-By: GH:jaraco
2023-02-20 09:33:00 -08:00
Miss Islington (bot) b0bba7ad14
gh-101517: make bdb avoid looking up in linecache with lineno=None (GH-101787)
(cherry picked from commit 366b949058)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-02-10 09:26:27 -08:00
Miss Islington (bot) 5f0b819050
[3.11] gh-100933: Improve `check_element` helper in `test_xml_etree` (GH-100934) (#101686)
Items checked by this test are always `str` and `dict` instances.
(cherry picked from commit eb49d32b9a)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-02-08 12:11:54 +01:00
Oleg Iarygin efcab38699
[3.11] gh-96127: Fix `inspect.signature` call on mocks (#96335) (#101646)
(cherry picked from commit 9e7d7266ec)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-02-08 11:05:57 +01:00
Miss Islington (bot) c38b4e75b1
[3.11] Make use of TESTFN_ASCII in test_fileio (GH-101645) (#101650)
testBytesOpen requires an ASCII filename, but TESTFN usually isn't ASCII.
(cherry picked from commit 6fd5eb640a)

Co-authored-by: Zachary Ware <zach@python.org>
2023-02-08 11:05:36 +01:00
Łukasz Langa 955ba2839b
[3.11] gh-101072: support default and kw default in PyEval_EvalCodeEx for 3.11+ (GH-101127) (#101636)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Matthieu Dartiailh <m.dartiailh@gmail.com>
2023-02-07 13:36:35 +00:00
Mark Dickinson 358b02dac4
[3.11] gh-101266: Revert fix __sizeof__ for subclasses of int (#101638)
Revert "[3.11] gh-101266: Fix __sizeof__ for subclasses of int (GH-101394) (#101579)"

This reverts commit cf89c16486.
2023-02-07 11:44:43 +00:00
Miss Islington (bot) 9e7acafa14
gh-101562: typing: add tests for inheritance with NotRequired & Required in parent fields (GH-101563)
(cherry picked from commit b96b344f25)

Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
2023-02-06 11:53:53 -08:00
Miss Islington (bot) cf8973c638
gh-101541: [Enum] create flag psuedo-member without calling original __new__ (GH-101590)
(cherry picked from commit ef7c2bfcf1)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-02-05 19:52:22 -08:00
Miss Islington (bot) 6ae80323df
gh-101334: Don't force USTAR format in test_tarfile. (GH-101572)
That causes the test to fail when run using a high UID as that ancient format
cannot represent it. The current default (PAX) and the old default (GNU) both
support high UIDs.
(cherry picked from commit ffcb8220d7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-02-05 11:47:12 -08:00
Mark Dickinson cf89c16486
[3.11] gh-101266: Fix __sizeof__ for subclasses of int (GH-101394) (#101579)
Fix the behaviour of the `__sizeof__` method (and hence the results returned
by `sys.getsizeof`) for subclasses of `int`. Previously, `int` subclasses gave
identical results to the `int` base class, ignoring the presence of the instance
dictionary.

(Manual backport of #101394 to the Python 3.11 branch.)
2023-02-05 12:18:56 +00:00
Miss Islington (bot) e98fa7121d
gh-101467: Correct py.exe handling of prefix matches and cases when only one runtime is installed (GH-101468)
(cherry picked from commit eda60916bc)

Co-authored-by: Steve Dower <steve.dower@python.org>
2023-02-01 13:31:21 -08:00
Dong-hee Na 0c37ea9aba
[3.11] gh-101400: Fix incorrect lineno in exception message on contin… (gh-101447) 2023-01-31 23:53:14 +09:00
Miss Islington (bot) faf8068dd0
gh-101229: Add tests for aliases of imported names (GH-101230)
(cherry picked from commit 28db978d7f)

Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
2023-01-30 12:21:18 -08:00
Shantanu cd0fe5ba09
[3.11] gh-101326: Fix regression when passing None to FutureIter.throw (GH-101327) (#101328)
(cherry picked from commit a178ba82bf)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-01-25 13:01:13 -08:00
Miss Islington (bot) 29ff9daf82
gh-101015: Fix `typing.get_type_hints` with unpacked `*tuple` (PEP 646) (GH-101031)
(cherry picked from commit 807d6b576f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-01-23 00:20:15 -08:00
Gregory P. Smith efe3a389ca
[3.11] gh-101144: Allow zipfile.Path .open & .read_text encoding to be positional (#101179)
The zipfile.Path open() and read_text() encoding parameter can be supplied as a positional argument without causing a TypeError again. 3.10.0b1 included a regression that made it keyword only.

Documentation update included as users writing code to be compatible with a wide range of versions will need to consider this for some time..

(cherry picked from commit 5927013e47)

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
2023-01-20 00:06:18 -08:00
Steve Dower 87ade7ebda
gh-100320: Fix path calculations on Windows when python.exe is moved outside of the normal location (GH-100947) 2023-01-16 17:00:34 +00:00
Nikita Sobolev 855b1a935e
[3.11] GH-100942: Fix incorrect cast in property_copy(). (GH-100965). (#101008)
(cherry picked from commit 94fc7706b7)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-01-15 12:38:25 +05:30
Miss Islington (bot) d06315a6fa
[3.11] GH-100573: Fix server hang caused by os.stat() on named pipe (Windows) (GH-100959) (#101019)
(cherry picked from commit 1bc7a73683)
2023-01-13 13:58:20 -08:00
Miss Islington (bot) 6492492ce7
gh-100247: Fix py.exe launcher not using entire shebang command for finding custom commands (GH-100944)
(cherry picked from commit 468c3bf798)

Co-authored-by: Steve Dower <steve.dower@python.org>
2023-01-13 04:52:28 -08:00
Steve Dower 55a26de6ba
gh-96290: Support partial/invalid UNC drives in ntpath.normpath() and splitdrive() (GH-100351)
This brings the Python implementation of `ntpath.normpath()` in line with the C implementation added in 99fcf15

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
2023-01-12 21:32:26 +00:00
Nikita Sobolev cb6ff54b01
[3.11] gh-100931: Test all `pickle` protocols in `test_slice` (GH-100932). (GH-100979)
(cherry picked from commit 8795ad1bd0)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Automerge-Triggered-By: GH:AlexWaygood
2023-01-12 03:24:09 -08:00
Nikita Sobolev db2643737d
[3.11] gh-100871: Improve `copy` module tests (GH-100872) (#100976)
(cherry picked from commit 729ab9b622)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-01-12 11:15:00 +00:00
Kumar Aditya e707671684
[3.11] GH-100892: Fix race in clearing `threading.local` (GH-100922). (#100937)
(cherry picked from commit 762745a124)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-01-11 21:01:48 +05:30
Serhiy Storchaka 1b2459dc64
[3.11] gh-100160: Remove any deprecation warnings in asyncio.get_event_loop() (#100412)
Some deprecation warnings will reappear (in a slightly different form) in 3.12.

Co-authored-by: Guido van Rossum <guido@python.org>
2023-01-10 12:20:09 -08:00
Miss Islington (bot) 6184b800ee
GH-100805: Support numpy.array() in random.choice(). (GH-100830)
(cherry picked from commit 9a68ff12c3)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-01-08 12:04:49 -08:00
Carl Meyer f488831576
[3.11] gh-90104: avoid RecursionError on recursive dataclass field repr (gh-100756) (GH-100784)
Avoid RecursionError on recursive dataclass field repr

(cherry picked from commit 0a7936a38f)

Automerge-Triggered-By: GH:ericvsmith
2023-01-05 18:08:33 -08:00
Miss Islington (bot) ad40764f5b
GH-86508: skip binding to local addresses of different family in `asyncio.open_connection` (GH-100615)
(cherry picked from commit ba8dcdbcab)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-01-04 00:28:00 -08:00
Miss Islington (bot) 50409a2968
[3.11] gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ob_digit array for 0 and False (GH-100663) (#100717)
gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ob_digit array for 0 and False (GH-100663)

Fixes behaviour where int (and subtypes like bool) __sizeof__ under-reports true size as it did not take into account the size 1 `ob_digit` array for the zero int.

(cherry picked from commit d7e7f79ca7)

Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2023-01-03 17:59:40 +00:00
Miss Islington (bot) 861cdefc1b
gh-95882: fix regression in the traceback of exceptions propagated from inside a contextlib context manager (GH-95883)
(cherry picked from commit b3722ca058)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2023-01-03 08:18:45 -08:00
Miss Islington (bot) c88a83e7d8
gh-99433: Fix `doctest` failure on `types.MethodWrapperType` (GH-99434)
(cherry picked from commit 79c10b7da8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-12-30 04:18:54 -08:00
Miss Islington (bot) dd520e7bae
gh-100600: Fix "coroutine was never awaited" warning in `test_coroutines` (GH-100601)
(cherry picked from commit 76856366d3)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-12-29 07:41:34 -08:00
Kumar Aditya ebe428824d
[3.11] GH-100342: check for allocation failure in AC `*args` parsing (GH-100343). (#100568)
(cherry picked from commit 7cf164ad5e)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-12-28 10:11:27 +05:30
Miss Islington (bot) fba8c7cf74
gh-100553: Improve accuracy of sqlite3.Row iter test (GH-100555)
(cherry picked from commit 3dc48dabd4)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-12-27 17:25:28 -08:00
colorfulappl a3dbd4c70e
[3.11] gh-64490: Fix bugs in argument clinic varargs processing (GH-32092) (#100368)
(cherry picked from commit 0da728387c)
2022-12-28 02:10:06 +01:00
Miss Islington (bot) 44b664e057
gh-99535: Add test for inheritance of annotations and update documentation (GH-99990)
(cherry picked from commit f5b7b19bf1)

Co-authored-by: MonadChains <monadchains@gmail.com>
2022-12-24 12:31:10 -08:00
Miss Islington (bot) 714a93f638
[3.11] gh-100474: Fix handling of dirs named index.html in http.server (GH-100505)
Co-authored-by: James Frost <git@frost.cx>
2022-12-24 15:28:41 -05:00
Bill Fisher 57e727af3f
[3.11] gh-99110: Initialize frame->previous in init_frame to fix segmentation fault (GH-100182) (#100478)
(cherry picked from commit 88d565f32a)

Co-authored-by: Bill Fisher <william.w.fisher@gmail.com>
2022-12-24 11:17:10 +05:30
Miss Islington (bot) c4aff6d273
gh-94808: improve test coverage of number formatting (GH-99472)
(cherry picked from commit 7ca45e5ddd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-12-23 18:14:08 -08:00
Miss Islington (bot) d5eb2f4747
bpo-40447: accept all path-like objects in compileall.compile_file (GH-19883)
(cherry picked from commit 1ecfd1ebf1)

Co-authored-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@archlinux.org>
Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-23 12:43:13 -08:00
Miss Islington (bot) 0397f040e2
gh-100129: Add tests for pickling all builtin types and functions (GH-100142)
(cherry picked from commit b98d2d31bf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-12-21 06:58:20 -08:00
Miss Islington (bot) b2076b0071
gh-100374: Fixed a bug in socket.getfqdn() (gh-100375)
(cherry picked from commit 12be23cf3c)

Co-authored-by: Dominic Socular <BBH@awsl.rip>
2022-12-21 06:06:10 -08:00
Miss Islington (bot) ae8520c709
GH-100133: fix `asyncio` subprocess losing `stderr` and `stdout` output (GH-100154)
(cherry picked from commit a7715ccfba)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-12-21 02:24:19 -08:00
colorfulappl bed1d141a9
[3.11] gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing (GH-99890) (#100385)
(cherry picked from commit efbb1eb9f5)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-21 15:32:29 +05:30
Shantanu bee905184e
[3.11] gh-85267: Improvements to inspect.signature __text_signature__ handling (GH-98796) (#100392)
This makes a couple related changes to inspect.signature's behaviour
when parsing a signature from `__text_signature__`.

First, `inspect.signature` is documented as only raising ValueError or
TypeError. However, in some cases, we could raise RuntimeError.  This PR
changes that, thereby fixing GH-83685.

(Note that the new ValueErrors in RewriteSymbolics are caught and then
reraised with a message)

Second, `inspect.signature` could randomly drop parameters that it
didn't understand (corresponding to `return None` in the `p` function).
This is the core issue in GH-85267. I think this is very surprising
behaviour and it seems better to fail outright.

Third, adding this new failure broke a couple tests. To fix them (and to
e.g. allow `inspect.signature(select.epoll.register)` as in GH-85267), I
add constant folding of a couple binary operations to RewriteSymbolics.

(There's some discussion of making signature expression evaluation
arbitrary powerful in GH-68155. I think that's out of scope. The
additional constant folding here is pretty straightforward, useful, and
not much of a slippery slope)

Fourth, while GH-85267 is incorrect about the cause of the issue, it turns
out if you had consecutive newlines in __text_signature__, you'd get
`tokenize.TokenError`.

Finally, the `if name is invalid:` code path was dead, since
`parse_name` never returned `invalid`..
(cherry picked from commit 79311cbfe7)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-20 21:25:13 -08:00
Miss Islington (bot) 73d2b15bd2
[3.11] gh-99576: Fix cookiejar file that was not truncated for some classes (GH-99616) (GH-100377)
(cherry picked from commit 44892d45b0)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-12-20 18:22:39 +01:00
colorfulappl ba8e30c56b
[3.11] gh-99240: Fix double-free bug in Argument Clinic str_converter generated code (GH-99241) (#100352)
(cherry picked from commit 8dbe08eb7c)

Fix double-free bug mentioned at GH-99240, by moving memory clean up out of "exit" label.
2022-12-20 15:49:53 +05:30
colorfulappl c42a4ad587
[3.11] gh-64490: Fix refcount error when arguments are packed to tuple in argument clinic (GH-99233) (#100338)
(cherry picked from commit 69f6cc77d0)
2022-12-19 15:18:49 +05:30
colorfulappl dd323afea8
[3.11] gh-96002: Add functional test for Argument Clinic (GH-96178) (#100230)
(cherry picked from commit c450c8c9ed)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-17 12:04:54 +05:30
Miss Islington (bot) 3939a4b7d9
bpo-43984: Allow winreg.SetValueEx to set -1 without treating it as an error (GH-25775)
(cherry picked from commit a29a7b9b78)

Co-authored-by: Shreyan Avigyan <shreyan.avigyan@gmail.com>
2022-12-09 05:12:43 -08:00
Miss Islington (bot) 42fde2d164
test_ast uses infinite_recursion() to prevent crash (GH-100104)
test.test_ast_recursion_limit() now uses infinite_recursion() of
test.support to prevent crashes on debug builds.

Before this change, the test crashed on ARM64 Windows 3.x buildbot
worker which builds Python in debug mode.
(cherry picked from commit cd67c1bb30)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-12-08 00:52:02 -08:00
Miss Islington (bot) d4426c8295
gh-100098: [Enum] insist on actual tuples, no subclasses, for auto (GH-100099)
When checking for auto() instances, only top-level usage is supported,
which means either alone or as part of a regular tuple. Other
containers, such as lists, dicts, or namedtuples, will not have auto()
transformed into a value.
(cherry picked from commit ded02ca54d)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-12-07 23:21:29 -08:00
Miss Islington (bot) 846898e5ab
gh-98778: Update HTTPError to initialize properly even if fp is None (gh-99966)
(cherry picked from commit dc8a86893d)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-12-07 20:17:23 -08:00
Miss Islington (bot) 2997f3913a
gh-83035: handle decorator with nested parens in inspect.getsource (GH-99654)
(cherry picked from commit 68e41295b8)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2022-12-07 09:26:11 -08:00
Miss Islington (bot) 2b97ddd512
gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer (GH-100065)
(cherry picked from commit 97e7004cfe)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Automerge-Triggered-By: GH:pablogsal
2022-12-07 01:18:00 -08:00
Brandt Bucher 2182a71eed
[3.11] GH-99729: Unlink frames before clearing them (#100047) 2022-12-06 17:02:19 +00:00
Serhiy Storchaka 3fae04b10e
[3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created (#99949)
It no longer emits a deprecation warning if the current event loop was set.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-12-06 16:15:44 +01:00
Miss Islington (bot) b2ff0f761d
gh-100001: Also escape \s in http.server log messages. (GH-100038)
Also \ escape \s in the http.server BaseHTTPRequestHandler.log_message so
that it is technically possible to parse the line and reconstruct what the
original data was.  Without this a \xHH is ambiguious as to if it is a hex
replacement we put in or the characters r"\x" came through in the original
request line.
(cherry picked from commit 7e29398407)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-12-05 14:53:41 -08:00
Miss Islington (bot) a726f747e6
gh-100001: Omit control characters in http.server stderr logs. (GH-100002)
Replace control characters in http.server.BaseHTTPRequestHandler.log_message with an escaped \xHH sequence to avoid causing problems for the terminal the output is printed to.
(cherry picked from commit d8ab0a4dfa)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-12-05 13:39:22 -08:00
Łukasz Langa 32a2193f67
[3.11] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#100016)
In case if only True/False be supported as boolean arguments in future,
we should continue to support 1/0 here.
(cherry picked from commit 922a6cf6c2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-12-05 17:58:40 +01:00
Miss Islington (bot) 4a7612fbec
gh-99892: test_unicodedata: skip test on download failure (GH-100011)
Skip test_normalization() of test_unicodedata if it fails to download
NormalizationTest.txt file from pythontest.net.
(cherry picked from commit 2488c1e1b6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-12-05 08:07:00 -08:00
Miss Islington (bot) 5533cf67e7
gh-100005: Skip test_script_as_dev_fd() on FreeBSD (GH-100006)
On FreeBSD, skip test_script_as_dev_fd() of test_cmd_line_script if
fdescfs is not mounted (at /dev/fd).
(cherry picked from commit 038b151963)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-12-05 06:07:48 -08:00
Miss Islington (bot) 7aa87bba05
gh-60203: Always pass True/False as boolean arguments in tests (GH-99983)
Unless we explicitly test non-bool values.
(cherry picked from commit 76f43fc09a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-12-04 04:50:46 -08:00
Ken Jin 9e38553132
[3.11] gh-99886: Fix crash when freeing objects with managed dictionaries (#99902)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-04 14:41:23 +08:00
Miss Islington (bot) 4710a7589a
gh-99934: test_marshal.py: add more elements in test_deterministic_sets (GH-99935)
Existing elements do produce different output on x86_64, but they
do not on x86. Let's make the data longer to ensure it differs.
(cherry picked from commit c68573b339)

Co-authored-by: Alexander Kanavin <alex.kanavin@gmail.com>
2022-12-03 09:18:23 -08:00
Pablo Galindo Salgado 6282ef6c3f
[3.11] gh-99891: Fix infinite recursion in the tokenizer when showing warnings (GH-99893) (GH-99896)
Automerge-Triggered-By: GH:pablogsal.
(cherry picked from commit 417206a05c)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-12-01 00:57:04 -08:00
Miss Islington (bot) 0076ca48e9
gh-96192: fix os.ismount() to use a path that is str or bytes (GH-96194)
(cherry picked from commit 367f552129)

Co-authored-by: Christoph Anton Mitterer <calestyo@scientia.org>
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-11-30 15:31:49 -08:00
Miss Islington (bot) 8dafefcace
gh-82836: fix private network check (GH-97733)
Fixes private checks for network objects. The previous method would incorrectly return True for a private check in cases such as "0.0.0.0/0".
(cherry picked from commit ed391090cc)

Co-authored-by: Pete Wicken <2273100+JamoBox@users.noreply.github.com>
2022-11-29 14:12:57 -08:00
Miss Islington (bot) 74920aa27d
gh-99344, gh-99379, gh-99382: Fix issues in substitution of ParamSpec and TypeVarTuple (GH-99412)
* Fix substitution of TypeVarTuple and ParamSpec together in user generics.

* Fix substitution of ParamSpec followed by TypeVarTuple in generic aliases.

* Check the number of arguments in substitution in user generics containing a
  TypeVarTuple and one or more TypeVar.
(cherry picked from commit 8f2fb7dfe7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-29 06:46:53 -08:00
Kumar Aditya 6f658dd60d
[3.11] bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and segfaults (GH-18640) (#99841)
Co-authored-by: Oren Milman <orenmn@gmail.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>

(cherry picked from commit 53eef27133)
2022-11-28 16:47:33 +05:30
Miss Islington (bot) fce9516a0f
gh-51524: Fix bug when calling trace.CoverageResults with valid infile (GH-99629)
(cherry picked from commit 594de165bf)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-11-27 23:15:00 -08:00
Miss Islington (bot) e4cfdaa45b
GH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on macOS (GH-99768)
On macOS all file descriptors for a particular file in /dev/fd
share the same file offset, that is ``open("/dev/fd/9", "r")`` behaves
more like ``dup(9)`` than a regular open.

This causes problems when a user tries to run "/dev/fd/9" as a script
because zipimport changes the file offset to try to read a zipfile
directory. Therefore change zipimport to reset the file offset after
trying to read the zipfile directory.
(cherry picked from commit d08fb25769)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-27 03:19:02 -08:00
Miss Islington (bot) 193a25e89c
gh-91078: Return None from TarFile.next when the tarfile is empty (GH-91850)
(cherry picked from commit 78365b8e28)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-11-26 11:01:20 -08:00
Miss Islington (bot) 45ffab40e8
gh-97966: Restore prior expectation that uname_result._fields and ._asdict would include the processor. (gh-98343)
(cherry picked from commit dc063a25d2)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2022-11-26 05:53:00 -08:00
Miss Islington (bot) c06f74f1d6
bpo-38031: Fix a possible assertion failure in _io.FileIO() (GH-GH-5688)
(cherry picked from commit d386115039)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-11-25 05:20:00 -08:00
Miss Islington (bot) 85dbd2d767
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:03:26 -08:00
Miss Islington (bot) e26aa24b47
gh-99659: Use correct exceptions in sqlite3 bigmem tests (GH-99660)
The tests in question were added in 0eec6276fd by Serhiy. Apparently,
sqlite3 changed exceptions raised in those cases in the mean time but
the tests never ran because they require a high `-M` setting in the
test runner.
(cherry picked from commit 2781ec9b0e)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-11-22 00:51:59 -08:00
Batuhan Taskaya a3480ec795
[3.11] gh-99103: Normalize specialized traceback anchors against the current line (#99423)
[3.11] gh-99103: Normalize specialized traceback anchors against the current line (GH-99145)

Automerge-Triggered-By: GH:isidentical.
(cherry picked from commit 57be545959)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-11-21 22:16:12 +00:00
Miss Islington (bot) 9dda9020ab
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:43:23 -08:00
Miss Islington (bot) f381644819
gh-99581: Fix a buffer overflow in the tokenizer when copying lines that fill the available buffer (GH-99605)
(cherry picked from commit e13d1d9dda)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-11-20 12:53:02 -08:00
Lysandros Nikolaou 152a437b8d
[3.11] gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215) (GH-99622)
gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215)

(cherry picked from commit 9c4232ae89)
2022-11-20 19:29:05 +01:00
Serhiy Storchaka 56a517e9e8
[3.11] gh-78453: Move Unicode C API tests from test_unicode to test_capi.test_unicode (GH-99431). (GH-99614)
(cherry picked from commit 06d4e02c3b)
2022-11-20 11:24:45 +02:00
Miss Islington (bot) d5e6f9b0ab
gh-99442: Fix handling in py.exe launcher when argv[0] does not include a file extension (GH-99542)
(cherry picked from commit a220c6d1ee)
2022-11-18 17:49:14 +00:00
Miss Islington (bot) 82ab9e6b79
gh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException (GH-99572)
(cherry picked from commit c8c6113398)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-11-18 08:10:55 -08:00
Miss Islington (bot) 0014ce7d0d
gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)
(cherry picked from commit 7c57857340)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-16 15:41:18 -08:00
Miss Islington (bot) f4cb8285ba
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 13:10:27 -08:00
Miss Islington (bot) e1e8a15abf
GH-98219: reduce sleep time in `asyncio` subprocess test (GH-99464)
(cherry picked from commit 619cadcda6)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-15 07:52:38 -08:00
Miss Islington (bot) b189f429b2
gh-99370: fix test_zippath_from_non_installed_posix (GH-99483)
When build with shared enabled, we need to set `LD_LIBRARY_PATH`
for the non-installed python environment in
test_zippath_from_non_installed_posix so that the python binary
and find and link the libpython.so.
(cherry picked from commit 1df0752b4d)

Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
2022-11-14 17:27:42 -08:00
Miss Islington (bot) 90de4b76b9
[3.11] gh-99357: Close the event loop when it is no longer used in test_uncancel_structured_blocks (GH-99414) (#99424)
(cherry picked from commit 99972dc745)

Co-authored-by: Xiao Chen <chenxiao_7@163.com>
2022-11-14 10:52:10 -08:00
Miss Islington (bot) 5971a65d07
gh-99370: Calculate zip path from prefix when in a venv (GH-99371)
Before python3.11, when in a venv the zip path is calculated
from prefix on POSIX platforms. In python3.11 the behavior is
accidentally changed to calculating from default prefix. This
change will break venv created from a non-installed python
with a stdlib zip file. This commit restores the behavior back
to before python3.11.
(cherry picked from commit e3d4fed074)

Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
2022-11-14 07:31:46 -08:00
Miss Islington (bot) 72d356e358
gh-99418: Make urllib.parse.urlparse enforce that a scheme must begin with an alphabetical ASCII character. (GH-99421)
Prevent urllib.parse.urlparse from accepting schemes that don't begin with an alphabetical ASCII character.

RFC 3986 defines a scheme like this: `scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )`
RFC 2234 defines an ALPHA like this: `ALPHA = %x41-5A / %x61-7A`

The WHATWG URL spec defines a scheme like this:
`"A URL-scheme string must be one ASCII alpha, followed by zero or more of ASCII alphanumeric, U+002B (+), U+002D (-), and U+002E (.)."`
(cherry picked from commit 439b9cfaf4)

Co-authored-by: Ben Kallus <49924171+kenballus@users.noreply.github.com>
2022-11-13 11:00:25 -08:00
Miss Islington (bot) ecc164f350
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:42 -08:00