Commit Graph

29015 Commits

Author SHA1 Message Date
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
Miss Islington (bot) 92b531b858
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:30:38 -08:00
Miss Islington (bot) c9f2177d13
gh-99204: Calculate base_executable by alternate names in POSIX venvs (GH-99206)
Check to see if `base_executable` exists. If it does not, attempt
to use known alternative names of the python binary to find an
executable in the path specified by `home`.

If no alternative is found, previous behavior is preserved.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>

(cherry picked from commit c41b13d39c)

Co-authored-by: Vincent Fazio <vfazio@gmail.com>
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
2022-11-10 08:53:51 -08:00
Miss Islington (bot) f9a68be673
[3.11] GH-99257: Check the owner's type when specializing slots (GH-99324)
(cherry picked from commit 9d69284169)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-11-10 08:44:49 -08:00
Miss Islington (bot) 1de088ca95
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:58:06 -08:00
Miss Islington (bot) 921f235367
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:22:00 -08:00
Miss Islington (bot) 1565db7020
gh-94445: add compiler test for another case of excessive stack use (GH-99237)
(cherry picked from commit 027bc7e6bb)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2022-11-08 13:16:28 -08:00
Miss Islington (bot) 4f31171e3f
gh-99248: [Enum] fix negative number infinite loop (GH-99256)
[Enum] fix negative number infinite loop

- _iter_bits_lsb() now raises a ValueError if a negative number
  is passed in

- verify() now skips checking negative numbers for named flags
(cherry picked from commit 0b4ffb08cc)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-11-08 12:33:21 -08:00
Miss Islington (bot) 47f4a18be0
gh-99181: fix except* on unhashable exceptions (GH-99192)
(cherry picked from commit c43714fbcd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-11-08 01:58:45 -08:00
Miss Islington (bot) a6f6c3a3d6
[3.11] gh-98433: Fix quadratic time idna decoding. (GH-99092) (#99222)
There was an unnecessary quadratic loop in idna decoding. This restores
the behavior to linear.

(cherry picked from commit d315722564)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-11-07 18:57:10 -08:00
Miss Islington (bot) 1add2393a8
[3.11] gh-98513: Test abstract methods of some `collections` types (GH-98516) (#99226)
(cherry picked from commit a309ad9f76)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-07 18:45:08 -08:00
Miss Islington (bot) 42fb233c52
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:12:48 -08:00
Miss Islington (bot) 5f83209d89
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:11:11 -08:00
Irit Katriel d8a42bcaf0
[3.11] gh-99153: set location on SyntaxError for try with both except and except* (GH-99160) (#99168) 2022-11-07 09:41:20 +00:00
Nikita Sobolev 263e9830aa
[3.11] GH-99155: Fix `NormalDist` pickle with `0` and `1` protocols (GH-99156). (GH-99188)
(cherry picked from commit d7a00f1e8e)

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

Automerge-Triggered-By: GH:rhettinger
2022-11-07 01:41:08 -08:00
Miss Islington (bot) 6fadca308c
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 12:03:15 -08:00
Miss Islington (bot) be4bab8c2b
gh-93464: [Enum] fix auto() failure during multiple assignment (GH-99148)
* fix auto() failure during multiple assignment

i.e. `ONE = auto(), 'text'` will now have `ONE' with the value of `(1,
'text')`.  Before it would have been `(<an auto instance>, 'text')`
(cherry picked from commit 8feb7ab77c)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-11-06 06:30:32 -08:00
Miss Islington (bot) d025046ef5
`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:45 -08:00
Miss Islington (bot) d8c11b75e2
gh-94808: add tests covering `PySequence_{Set,Del}Slice` (GH-99123)
(cherry picked from commit c5c40773cb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-05 10:32:46 -07:00
Jason R. Coombs 07734a42db
[3.11] gh-98706: Sync with importlib_metadata 4.13.0. (GH-98875)
These changes are already applied to main but have been selected from importlib_metadata 4.x for their bug fixes.
2022-11-05 06:55:04 -07:00
Miss Islington (bot) 46a493e2db
gh-94808: add tests covering `PyEval_GetFuncDesc` function (GH-98300)
(cherry picked from commit b5f711185b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-05 06:32:46 -07:00
Victor Stinner a9a8c87126
[3.11] gh-90867: test.support.wait_process() uses LONG_TIMEOUT (#99071) (#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 f09da28768)
2022-11-04 15:50:51 +01:00
Miss Islington (bot) 2b79f4e469
[3.11] gh-94808: Cover `LOAD_GLOBAL` for custom dict subtypes (GH-96767) (GH-99091) 2022-11-04 11:12:42 +00:00
Miss Islington (bot) eb023a84d9
gh-98740: Fix validation of conditional expressions in RE (GH-98764)
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 00:47:39 -07:00
Miss Islington (bot) a02979fa48
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:35:39 -07:00
Steve Dower 3ff659aea2
gh-98790: When DLLs directory is missing on Windows, assume executable_dir contains PYD files instead (GH-98936) 2022-11-02 20:04:06 +00:00
Miss Islington (bot) 39e0627b77
[3.11] gh-98925: Lower marshal recursion depth for WASI (GH-98938) (GH-98979)
* gh-98925: Lower marshal recursion depth for WASI (GH-98938)

For wasmtime 2.0, the stack depth cost is 6% higher. This causes the default max `marshal` recursion depth to blow the stack.

As the default marshal depth is 2000 and Windows is set to 1000, split the difference and choose 1500 for WASI to be safe.
(cherry picked from commit 9711265182)

Co-authored-by: Brett Cannon <brett@python.org>
2022-11-01 16:18:55 -07:00
Miss Islington (bot) 20c258c692
gh-98852: Fix subscription of type aliases (GH-98920)
Fix subscription of type aliases containing bare generic types or types
like TypeVar: for example tuple[A, T][int] and tuple[TypeVar, T][int],
where A is a generic type, and T is a type variable.
(cherry picked from commit 0e15c31c7e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-01 01:01:28 -07:00
Miss Islington (bot) 8495af8963
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:40:30 -07:00
Miss Islington (bot) 46a3cf4fe3
gh-98692: Enable treating shebang lines as executables in py.exe launcher (GH-98732)
(cherry picked from commit 88297e2a8a)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-10-31 14:31:26 -07:00
Charlie Zhao 2b0cbb90c3
[3.11] gh-98793: Fix typecheck in `overlapped.c` (GH-98835) (#98889)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 3ac8c0ab6e)
2022-10-31 11:21:01 -07:00
Miss Islington (bot) ca24e496ba
[3.11] gh-96151: Use a private name for passing builtins to dataclass. This now allows for a field named BUILTIN (gh-98143) (gh-98900)
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:00 -04:00
Miss Islington (bot) 57dd11038f
[3.11] gh-96853: Restore test coverage for Py_Initialize(Ex) (GH-98874)
* As most of `test_embed` now uses `Py_InitializeFromConfig`, add
  a specific test case to cover `Py_Initialize` (and `Py_InitializeEx`)
* Rename `_testembed` init helper to clarify the API used
* Add a `PyConfig_Clear` call in `Py_InitializeEx` to make
  the code more obviously correct (it already didn't leak as
  none of the dynamically allocated config fields were being
  populated, but it's clearer if the wrappers follow the
  documented API usage guidelines)
(cherry picked from commit 05e48865be)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2022-10-31 09:15:12 +10:00
Dennis Sweeney 5efe2eead3
[3.11] gh-98783: Fix crashes when `str` subclasses are used in `_PyUnicode_Equal` (GH-98806) (#98871)
* gh-98783: Fix crashes when `str` subclasses are used in `_PyUnicode_Equal` (GH-98806)
(cherry picked from commit 76f989dc3e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-30 14:30:08 -04:00
Batuhan Taskaya 751da28feb
[3.11] gh-98744: Prevent column-level decoding crashes on traceback module (#98850)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-10-29 15:12:15 +01:00
Miss Islington (bot) 8e475adf30
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:33:19 -07:00
Miss Islington (bot) 3bad567d08
[3.11] gh-98741: Remove useless check_home usage from is_python_build usage (GH-98743) (GH-98746)
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-10-26 23:35:54 +01:00
Miss Islington (bot) ce2b56e280
gh-98713: Use `@cpython_only` for a test that fails on PyPy (GH-98714)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 9495360c72)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-26 06:41:42 -07:00
Miss Islington (bot) db14a9d594
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:57:49 -07:00
Jelle Zijlstra 83c8df29dd
[3.11] GH-87390: Add remaining tests for PEP 646 (GH-98267) (#98667)
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>.
Co-authored-by: Matthew Rahtz <matthew.rahtz@gmail.com>

(cherry picked from commit cb95cc24ef)
2022-10-25 18:46:57 -07:00
Miss Islington (bot) 18b788c63a
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:04:01 -07:00
Miss Islington (bot) abc1a8c61c
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:19:37 -07:00
Miss Islington (bot) 65f9c8e6dd
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:49:34 -07:00
Miss Islington (bot) 8950689dce
[3.11] GH-89237: fix hang in proactor `subprocess.wait_closed()` (GH-98572) (#98620)
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 20:34:08 -07:00
Pablo Galindo Salgado b3cafb60af
[3.11] Fix v3.11.0 release merge problems (GH-98622)
When merging the v3.11.0 tag into 3.11, some files were incorrectly updated and some others were not properly deleted.

Automerge-Triggered-By: GH:pablogsal
2022-10-24 16:30:06 -07:00
Miss Islington (bot) 3a1eb81abf
GH-98407: fix `test_kill_issue43884` to not leak child processes (GH-98491)
(cherry picked from commit 3b2724abcf)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-24 12:41:10 -07:00
Pablo Galindo 69b6b56d85 Python 3.11.0
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEz9yiRbEEPPKl+Xhl/+h0BBaL2EcFAmNWzOwACgkQ/+h0BBaL
 2EcepxAAmZLGMrL4D7Zxzo6N2ezkuiuoQH4JvxIUaB7cjU5h0GSUFlmcJQCHhCwk
 AvToQrmH/7uuuEZKST1fomtUE83wudfHhX2t+CMBdbLG1hIwhTfLNMTqFhONturF
 XlkVUcva1i9XrYZPLl1pIcBf1Sjm6pPW5QZ4BP1ZHJ5C2pHEzaBRFX/q0lU5aF9O
 z5nBBpnga2gShUTqM1VkXucU4lKXsi4blbn/Z8giganMXY1SXIsEOoCaDZYN1Hh/
 xQiOpSrjy/uSz4vGSNuPwp9J2lRlw8n4RBd/P7om01CrJMAKotH+62OqwhlQ8ydB
 ywp0kygtPtMdSK7F1WKMWkYX4CXfLpYwN0+x3Z3iYFBFiuzOFrUCQYgqqfEPNq+o
 bQxxnhAvYcOVINUub6oL23hgFZIoM6l54L66qujQVFM0usCY2f23Ikqd0Z7K8+6e
 uDRAvGiCHkbbfhdnfXzc/Wgj4zLaPnNs8S2s8ojK32NPV8gyWVBumcsRvlocfl6K
 hoA5wqeAXsOv+pFjkGtk90Yg+8R9n+n47//o6uYW/vvZtksm2wPm3hnuCA0WqPzN
 IM7SJE5VrtSRqQpXT9j4G3zyHDNT/Qhrh+cyBM5kgoPSdbU0ugZN8P7GWVtsFhmK
 rrHRns85gNZJ6qTN1pU22MybYCPIsg5Dt6+jZ8hJWIzOOy9apIk=
 =Ryd2
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEz9yiRbEEPPKl+Xhl/+h0BBaL2EcFAmNW55YACgkQ/+h0BBaL
 2EfCLg//bMWtb/X3D+IM+9BIrpEscj/vw22zH9j8PIRd8iWfW80TNEIBh4uPEc0j
 SDTkA5bqN6CB7xqIxDlWQcJpGiImVZ2LzOw8HHye1QCfVZk741CF78UhEnb+hTbO
 gr7nIznytv+VdMSDRHTSgpnkRNQ9FjFEHLu7YQTMof5i/YmTxWZcsru6dTLlEutg
 F3+PfxbKwPgJkfare91X62XSQwyTL6k0mvl5+Sdq2WEQdgMqv4I8V9dHbnk9K3VI
 B+K2xsfIyWHrLDwQa3LBZj4YOKTwnwqlr1sEqO47NfasWaMYa1vBsktLVtPVQ3xS
 Hz0lLhJXJLzf5hmf2r4Tw1S5spn5ijsZ7CwK2Zl+1+dbJMpRoK4VeSSYy/OfEpwy
 8Hx1YitMyORF3HkGWa+pPYPNaIOw4S/EQQPYd5osg3NnknYjkkKZZaliq7EZra7c
 GANPJamXhHREQyhux9KeiYZer3SU3CSXopyxm8ClcBZJAiAOjhAdeOk+Q4Ta9T6+
 gRWBOrelroyFTWHsOd8V7gSz3XJNuAzlNZ/+1Oj/7Em+5DGLFcxJrZGLxn+hruZ5
 GPK9IQXbURAuxqVrqCzw2tzf/NzJr0fs4QDYEVI95pfLjzk1tuJ5WR6zFNC0COK2
 qw8TTvXglsvHqVMnK8u73GVSTv1UGYqbQH9uAeEikAQYr3TTdZo=
 =dsZm
 -----END PGP SIGNATURE-----

Merge tag 'v3.11.0' into 3.11

Python 3.11.0
2022-10-24 20:29:24 +01:00
Miss Islington (bot) 981b509784
GH-90985: Revert "Deprecate passing a message into cancel()" (GH-97999)
Reason: we were too hasty in deprecating this.
We shouldn't deprecate it before we have a replacement.
(cherry picked from commit 09de8d7aaf)

Co-authored-by: Guido van Rossum <guido@python.org>
2022-10-24 17:09:41 +01:00
Miss Islington (bot) f0083923fa
gh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() (GH-95253)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
(cherry picked from commit f00645d5db)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-10-24 17:09:37 +01:00
Miss Islington (bot) 965ce0d8f1
gh-95027: Fix regrtest stdout encoding on Windows (GH-98492)
On Windows, when the Python test suite is run with the -jN option,
the ANSI code page is now used as the encoding for the stdout
temporary file, rather than using UTF-8 which can lead to decoding
errors.
(cherry picked from commit ec1f6f5f13)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-10-24 16:45:42 +01:00
Miss Islington (bot) 38ade0d2ac
gh-97616: list_resize() checks for integer overflow (GH-97617)
Fix multiplying a list by an integer (list *= int): detect the
integer overflow when the new allocated length is close to the
maximum size.  Issue reported by Jordan Limor.

list_resize() now checks for integer overflow before multiplying the
new allocated length by the list item size (sizeof(PyObject*)).
(cherry picked from commit a5f092f3c4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-10-24 16:45:40 +01:00
Miss Islington (bot) 9c80b55ad6
gh-97545: Make Semaphore run faster. (GH-97549)
(cherry picked from commit 68c46ae68b)

Co-authored-by: Cyker Way <cykerway@gmail.com>
2022-10-24 16:45:39 +01:00
Miss Islington (bot) 56145c6963
gh-90155: Fix bug in asyncio.Semaphore and strengthen FIFO guarantee (GH-93222)
The main problem was that an unluckily timed task cancellation could cause
the semaphore to be stuck. There were also doubts about strict FIFO ordering
of tasks allowed to pass.

The Semaphore implementation was rewritten to be more similar to Lock.
Many tests for edge cases (including cancellation) were added.
(cherry picked from commit 24e0379624)

Co-authored-by: Cyker Way <cykerway@gmail.com>
2022-10-24 16:45:38 +01:00
Miss Islington (bot) 67f5d24e44
gh-96848: Fix -X int_max_str_digits option parsing (GH-96988)
Fix command line parsing: reject "-X int_max_str_digits" option with
no value (invalid) when the PYTHONINTMAXSTRDIGITS environment
variable is set to a valid limit.
(cherry picked from commit 41351662bc)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-10-22 20:55:26 +01:00
Nikita Sobolev 9cb7324e8f
[3.11] gh-96587: Raise `SyntaxError` for PEP654 on older `feature_version` (GH-96588) (#96591)
(cherry picked from commit 2c7d2e8d46)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-22 20:53:46 +01:00
Miss Islington (bot) 84fd4a54a6
[3.11] gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK (GH-97944) (#97969)
The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls.
 Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a
 segfault if cpython is built with the macOS 13 SDK but run on an earlier
 version of macOS. Prevent this by adding runtime support for detection of
 these system calls ("weaklinking") as is done for other newer syscalls on
 macOS.
(cherry picked from commit 6d0a0191a4)

Co-authored-by: Ned Deily <nad@python.org>
2022-10-22 20:49:42 +01:00
Miss Islington (bot) 1a788914ca
gh-96865: [Enum] fix Flag to use CONFORM boundary (GH-97528)
(cherry picked from commit b44372e03c)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-10-22 20:48:32 +01:00
Miss Islington (bot) fc127628d5
gh-98414: py.exe launcher does not use defaults for -V:company/ option (GH-98460)
(cherry picked from commit 4bd63f66cd)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-10-22 20:15:49 +01:00
Miss Islington (bot) 585c95df95
[3.11] GH-97752: Clear the previous member of newly-created generator/coroutine frames (GH-97812)
(cherry picked from commit 93fcc1f413)
2022-10-22 20:10:18 +01:00
Miss Islington (bot) 4e0fda59f1
gh-98360: multiprocessing now spawns children on Windows with correct argv[0] in virtual environments (GH-98462)
(cherry picked from commit e48f9b2b7e)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-10-22 20:10:11 +01:00
Miss Islington (bot) d0ab10f6f0
[3.11] GH-97002: Prevent _PyInterpreterFrames from backing more than one PyFrameObject (GH-98002)
(cherry picked from commit 21a2d9ff55)
2022-10-22 20:09:08 +01:00
Miss Islington (bot) 154b3cd751
GH-96975: Skip incomplete frames in PyEval_GetFrame (GH-97018)
(cherry picked from commit 8fd2c3b75b)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-10-22 20:09:00 +01:00
Miss Islington (bot) c835b97c5f
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:27:41 -07:00
Miss Islington (bot) b2aa28eec5
gh-95027: Fix regrtest stdout encoding on Windows (GH-98492)
On Windows, when the Python test suite is run with the -jN option,
the ANSI code page is now used as the encoding for the stdout
temporary file, rather than using UTF-8 which can lead to decoding
errors.
(cherry picked from commit ec1f6f5f13)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-10-21 07:52:17 -07:00
Miss Islington (bot) 1520f4e45b
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:28:36 -07:00
Miss Islington (bot) ace6611de6
gh-98360: multiprocessing now spawns children on Windows with correct argv[0] in virtual environments (GH-98462)
(cherry picked from commit e48f9b2b7e)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-10-20 07:33:12 -07:00
Miss Islington (bot) 5f5fa4ca4b
typing tests: `_overload_dummy` raises `NotImplementedError`, not `RuntimeError` (GH-98351)
(cherry picked from commit 1ca6647f22)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-19 18:23:40 -07:00
Miss Islington (bot) df4aaff0e6
[3.11] gh-94808: Cover `str.rsplit` for UCS1, UCS2 or UCS4 (GH-98228) (#98291)
gh-94808: Cover `str.rsplit` for UCS1, UCS2 or UCS4 (GH-98228)
(cherry picked from commit b7dd2cad18)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-19 17:53:50 -07:00
Miss Islington (bot) 0b71dad9b8
gh-98414: py.exe launcher does not use defaults for -V:company/ option (GH-98460)
(cherry picked from commit 4bd63f66cd)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-10-19 15:41:28 -07:00
Jelle Zijlstra 39eaca884f
[3.11] gh-94808: Cover `PyFunction_GetCode`, `PyFunction_GetGlobals`,… (#98317)
[3.11] gh-94808: Cover `PyFunction_GetCode`, `PyFunction_GetGlobals`, `PyFunction_GetModule` (GH-98158).
(cherry picked from commit 7b48d02933)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-18 17:37:16 -07:00
Miss Islington (bot) 0bba980c5f
[3.11] gh-98174: Handle EPROTOTYPE under macOS in test_sendfile_fallback_close_peer_in_the_middle_of_receiving (GH-98316) (#98357)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
(cherry picked from commit 3e82ad05b1)

Co-authored-by: fancidev <fancidev@gmail.com>
2022-10-18 08:21:58 -07:00
Miss Islington (bot) b5874fae0a
[3.11] gh-95731: Fix module docstring extraction in pygettext (GH-95732) (#98281)
gh-95731: Fix module docstring extraction in pygettext (GH-95732)
(cherry picked from commit 120b4ab2b6)

Co-authored-by: Jakub Kuczys <me@jacken.men>
2022-10-15 21:15:17 -07:00
Jelle Zijlstra 93d0d9cfdd
[3.11] gh-94808: Cover `PyEval_GetFuncName` (GH-98246). (#98283)
(cherry picked from commit f01b56c7bd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-15 11:48:48 -07:00
Miss Islington (bot) 4e78d9482a
gh-95971: Turn @writes_bytecode_files to skip when not running (GH-95972)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 07b5c4699e)

Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>
2022-10-15 08:22:38 -07:00
Miss Islington (bot) 22ad9e5f3e
gh-98251: Allow venv to pass along PYTHON* variables to pip and ensurepip when they do not impact path resolution (GH-98259)
(cherry picked from commit 2fe44f728a)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-10-14 09:24:23 -07:00
Miss Islington (bot) 595ef03c7c
bpo-46364: Use sockets for stdin of asyncio only on AIX (GH-30596)
Signed-off-by: Christoph Hamsen <hamsen.christoph@posteo.de>
Co-authored-by: July Tikhonov <july.tikh@gmail.com>
(cherry picked from commit c9ed0327a9)

Co-authored-by: Christoph Hamsen <37963496+xopham@users.noreply.github.com>
2022-10-13 10:27:31 -07:00
Serhiy Storchaka f6e50b82f6
[3.11] Add more syslog tests (GH-97953). (GH-98096)
(cherry picked from commit cae7d1d7a7)
2022-10-08 22:22:26 +03:00
Miss Islington (bot) e493792612
gh-92886: make test_ast pass with -O (assertions off) (GH-98058)
-O does not strip docstrings.

Automerge-Triggered-By: GH:iritkatriel
(cherry picked from commit 27ce45d8e1)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-10-07 22:02:38 -07:00
Miss Islington (bot) 72a23d8f06
gh-92886: make test_coroutines pass with -O (assertions off) (GH-98060)
Automerge-Triggered-By: GH:iritkatriel
(cherry picked from commit 45f21472da)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-10-07 21:24:02 -07:00
Miss Islington (bot) 46aa5d2c2d
[3.11] gh-94808: Cover `%p` in `PyUnicode_FromFormat` (GH-96677) (#98033)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

(cherry picked from commit 72c166add8)
2022-10-07 17:09:53 -07:00
Miss Islington (bot) c2f21af42a
gh-65496: Correct wording on csv's skipinitialspace argument (GH-96170)
(cherry picked from commit 676d8ef380)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-10-07 16:45:53 -07:00
Miss Islington (bot) 107ba927cf
GH-96073: Fix wild replacement in inspect.formatannotation (GH-96074)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit d5fea01d9d)

Co-authored-by: Anh71me <iyumelive@gmail.com>
2022-10-07 12:56:16 -07:00
Miss Islington (bot) d163d5976d
GH-90985: Revert "Deprecate passing a message into cancel()" (GH-97999)
Reason: we were too hasty in deprecating this.
We shouldn't deprecate it before we have a replacement.
(cherry picked from commit 09de8d7aaf)

Co-authored-by: Guido van Rossum <guido@python.org>
2022-10-06 18:50:25 -07:00
Miss Islington (bot) 89e9474327
[3.11] GH-97002: Prevent _PyInterpreterFrames from backing more than one PyFrameObject (GH-98002)
(cherry picked from commit 21a2d9ff55)
2022-10-06 17:36:39 -07:00
Miss Islington (bot) 60570303e4
[3.11] gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK (GH-97944) (#97969)
The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls.
 Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a
 segfault if cpython is built with the macOS 13 SDK but run on an earlier
 version of macOS. Prevent this by adding runtime support for detection of
 these system calls ("weaklinking") as is done for other newer syscalls on
 macOS.
(cherry picked from commit 6d0a0191a4)

Co-authored-by: Ned Deily <nad@python.org>
2022-10-06 12:13:46 -07:00
Miss Islington (bot) 1cd19f7ebf
[3.11] gh-94808: Coverage: Test that maximum indentation level is handled (GH-95926) (#97979)
gh-94808: Coverage: Test that maximum indentation level is handled (GH-95926)

* gh-94808: Coverage: Test that maximum indentation level is handled

* Use "compile" rather than "exec"
(cherry picked from commit 23e83a8465)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-10-06 12:06:49 -07:00
Miss Islington (bot) 4aa93afd6e
gh-94808: Cover `PyObject_PyBytes` case with custom `__bytes__` method (GH-96610)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit e39ae6bef2)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-06 05:44:05 -07:00
Miss Islington (bot) c9480d5ad5
gh-96865: [Enum] fix Flag to use CONFORM boundary (GH-97528)
(cherry picked from commit b44372e03c)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-10-05 16:32:16 -07:00
Shantanu c9eacc8d02
[3.11] gh-95987: Fix `repr` of `Any` type subclasses (GH-96412) (#96451)
(cherry picked from commit 4217393)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-05 15:02:06 -07:00
Nikita Sobolev 8c6ced36ab
[3.11] gh-96587: Raise `SyntaxError` for PEP654 on older `feature_version` (GH-96588) (#96591)
(cherry picked from commit 2c7d2e8d46)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-10-05 15:00:13 -07:00
Miss Islington (bot) aec133347e
gh-88050: Fix asyncio subprocess to kill process cleanly when process is blocked (GH-32073)
(cherry picked from commit 7015e13797)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-05 10:48:48 -07:00
Miss Islington (bot) 2b248b0ab5
gh-95196: Disable incorrect pickling of the C implemented classmethod descriptors (GH-96383)
(cherry picked from commit 77f0249308)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-10-05 04:59:09 -07:00
Miss Islington (bot) 015b49ac05
[3.11] GH-97779: Ensure that *all* frame objects are backed by "complete" frames (GH-97886)
(cherry picked from commit 0ff8fd6583)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-10-04 22:46:34 -07:00
Miss Islington (bot) 9133aabc70
gh-97825: fix AttributeError when calling subprocess.check_output(input=None) with encoding or errors args (GH-97826)
* fix AttributeError, add unit test
(cherry picked from commit db64fb9bbe)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2022-10-04 20:29:40 -07:00
Miss Islington (bot) 4591dae421
[3.11] GH-97752: Clear the previous member of newly-created generator/coroutine frames (GH-97812)
(cherry picked from commit 93fcc1f413)
2022-10-03 21:03:26 -07:00
Miss Islington (bot) fe99b64bef
gh-94808: Coverage: Check picklablability of calliter (GH-95923)
(cherry picked from commit cfbc7dd910)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2022-10-03 14:25:48 -07:00
Serhiy Storchaka f07ee41479
[3.11] gh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE converter (GH-97729) (GH-97757)
It affects function os.system() on Windows and Windows-specific modules
winreg, _winapi, _overlapped, and _msi.
(cherry picked from commit 0ee9619a4c)
2022-10-03 15:01:54 +03:00
Miss Islington (bot) f59506780a
gh-96819: multiprocessing.resource_tracker: check if length of pipe write <= 512 (GH-96890)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 19ca114645)

Co-authored-by: Koki Saito <49419225+saito828koki@users.noreply.github.com>
2022-10-02 18:09:58 -07:00
Miss Islington (bot) dbde686a49
gh-97591: In `Exception.__setstate__()` acquire strong references before calling `tp_hash` slot (GH-97700)
(cherry picked from commit d639438609)

Co-authored-by: Ofey Chan <ofey206@gmail.com>
2022-10-01 21:19:57 -07:00
Miss Islington (bot) 3614bbb8eb
gh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() (GH-95253)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
(cherry picked from commit f00645d5db)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-10-01 11:10:04 -07:00
Miss Islington (bot) 3124618fd5
GH-97592: Fix crash in C remove_done_callback due to evil code (GH-97660)
Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called.
(cherry picked from commit 63780f4599)

Co-authored-by: Guido van Rossum <guido@python.org>
2022-09-30 13:22:48 -07:00