Commit graph

26974 commits

Author SHA1 Message Date
Ken Jin
99506dcbbe
[3.9] bpo-45121: Fix RecursionError when calling Protocol.__init__ from a subclass' __init__ (GH-28206) (GH-28233)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-09-08 17:01:51 +02:00
Miss Islington (bot)
04c13c97ee
bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) (GH-28215)
Fix regrtest second summary when using -w/--verbose2 command line
option: lists re-run tests in the second test summary.
(cherry picked from commit c4ea45d7d2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-07 19:21:19 +02:00
Serhiy Storchaka
ab58269ab3
[3.9] bpo-45042: Now test classes decorated with requires_hashdigest are not skipped (GH-28060) (GH-28169)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>.
(cherry picked from commit dd7b816ac8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-05 09:41:33 +03:00
Miss Islington (bot)
fecd17fbcb
bpo-45030: Fix integer overflow in __reduce__ of the range iterator (GH-28000)
It happened with fast range iterator  when the calculated stop = start + step * len
was out of the C long range.
(cherry picked from commit 936f6a16b9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-04 13:39:47 -07:00
Serhiy Storchaka
c967bd523c
[3.9] bpo-45097: Remove incorrect deprecation warnings in asyncio. (GH-28153)
Deprecation warnings about the loop argument were incorrectly emitted
in cases when the loop argument was used inside the asyncio library,
not from user code.
2021-09-04 20:54:50 +03:00
Miss Islington (bot)
41c2374024
[3.9] bpo-45083: Include the exception class qualname when formatting an exception (GH-28119) (GH-28135)
* bpo-45083: Include the exception class qualname when formatting an exception (GH-28119)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
(cherry picked from commit b4b6342848)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-03 18:56:05 +02:00
Miss Islington (bot)
98eb40828a
bpo-45081: Fix __init__ method generation when inheriting from Protocol (GH-28121) (GH-28132)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 0635e201be)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-09-02 19:01:32 +02:00
Serhiy Storchaka
e09dd8aafd
[3.9] bpo-45060: Get rid of few uses of the equality operators with None (GH-28087). (GH-28093)
(cherry picked from commit 3c65457156)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-01 09:51:01 +03:00
Serhiy Storchaka
e527f79fa8
[3.9] bpo-45057: Simplify RegressionTestResult (GH-28081) (GH-28103)
Remove code which duplicates the functionality of TextTestResult.
(cherry picked from commit 2b76a5322f)
2021-09-01 09:45:09 +03:00
Miss Islington (bot)
24416e4191
bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) (GH-28035)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 0897253f42)

Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
2021-08-29 16:45:25 +02:00
Serhiy Storchaka
330aabbbbe
[3.9] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005). (GH-28028)
(cherry picked from commit 2a8127cafe)
2021-08-29 15:08:32 +03:00
Serhiy Storchaka
1046cd06b0
[3.9] bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002) (GH-28017)
PyPy and potentially other implementations have different or no
contraints on the number of blocks that can be statically nested. move
the test that checks for this behaviour into a unit test and mark it as
CPython-only..
(cherry picked from commit eb263f9a35)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2021-08-28 22:24:39 +03:00
Miss Islington (bot)
02437641d2
bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938) (GH-27991)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 94a3d2a632)

Co-authored-by: chilaxan <chilaxan@gmail.com>
2021-08-27 12:52:07 +02:00
Miss Islington (bot)
970533e65c
[3.9] bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) (GH-27970)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7dc505b865)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-26 19:56:50 +02:00
Miss Islington (bot)
2cdbd3b8b2
bpo-45001: Make email date parsing more robust against malformed input (GH-27946) (GH-27973)
Various date parsing utilities in the email module, such as
email.utils.parsedate(), are supposed to gracefully handle invalid
input, typically by raising an appropriate exception or by returning
None.

The internal email._parseaddr._parsedate_tz() helper used by some of
these date parsing routines tries to be robust against malformed input,
but unfortunately it can still crash ungracefully when a non-empty but
whitespace-only input is passed. This manifests as an unexpected
IndexError.

In practice, this can happen when parsing an email with only a newline
inside a ‘Date:’ header, which unfortunately happens occasionally in the
real world.

Here's a minimal example:

    $ python
    Python 3.9.6 (default, Jun 30 2021, 10:22:16)
    [GCC 11.1.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import email.utils
    >>> email.utils.parsedate('foo')
    >>> email.utils.parsedate(' ')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.9/email/_parseaddr.py", line 176, in parsedate
        t = parsedate_tz(data)
      File "/usr/lib/python3.9/email/_parseaddr.py", line 50, in parsedate_tz
        res = _parsedate_tz(data)
      File "/usr/lib/python3.9/email/_parseaddr.py", line 72, in _parsedate_tz
        if data[0].endswith(',') or data[0].lower() in _daynames:
    IndexError: list index out of range

The fix is rather straight-forward: guard against empty lists, after
splitting on whitespace, but before accessing the first element.
(cherry picked from commit 989f6a3800)

Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
2021-08-26 17:48:20 +02:00
Miss Islington (bot)
9d3b6b2472
[3.9] bpo-34990: Treat the pyc header's mtime in compileall as an unsigned int (GH-19708)
(cherry picked from commit bb21e28fd0)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2021-08-24 11:07:31 -04:00
Miss Islington (bot)
de49eacee8
bpo-44980: fix test_constructor to return None value (GH-27898) (GH-27914)
(cherry picked from commit 27b761a11a)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-08-23 21:20:29 +02:00
Łukasz Langa
b0df288c94
[3.9] bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904) (GH-27910)
Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL)..
(cherry picked from commit 4d68917386)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-23 20:48:04 +02:00
Miss Islington (bot)
d5781e9730
bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870)
The code of the test was never executed because the test function
was unintentionally converted to a generator function.
(cherry picked from commit 585390fdd8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-21 13:29:18 -07:00
Miss Islington (bot)
7ef0673de4
bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) (GH-27855)
(cherry picked from commit 60b93d9e49)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-08-20 12:37:41 +01:00
Miss Islington (bot)
0215257c61
bpo-44949: Fix test_readline auto history tests (GH-27813) (GH-27822)
(cherry picked from commit 6fb62b42f4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-08-19 12:35:28 +02:00
Łukasz Langa
4e4d35d332
[3.9] bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814) (GH-27817)
(cherry picked from commit b2f68b1900)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-18 23:03:59 +02:00
Sam Bull
b2779b2aa1
[3.9] bpo-44815: Always show deprecation in asyncio.gather/sleep() (GH-27569)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-18 20:47:55 +02:00
Miss Islington (bot)
ebe7e6d86c
bpo-44852: Support filtering over warnings without a set message (GH-27793) (GH-27810)
Additional improvements:

- messages which were compiled regular expressions aren't unpacked back into
  strings for unmatched warnings;

- removed unnecessary "if tokens:" check (there's one before the for loop);

- took `endswith` calculation out of the for loop.
(cherry picked from commit 8cf07d3db3)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-18 14:10:39 +02:00
Miss Islington (bot)
beb3a835da
bpo-44698: Restore complex pow behaviour for small integral exponents (GH-27772) (GH-27797)
(cherry picked from commit 4b9a2dcf19)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-08-17 18:38:39 +01:00
Łukasz Langa
27fd313110
[3.9] bpo-38956: don't print BooleanOptionalAction's default twice (GH-27672) (GH-27788)
Co-authored-by: Micky Yun Chan <michan@redhat.com>.
(cherry picked from commit 1512bc21d6)

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2021-08-17 11:17:00 +02:00
Łukasz Langa
c7c4cbc58e
[3.9] bpo-44852: Support ignoring specific DeprecationWarnings wholesale in regrtest (GH-27634) (GH-27785)
(cherry picked from commit a0a6d39295)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-16 22:47:08 +02:00
Pablo Galindo Salgado
282fc5c007
[3.9] Fix the test suite for the old parser (GH-27749)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-13 12:26:07 +02:00
Pablo Galindo Salgado
4b86c9c514
[3.9] bpo-44885: Correct the ast locations of f-strings with format specs and repeated expressions (GH-27729) (GH-27744)
(cherry picked from commit 8e832fb2a2)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-12 18:46:35 +01:00
Miss Islington (bot)
f7635f0e54
[3.9] bpo-33930: Fix typo in the test name. (GH-27733) (GH-27734)
[bpo-33930](): Fix typo in the test name. (GH-27733)
(cherry picked from commit f08e6d1bb3)


Co-authored-by: Benjamin Peterson <benjamin@python.org>

Automerge-Triggered-By: GH:benjaminp
2021-08-11 19:20:21 -07:00
Miss Islington (bot)
15f0a45b28
bpo-33930: Fix segfault with deep recursion when cleaning method objects (GH-27678) (GH-27720)
(cherry picked from commit bfc2d5a5c4)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-11 10:32:24 +02:00
Miss Islington (bot)
897c87045c
bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694) (GH-27698)
(cherry picked from commit 8ed1833912)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-08-10 15:09:42 +02:00
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