Commit graph

47968 commits

Author SHA1 Message Date
Miss Islington (bot)
f894995eb6
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:09:39 -08:00
Ionite
9f472f81bc
[3.10] gh-101765: Fix SystemError / segmentation fault in iter __reduce__ when internal access of builtins.__dict__ exhausts the iterator (GH-101769) (#102229)
(cherry picked from commit 54dfa14c5a)
2023-02-24 19:50:53 -08:00
Miss Islington (bot)
3e80d21b76
[3.10] gh-95675: fix uid and gid at test_add_dir_getmember (gh-102207) (gh-102230)
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:56:08 +09:00
Miss Islington (bot)
2e2ab6752b
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:52:31 -08:00
Miss Islington (bot)
0f28af589b
[3.10] gh-101936: Update the default value of fp from io.StringIO to io.BytesIO (gh-102100) (#102118)
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:28 +09:00
Miss Islington (bot)
bac3fe76df
[3.10] gh-95672 fix typo SkitTest to SkipTest (gh-102119) (gh-102122)
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:36:00 +09:00
Miss Islington (bot)
d9dce23643
[3.10] gh-101961 fileinput.hookcompressed should not set the encoding value for the binary mode (gh-102068) (#102099)
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:30 +09:00
Jason R. Coombs
7bb41d9d5d
[3.10] gh-101566: Sync with zipp 3.14. (GH-102018). (GH-102091)
(cherry picked from commit 36854bbb24)

Includes the bugfix only.

Automerge-Triggered-By: GH:jaraco
2023-02-20 15:21:48 -08:00
Miss Islington (bot)
8520e6cbb2
gh-100210: Correct the comment link for unescaping HTML (GH-100212)
(cherry picked from commit 9a07eff628)

Co-authored-by: Jean-Christophe Amiel <jeanchristophe.amiel@gmail.com>
gh-100210: correct the comment link for unescaping HTML
2023-02-19 02:41:53 -08:00
Miss Islington (bot)
3c1b495cac
gh-100226: Clarify StreamReader.read behavior (GH-101807)
(cherry picked from commit 77d95c8373)

Co-authored-by: Jan Gosmann <jan@hyper-world.de>
2023-02-17 13:24:42 -08:00
Miss Islington (bot)
6d8ef96806
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:24:30 -08:00
Miss Islington (bot)
9889de3fa7
Apply suggestions from code review 2023-02-08 15:45:17 -08:00
Miss Islington (bot)
c51cd54b65
[3.10] gh-100933: Improve check_element helper in test_xml_etree (GH-100934) (#101687)
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:40:40 +01:00
Pablo Galindo
aad5f6a891 Python 3.10.10 2023-02-07 12:05:45 +00:00
Miss Islington (bot)
435fcb07e5
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:46:50 -08:00
Miss Islington (bot)
b134978467
[3.10] [3.11] gh-99952: fix refcount issues in ctypes.Structure from_param() result (GH-101339) (#101340)
[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)

(cherry picked from commit fa7c37af49)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-02-04 12:09:29 -08:00
Dong-hee Na
740050af04
[3.10] gh-101400: Fix incorrect lineno in exception message on contin… (gh-101448) 2023-01-31 23:42:22 +09:00
Miss Islington (bot)
3adac4126d
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:14:38 -08:00
Miss Islington (bot)
5717ab3ac5
[3.10] gh-96192: fix os.ismount() to use a path that is str or bytes (GH-96194) (#99456)
gh-96192: fix os.ismount() to use a path that is str or bytes (GH-96194)
(cherry picked from commit 367f552129)

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Christoph Anton Mitterer <calestyo@scientia.org>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-01-22 05:19:10 -08:00
Miss Islington (bot)
9532c04151
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 03:25:22 -08:00
Miss Islington (bot)
b2a662fc6b
[3.10] gh-101144: Allow zipfile.Path .open & .read_text encoding to be positional (GH-101179) (GH-101182)
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)
(cherry picked from commit efe3a389ca)

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

Automerge-Triggered-By: GH:gpshead
2023-01-20 00:31:15 -08:00
Nikita Sobolev
b7b641a2ff
[3.10] GH-100942: Fix incorrect cast in property_copy(). (GH-100965). (#101009)
(cherry picked from commit 94fc7706b7)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-01-15 12:38:59 +05:30
Barry Warsaw
78c9f39352
[3.10] gh-101021: Document binary parameters as bytes (GH-101024). (#101052)
(cherry picked from commit 49cae39ef0)

Co-authored-by: Bob Kline <bkline@users.noreply.github.com>

Co-authored-by: Bob Kline <bkline@users.noreply.github.com>
2023-01-14 21:31:59 -08:00
Miss Islington (bot)
94f9198f58
[3.10] GH-100573: Fix server hang caused by os.stat() on named pipe (Windows) (GH-100959) (#101020)
(cherry picked from commit 1bc7a73683)
2023-01-13 13:57:52 -08:00
Serhiy Storchaka
87f9b1d53f
[3.10] gh-100160: Remove any deprecation warnings in asyncio.get_event_loop() (GH-100412) (GH-100970)
Some deprecation warnings will reappear (in a slightly different form) in 3.12.

Co-authored-by: Guido van Rossum <guido@python.org>.
(cherry picked from commit 1b2459dc64)
2023-01-13 09:34:55 +02:00
Nikita Sobolev
47b1eb9784
[3.10] gh-100931: Test all pickle protocols in test_slice (GH-100932). (GH-100978)
(cherry picked from commit 8795ad1bd0)

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

Automerge-Triggered-By: GH:AlexWaygood
2023-01-12 03:14:27 -08:00
Nikita Sobolev
ebc1fd3795
[3.10] gh-100871: Improve copy module tests (GH-100872) (#100975)
(cherry picked from commit 729ab9b622)

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

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-01-11 21:02:02 +05:30
Miss Islington (bot)
b374481616
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 07:54:00 -08:00
Carl Meyer
ebe8d23407
[3.10] gh-90104: avoid RecursionError on recursive dataclass field repr (gh-100756) (GH-100785)
Avoid RecursionError on recursive dataclass field repr

(cherry picked from commit 0a7936a38f)

Automerge-Triggered-By: GH:ericvsmith
2023-01-05 18:15:27 -08:00
Miss Islington (bot)
f49cc3c805
gh-100739: Respect mock spec when checking for unsafe prefixes (GH-100740)
(cherry picked from commit 7f1eefc6f4)

Co-authored-by: Christian Klein <167265+cklein@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-01-04 15:11:46 -08:00
Miss Islington (bot)
35a010f1f9
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:24:36 -08:00
Irit Katriel
ff9ac58071
[3.10] gh-95882: Add tests for traceback from contextlib context managers (GH-95883) (#100715) 2023-01-03 22:24:19 +00:00
Miss Islington (bot)
0d57f10e40
IDLE - fix module browser test (GH-100647)
(cherry picked from commit 1f6c87ca7b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-12-31 16:20:53 -08:00
Miss Islington (bot)
04285502ba
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:16:53 -08:00
Jelle Zijlstra
1ffc67265f
[3.10] gh-99535: Add test for inheritance of annotations and update documentation (GH-99990) (#100509)
(cherry picked from commit f5b7b19bf1)

Co-authored-by: MonadChains <monadchains@gmail.com>
2022-12-26 20:44:53 -08:00
Miss Islington (bot)
bb159b4481
[3.10] gh-100520: Fix rst markup in configparser docstrings (GH-100524) (#100534)
gh-100520: Fix `rst` markup in `configparser`  docstrings (GH-100524)
(cherry picked from commit 199507b81a)

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

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-12-26 21:12:56 +05:30
Shantanu
9975d4e7ba
[3.10] gh-100287: Fix unittest.mock.seal with AsyncMock (GH-100496) (#100508)
(cherry picked from commit e4b43ebb3a)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-24 14:39:27 -06:00
Miss Islington (bot)
ecbf136702
[3.10] gh-100474: Fix handling of dirs named index.html in http.server (GH-100504)
Co-authored-by: James Frost <git@frost.cx>
2022-12-24 15:29:21 -05:00
Miss Islington (bot)
b168b0e013
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:14 -08:00
Miss Islington (bot)
9c4b8cca09
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:39:55 -08:00
Miss Islington (bot)
95c55a69b3
[3.10] gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576) (#100451)
gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576)

The itemsize returned in a memoryview of a ctypes array is now computed from the item type, instead of dividing the total size by the length and assuming that the length is not zero.
(cherry picked from commit 84bc6a4f25)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
2022-12-23 08:55:55 +00:00
Miss Islington (bot)
de74d49b21
gh-57762: fix misleading tkinter.Tk docstring (GH-98837)
Mentioned as a desired change by terryjreedy on the corresponding issue,
since Tk is not a subclass of Toplevel.
(cherry picked from commit ad23da0e77)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-22 15:03:38 -08:00
Miss Islington (bot)
58967d1abe
Correct typo in typing.py (GH-100423)
In the docstring of `ParamSpec`, the name of `P = ParamSpec('P')` was
mistakenly written as `'T'`.
(cherry picked from commit 68981578ec)

Co-authored-by: david-why <david_why@outlook.com>
2022-12-22 03:43:55 -08:00
Miss Islington (bot)
2dda6680cc
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:31 -08:00
Miss Islington (bot)
7f24056dfb
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:27 -08:00
colorfulappl
591365cd49
[3.10] gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing (GH-99890) (#100386)
(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:33:21 +05:30
Shantanu
919045cb73
[3.10] gh-85267: Improvements to inspect.signature __text_signature__ handling (GH-98796) (#100393)
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:18 -08:00
colorfulappl
53063b7ffa
[3.10] gh-99240: Fix double-free bug in Argument Clinic str_converter generated code (GH-99241) (#100353)
(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:50:42 +05:30
colorfulappl
3144aca3da
[3.10] gh-96002: Add functional test for Argument Clinic (GH-96178) (#100232)
(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:06:06 +05:30