Commit graph

27356 commits

Author SHA1 Message Date
Mark Shannon
762ef85f44
bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656) (#27673)
(cherry picked from commit b854557b49)
2021-08-09 10:54:48 +01:00
Miss Islington (bot)
66dd1a0e64
bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633) (GH-27640) 2021-08-06 15:11:44 -05:00
Miss Islington (bot)
a5d9963276
bpo-40928: notify users running test_decimal on macOS of malloc warnings (GH-26783)
* When trying to allocate very large regions on macOS, malloc does not   fail silently. It sends a noisy error out to STDERR
* This provides a helper function to warn the user, and provides the warning for test_decimal, which consistently generates these warnings on macOS.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 15d3c14df3)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
2021-08-06 10:09:06 -07:00
Miss Islington (bot)
36a2497093
bpo-44524: Fix an issue wherein _GenericAlias._name was not properly set for specialforms (GH-27614)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 8bdf12e99a)

Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
2021-08-06 10:08:27 -07:00
Miss Islington (bot)
a11158ecef
bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065)
The threading debug (PYTHONTHREADDEBUG environment variable) is
deprecated in Python 3.10 and will be removed in Python 3.12. This
feature requires a debug build of Python.
(cherry picked from commit 4d77691172)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-08-06 04:32:37 -07:00
Pablo Galindo Salgado
b1bd16c252
[3.10] bpo-44838: Refine the custom syntax errors for invalid 'if' expressions (GH-27615). (GH-27616)
…

(cherry picked from commit f5cbea6b1b)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

Automerge-Triggered-By: GH:lysnikolaou
2021-08-05 11:00:19 -07:00
Miss Islington (bot)
536e35ae6a
bpo-44801: Check arguments in substitution of ParamSpec in Callable (GH-27585)
(cherry picked from commit 3875a69547)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-04 13:36:01 -07:00
Miss Islington (bot)
bc2841c7a9
bpo-44808: fixes test for interactive inspect getsource of a class (GH-27571)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 58325971de)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-08-03 06:07:59 -07:00
Miss Islington (bot)
8ce7f2f4ef
bpo-39091: Fix segfault when Exception constructor returns non-exception for gen.throw. (GH-17658) (GH-27572)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
(cherry picked from commit 83ca46b778)

Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-08-03 12:10:38 +02:00
Pablo Galindo
cc115e5bf6
Python 3.10.0rc1 2021-08-02 20:53:59 +01:00
Miss Islington (bot)
567176249e
bpo-44792: Improve syntax errors for if expressions (GH-27506) (GH-27565)
(cherry picked from commit 28b6dc9dd5)

Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
2021-08-02 20:05:33 +01:00
Miss Islington (bot)
aa7266854a
bpo-44785: Silence deprecation warnings in test_pickle (GH-27538)
(cherry picked from commit 36d952d228)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-02 10:09:05 -07:00
Miss Islington (bot)
2cc19a5463
bpo-44806: Fix __init__ in subclasses of protocols (GH-27545)
Non-protocol subclasses of protocol ignore now the __init__ method
inherited from protocol base classes.
(cherry picked from commit 043cd60abe)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-02 10:08:59 -07:00
Miss Islington (bot)
a1eaa74d9d
bpo-44808: Fix test_inspect in refleak mode (GH-27544)
(cherry picked from commit 626d397cc1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-02 06:41:08 -07:00
Miss Islington (bot)
33a4010198
bpo-44667: Treat correctly lines ending with comments and no newlines in the Python tokenizer (GH-27499) (GH-27500)
(cherry picked from commit b6bde9fc42)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-02 11:43:45 +02:00
Miss Islington (bot)
c8db292012
bpo-44793: Fix checking the number of arguments when subscribe a generic type with ParamSpec parameter. (GH-27515)
For example Callable[P, T][[int], str, float] will now raise an error.

Use also term "arguments" instead of "parameters" in error
message for too few/many arguments.
(cherry picked from commit f92b9133ef)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-02 00:08:24 -07:00
Miss Islington (bot)
21d5897982
bpo-44784: Apply changes from importlib_metadata 4.6.3 (GH-27508) (#27510)
Addressing issues with tests under error on warnings.

Automerge-Triggered-By: GH:jaraco
(cherry picked from commit 1cf8424a62)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-07-31 23:01:38 -04:00
Miss Islington (bot)
35035bc35a
bpo-34013: Don't consider a grouped expression when reporting legacy print syntax errors (GH-27521)
(cherry picked from commit 208a7e957b)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-31 18:31:44 -07:00
Miss Islington (bot)
76903ff9ce
bpo-44794: Merge tests for typing.Callable and collection.abc.Callable (GH-27507)
(cherry picked from commit be4cb9089a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-31 10:25:22 -07:00
Miss Islington (bot)
f468ede4a2
bpo-44648: Fix error type in inspect.getsource() in interactive session (GH-27171) (GH-27495)
(cherry picked from commit 48a62559df)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-07-30 19:46:42 +02:00
Miss Islington (bot)
440c9f772a
bpo-43625: Enhance csv sniffer has_headers() to be more accurate (GH-26939) (GH-27494)
(cherry picked from commit ceea579ccc)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-07-30 19:30:09 +02:00
Miss Islington (bot)
6f950023c6
bpo-42892: fix email multipart attribute error (GH-26903) (GH-27492)
(cherry picked from commit e3f877c32d)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-07-30 19:27:06 +02:00
Miss Islington (bot)
0db6c143ae
bpo-44666: Use default encoding as fallback for compile_file (GH-27236) (GH-27488)
When sys.stdout.encoding is None compile_file will fall back to
sys.getdefaultencoding to encode/decode error messages.

Co-authored-by: Stefan Hoelzl <stefan.hoelzl@posteo.de>
Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr>
(cherry picked from commit 80f0707629)
2021-07-30 19:12:05 +02:00
Miss Islington (bot)
f7f1c26423
Update URLs in comments and metadata to use HTTPS (GH-27458) (GH-27478)
(cherry picked from commit be42c06bb0)

Co-authored-by: Noah Kantrowitz <noah@coderanger.net>
2021-07-30 16:25:28 +02:00
Miss Islington (bot)
56122b0bba
bpo-44761: Change default value of NewType __module__ attr (GH-27406) (GH-27477)
(cherry picked from commit 7b975f81e4)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-07-30 15:48:01 +02:00
Miss Islington (bot)
472997659b
bpo-44662: Add ability to annotate types.Union (GH-27214) (GH-27461)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 8182c8329c)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-07-30 11:31:54 +02:00
Miss Islington (bot)
a438b37d9f
To fix the random failed test cases of test___xxsubinterpreters in multiprocess. (GH-27240) (GH-27452)
(cherry picked from commit 9101b39e67)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2021-07-29 19:27:24 +02:00
Miss Islington (bot)
d20f1095a6
bpo-44752: Make rlcompleter not call @property methods (GH-27401) (GH-27444)
* rlcompleter was calling these methods to identify whether to add
  parenthesis to the completion, based on if the attribute is callable.
* for property objects, completion with parenthesis are never desirable.
* property methods with print statements behaved very strangely, which
  was especially unfriendly to language newcomers. <tab> could suddenly
  produce output unexpectedly.
(cherry picked from commit 50de8f74f8)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
2021-07-29 14:07:00 +02:00
Miss Islington (bot)
405f5c5491
[3.10] bpo-43897: Reject "_" captures and top-level MatchStar in the AST validator (GH-27432) (GH-27435)
(cherry picked from commit 8d0647485d)


Co-authored-by: Brandt Bucher <brandt@python.org>

Automerge-Triggered-By: GH:brandtbucher
2021-07-28 18:02:14 -07:00
Miss Islington (bot)
8789add991
bpo-27827: identify a greater range of reserved filename on Windows. (GH-26698) (GH-27421)
`pathlib.PureWindowsPath.is_reserved()` now identifies as reserved
filenames with trailing spaces or colons.

Co-authored-by: Barney Gale <barney.gale@foundry.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
(cherry picked from commit 56c1f6d7ed)
2021-07-28 17:01:47 +02:00
Jason R. Coombs
684eb5cb80
[3.10] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227) (GH-27399)
Automerge-Triggered-By: GH:jaraco
2021-07-28 06:04:38 -07:00
Miss Islington (bot)
5502ee052f
bpo-44600: Refactor new tracing tests (GH-27396) (GH-27404)
(cherry picked from commit 38ddc8beb3)

Co-authored-by: Brandt Bucher <brandt@python.org>
2021-07-28 14:38:39 +02:00
Miss Islington (bot)
68e3dca068
bpo-34013: Move the Python 2 hints from the exception constructor to the parser (GH-27392)
(cherry picked from commit ecc3c8e421)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-27 14:19:18 -07:00
Pablo Galindo Salgado
b977f8510e
[3.10] bpo-34013: Generalize the invalid legacy statement error message (GH-27389). (GH-27391)
(cherry picked from commit 6948964ecf)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-27 18:52:32 +01:00
Miss Islington (bot)
6fc1efa454
bpo-44740: Lowercase "internet" and "web" where appropriate. (GH-27378) (GH-27380)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 11749e2dc2)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-27 00:34:32 +02:00
Miss Islington (bot)
0ea5e0d792
bpo-44515: handle non-refcounted GC in contextlib tests (GH-26910) (GH-27379)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit a2c45e5bcf)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2021-07-26 23:21:36 +02:00
Miss Islington (bot)
256d97c8a3
bpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) (#27366)
(cherry picked from commit 1d582bbc96)

Co-authored-by: T. Wouters <thomas@python.org>
2021-07-26 21:29:52 +02:00
Miss Islington (bot)
8a37e8cf45
bpo-44732: Rename types.Union to types.UnionType (GH-27342)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 2b8ad9e6c5)

Co-authored-by: Hasan <hasan.aleeyev@gmail.com>
2021-07-26 12:02:58 -07:00
Miss Islington (bot)
16a174f7ba
bpo-44734: Fix precision in turtle tests (GH-27343) (GH-27361)
(cherry picked from commit 3f135c073a)

Co-authored-by: Logan Jones <loganasherjones@gmail.com>
2021-07-26 17:55:50 +02:00
Miss Islington (bot)
01601aa736
[3.10] bpo-44600: Fix line numbers for pattern matching cleanup code (GH-27346) (GH-27356)
(cherry picked from commit 4214f470f0)


Co-authored-by: Charles Burkland <charles.aburkland@gmail.com>

Automerge-Triggered-By: GH:brandtbucher
2021-07-25 17:04:06 -07:00
Miss Islington (bot)
0aea99e444
bpo-44676: Serialize the union type using only public API (GH-27323) (GH-27340)
Remove also the _from_args() constructor.
(cherry picked from commit 435a0334d3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-24 22:35:33 +03:00
Ken Jin
ca5a4cf826
bpo-44731: Simplify the union type implementation (GH-27318) (GH-27334)
Remove direct support of typing types in the C code because they are already supported by defining methods __or__ and __ror__ in the Python code.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-24 15:49:25 +01:00
Pablo Galindo Salgado
9356d1e47d
[3.10] bpo-44676: Add ability to serialize types.Union (GH-27244) (GH-27333)
(cherry picked from commit fe13f0b0f6)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-07-24 15:08:53 +01:00
Miss Islington (bot)
e8c01749c0
bpo-44353: Improve tests covering typing.NewType pickling (GH-27302) (GH-27328)
(cherry picked from commit a22b05da87)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-07-24 12:29:19 +02:00
Łukasz Langa
05f5d8e48c
[3.10] bpo-44353: Expand NewType tests for complex __qualname__ (GH-27311) (GH-27326)
Make NewType pickleable by name.
(cherry picked from commit e89ef0ad2a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-24 12:07:56 +02:00
Miss Islington (bot)
659030c7d5
bpo-44720: Don't crash when calling weakref.proxy(not_an_iterator).__next__ (GH-27316) (GH-27324)
(cherry picked from commit 5370f0a82a)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2021-07-24 11:45:13 +02:00
Miss Islington (bot)
c589992e09
bpo-29298: Fix crash with required subparsers without dest (GH-3680) (GH-27303)
(cherry picked from commit 17575f73ce)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2021-07-23 15:27:05 +02:00
Miss Islington (bot)
21db59fc75
bpo-44653: Support typing types in parameter substitution in the union type. (GH-27247) (#27296)
(cherry picked from commit 2e3744d50b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-23 00:18:49 +02:00
Miss Islington (bot)
9608719e12
bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) (GH-27290)
* Move to a static argparse.Namespace subclass
* Roughly annotate runtest.py
* Refactor libregrtest to use lossless test result objects
* Only re-run test methods that match names of previously failing test methods
* Adopt tests to cover test method name matching

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
(cherry picked from commit f1afef5e0d)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-22 22:30:44 +02:00
Miss Islington (bot)
4194f1465f
bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27282) 2021-07-21 19:23:21 -05:00