Commit graph

26892 commits

Author SHA1 Message Date
Miss Islington (bot)
09390c837a
bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) (GH-28507)
This was a regression from fixing BPO-43219.
(cherry picked from commit b7eac52b46)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-09-22 00:21:10 +02:00
Miss Islington (bot)
65268ab849
bpo-45209: fix UserWarning: resource_tracker in test_multiprocessing (GH-28377) (GH-28500)
(cherry picked from commit f604cf1c37)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-21 20:37:04 +02:00
Miss Islington (bot)
b06c3b3647
[3.9] bpo-45021: Fix a hang in forked children (GH-28007) (GH-28481)
_global_shutdown_lock should be reinitialized in forked children
(cherry picked from commit 0bfa1106ac)


Co-authored-by: nullptr <3621629+0x0L@users.noreply.github.com>

Automerge-Triggered-By: GH:gpshead
2021-09-20 11:54:24 -07:00
Miss Islington (bot)
04dea46dde
bpo-45229: Make pickle tests discoverable (GH-28467) (GH-28479)
(cherry picked from commit e6ba992288)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-20 18:19:49 +02:00
Miss Islington (bot)
29e431419a
bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466) (GH-28471)
Calling Py_InitializeFromConfig()+Py_RunMain() multiple times must
not crash.

Cleanup also test_get_argc_argv().
(cherry picked from commit 5e2c32e08e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-20 17:51:32 +02:00
Serhiy Storchaka
5822ab672a
[3.9] bpo-45229: Remove test_main in many tests (GH-28405) (GH-28456)
Instead of explicitly enumerate test classes for run_unittest()
use the unittest ability to discover tests. This also makes these
tests discoverable and runnable with unittest.

load_tests() can be used for dynamic generating tests and adding
doctests. setUpModule(), tearDownModule() and addModuleCleanup()
can be used for running code before and after all module tests..
(cherry picked from commit 40348acc18)
2021-09-20 09:34:52 +03:00
Miss Islington (bot)
a18d52269a
bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) (GH-28443) 2021-09-18 01:47:41 -05:00
Miss Islington (bot)
6c50f23ae0
bpo-45187: Fix dangling threads in test_socket.CreateServerFunctionalTest (GH-28422) (GH-28424)
(cherry picked from commit 51ebb7f4f5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-17 22:40:33 +03:00
Łukasz Langa
0f4449ecb0
[3.9] bpo-45187: Collect test_socket tests using unittest (GH-28317) (GH-28413)
Previously, test classes ISOTPTest, J1939Test, BasicUDPLITETest and
UDPLITETimeoutTest were not included in the list of tests and
were not run by regrtest..
(cherry picked from commit 0361335b80)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-17 14:48:54 +03:00
Serhiy Storchaka
10c3cf7851
[3.9] bpo-45212: Fix dangling threads in skipped tests in test_socket (GH-28361) (GH-28408)
tearDown() is not called if setUp() raises an exception
(including SkipTest). addCleanup() should be used for guaranteed
execution of the cleanup code.
(cherry picked from commit 7dacb70485)
2021-09-17 13:11:50 +03:00
Victor Stinner
471b3811fe
bpo-45208: Make test_pdb.test_checkline_is_not_executable() quiet (GH-28354) (GH-28381)
test_pdb.test_checkline_is_not_executable() no longer writes output
to stdout.

Remove also unused variables 'f'.

(cherry picked from commit e08e491a6c)
2021-09-16 09:53:02 +02:00
Miss Islington (bot)
9443ce4eed
bpo-45205: Make test_compileall quiet (GH-28356) (GH-28364)
Make test_compileall quiet: test_year_2038_mtime_compilation() and
test_larger_than_32_bit_times() of test_compileall no longer log
"Compiling ..." messages to stdout.
(cherry picked from commit cc057ff522)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-15 21:33:52 +02:00
Miss Islington (bot)
2746045a37
bpo-45167: Fix deepcopying of GenericAlias (GH-28324) (GH-28368)
(cherry picked from commit 5dce51a887)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-15 21:31:14 +02:00
Miss Islington (bot)
1c70efcbb5
bpo-45207: Make test_gdb.test_pycfunction() quiet (GH-28355) (GH-28366)
test_gdb.test_pycfunction() now ignores gdb stderr, it no longer logs
messages like:

    Function "meth_varargs" not defined.
(cherry picked from commit 84a6061e29)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-15 21:11:21 +02:00
Miss Islington (bot)
4ce55cceb2
bpo-45195: Fix test_readline.test_nonascii() (GH-28329) (GH-28334)
Fix test_readline.test_nonascii(): sometimes, the newline character
is not written at the end, so don't expect it in the output.
(cherry picked from commit 797c8eb9ef)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-15 14:38:57 +02:00
Miss Islington (bot)
9ccdc90488
bpo-45196: prevent unittest crash on address sanitizer builds (GH-28331)
(cherry picked from commit b668cdfa09)

Co-authored-by: junyixie <xiejunyi.arch@bytedance.com>
2021-09-14 11:54:27 -07:00
Miss Islington (bot)
9cd8fb8d63
bpo-35474: Fix mimetypes.guess_all_extensions() potentially mutating list (GH-28286) (GH-28290)
* 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:08 +02:00
Serhiy Storchaka
a328a13b70
[3.9] bpo-45097: Fix deprecation warnings in test_asyncio (GH-28236) 2021-09-08 17:59:40 +02:00
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