Commit Graph

27484 Commits

Author SHA1 Message Date
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
Miss Islington (bot) 68b4690b01
bpo-44566: resolve differences between asynccontextmanager and contextmanager (GH-27024) (#27266)
(cherry picked from commit 7f1c330da3)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2021-07-20 21:12:47 +02:00
Miss Islington (bot) 574da4633b
[3.10] bpo-43219: skip Solaris in the test as well (GH-27257) (GH-27268)
(cherry picked from commit 6564656495)


Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>

Automerge-Triggered-By: GH:gpshead
2021-07-20 11:53:31 -07:00
Miss Islington (bot) 9ae5ba7dbf
bpo-44353: Add test to cover __or__ of two NewType (GH-27259) (#27261)
(cherry picked from commit 4868b94c60)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-07-20 18:06:38 +02:00
Miss Islington (bot) c2f33dfc83
bpo-44353: Refactor typing.NewType into callable class (GH-27250) (#27258)
(cherry picked from commit 965dd76e90)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-07-20 17:24:57 +02:00
Miss Islington (bot) c895f2bc4f
bpo-44524: Add missed __name__ and __qualname__ to typing module objects (GH-27237) (#27246)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit bce1418541)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-07-19 19:57:27 +02:00
Miss Islington (bot) 8c43bf1a92
bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (GH-27242)
getaddresses() should be able to handle a Header object if passed
one.

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

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2021-07-19 18:54:45 +02:00
Ken Jin a272164959
bpo-44490: Improve typing module compatibility with types.Union (GH-27048) (#27222)
(cherry picked from commit bf89ff96e6)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-07-19 07:22:59 -07:00
Miss Islington (bot) 37bdd2221c
bpo-44645: Check for interrupts on any potentially backwards edge (GH-27216) (GH-27235)
(cherry picked from commit d09c134178)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2021-07-19 12:15:58 +01:00
Miss Islington (bot) 85b58292cf
bpo-44633: Fix parameter substitution of the union type with wrong types. (GH-27218) (GH-27224)
A TypeError is now raised instead of returning NotImplemented.
(cherry picked from commit 3ea5332a43)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-18 14:59:25 +03:00
Miss Islington (bot) 03aad3049d
[3.10] bpo-44654: Refactor and clean up the union type implementation (GH-27196) (GH-27219)
(cherry picked from commit 0fd27375ca)
2021-07-18 00:10:21 +03:00
Serhiy Storchaka 2d055ce132
[3.10] bpo-44490: Add __parameters__ and __getitem__ to types.Union (GH-26980) (GH-27207)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>.
(cherry picked from commit c45fa1a5d9)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-07-17 22:14:57 +03:00
Miss Islington (bot) 480f29f913
bpo-41249: Fix postponed annotations for TypedDict (GH-27017) (#27204)
This fixes TypedDict to work with get_type_hints and postponed evaluation of annotations across modules.

This is done by adding the module name to ForwardRef at the time the object is created and using that to resolve the globals during the evaluation.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 889036f7ef)

Co-authored-by: Germán Méndez Bravo <german.mb@gmail.com>
2021-07-17 10:48:17 +02:00
Miss Islington (bot) efda9054b9
bpo-44655: Include the name of the type in unset __slots__ attribute errors (GH-27199) (GH-27201)
(cherry picked from commit f783428a23)

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

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-17 01:01:53 +01:00
Miss Islington (bot) a0b1d401db
bpo-44655: Don't include suggestions for attributes that are the same as the missing one (GH-27197) (GH-27198)
(cherry picked from commit 6714dec5e1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-16 22:16:08 +01:00
Miss Islington (bot) 42a5514cca
Revert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)" (GH-27194) (#27195)
This reverts commit 000e70ad52.
(cherry picked from commit c90c591e51)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-16 19:29:32 +02:00
Miss Islington (bot) 93d36a5bce
bpo-44647: Add a permanent Unicode-valued env var to regrtest (GH-27187) (#27191)
(cherry picked from commit 7915c96ffd)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-16 15:55:26 +02:00
Serhiy Storchaka 80844d1ebc
[3.10] bpo-44652: Preserve natural order of args in the union type. (GH-27185) (GH-27190)
(cherry picked from commit 0cd2d51aad)

Automerge-Triggered-By: GH:ambv
2021-07-16 06:42:04 -07:00
Miss Islington (bot) 948e39a866
bpo-40897:Give priority to using the current class constructor in `inspect.signature` (GH-27177) (#27189)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 6aab5f9bf3)

Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
2021-07-16 15:25:57 +02:00
Serhiy Storchaka c3007ab3c6
[3.10] bpo-44636: Collapse union of equal types (GH-27178) (GH-27181)
The result of `int | int` is now `int`.

Fix comparison of the union type with non-hashable objects.
`int | str == {}` no longer raises a TypeError.
(cherry picked from commit d9f923280f)
2021-07-16 14:48:20 +03:00
Mark Shannon 37686f78cc
bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138) (GH-27182)
(cherry picked from commit a86f7dae0a)
2021-07-16 11:49:10 +01:00
Mark Shannon 0e349ea554
[3.10] bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167) (GH-27183)
(cherry picked from commit 000e70ad52)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2021-07-16 11:48:46 +01:00
Miss Islington (bot) 705988056e
bpo-44646: Fix the hash of the union type. (GH-27179) (#27180)
It no longer depends on the order of arguments.
hash(int | str) == hash(str | int)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
(cherry picked from commit aeaa553d65)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-16 11:02:59 +02:00
Miss Islington (bot) 356bdff1e9
bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows (GH-27161) (#27169)
GH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of os.environ on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This change fixes the HTTP_ACCEPT test.
(cherry picked from commit 82b218f36c)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-15 22:09:26 +02:00
Mark Shannon 47695e3c88
bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. (GH-27160) (GH-27163)
(cherry picked from commit f333ab0f2e)
2021-07-15 16:54:38 +02:00
Miss Islington (bot) 2ce8af3cbc
bpo-42073: allow classmethod to wrap other classmethod-like descriptors (GH-27115) (GH-27162)
Patch by Erik Welch.

bpo-19072 (GH-8405) allows `classmethod` to wrap other descriptors, but this does
not work when the wrapped descriptor mimics classmethod.  The current PR fixes
this.

In Python 3.8 and before, one could create a callable descriptor such that this
works as expected (see Lib/test/test_decorators.py for examples):
```python
class A:
    @myclassmethod
    def f1(cls):
        return cls

    @classmethod
    @myclassmethod
    def f2(cls):
        return cls
```
In Python 3.8 and before, `A.f2()` return `A`. Currently in Python 3.9, it
returns `type(A)`.  This PR make `A.f2()` return `A` again.

As of GH-8405, classmethod calls `obj.__get__(type)` if `obj` has `__get__`.
This allows one to chain `@classmethod` and `@property` together.  When
using classmethod-like descriptors, it's the second argument to `__get__`--the
owner or the type--that is important, but this argument is currently missing.
Since it is None, the "owner" argument is assumed to be the type of the first
argument, which, in this case, is wrong (we want `A`, not `type(A)`).

This PR updates classmethod to call `obj.__get__(type, type)` if `obj` has
`__get__`.

Co-authored-by: Erik Welch <erik.n.welch@gmail.com>
(cherry picked from commit b83861f026)
2021-07-15 15:42:11 +02:00
Miss Islington (bot) cc1a47c849
bpo-44632: Fix support of TypeVar in the union type (GH-27139) (GH-27143)
int | TypeVar('T') returns now an instance of types.Union
instead of typing.Union.
(cherry picked from commit a158b20019)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-15 10:25:22 +03:00
Serhiy Storchaka 6dec525582
[3.10] bpo-44635: Convert None to NoneType in the union type constructor (GH-27136). (GH-27142)
(cherry picked from commit b81cac0560)
2021-07-15 10:15:14 +03:00
Miss Islington (bot) 016af14d93
[3.10] bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal keys (GH-27131) (GH-27157)
(cherry picked from commit 2693132292)


Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>

Automerge-Triggered-By: GH:brandtbucher
2021-07-14 18:00:35 -07:00
Miss Islington (bot) ff7af2203c
bpo-34932: Add socket.TCP_KEEPALIVE for macOS (GH-25079)
(cherry picked from commit d59d7374a3)

Co-authored-by: Shane Harvey <shnhrv@gmail.com>
2021-07-14 16:15:31 -07:00
Mark Shannon 794ff7d505
bpo-44616: Mark all clean up instructions at end of named exception block as artificial (GH-27109) (GH-27135)
(cherry picked from commit e5862f79c1)
2021-07-14 11:43:56 +01:00
Miss Islington (bot) 7e1d6308a3
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
if it is called with a sequence or set, but not list or tuple.
(cherry picked from commit f572cbf1fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-13 22:40:10 -07:00
Miss Islington (bot) b42eee78e7
bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-27120)
* Fix issubclass() for None.
  E.g. issubclass(type(None), int | None) returns now True.
* Fix issubclass() for virtual subclasses.
  E.g. issubclass(dict, int | collections.abc.Mapping) returns now True.
* Fix crash in isinstance() if the check for one of items raises exception.
(cherry picked from commit 81989058de)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-13 21:55:45 -07:00
Miss Islington (bot) bb260c2a21
[3.10] bpo-44630: Fix assertion errors in csv module (GH-27127) (GH-27129)
Fix incorrect handling of exceptions when interpreting dialect objects in
the csv module. Not clearing exceptions between calls to
PyObject_GetAttrString() causes assertion failures in pydebug mode (or with
assertions enabled).

Add a minimal test that would've caught this (passing None as dialect, or
any object that isn't a csv.Dialect subclass, which the csv module allows
and caters to, even though it is not documented.) In pydebug mode, the test
triggers the assertion failure in the old code.

Contributed-By: T. Wouters [Google]
(cherry picked from commit 0093876328)


Co-authored-by: T. Wouters <thomas@python.org>

Automerge-Triggered-By: GH:gpshead
2021-07-13 16:18:28 -07:00
Miss Islington (bot) 1cc6769e41
bpo-38741: Definition of multiple ']' in header configparser (GH-17129) (#27110)
Co-authored-by: Jason Killen <jason.killen@windsorcircle.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 2924bb1a56)

Co-authored-by: jsnklln <jsnklln@gmail.com>
2021-07-13 16:35:30 +02:00
Miss Islington (bot) 1577259cc5
bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049)
Fixes the misleading IsADirectoryError to be FileNotFoundError.
(cherry picked from commit 248173cc04)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-07-09 21:07:35 -07:00
Miss Islington (bot) 2a722d4fab
bpo-44317: Improve tokenizer errors with more informative locations (GH-26555) (GH-27079)
(cherry picked from commit f24777c2b3)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-10 01:47:33 +01:00
Batuhan Taskaya 2f7636887e
[3.10] bpo-43897: ast validation for pattern matching nodes (GH-27074)
(cherry picked from commit 8dcb7d9808)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
2021-07-10 01:16:15 +01:00
Mark Shannon 9f2c63b258
bpo-44570: Fix line tracing for forward jumps to duplicated tails (GH-27067) 2021-07-08 19:21:22 +01:00
Pablo Galindo 61eb9b5dfd
[3.10] bpo-44446: support lineno being None in traceback.FrameSummary (GH-26781) (GH-27072)
As of 088a15c49d, lineno is None instead
of -1 if there is no line number.

Signed-off-by: Filipe Laíns <lains@riseup.net>.
(cherry picked from commit 91a8f8c16c)

Co-authored-by: Filipe Laíns <lains@riseup.net>

Co-authored-by: Filipe Laíns <lains@riseup.net>
2021-07-08 17:47:12 +01:00
Miss Islington (bot) 08697ac5d1
bpo-44582: Accelerate mimetypes.init on Windows with a native accelerator (GH-27059)
(cherry picked from commit bbf2fb6c7a)

Co-authored-by: Steve Dower <steve.dower@python.org>
2021-07-08 09:13:06 -07:00
Miss Islington (bot) 9f431dd0a5
bpo-44558: Match countOf `is`/`==` treatment to c (GH-27007)
(cherry picked from commit 6bd3ecfc27)

Co-authored-by: Rupert Tombs <rupert.tombs@gmail.com>
2021-07-07 06:50:41 -07:00
Miss Islington (bot) 1f8486fd50
bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012)
(cherry picked from commit 09302405d2)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2021-07-05 02:51:46 -07:00
Ethan Furman 9bf7c2d638
[3.10] bpo-44559: [Enum] revert enum module to 3.9 (GH-27010)
* [Enum] revert enum module to 3.9
2021-07-03 21:08:42 -07:00
Irit Katriel 33022f9e86
[3.10] bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) (GH-27006)
(cherry picked from commit d968a638fc)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-07-03 17:28:46 +01:00
Miss Islington (bot) 0856134542
bpo-44553 : Implement GC methods for types.Union (GH-26993)
(cherry picked from commit 1097384ce9)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-07-03 06:33:16 -07:00
Miss Islington (bot) 3ec3e0f83c
bpo-30256: Add manager_owned keyword arg to AutoProxy (GH-16341) (#26987)
Co-authored-by: Jordan Speicher <jordan@jspeicher.com>
(cherry picked from commit 85b920498b)

Co-authored-by: finefoot <33361833+finefoot@users.noreply.github.com>
2021-07-01 21:15:47 -07:00
Steve Dower a5764d3d96
bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal.dumps (GH-26970) 2021-06-30 18:52:25 +01:00
Miss Islington (bot) 2df13e1211
bpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950)
(cherry picked from commit e2fea101fd)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-29 16:19:06 -07:00
Miss Islington (bot) 3df23b5199
[3.10] bpo-44468: Never skip base classes in `typing.get_type_hints()`, even with invalid `.__module__`. (GH-26862) (GH-26920)
(cherry picked from commit 7569c0fe91)


Co-authored-by: will-ca <willchencontact@gmail.com>

Automerge-Triggered-By: GH:gvanrossum
2021-06-26 16:52:28 -07:00
Miss Islington (bot) 88970125e7
bpo-43977: Properly update the tp_flags of existing subclasses when their parents are registered (GH-26864)
(cherry picked from commit ca2009d72a)

Co-authored-by: Brandt Bucher <brandt@python.org>
2021-06-25 08:46:23 -07:00
Miss Islington (bot) 8bec9fb92f
bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in tests (GH-26905) (GH-26907)
(cherry picked from commit 22e7effad5)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-06-25 00:38:01 +01:00
Miss Islington (bot) a80a38ee9a
[3.10] bpo-44498: Issue a deprecation warning on asynchat, asyncore and smtpd import (GH-26882) (GH-26904)
* Issue a deprecation warning on smtpd import

* Also issue DeprecationWarnings for asynchat and asyncore

* Fix some tests

* test___all__ requires the word 'module' or 'package' in the deprecation
  warning text, so add those to smtpd, asynchat, and asyncore.
* In test_support, use pprint now instead of asyncore as the landmark.

* Add What's New

* Use ..deprecated::

* Use ..deprecated::

* Update Lib/smtpd.py

Co-authored-by: Miro Hrončok <miro@hroncok.cz>

* Update Doc/library/smtpd.rst

Co-authored-by: Miro Hrončok <miro@hroncok.cz>

* Import async{hat,ore} after the DeprecationWarning for this module

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit 8488b85c63)


Co-authored-by: Barry Warsaw <barry@python.org>

Automerge-Triggered-By: GH:warsaw
2021-06-24 12:57:55 -07:00
Miss Islington (bot) 11f1a30cdb
bpo-44456: Improve the syntax error when mixing keyword and positional patterns (GH-26793)
(cherry picked from commit 0acc258fe6)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-24 08:34:28 -07:00
Miss Islington (bot) b3fac2926b
bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893)
(cherry picked from commit b5a52eef67)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-24 05:27:35 -07:00
Miss Islington (bot) 733587011d
bpo-43916: Use test.support.check_disallow_instantiation() in test_tcl (GH-26412) (GH-26888)
(cherry picked from commit e90e042218)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-24 14:12:11 +02:00
Mark Shannon 0b6b286518
bpo-44297: Add a regression test for line numbers in with statements (GH-26891) 2021-06-24 13:09:14 +01:00
Erlend Egeberg Aasland 0a3452e7cf
[3.10] bpo-43988: Add test.support.check_disallow_instantiation() (GH-25757) (GH-26885)
(cherry picked from commit 4f725261c6, fbff5387c3, and 8cec740820)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Automerge-Triggered-By: GH:vstinner
2021-06-23 16:46:25 -07:00
Victor Stinner ece3841d3d
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26877)
Py_RunMain() now resets PyImport_Inittab to its initial value at
exit. It must be possible to call PyImport_AppendInittab() or
PyImport_ExtendInittab() at each Python initialization.

(cherry picked from commit 489699ca05)
2021-06-23 17:47:38 +02:00
Miss Islington (bot) 280425d417
bpo-28395: Remove unnecessary semicolons in tests (GH-26868)
(cherry picked from commit 5a3108044d)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2021-06-23 03:02:40 -07:00
Miss Islington (bot) 7e6cad7e30
bpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848) (GH-26852)
(cherry picked from commit adfa1ba398)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-06-23 12:38:49 +03:00
Miss Islington (bot) 01858fbe31
bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly (GH-26764) (GH-26845)
No longer use len() to get the length of the input data. For some buffer protocol objects,
the length obtained by using len() is wrong.
(cherry picked from commit bc6c12c72a)

Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
2021-06-22 16:59:53 +03:00
Miss Islington (bot) c032a12cbb
bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)
Fix asyncio test_popen() of test_windows_utils by using a longer
timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT
timeout rather than a hardcoded timeout of 10 seconds: it's 30
seconds by default, but it is made longer on slow buildbots.

WaitForMultipleObjects() timeout argument is in milliseconds.
(cherry picked from commit be1cb3214d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-06-21 17:22:02 -07:00
Miss Islington (bot) 20a1495b8a
bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685)
(cherry picked from commit 30f7a77f35)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2021-06-21 07:27:26 -07:00
Victor Stinner 9b0bbb9143
bpo-44466: Faulthandler now detects the GC (GH-26823) (GH-26826)
The faulthandler module now detects if a fatal error occurs during a
garbage collector collection (only if all_threads is true).

(cherry picked from commit d19163912b)
2021-06-21 14:23:13 +02:00
Mark Shannon 7674c83d81
bpo-44297: Fix missing line number in generator expressions (GH-26821)
* Make sure that line number is set when entering comprehension scope in compiler.

(cherry picked from commit 82e5c28af7)
2021-06-21 11:47:16 +01:00
Miss Islington (bot) 553e10498a
bpo-44469: Fix tests for "async with" with bad object (GH-26817)
Test for execution of the body was null. It would pass
even if the code which should be skipped was executed.
(cherry picked from commit 5d2b3a0d68)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-06-21 00:57:07 -07:00
Ethan Furman 1b4addf3cb
[3.10] bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752)
* [Enum] reduce scope of new format behavior

Instead of treating all Enums the same for format(), only user mixed-in
enums will be affected.  In other words, IntEnum and IntFlag will not be
changing the format() behavior, due to the requirement that they be
drop-in replacements of existing integer constants.

If a user creates their own integer-based enum, then the new behavior
will apply:

    class Grades(int, Enum):
        A = 5
        B = 4
        C = 3
        D = 2
        F = 0

Now:  format(Grades.B)  -> DeprecationWarning and '4'
3.12:                   -> no warning, and 'B'.

(cherry picked from commit f60b07ab6c)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-06-18 14:25:42 -07:00
Pablo Galindo a8c418d5ed
[3.10] bpo-44368: Improve syntax errors with invalid as pattern targets (GH-26632) (GH-26792)
(cherry picked from commit 05073036dc)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-18 22:15:57 +01:00
Miss Islington (bot) bf55a799e0
bpo-44451: Reset DeprecationWarning filters in test_importlib.test_entry_points_by_index (GH-26784)
This avoids the following error if DeprecationWarnings are ignored.

    ======================================================================
    ERROR: test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests)
    Prior versions of Distribution.entry_points would return a
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/builddir/build/BUILD/Python-3.10.0b3/Lib/test/test_importlib/test_metadata_api.py", line 145, in test_entry_points_by_index
        expected = next(iter(caught))
    StopIteration
    ----------------------------------------------------------------------
    Ran 1402 tests in 2.125s
    FAILED (errors=1, skipped=18, expected failures=1)
(cherry picked from commit df1502e47f)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2021-06-18 13:30:53 -07:00
Miss Islington (bot) bba726710b
[3.10] Reorganize the pattern matching suite (GH-26661) (GH-26787)
(cherry picked from commit c106cf31f8)


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

Automerge-Triggered-By: GH:brandtbucher
2021-06-18 10:48:07 -07:00
Miss Islington (bot) eb0a6801be
bpo-43024: improve signature (in help, etc) for functions taking sent… (GH-24331) (GH-26773)
…inel defaults
(cherry picked from commit f73377d57c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-06-17 17:41:46 +01:00
Miss Islington (bot) 08f2b9dede
bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)
`ssl.SSL_NO_TLS` should be `ssl.OP_NO_TLS`.
(cherry picked from commit c544393b89)

Co-authored-by: Joe <nigelchiang@outlook.com>
2021-06-17 03:00:56 -07:00
Ethan Furman 41c2a4a727
[3.10] bpo-44342: [Enum] improve test, add andrei kulakov to ACKS (GH-26726)
* [3.10] [Enum] improve test, add andrei kulakov to ACKS (GH-26726).
(cherry picked from commit cb2014f207)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-06-15 18:50:59 -07:00
Miss Islington (bot) 0f99324f61
bpo-44342: [Enum] fix data type search (GH-26667)
In an inheritance chain of

  int -> my_int -> final_int

the data type is now final_int (not my_int)
(cherry picked from commit 3a7cccfd6c)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-06-15 14:07:37 -07:00
Miss Islington (bot) 133cddf76e
bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712)
(cherry picked from commit 507ed6fa1d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-14 10:07:52 -07:00
Miss Islington (bot) 2b57ad3f53
bpo-43425: Update test_c_parser not to use TempdirManager (GH-26693)
(cherry picked from commit 736ed6f7a9)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2021-06-13 17:24:11 -07:00
Miss Islington (bot) 128899d8b8
bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679)
(cherry picked from commit 9f1c5f6e8a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-06-13 07:05:28 -07:00
Miss Islington (bot) 4becc569a6
[3.10] bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700) (GH-26705)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit bf527277d4)


Co-authored-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
2021-06-13 05:07:00 -07:00
Miss Islington (bot) d03f342a83
bpo-44396: Update multi-line-start location when reallocating tokenizer buffers (GH-26676) (GH-26695)
Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit a342cc5891)
2021-06-12 21:27:02 +01:00
Miss Islington (bot) 9c0180ae77
bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646) (GH-26674)
(cherry picked from commit 4cb6ba1432)

Co-authored-by: huzhaojie <hu.zj@foxmail.com>
2021-06-11 17:18:19 +01:00
Miss Islington (bot) 0a186b1ec1
bpo-44242: [Enum] improve error messages (GH-26669)
(cherry picked from commit c956734d7a)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-06-11 02:58:57 -07:00
Miss Islington (bot) d7930fb720
bpo-44362: ssl: improve deprecation warnings and docs (GH-26646)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e26014f1c4)

Co-authored-by: Christian Heimes <christian@python.org>
2021-06-11 00:36:17 -07:00
Miss Islington (bot) b613132861
bpo-44342: [Enum] changed pickling from by-value to by-name (GH-26658) (GH-26660)
by-value lookups could fail on complex enums, necessitating a check for
__reduce__ and possibly sabotaging the final enum;

by-name lookups should never fail, and sabotaging is no longer necessary
for class-based enum creation.
(cherry picked from commit 62f1d2b3d7)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-06-10 16:37:27 -07:00
Miss Islington (bot) 01286017c3
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649) (GH-26653)
This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum:

    class Str1Enum(str, Enum):
        GH- some behavior here

    class Str2Enum(str, Enum):
        GH- some more behavior here

    class FinalStrEnum(Str1Enum, Str2Enum):
        GH- this now works
(cherry picked from commit 8a4f0850d7)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-06-10 15:01:03 -07:00
Miss Islington (bot) e3bc32fc1a
bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr (GH-18180) (GH-26650)
(cherry picked from commit 6544b2532d)

Co-authored-by: Daniel Hahler <git@thequod.de>
2021-06-10 21:56:57 +01:00
Ethan Furman 749648609d
[3.10] bpo-44242: [Enum] remove missing bits test from Flag creation (GH-26586) (GH-26635)
Move the check for missing named flags in flag aliases from Flag creation
to a new *verify* decorator..

(cherry picked from commit eea8148b7d)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-06-10 07:24:20 -07:00
Miss Islington (bot) f807a4fad4
bpo-44368: Ensure we don't raise incorrect custom syntax errors with soft keywords (GH-26630)
(cherry picked from commit 457ce60fc7)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-09 14:45:43 -07:00
Miss Islington (bot) c0496093e5
bpo-44349: Fix edge case when displaying text from files with encoding in syntax errors (GH-26611) (GH-26616)
(cherry picked from commit 9fd21f649d)

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-09 01:29:21 +01:00
Miss Islington (bot) eeefa7f6c0
bpo-43833: Emit warnings for numeric literals followed by keyword (GH-25466)
Emit a deprecation warning if the numeric literal is immediately followed by
one of keywords: and, else, for, if, in, is, or. Raise a syntax error with
more informative message if it is immediately followed by other keyword or
identifier.

Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 2ea6d89028)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-06-08 16:52:23 -07:00
Batuhan Taskaya bd6f0d3ead
[3.10] bpo-11105: reduce the recursion limit for tests. (GH-26607)
(cherry picked from commit e58d762c1f)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
2021-06-08 20:39:30 +03:00
Miss Islington (bot) 933b5b6359
bpo-44335: Fix a regression when identifying invalid characters in syntax errors (GH-26589)
(cherry picked from commit d334c73b56)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-08 04:46:56 -07:00
Miss Islington (bot) d80f4265db
fix: use unambiguous punction in 'invalid escape sequence' message (GH-26582)
(cherry picked from commit ffd87b7093)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2021-06-07 17:36:19 -07:00
Miss Islington (bot) 0d441d2e70
bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test suite (GH-26542) (GH-26544)
(cherry picked from commit f171877ebe)

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-05 01:05:54 +01:00
Miss Islington (bot) 3f4d801bf9
bpo-44048: Fix two hashlib test cases under FIPS mode (GH-26470) (GH-26531)
test_disallow_instantiation and test_readonly_types try to test all the available
digests, however under FIPS mode, while the algorithms are available, trying to use
them will fail with a ValueError.
(cherry picked from commit a46c220edc)

Co-authored-by: stratakis <cstratak@redhat.com>

Co-authored-by: stratakis <cstratak@redhat.com>
2021-06-04 19:38:02 +01:00
Pablo Galindo e53f72a1b4
[3.10] bpo-44305: Improve syntax error for try blocks without except or finally (GH-26523) (GH-26524)
(cherry picked from commit b250f89bb7)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-04 00:11:43 +01:00
Pablo Galindo 3283bf4519
[3.10] bpo-44273: Improve syntax error message for assigning to "..." (GH-26477) (GH-26478)
Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis.
(cherry picked from commit 39dd141)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-06-03 22:22:28 +01:00
Miss Islington (bot) 976598d36b
bpo-11105: Do not crash when compiling recursive ASTs (GH-20594)
When compiling an AST object with a direct / indirect reference
cycles, on the conversion phase because of exceeding amount of
calls, a segfault was raised. This patch adds recursion guards to
places for preventing user inputs to not to crash AST but instead
raise a RecursionError.
(cherry picked from commit f3491242e4)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
2021-06-03 13:27:00 -07:00
Miss Islington (bot) d2ab15f537
bpo-43921: Fix test_ssl.test_wrong_cert_tls13() on Windows (GH-26502) (GH-26518)
Fix test_ssl.test_wrong_cert_tls13(): use suppress_ragged_eofs=False,
since read() can raise ssl.SSLEOFError on Windows.
(cherry picked from commit ea0210fa8c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-06-03 22:15:15 +02:00
Mark Shannon cea0585b79
[3.10] bpo-44298: Backport #26513 to 3.10 (#26516)
* Backport 937cebc93 to 3.10

* Update importlib
2021-06-03 19:57:31 +01:00
Miss Islington (bot) 98e5a7975d
bpo-44022: Improve the regression test. (GH-26503)
It wasn't actually detecting the regression due to the
assertion being too lenient.
(cherry picked from commit e60ab843cb)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2021-06-02 21:04:20 -07:00
Miss Islington (bot) e5e93e6145
bpo-43921: Fix test_ssl.test_pha_required_nocert() (GH-26489)
Fix test_pha_required_nocert() of test_ssl: catch two more EOF cases
(when the recv() method returns an empty string).
(cherry picked from commit 320eaa7f42)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-06-02 16:48:40 -07:00
Miss Islington (bot) 7207203e1d
[3.10] bpo-44246: Restore compatibility in entry_points (GH-26468) (GH-26471)
* [bpo-44246](): Entry points performance improvements.

From importlib_metadata 4.3.1.

* [bpo-44246](): Sync with importlib_metadata 4.4
(cherry picked from commit c34ed08d97)


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

Automerge-Triggered-By: GH:jaraco
2021-05-31 09:41:55 -07:00
Miss Islington (bot) d1480ad2f5
bpo-44246: Entry points performance improvements. (GH-26467)
From importlib_metadata 4.3.1.
(cherry picked from commit 410b70d39d)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-05-31 09:12:32 -07:00
Miss Islington (bot) 97b4576f65
bpo-38693: Prefer f-strings in importlib.resources (importlib_resources 5.0.6). (GH-26387) (#26389)
Automerge-Triggered-By: GH:jaraco
(cherry picked from commit f6fbdb90ee)

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-05-26 17:09:27 -04:00
Miss Islington (bot) 7b3b6982a5
bpo-44232: Fix type_new() error reporting (GH-26359) (GH-26365)
Fix a regression in type() when a metaclass raises an exception. The
C function type_new() must properly report the exception when a
metaclass constructor raises an exception and the winner class is not
the metaclass.
(cherry picked from commit bd199e72fb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-05-26 11:30:55 +02:00
Miss Islington (bot) 86779878df
bpo-44151: linear_regression() minor API improvements (GH-26199) (GH-26338) 2021-05-24 18:11:12 -07:00
Miss Islington (bot) 50b0d148a6
bpo-44184: Fix subtype_dealloc() for freed type (GH-26274) (GH-26290)
Fix a crash at Python exit when a deallocator function removes the
last strong reference to a heap type.

Don't read type memory after calling basedealloc() since
basedealloc() can deallocate the type and free its memory.

_PyMem_IsPtrFreed() argument is now constant.
(cherry picked from commit 615069eb08)

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-05-22 00:50:11 +02:00
Miss Islington (bot) ae1732d461
bpo-44180: Fix edge cases in invalid assigment rules in the parser (GH-26283)
The invalid assignment rules are very delicate since the parser can
easily raise an invalid assignment when a keyword argument is provided.
As they are very deep into the grammar tree, is very difficult to
specify in which contexts these rules can be used and in which don't.
For that, we need to use a different version of the rule that doesn't do
error checking in those situations where we don't want the rule to raise
(keyword arguments and generator expressions).

We also need to check if we are in left-recursive rule, as those can try
to eagerly advance the parser even if the parse will fail at the end of
the expression. Failing to do this allows the parser to start parsing a
call as a tuple and incorrectly identify a keyword argument as an
invalid assignment, before it realizes that it was not a tuple after all.
(cherry picked from commit c878a97968)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-21 11:20:43 -07:00
Miss Islington (bot) fdb65e399e
[3.10] bpo-43643: Sync with python/importlib_resources@c17a610aad. (GH-26284) (GH-26286)
* [bpo-43643](): Sync with python/importlib_resources@c17a610aad.
* Sync with python/importlib_resources@89fd5e961a.
(cherry picked from commit 875b3d84b3)


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

Automerge-Triggered-By: GH:jaraco
2021-05-21 10:52:24 -07:00
Miss Islington (bot) 07dba474c5
bpo-44180: Report generic syntax errors in the furthest position reached in the first parser pass (GH-26253) (GH-26281)
(cherry picked from commit b51081c1a8)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-21 16:29:58 +01:00
Barney Gale ee51c56c02
[3.10] bpo-38671: Add test that `pathlib.Path.resolve()` returns an absolute path. (GH-26184) (GH-26270)
Issue should be fixed in [bpo-43757]()

Co-Authored-by: Tzu-ping Chung <uranusjr@gmail.com>
(cherry picked from commit 18f41c04ff)

Co-authored-by: Barney Gale <barney.gale@gmail.com>

Automerge-Triggered-By: GH:encukou
2021-05-21 04:54:56 -07:00
Miss Islington (bot) 4389711ce9
bpo-36160: Fix test_site so that it can run independently of other tests (GH-12131) (GH-26262)
(cherry picked from commit 1270ad6ec8)

Co-authored-by: native-api <vano@mail.mipt.ru>
2021-05-20 11:42:00 +01:00
Miss Islington (bot) ec0699c044
bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210) (GH-26247)
(cherry picked from commit 33c0c90dea)

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-19 19:28:31 +01:00
Irit Katriel 373741a97c
[3.10] bpo-25872: Add unit tests for linecache and threading (GH-25913) (GH-26212)
(cherry picked from commit 115dea9e26)

Co-authored-by: uniocto <serit142sa33go@gmail.com>
2021-05-18 14:53:57 +01:00
Miss Islington (bot) a44bb6ddb1
bpo-33433 Fix private address checking for IPv4 mapped IPv6. (GH-26172)
For IPv4 mapped IPv6 addresses, defer privacy check to the mapped IPv4 address. Solves bug where public mapped IPv4 addresses are considered private by the IPv6 check.

Automerge-Triggered-By: GH:gpshead
(cherry picked from commit 83f0f8d62f)

Co-authored-by: Pete Wicken <2273100+JamoBox@users.noreply.github.com>
2021-05-17 12:42:08 -07:00
Miss Islington (bot) b913f47e87
bpo-39950: Fix deprecation warning in test for `pathlib.Path.link_to()` (GH-26155) (GH-26178)
(cherry picked from commit 1a08c5ac49)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2021-05-16 15:35:44 -07:00
Miss Islington (bot) 1afaaf5a2d
bpo-44143: Fix crash in the parser when raising tokenizer errors with an exception set (GH-26144) (GH-26148)
(cherry picked from commit 80b089179f)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-15 18:39:18 +01:00
Miss Islington (bot) 71dca6ea73
[3.10] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) (GH-26138)
When a Thread is not joined after it has stopped, its lock may remain in the _shutdown_locks set until interpreter shutdown.  If many threads are created this way, the _shutdown_locks set could therefore grow endlessly.  To avoid such a situation, purge expired locks each time a new one is added or removed.
(cherry picked from commit c10c2ec7a0)


Co-authored-by: Antoine Pitrou <antoine@python.org>
2021-05-15 02:24:44 -07:00
Miss Islington (bot) 2d780237d9
bpo-28146: Fix a confusing error message in str.format() (GH-24213)
Automerge-Triggered-By: GH:pitrou
(cherry picked from commit 4aeee0b47b)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2021-05-13 14:24:49 -07:00
Miss Islington (bot) c55ff1b352
bpo-44098: Drop ParamSpec from most ``__parameters__`` in typing generics (GH-26013) (#26091)
Added two new attributes to ``_GenericAlias``:
* ``_typevar_types``, a single type or tuple of types indicating what types are treated as a ``TypeVar``. Used for ``isinstance`` checks.
* ``_paramspec_tvars ``, a boolean flag which guards special behavior for dealing with ``ParamSpec``. Setting it to ``True`` means this  class deals with ``ParamSpec``.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit b2f3f8e3d8)
2021-05-13 10:19:24 -07:00
Mark Shannon 0acdf255a5
[3.10] bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26061)
* Guarantee that line number is set for returns.
2021-05-13 14:11:41 +01:00
Miss Islington (bot) a2d94a0a9b
bpo-38908: Fix issue when non runtime_protocol failed to raise TypeError (GH-26067)
(cherry picked from commit c40486a32d)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-05-12 09:09:04 -07:00
Irit Katriel bd5dfd6c8c
[3.10] bpo-25479: add unit test for __subclasshook__ in test_abc.py (GH-24034) (GH-26065)
Co-authored-by: Szymon Trapp
(cherry picked from commit 5010c044c7)

Co-authored-by: Karl Dubost <karl+github@la-grange.net>
2021-05-12 15:06:34 +01:00
Miss Islington (bot) 3e44e9af9e
bpo-44089: Allow subclassing of ``csv.Error`` (GH-26008) (GH-26066)
* fix subclass error

* Update 2021-05-09-22-52-34.bpo-44089.IoANsN.rst
(cherry picked from commit 2b458c1dba)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-05-12 07:02:46 -07:00
Miss Islington (bot) c90ed8e2e7
bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None. (GH-25438) (#26050)
Co-authored-by: Thomas Kluyver <takowl@gmail.com>
(cherry picked from commit 8563a7052c)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-12 00:48:05 +01:00
Miss Islington (bot) 9a0e65c8e0
bpo-43149: Correct the syntax error message for multiple exception types (GH-25996) GH-25997)
Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 6692dc1ca9)

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-09 22:13:50 +01:00
Miss Islington (bot) c3eb3c18f1
Revert test for Tix deprecation warning (GH-26005)
Added in bpo-41730 (GH-22186), the test apparently causes refleaks.  The
test isn't worth hunting them down, so it's simply reverted.

This partially reverts commit 4a2d98a1e9.
(cherry picked from commit 8e8307d70b)

Co-authored-by: Zachary Ware <zach@python.org>
2021-05-09 00:19:43 -07:00
Miss Islington (bot) 6e7fe19016
[3.10] bpo-31904: Correct error string in test_file_not_exists() for VxWorks (GH-25965) (GH-25983)
The error string on VxWorks is "no such file or directory" for FileNotFoundError. That is, the 1st letter of the error string has lower case.
(cherry picked from commit b063b02eab)


Co-authored-by: pxinwr <peixing.xin@windriver.com>

Automerge-Triggered-By: GH:gpshead
2021-05-08 02:09:29 -07:00
Miss Islington (bot) 13de28f17a
bpo-44063: set the missing end locations on the compiler (GH-25956) (#25972)
(cherry picked from commit b2ec37a722)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2021-05-07 23:40:09 +03:00
Miss Islington (bot) ec6a1ea1ee
bpo-41730: Show deprecation warnings for tkinter.tix (GH-22186)
Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
(cherry picked from commit 4a2d98a1e9)

Co-authored-by: wyz23x2 <52805709+wyz23x2@users.noreply.github.com>
2021-05-07 09:14:48 -07:00
Miss Islington (bot) 569ca81adf
bpo-40943: Fix skipitem() didn't raise SystemError (GH-25937)
`convertitem()` raises `SystemError` when 'GH-' is used without `PY_SSIZE_T_CLEAN`.
This commit makes `skipitem()` raise it too.
(cherry picked from commit 4ebf4a6bfa)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-05-06 20:18:42 -07:00
Miss Islington (bot) 058f9b27d3
bpo-43972: Set content-length to 0 for http.server.SimpleHTTPRequestHandler 301s (GH-25705)
* Set content-length for simple http server 301s

When http.server.SimpleHTTPRequestHandler sends a 301 (Moved
Permanently) due to a missing file, it does not set a Content-Length
of 0. Unfortunately, certain clients can be left waiting for the
connection to be closed in this circumstance, even though no body
will be sent. At time of writing, both curl and Firefox demonstrate
this behavior.

* Test Content-Length on simple http server redirect

When serving a redirect, the SimpleHTTPRequestHandler will now send
`Content-Length: 0`. Several tests for http.server already cover
various behaviors and checks including redirection. This change only
adds one check for the expected Content-Length on the simplest case
for a redirect.

* Add news entry for SimpleHTTPRequestHandler fix

* Clarify the specific kind of 301

Co-authored-by: Senthil Kumaran <skumaran@gatech.edu>
(cherry picked from commit fb42725561)

Co-authored-by: Stephen Rosen <sirosen@globus.org>
2021-05-06 12:48:36 -07:00
Mark Shannon 8d4b18429d
Correct location for syntax error in try-except (GH-25939) 2021-05-06 13:38:50 +01:00
Miss Islington (bot) 60ba0b6847
bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916) (GH-25931)
Fixes http.client potential denial of service where it could get stuck reading lines from a malicious server after a 100 Continue response.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
(cherry picked from commit 47895e31b6)

Co-authored-by: Gen Xu <xgbarry@gmail.com>
2021-05-05 16:14:28 -07:00
Miss Islington (bot) 24f1d1a8a2
bpo-43882 Remove the newline, and tab early. From query and fragments. (GH-25936)
(cherry picked from commit 985ac01637)
2021-05-05 16:04:38 -07:00
Miss Islington (bot) 10d6f6bfd7
bpo-35753: Fix crash in doctest with unwrap-able functions (GH-22981) (#25926)
Ignore objects that inspect.unwrap throws due to
too many wrappers.  This is a very rare case, however
it can easily be surfaced when a module under doctest
imports unitest.mock.call into its namespace.

We simply skip any object that throws this exception.
This should handle the majority of cases.
(cherry picked from commit 565a31804c)

Co-authored-by: Alfred Perlstein <alfred@fb.com>
2021-05-05 20:01:21 +02:00
Miss Islington (bot) 7b4725a210
bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548)
The address tuple for CAN_RAW no longer returns the address family
after the introduction of CAN ISO-TP support in a30f6d45ac. However,
updating test_socket.CANTest.testSendFrame was missed as part of the
change, so the test incorrectly attempts to index past the last tuple
item to retrieve the address family.

This removes the now-redundant check for equality against socket.AF_CAN,
as the tuple will not contain the address family.
(cherry picked from commit 355bae8882)

Co-authored-by: karl ding <karlding@users.noreply.github.com>
2021-05-04 14:01:42 -07:00
Miss Islington (bot) 2995bff426
bpo-44018: random.seed() no longer mutates its inputs (GH-25856) (GH-25872) 2021-05-03 19:45:30 -07:00
Miss Islington (bot) d194e1eb93
fix enum and backslash warnings (GH-25861) (GH-25871)
- Enum warning in test_faulthandler
- backslash warning in test_ipaddress
(cherry picked from commit 652bcd9f9c)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-05-03 19:17:23 -07:00
Miss Islington (bot) 756b7b9248
bpo-43822: Prioritize tokenizer errors over custom syntax errors when raising parser exceptions (GH-25866)
(cherry picked from commit 9142088e74)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-03 18:06:45 -07:00
Shreyan Avigyan d3b9134ebb
Remove Enum warnings from test_httpservers (GH-25844) 2021-05-03 20:27:47 +01:00
Dennis Sweeney 80a2a4ed7d
bpo-38530: Refactor and improve AttributeError suggestions (GH-25776)
- Make case-swaps half the cost of any other edit
- Refactor Levenshtein code to not use memory allocator, and to bail early on no match.
- Add comments to Levenshtein distance code
- Add test cases for Levenshtein distance behind a debug macro
- Set threshold to `(name_size + item_size + 3) * MOVE_COST / 6`.
  - Reasoning: similar to `difflib.SequenceMatcher.ratio()` >= 2/3:
```
"Multiset Jaccard similarity" >= 2/3
matching letters / total letters >= 2/3
(name_size - distance + item_size - distance) / (name_size + item_size) >= 2/3
1 - (2*distance) / (name_size + item_size) >= 2/3
1/3 >= (2*distance) / (name_size + item_size)
(name_size + item_size) / 6 >= distance
With rounding:
(name_size + item_size + 3) // 6 >= distance
```

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-05-03 16:47:27 +01:00
Christian Heimes c715b52421
bpo-43943: ssl tests: Increase server socket timeout, backlog, debugging (GH-25850)
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-03 17:45:02 +02:00
Pablo Galindo 7719953b30
bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)
This reverts commit 5fb06edbbb and all
subsequent dependent commits.
2021-05-03 16:21:59 +01:00
Andrew Svetlov 4ffd6fd2f1
Increase test timeout (GH-25842) 2021-05-03 12:06:17 +03:00
Batuhan Taskaya ad106c68eb
bpo-42725: Render annotations effectless on symbol table with PEP 563 (GH-25583) 2021-05-03 10:43:00 +03:00
Christian Heimes 37ebdf0a86
bpo-44011: Fix asyncio tests without ssl module (GH-25840)
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-03 09:38:56 +02:00
Eric V. Smith 99ad742ea9
bpo-44015: dataclasses should allow KW_ONLY to be specified only once per class (GH-25841)
bpo-44015: Raise a TypeError if KW_ONLY is specified more than once.
2021-05-03 03:24:53 -04:00
Raymond Hettinger 8c598dbb94
bpo-25478: Add total() method to collections.Counter (GH-25829) 2021-05-02 20:19:51 -07:00
Ned Deily 8703178258
bpo-43568: Drop support for MACOSX_DEPLOYMENT_TARGET < 10.3 (GH-25827)
Only complain if the config target is >= 10.3 and the current target is
< 10.3. The check was originally added to ensure that incompatible
LDSHARED flags are not used, because -undefined dynamic_lookup is
used when building for 10.3 and later, and is not supported on older OS
versions. Apart from that, there should be no problem in general
with using an older target.

Authored-by: Joshua Root <jmr@macports.org>
2021-05-02 20:28:43 -04:00
Mark Shannon 33ec88ac81
bpo-43977: Make sure that tp_flags for pattern matching are inherited correctly. (GH-25813) 2021-05-03 00:38:22 +01:00
Andrew Svetlov 5fb06edbbb
bpo-44011: New asyncio ssl implementation (#17975) 2021-05-03 00:34:15 +03:00
Erlend Egeberg Aasland c96cc089f6
bpo-43434: Move sqlite3.connect audit events to sqlite3.Connection.__init__ (GH-25818) 2021-05-02 22:25:17 +01:00
Jason R. Coombs 37e0c7850d
bpo-43926: Cleaner metadata with PEP 566 JSON support. (GH-25565)
* bpo-43926: Cleaner metadata with PEP 566 JSON support.

* Add blurb

* Add versionchanged and versionadded declarations for changes to metadata.

* Use descriptor for PEP 566
2021-05-02 17:03:40 -04:00
Brandt Bucher 0ad1e0384c
bpo-43754: Eliminate bindings for partial pattern matches (GH-25229) 2021-05-02 13:02:10 -07:00
Christian Heimes 60ce8f0be6
bpo-36384: Leading zeros in IPv4 addresses are no longer tolerated (GH-25099)
Reverts commit e653d4d8e8 and makes
parsing even more strict. Like socket.inet_pton() any leading zero
is now treated as invalid input.

Signed-off-by: Christian Heimes <christian@python.org>

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-05-02 14:00:35 +02:00
Christian Heimes 91554e4c5c
bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792)
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-02 09:47:45 +02:00
Ethan Furman 1ae05fdf2d
Revert "bpo-43989: Temporarily disable warnings in ssltests (GH-25780)" (GH-25793)
Reverts python/cpython#25780

Automerge-Triggered-By: GH:tiran
2021-05-01 13:53:57 -07:00
Christian Heimes ddbef71a2c
bpo-43916: Rewrite new hashlib tests, fix typo (GH-25791)
* bpo-43916: Rewrite new hashlib tests, fix typo
* Flag test as cpython only
2021-05-01 22:42:36 +02:00
Christian Heimes a5669b3c62
bpo-43998: Fix testing without ssl module (GH-25790)
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-01 22:17:01 +02:00
Christian Heimes e983252b51
bpo-43998: Default to TLS 1.2 and increase cipher suite security (GH-25778)
The ssl module now has more secure default settings. Ciphers without forward
secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits
weak RSA, DH, and ECC keys with less than 112 bits of security.
:class:`~ssl.SSLContext` defaults to minimum protocol version TLS 1.2.
Settings are based on Hynek Schlawack's research.

```
$ openssl version
OpenSSL 1.1.1k  FIPS 25 Mar 2021
$ openssl ciphers -v '@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM'
TLS_AES_256_GCM_SHA384  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(256) Mac=AEAD
TLS_CHACHA20_POLY1305_SHA256 TLSv1.3 Kx=any      Au=any  Enc=CHACHA20/POLY1305(256) Mac=AEAD
TLS_AES_128_GCM_SHA256  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(128) Mac=AEAD
TLS_AES_128_CCM_SHA256  TLSv1.3 Kx=any      Au=any  Enc=AESCCM(128) Mac=AEAD
ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(128) Mac=AEAD
ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(128) Mac=AEAD
ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=CHACHA20/POLY1305(256) Mac=AEAD
ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH     Au=RSA  Enc=CHACHA20/POLY1305(256) Mac=AEAD
ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AES(256)  Mac=SHA384
ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AES(256)  Mac=SHA384
ECDHE-ECDSA-AES128-SHA256 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AES(128)  Mac=SHA256
ECDHE-RSA-AES128-SHA256 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AES(128)  Mac=SHA256
DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(128) Mac=AEAD
DHE-RSA-AES256-SHA256   TLSv1.2 Kx=DH       Au=RSA  Enc=AES(256)  Mac=SHA256
DHE-RSA-AES128-SHA256   TLSv1.2 Kx=DH       Au=RSA  Enc=AES(128)  Mac=SHA256
```

Signed-off-by: Christian Heimes <christian@python.org>
2021-05-01 20:53:10 +02:00
Eric V. Smith 823fbf4e0e
If using a frozen class with slots, add __getstate__ and __setstate__ to set the instance values. (GH-25786) 2021-05-01 13:27:30 -04:00
Christian Heimes f82fd77717
bpo-43989: Temporarily disable warnings in ssltests (GH-25780)
-Werror is currently broken.
2021-05-01 16:05:01 +02:00
Yurii Karabas c24199184b
bpo-42269: Add slots parameter to dataclass decorator (GH-24171)
Add slots parameter to dataclass decorator and make_dataclass function.
2021-04-30 22:14:30 -04:00
Erlend Egeberg Aasland e467ec476f
bpo-43995: Fix reference leak in test_grammar (GH-25764) 2021-05-01 00:23:14 +01:00
Victor Stinner 665c7746fc
bpo-43916: _md5.md5 uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25753)
The following types use Py_TPFLAGS_DISALLOW_INSTANTIATION flag:

* _md5.md5
* _sha1.sha1
* _sha256.sha224
* _sha256.sha256
* _sha512.sha384
* _sha512.sha512
2021-04-30 18:40:30 +02:00
Pablo Galindo e374a40afa
bpo-43901: Fix refleaks in test_module (GH-25754) 2021-04-30 17:26:45 +01:00
Victor Stinner 7dcf0f6db3
bpo-43916: select.devpoll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25751) 2021-04-30 18:19:57 +02:00
Erlend Egeberg Aasland 9746cda705
bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748)
Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to the following types:

* _dbm.dbm
* _gdbm.gdbm
* _multibytecodec.MultibyteCodec
* _sre..SRE_Scanner
* _thread._localdummy
* _thread.lock
* _winapi.Overlapped
* array.arrayiterator
* functools.KeyWrapper
* functools._lru_list_elem
* pyexpat.xmlparser
* re.Match
* re.Pattern
* unicodedata.UCD
* zlib.Compress
* zlib.Decompress
2021-04-30 16:04:57 +02:00
Erlend Egeberg Aasland 387397f8a4
bpo-43916: select.poll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25750) 2021-04-30 15:49:17 +02:00
Mark Shannon 5979e81a21
bpo-43933: Set frame.f_lineno during call to __exit__ (GH-25719)
* Set line number of __exit__ call in a with statement to be that of the with keyword.
2021-04-30 14:32:47 +01:00
Erlend Egeberg Aasland 64141382ec
bpo-43908: check_set_special_type_attr() checks Py_TPFLAGS_IMMUTABLETYPE (GH-25743)
check_set_special_type_attr() and type_set_annotations()
now check for immutable flag (Py_TPFLAGS_IMMUTABLETYPE).

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-04-30 15:25:43 +02:00