Commit Graph

49196 Commits

Author SHA1 Message Date
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
Alex Waygood 3b1201daf6
[3.11] Fix typos in documentation and comments (GH-102374) (#102376)
[3.11] Fix typos in documentation and comments (GH-102374)

Found some duplicate `to`s in the documentation and some code comments and fixed them.

[Misc/NEWS.d/3.12.0a1.rst](ed55c69ebd/Misc/NEWS.d/3.12.0a1.rst) also contains two duplicate `to`s, but I wasn't sure if it's ok to touch that file.  Looks auto generated.  I'm happy to amend the PR if requested. :)

Automerge-Triggered-By: GH:AlexWaygood

Co-authored-by: Michael K <michael-k@users.noreply.github.com>
2023-03-02 16:00:06 +00: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) d01cf5072b
IDLE: Simplify DynOptionsMenu __init__code (GH-101371)
Refactor DynOptionMenu's initializer to not copy  kwargs dict and use subscripting;
improve its htest.

(cherry picked from commit c41af812c9)

Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-02-27 22:41:20 -08: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) 42d0ca92ed
[3.11] gh-100226: Clarify StreamReader.read behavior (GH-101807) (#102001)
gh-100226: Clarify StreamReader.read behavior (GH-101807)
(cherry picked from commit 77d95c8373)

Co-authored-by: Jan Gosmann <jan@hyper-world.de>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-02-23 19:05:59 +05:30
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
Miss Islington (bot) e9103e69cd
[3.11] gh-100210: Correct the comment link for unescaping HTML (GH-100212) (#102044)
gh-100210: Correct the comment link for unescaping HTML (GH-100212)
(cherry picked from commit 9a07eff628)


gh-100210: correct the comment link for unescaping HTML

Co-authored-by: Jean-Christophe Amiel <jeanchristophe.amiel@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-02-21 07:52:02 +08: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) 51b079a2d6
Update Lib/subprocess.py 2023-02-08 15:44:06 -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
Pablo Galindo 878ead1ac1 Python 3.11.2 2023-02-07 13:37:51 +00: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
Gregory P. Smith fa7c37af49
[3.11] gh-99952: fix refcount issues in ctypes.Structure from_param() result (#101339)
[3.11] gh-99952: [ctypes] fix refcount issues in from_param() result. (GH-100169)

Fixes a reference counting issue with `ctypes.Structure` when a `from_param()` method call is used and the structure size is larger than a C pointer `sizeof(void*)`.

This problem existed for a very long time, but became more apparent in 3.8+ by change likely due to garbage collection cleanup timing changes..
(cherry picked from commit dfad678d70)

Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
2023-01-26 01:02:37 -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
Miss Islington (bot) 69d12d868e
[3.11] GH-101097: Switch from standard interval notation to greater or less than signs for random.random()'s documentation (GH-101119) (GH-101246)
(cherry picked from commit 8bcd4a6ec7)

Co-authored-by: Andrew Hong <andrewhong@myyahoo.com>

Automerge-Triggered-By: GH:rhettinger
2023-01-22 13:45:55 -08:00
Miss Islington (bot) 99da75e770
gh-101143: Remove references to `TimerHandle` from `asyncio.base_events.BaseEventLoop._add_callback` (GH-101197)
(cherry picked from commit 9e947675ae)

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-01-21 02:28:09 -08:00
Miss Islington (bot) c6cfde6fb1
gh-100750: pass encoding kwarg in lib/platform.py (GH-100751)
(cherry picked from commit 6b3993c556)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-01-20 21:07:56 -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) 39c1f68fff
gh-101021: Document binary parameters as bytes (GH-101024)
(cherry picked from commit 49cae39ef0)

Co-authored-by: Bob Kline <bkline@users.noreply.github.com>
2023-01-14 12:22:08 -08:00
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) 2d1128e9eb
GH-81061: Fix refcount issue when returning `None` from a `ctypes.py_object` callback (GH-13364)
(cherry picked from commit 837ba05267)

Co-authored-by: dgelessus <dgelessus@users.noreply.github.com>
2023-01-09 08:06:17 -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