Commit graph

27855 commits

Author SHA1 Message Date
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)
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
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)
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)
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
Miss Islington (bot)
580165d01c
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:17:25 -08:00
Miss Islington (bot)
85be25827b
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:35 -08:00
Miss Islington (bot)
fe7c309a8c
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:24:41 -08:00
Pablo Galindo Salgado
72cfe5b1b9
[3.10] gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer (GH-100065) (#100073)
Automerge-Triggered-By: GH:pablogsal.
(cherry picked from commit 97e7004cfe)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-12-07 13:52:05 +00:00
Łukasz Langa
300d812fd1
[3.10] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created (#100059)
It no longer emits a deprecation warning if the current event loop was set.

(cherry picked from commit 3fae04b10e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-12-06 18:40:30 +01:00
Miss Islington (bot)
aae7b43ca3
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:47:57 -08:00
Miss Islington (bot)
ec8c06bc28
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:16:14 -08:00
Łukasz Langa
b914eee222
[3.10] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#100017)
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:30 +01:00
Miss Islington (bot)
c067023d87
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:05:17 -08:00
Serhiy Storchaka
ac78128271
[3.10] gh-60203: Always pass True/False as boolean arguments in tests (GH-99983) (GH-99989)
Unless we explicitly test non-bool values.
(cherry picked from commit 76f43fc09a)
2022-12-04 15:08:24 +02:00
Kumar Aditya
a851797863
[3.10] bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and s… (#99842)
[3.10] bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and segfaults (GH-18640)

Co-authored-by: Oren Milman <orenmn@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>.
(cherry picked from commit 53eef27133)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-11-28 16:57:37 +05:30
Miss Islington (bot)
345aaa4176
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:08:12 -08:00
Miss Islington (bot)
289411d8ef
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:52:12 -08:00
Miss Islington (bot)
c42681546a
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:18:41 -08:00
Miss Islington (bot)
99e852c28f
gh-99341: Cover type ignore nodes when incrementing line numbers (GH-99422)
(cherry picked from commit 1acdfec359)

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

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-11-21 03:44:56 -08:00
Pablo Galindo Salgado
ad47c7d926
[3.10] gh-99581: Fix a buffer overflow in the tokenizer when copying lines that fill the available buffer (GH-99605). (#99630) 2022-11-20 22:30:15 +00:00
Serhiy Storchaka
42b7b2179e
[3.10] gh-78453: Move Unicode C API tests from test_unicode to test_capi.test_unicode (GH-99431). (GH-99617)
(cherry picked from commit 06d4e02c3b)

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

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-15 12:52:14 -08:00
Miss Islington (bot)
535027f470
bpo-34272: Reorganize C API tests. (GH-8551)
Move some C API tests into Lib/test/test_capi/.
(cherry picked from commit f883b7f8ee)

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

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

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

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

(cherry picked from commit d315722564)

(cherry picked from commit a6f6c3a3d6)

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

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

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

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

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

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-06 04:15:29 -08:00
Miss Islington (bot)
ae5317d309
[3.11] gh-90867: test.support.wait_process() uses LONG_TIMEOUT (GH-99071) (GH-99098)
The test.support.wait_process() function now uses a timeout of
LONG_TIMEOUT seconds by default, instead of SHORT_TIMEOUT.  It
doesn't matter if a Python buildbot is slower, it only matters that
the process completes. The timeout should just be shorter than
"forever".

(cherry picked from commit a9a8c87126)

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

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

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

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-02 19:33:01 -07:00
Serhiy Storchaka
9ca7b1561f
[3.10] gh-98852: Fix subscription of types.GenericAlias instances (GH-98920) (GH-98969)
Fix subscription of types.GenericAlias instances containing bare generic types:
for example tuple[A, T][int], where A is a generic type, and T is a type
variable.
2022-11-01 20:14:38 +02:00
Miss Islington (bot)
078ce6891c
GH-98897: fix memory leak if math.dist raises exception (GH-98898)
(cherry picked from commit ab57505070)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-31 19:47:29 -07:00
Charlie Zhao
d3d1738acd
[3.10] gh-98793: Fix typecheck in overlapped.c (GH-98835) (#98890)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 3ac8c0ab6e)
2022-10-31 11:22:02 -07:00