Commit graph

26892 commits

Author SHA1 Message Date
Miss Islington (bot)
6f4cdeddb9
bpo-25782: avoid hang in PyErr_SetObject when current exception has a cycle in its context chain (GH-27626) (GH-27707)
Co-authored-by: Dennis Sweeney 36520290+sweeneyde@users.noreply.github.com
(cherry picked from commit d5c217475c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-08-10 13:08:41 +02:00
Miss Islington (bot)
395f4c7fbf
bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631) (GH-27687)
(cherry picked from commit b33186bc43)

Co-authored-by: Johannes Reiff <mail@jreiff.de>
2021-08-10 00:34:58 +02:00
Miss Islington (bot)
ede221e517
bpo-32695: Docs and tests for compresslevel and preset kwargs in tarfile (GH-21470) (GH-27674)
Co-Authored-By: Bo Bayles <bbayles@gmail.com>
(cherry picked from commit eb2d4a66ff)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2021-08-09 12:30:00 +02:00
Miss Islington (bot)
fde84170d0
bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633) (GH-27641) 2021-08-06 14:57:52 -05:00
Łukasz Langa
693a661478
[3.9] bpo-40928: notify users running test_decimal on macOS of malloc warnings (GH-26783) (GH-27629)
* 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 15:35:11 +02:00
Miss Islington (bot)
0b551db04a
bpo-39091: Fix segfault when Exception constructor returns non-exception for gen.throw. (GH-17658) (GH-27573)
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:54 +02:00
Miss Islington (bot)
0f6a7739df
bpo-44806: Fix __init__ in subclasses of protocols (GH-27545) (GH-27559)
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 18:52:16 +02:00
Miss Islington (bot)
4817c14395
bpo-44785: Silence deprecation warnings in test_pickle (GH-27538) (#27557)
(cherry picked from commit 36d952d228)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-02 18:39:25 +02:00
Miss Islington (bot)
2d11797c81
bpo-44667: Treat correctly lines ending with comments and no newlines in the Python tokenizer (GH-27499) (GH-27501)
(cherry picked from commit b6bde9fc42)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-02 11:44:01 +02:00
Miss Islington (bot)
0f42b726c8
bpo-42892: fix email multipart attribute error (GH-26903) (GH-27493)
(cherry picked from commit e3f877c32d)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-07-30 19:30:58 +02:00
Miss Islington (bot)
73240d425b
bpo-44666: Use default encoding as fallback for compile_file (GH-27236) (GH-27489)
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:29 +02:00
Łukasz Langa
168879e366
[3.9] Update URLs in comments and metadata to use HTTPS (GH-27458) (GH-27480)
(cherry picked from commit be42c06bb0)

Co-authored-by: Noah Kantrowitz <noah@coderanger.net>
2021-07-30 16:34:04 +02:00
Miss Islington (bot)
e627c79478
To fix the random failed test cases of test___xxsubinterpreters in multiprocess. (GH-27240) (GH-27453)
(cherry picked from commit 9101b39e67)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2021-07-29 19:28:22 +02:00
Miss Islington (bot)
acaf3b9594
bpo-44752: Make rlcompleter not call @property methods (GH-27401) (#27445)
* 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 15:53:39 +02:00
Jason R. Coombs
49b5e20fa8
[3.9] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227) (GH-27400)
* [3.9] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227)

* bpo-44461: Fix bug with pdb's handling of import error due to a package which does not have a __main__ module

* 📜🤖 Added by blurb_it.

* remove "else"

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

* If running as a module, first check that it can run as a module. Alternate fix for bpo-44461.

Co-authored-by: Irit Katriel
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>.
(cherry picked from commit ee03bad25e)

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

* Ensure os_helper is imported.

* Actually, os_helper doesn't exist yet. Just reference rmtree from support.
2021-07-28 18:48:52 -04:00
Miss Islington (bot)
debb751f11
bpo-27827: identify a greater range of reserved filename on Windows. (GH-26698) (#27422)
`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:15:51 +02:00
Miss Islington (bot)
85ac81499e
bpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) (GH-27367)
(cherry picked from commit 1d582bbc96)

Co-authored-by: T. Wouters <thomas@python.org>
2021-07-26 21:30:11 +02:00
Miss Islington (bot)
7b2185b8e4
bpo-44734: Fix precision in turtle tests (GH-27343) (GH-27362)
(cherry picked from commit 3f135c073a)

Co-authored-by: Logan Jones <loganasherjones@gmail.com>
2021-07-26 17:56:13 +02:00
Miss Islington (bot)
0a08f22184
bpo-44720: Don't crash when calling weakref.proxy(not_an_iterator).__next__ (GH-27316) (#27325)
(cherry picked from commit 5370f0a82a)

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

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2021-07-23 15:27:17 +02:00
Łukasz Langa
0f55d21212
[3.9] bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) (GH-27293)
* 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 23:17:13 +02:00
Miss Islington (bot)
e0ef81600f
bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27283) 2021-07-21 19:23:38 -05:00
Łukasz Langa
1c5c9c89ff
[3.9] bpo-44566: resolve differences between asynccontextmanager and contextmanager (GH-27024). (#27269)
(cherry picked from commit 7f1c330da3)

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


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

Automerge-Triggered-By: GH:gpshead
2021-07-20 11:44:58 -07:00
Mark Shannon
7ebd7465a5
Set line number of END_ASYNC_FOR so that it doesn't show in traces. (GH-27255) 2021-07-20 12:09:56 +02:00
Miss Islington (bot)
9ee12cf325
bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (#27245)
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 19:28:56 +02:00
Ken Jin
fa674bdea3
[3.9] bpo-41249: Fix postponed annotations for TypedDict (GH-27017) (GH-27205)
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>
Co-authored-by: Germán Méndez Bravo <german.mb@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-17 11:36:38 +02:00
Miss Islington (bot)
df7c62980d
bpo-40897:Give priority to using the current class constructor in inspect.signature (GH-27177) (GH-27209)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 6aab5f9bf3)

Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
2021-07-17 10:36:31 +02:00
Miss Islington (bot)
298ee657ab
bpo-44184: Fix subtype_dealloc() for freed type (GH-26274)
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>
2021-07-15 16:36:51 -07:00
Miss Islington (bot)
95596d5921
bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows (GH-27161) (#27170)
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:55 +02:00
Miss Islington (bot)
94adfe6e2c
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:44:08 -07:00
Miss Islington (bot)
fe73509c5b
bpo-44630: Fix assertion errors in csv module (GH-27127)
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>
2021-07-13 16:20:28 -07:00
Vladimir Feinberg
489c273583
[3.9] bpo-43048: RecursionError traceback RecursionError bugfix for cpy3.9 (GH-24460) (#24460)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2021-07-12 17:58:47 +02:00
Miss Islington (bot)
c89f0b2587
[3.9] bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049) (GH-27082)
Fixes the misleading IsADirectoryError to be FileNotFoundError.
(cherry picked from commit 248173cc04)


Co-authored-by: andrei kulakov <andrei.avk@gmail.com>

Automerge-Triggered-By: GH:gpshead
2021-07-09 21:13:59 -07:00
Dong-hee Na
9761abf306
[3.9] bpo-44558: Match countOf is/== treatment to c (GH-27007). (GH-27055) 2021-07-07 23:55:22 +09:00
Miss Islington (bot)
9f47d872db
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:52:04 -07:00
Miss Islington (bot)
21be6cb030
bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) (GH-27005)
(cherry picked from commit d968a638fc)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-07-03 17:05:33 +01:00
Miss Islington (bot)
8aa45de6c6
bpo-30256: Add manager_owned keyword arg to AutoProxy (GH-16341) (GH-26989)
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:35:31 -07:00
Steve Dower
863e3d5c7e
bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal.dumps (GH-26971) 2021-06-30 18:52:39 +01:00
Miss Islington (bot)
f790bc8084
bpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950) (GH-26960)
(cherry picked from commit e2fea101fd)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-30 00:19:32 +01:00
Miss Islington (bot)
0796e21fea
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:25:41 -07:00
Victor Stinner
5ed7827b16
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26878)
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:33 +02:00
Miss Islington (bot)
fcde2c6a8c
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:03:00 -07:00
Ma Lin
8bc26d8c9d
bpo-44439: BZ2File.write()/LZMAFile.write() handle length correctly (GH-26846)
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.

Co-authored-by: Marco Ribeiro <marcoffee@users.noreply.github.com>
2021-06-22 16:57:41 +03:00
Miss Islington (bot)
0ff487b8ab
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:29:13 -07:00
Miss Islington (bot)
67b3a99953
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:42 -07:00
Miss Islington (bot)
175e264d36
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:54:04 -07:00
Pablo Galindo
0d0a9eaa82
[3.9] bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712). (GH-26723)
(cherry picked from commit 507ed6fa1d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-14 18:07:51 +01:00
Miss Islington (bot)
6df926f1c4
bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646) (GH-26675)
(cherry picked from commit 4cb6ba1432)

Co-authored-by: huzhaojie <hu.zj@foxmail.com>
2021-06-11 17:18:49 +01:00
Ethan Furman
e9726314df
[Enum] improve pickle support (#26666)
search all bases for a __reduce__ style method; if a __new__ method is
found first the enum will be made unpicklable
2021-06-11 01:26:32 -07:00