Commit Graph

27406 Commits

Author SHA1 Message Date
Miss Islington (bot) 06c26f4d29
bpo-35474: Fix mimetypes.guess_all_extensions() potentially mutating list (GH-28286) (GH-28289)
* Calling guess_all_extensions() with strict=False potentially
  mutated types_map_inv.
* Mutating the result of guess_all_extensions() mutated types_map_inv.
(cherry picked from commit 97ea18eced)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-13 19:24:29 +02:00
Miss Islington (bot) 11103eb1f2
bpo-44860: Update test_sysconfig for posix_user platlib (GH-28235) (GH-28251)
Update test_sysconfig.test_user_similar() for the posix_user scheme:
"platlib" doesn't use sys.platlibdir.
(cherry picked from commit 49acac00c0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-09 11:35:36 +02:00
Raymond Hettinger 3c30805b58
[3.10] bpo-20499: Rounding error in statistics.pvariance (GH-28230) (GH-28248) 2021-09-08 22:42:29 -05:00
Miss Islington (bot) 6b996d61c9
[3.10] bpo-45083: Include the exception class qualname when formatting an exception (GH-28119) (GH-28134)
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>

* Use a private version of _PyType_GetQualName

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-08 18:32:19 +02:00
Łukasz Langa d41abe8970
[3.10] bpo-45056: Remove trailing unused constants from co_consts (GH-28109) (GH-28125)
(cherry picked from commit 55c4a92fc1)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-09-08 18:25:09 +02:00
Miss Islington (bot) 7538fe34d7
bpo-45118: Fix regrtest second summary for re-run tests (GH-28183) (GH-28214)
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-08 17:09:55 +02:00
Serhiy Storchaka 462c1f0403
[3.10] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005) (GH-28027)
(cherry picked from commit 2a8127cafe)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-08 17:08:57 +02:00
Miss Islington (bot) c081649e6d
bpo-45121: Fix RecursionError when calling Protocol.__init__ from a subclass' __init__ (GH-28206) (GH-28232)
(cherry picked from commit c11956a8bd)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-09-08 17:05:23 +02:00
Miss Islington (bot) be33e58699
Add more itertool recipes (GH-28165)
(cherry picked from commit 750368cbcd)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-09-07 10:52:26 -07:00
Miss Islington (bot) adc80a58f9
bpo-44963: Implement send() and throw() methods for anext_awaitable objects (GH-27955)
Co-authored-by: Yury Selivanov <yury@edgedb.com>
(cherry picked from commit 533e725821)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-09-07 03:52:53 -07:00
Miss Islington (bot) 6b5aea2dc1
bpo-45052: Unskips a failing `test_shared_memory_basics` test (GH-28182)
(cherry picked from commit 19871fce3b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-06 10:16:44 -07:00
Miss Islington (bot) 656b0bdfaa
bpo-44571: Add itertool recipe for a variant of takewhile() (GH-28167)
(cherry picked from commit 91be41ad93)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-09-04 22:30:37 -07:00
Miss Islington (bot) e5976dd2e6
bpo-45042: Now test classes decorated with `requires_hashdigest` are not skipped (GH-28060)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit dd7b816ac8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-04 14:04:44 -07:00
Miss Islington (bot) ed9f927527
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:30 -07:00
Miss Islington (bot) 2ad114ddff
[3.10] bpo-45097: Add more tests for shutdown_asyncgens() (GH-28154) (GH-28159)
* bpo-45097: Add more tests for shutdown_asyncgens() (GH-28154)
(cherry picked from commit c2970fdec5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-04 23:37:56 +03:00
Serhiy Storchaka e2b2930413
[3.10] bpo-45060: Get rid of few uses of the equality operators with None (GH-28087). (GH-28092)
(cherry picked from commit 3c65457156)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-03 21:13:00 -04:00
Miss Islington (bot) 79e9f5a584
bpo-45081: Fix __init__ method generation when inheriting from Protocol (GH-28121)
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 23:26:53 -07:00
Miss Islington (bot) 3d56272e4e
bpo-45057: Simplify RegressionTestResult (GH-28081) (GH-28101)
Remove code which duplicates the functionality of TextTestResult.
(cherry picked from commit 2b76a5322f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-01 09:45:46 +03:00
Miss Islington (bot) 9e6c317ab1
bpo-43124: Fix smtplib multiple CRLF injection (GH-25987)
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 07:43:39 -07:00
Miss Islington (bot) 779b9aef4f
bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002) (GH-28016)
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:02 +03:00
Miss Islington (bot) 81fa08c5ea
bpo-44524: Fix cryptic TypeError message when trying to subclass special forms in `typing` (GH-27710)
This was a Python 3.9 regression.
(cherry picked from commit a3a4d20d67)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-08-28 11:09:45 -07:00
Miss Islington (bot) cd986e9031
bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 94a3d2a632)

Co-authored-by: chilaxan <chilaxan@gmail.com>
2021-08-28 11:09:29 -07:00
Miss Islington (bot) 9a79242567
bpo-45001: Make email date parsing more robust against malformed input (GH-27946)
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 08:47:27 -07:00
Miss Islington (bot) 9f814beadb
bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7dc505b865)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-26 06:41:29 -07:00
Dong-hee Na 32c1caa87f
bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947) (GH-27957)
(cherry picked from commit 551da597a0)
2021-08-26 10:52:21 +01:00
Miss Islington (bot) 06e9a35169
bpo-44524: Don't modify MRO when inheriting from typing.Annotated (GH-27841)
(cherry picked from commit 23384a1749)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-08-25 11:36:47 -07:00
Miss Islington (bot) 0af681b652
[3.10] 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:09:14 -04:00
Miss Islington (bot) 6ff7fefc91
bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)
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 12:30:21 -07:00
Miss Islington (bot) 10955353ce
bpo-44980: fix test_constructor to return None value (GH-27898)
(cherry picked from commit 27b761a11a)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-08-23 12:21:06 -07:00
Miss Islington (bot) 88a1920c7b
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:30:08 -07:00
Miss Islington (bot) 5bd27c3be5
bpo-44524: Do not set _name of _SpecialForm without need (GH-27861) (GH-27871)
Because setting non-empty _name affects behavior of other code.

In most cases __name__ can be derived from __origin__.__name__.
(cherry picked from commit 4ceec49559)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-21 12:33:14 +03:00
Miss Islington (bot) 838b0e975f
bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834)
(cherry picked from commit 60b93d9e49)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-08-20 10:48:47 -07:00
Miss Islington (bot) fc6ad0585e
bpo-44949: Fix test_readline auto history tests (GH-27813)
(cherry picked from commit 6fb62b42f4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-08-19 01:52:16 -07:00
Miss Islington (bot) 846a10fc45
bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814)
(cherry picked from commit b2f68b1900)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-18 13:32:01 -07:00
Miss Islington (bot) d1c0e4413d
bpo-44852: Support filtering over warnings without a set message (GH-27793)
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 05:10:10 -07:00
Miss Islington (bot) 3f81e9628f
bpo-44698: Restore complex pow behaviour for small integral exponents (GH-27772) (GH-27796)
(cherry picked from commit 4b9a2dcf19)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-08-17 18:38:03 +01:00
Łukasz Langa bc98f98132
[3.10] bpo-44852: Support ignoring specific DeprecationWarnings wholesale in regrtest (GH-27634) (GH-27784)
(cherry picked from commit a0a6d39295)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-17 12:01:00 +02:00
Miss Islington (bot) 6f6648e436
bpo-38956: don't print BooleanOptionalAction's default twice (GH-27672)
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 02:40:41 -07:00
Miss Islington (bot) 1960409a6d
bpo-44895: skip test_no_hang_on_context_chain_cycle2 until the refleak is fixed (GH-27761)
(cherry picked from commit 62bc716fde)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-08-16 02:01:14 -07:00
Miss Islington (bot) 6d134864d6
Added test case based on recommended test cases from RFC 4648 (GH-27747)
(cherry picked from commit 230403a6a1)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-08-13 04:15:27 -07:00
Miss Islington (bot) 45a97d91a4
bpo-44891: Tests `id` preserving on `* 1` for `str` and `bytes` (GH-27745)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit a2ce538e16)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-08-13 04:04:08 -07:00
Miss Islington (bot) ebc5926234
bpo-44895: Temporarily add an extra gc.collect() call (GH-27746)
This is part of an investigation of a non-deterministic reference leak. While we're looking for the root cause, this is included temporarily so that CI doesn't fail on this particular issue. This enables it to find other regressions in the meantime, which would otherwise be shadowed by our known issue.
(cherry picked from commit 7bf28cbb4b)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-08-13 03:21:26 -07:00
Benjamin Peterson ef36dfe4de
[3.10] bpo-33930: Fix typo in the test name. (GH-27736)
[bpo-33930](): Fix typo in the test name. (GH-27733)
(cherry picked from commit f08e6d1bb3)

Automerge-Triggered-By: GH:benjaminp
2021-08-13 02:45:13 -07:00
Pablo Galindo Salgado c28c2e1cb0
[3.10] bpo-44885: Correct the ast locations of f-strings with format specs and repeated expressions (GH-27729) (GH-27743)
(cherry picked from commit 8e832fb2a2)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-12 17:41:21 +01:00
Miss Islington (bot) 5d444434ad
bpo-26228: Fix pty EOF handling (GH-12049) (GH-27732)
On non-Linux POSIX platforms, like FreeBSD or macOS,
the FD used to read a forked PTY may signal its exit not
by raising an error but by sending empty data to the read
syscall. This case wasn't handled, leading to hanging
`pty.spawn` calls.

Co-authored-by: Reilly Tucker Siemens <reilly@tuckersiemens.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 81ab8db235)

Co-authored-by: Zephyr Shannon <geoffpshannon@gmail.com>
2021-08-12 14:36:04 +02:00
Miss Islington (bot) d6d2d54997
bpo-33930: Fix segfault with deep recursion when cleaning method objects (GH-27678) (GH-27719)
(cherry picked from commit bfc2d5a5c4)

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

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-08-10 07:31:00 -07:00
Miss Islington (bot) d86bbe3cff
bpo-25782: avoid hang in PyErr_SetObject when current exception has a cycle in its context chain (GH-27626)
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 06:47:23 -07:00
Miss Islington (bot) a3185da26f
bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631)
(cherry picked from commit b33186bc43)

Co-authored-by: Johannes Reiff <mail@jreiff.de>
2021-08-09 16:44:17 -07:00
Miss Islington (bot) d5c8ad2471
bpo-32695: Docs and tests for compresslevel and preset kwargs in tarfile (GH-21470)
Co-Authored-By: Bo Bayles <bbayles@gmail.com>
(cherry picked from commit eb2d4a66ff)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2021-08-09 03:30:30 -07:00