Commit Graph

27484 Commits

Author SHA1 Message Date
Miss Islington (bot) 1cb17be3e6
bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540) (GH-28609)
(cherry picked from commit e046aabbe3)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-28 23:56:52 +02:00
Miss Islington (bot) fd52afd192
bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595)
(cherry picked from commit 84975146a7)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-09-28 05:56:52 -07:00
Miss Islington (bot) 38c67738c6
bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549)
Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.
(cherry picked from commit 95d3137082)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-27 14:39:35 -07:00
Miss Islington (bot) c7fdd6879b
bpo-45249: Ensure the traceback module prints correctly syntax errors with ranges (GH-28575)
(cherry picked from commit 20f439b6b9)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-09-27 14:26:39 -07:00
Miss Islington (bot) 9e209d48ca
bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator expression in function calls (GH-28576)
(cherry picked from commit e5f13ce5b4)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-09-27 07:05:20 -07:00
Miss Islington (bot) d452b2963b
bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559) (GH-28571)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
(cherry picked from commit f56268a2cd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-26 19:09:50 +02:00
Miss Islington (bot) d312b8516e
bpo-45166: fixes `get_type_hints` failure on `Final` (GH-28279) (GH-28560)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 784905dbef)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-25 11:21:13 +02:00
Łukasz Langa 8c1e1da565
[3.10] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28511)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 8f943ca257)

Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
2021-09-22 01:33:59 +02:00
Miss Islington (bot) c800e39094
[tests] Add missing assert against expected tracebacks in test_exceptions.py (GH-28484) (GH-28510)
(cherry picked from commit a007347100)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-09-22 00:38:59 +02:00
Miss Islington (bot) 41d48bc038
bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421) (GH-28508)
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:14:40 +02:00
Miss Islington (bot) 09e5016f8b
bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing (GH-28377)
(cherry picked from commit f604cf1c37)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-21 11:19:48 -07:00
Miss Islington (bot) d0d83a9431
[3.10] bpo-45021: Fix a hang in forked children (GH-28007) (GH-28480)
_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:52:23 -07:00
Miss Islington (bot) 74c6acc76f
bpo-45229: Make pickle tests discoverable (GH-28467) (GH-28478)
(cherry picked from commit e6ba992288)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-20 18:19:31 +02:00
Miss Islington (bot) 3d16fc90ce
bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466)
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 01:47:58 -07:00
Miss Islington (bot) 697b6650ed
Docs: Clarify the before_and_after() example (GH-28458) (#28464)
(cherry picked from commit fcbf9b176b)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-09-19 20:53:37 -05:00
Miss Islington (bot) 0e96086805
bpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387)
(cherry picked from commit 1d42408495)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-19 16:13:04 -07:00
Serhiy Storchaka bedce3538c
[3.10] bpo-45229: Remove test_main in many tests (GH-28405) (GH-28455)
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-19 22:36:03 +03:00
Miss Islington (bot) 6e4101add5
bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) (GH-28442) 2021-09-18 01:47:16 -05:00
Brett Cannon e1bdecb6dc
[3.10] bpo-45183: don't raise an exception when calling zipimport.zipimporter.find_spec() when the zip file is missing and the internal cache has been reset (GH-28435) (#28438)
This can occur when the zip file gets deleted, you call zipimport.zipimporter.invalidate_cache(), and then try to use zipimport.zipimporter.find_spec() (i.e. you left the zip file path on sys.path).
(cherry picked from commit 209b7035f7)

Co-authored-by: Brett Cannon <brett@python.org>
2021-09-17 17:46:22 -07:00
Miss Islington (bot) 21711d5341
bpo-45187: Fix dangling threads in test_socket.CreateServerFunctionalTest (GH-28422)
(cherry picked from commit 51ebb7f4f5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-17 12:16:03 -07:00
Miss Islington (bot) 5a5684a14b
bpo-45187: Collect test_socket tests using unittest (GH-28317)
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 03:34:46 -07:00
Serhiy Storchaka ce59ac9362
[3.10] bpo-45212: Fix dangling threads in skipped tests in test_socket (GH-28361) (GH-28409)
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:28 +03:00
Miss Islington (bot) de4c9c0bdc
bpo-45167: Fix deepcopying of GenericAlias (GH-28324) (GH-28367)
(cherry picked from commit 5dce51a887)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-15 21:35:16 +02:00
Miss Islington (bot) 17000b5a80
bpo-45205: Make test_compileall quiet (GH-28356) (GH-28370)
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:31:59 +02:00
Miss Islington (bot) bbaf5c27e6
bpo-45207: Make test_gdb.test_pycfunction() quiet (GH-28355) (GH-28365)
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:10:33 +02:00
Miss Islington (bot) 0e4f913da8
bpo-45208: Make test_pdb.test_checkline_is_not_executable() quiet (GH-28354) (GH-28363)
test_pdb.test_checkline_is_not_executable() no longer writes output
to stdout.

Remove also unused variables 'f'.
(cherry picked from commit e08e491a6c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-15 20:56:32 +02:00
Miss Islington (bot) ececa53b7f
bpo-45195: Fix test_readline.test_nonascii() (GH-28329) (GH-28333)
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:49 +02:00
Miss Islington (bot) be200c3c6e
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:58:19 -07:00
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
Mark Shannon 762ef85f44
bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656) (#27673)
(cherry picked from commit b854557b49)
2021-08-09 10:54:48 +01:00
Miss Islington (bot) 66dd1a0e64
bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633) (GH-27640) 2021-08-06 15:11:44 -05:00
Miss Islington (bot) a5d9963276
bpo-40928: notify users running test_decimal on macOS of malloc warnings (GH-26783)
* 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 10:09:06 -07:00
Miss Islington (bot) 36a2497093
bpo-44524: Fix an issue wherein `_GenericAlias._name` was not properly set for specialforms (GH-27614)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 8bdf12e99a)

Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
2021-08-06 10:08:27 -07:00
Miss Islington (bot) a11158ecef
bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065)
The threading debug (PYTHONTHREADDEBUG environment variable) is
deprecated in Python 3.10 and will be removed in Python 3.12. This
feature requires a debug build of Python.
(cherry picked from commit 4d77691172)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-08-06 04:32:37 -07:00
Pablo Galindo Salgado b1bd16c252
[3.10] bpo-44838: Refine the custom syntax errors for invalid 'if' expressions (GH-27615). (GH-27616)
…

(cherry picked from commit f5cbea6b1b)

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

Automerge-Triggered-By: GH:lysnikolaou
2021-08-05 11:00:19 -07:00
Miss Islington (bot) 536e35ae6a
bpo-44801: Check arguments in substitution of ParamSpec in Callable (GH-27585)
(cherry picked from commit 3875a69547)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-04 13:36:01 -07:00
Miss Islington (bot) bc2841c7a9
bpo-44808: fixes test for interactive inspect getsource of a class (GH-27571)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 58325971de)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-08-03 06:07:59 -07:00
Miss Islington (bot) 8ce7f2f4ef
bpo-39091: Fix segfault when Exception constructor returns non-exception for gen.throw. (GH-17658) (GH-27572)
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:38 +02:00
Pablo Galindo cc115e5bf6
Python 3.10.0rc1 2021-08-02 20:53:59 +01:00
Miss Islington (bot) 567176249e
bpo-44792: Improve syntax errors for if expressions (GH-27506) (GH-27565)
(cherry picked from commit 28b6dc9dd5)

Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
2021-08-02 20:05:33 +01:00
Miss Islington (bot) aa7266854a
bpo-44785: Silence deprecation warnings in test_pickle (GH-27538)
(cherry picked from commit 36d952d228)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-02 10:09:05 -07:00
Miss Islington (bot) 2cc19a5463
bpo-44806: Fix __init__ in subclasses of protocols (GH-27545)
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 10:08:59 -07:00
Miss Islington (bot) a1eaa74d9d
bpo-44808: Fix test_inspect in refleak mode (GH-27544)
(cherry picked from commit 626d397cc1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-02 06:41:08 -07:00
Miss Islington (bot) 33a4010198
bpo-44667: Treat correctly lines ending with comments and no newlines in the Python tokenizer (GH-27499) (GH-27500)
(cherry picked from commit b6bde9fc42)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-02 11:43:45 +02:00
Miss Islington (bot) c8db292012
bpo-44793: Fix checking the number of arguments when subscribe a generic type with ParamSpec parameter. (GH-27515)
For example Callable[P, T][[int], str, float] will now raise an error.

Use also term "arguments" instead of "parameters" in error
message for too few/many arguments.
(cherry picked from commit f92b9133ef)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-02 00:08:24 -07:00
Miss Islington (bot) 21d5897982
bpo-44784: Apply changes from importlib_metadata 4.6.3 (GH-27508) (#27510)
Addressing issues with tests under error on warnings.

Automerge-Triggered-By: GH:jaraco
(cherry picked from commit 1cf8424a62)

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-07-31 23:01:38 -04:00
Miss Islington (bot) 35035bc35a
bpo-34013: Don't consider a grouped expression when reporting legacy print syntax errors (GH-27521)
(cherry picked from commit 208a7e957b)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-31 18:31:44 -07:00
Miss Islington (bot) 76903ff9ce
bpo-44794: Merge tests for typing.Callable and collection.abc.Callable (GH-27507)
(cherry picked from commit be4cb9089a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-31 10:25:22 -07:00
Miss Islington (bot) f468ede4a2
bpo-44648: Fix error type in inspect.getsource() in interactive session (GH-27171) (GH-27495)
(cherry picked from commit 48a62559df)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-07-30 19:46:42 +02:00
Miss Islington (bot) 440c9f772a
bpo-43625: Enhance csv sniffer has_headers() to be more accurate (GH-26939) (GH-27494)
(cherry picked from commit ceea579ccc)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-07-30 19:30:09 +02:00
Miss Islington (bot) 6f950023c6
bpo-42892: fix email multipart attribute error (GH-26903) (GH-27492)
(cherry picked from commit e3f877c32d)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-07-30 19:27:06 +02:00