Commit graph

47261 commits

Author SHA1 Message Date
Miss Islington (bot)
6ae97bbf4e
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-29 12:37:42 +01:00
Łukasz Langa
b09a68ac87
[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-29 12:36:59 +01:00
Miss Islington (bot)
0a74d33e14
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-29 12:31:16 +01:00
Miss Islington (bot)
e1eb03d15f
bpo-45216: Remove extraneous method docs from difflib (GH-28445) (GH-28505)
(cherry picked from commit 06e1773c8d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-09-29 12:31:00 +01:00
Miss Islington (bot)
7d652c1b7a
bpo-30951: Correct co_names docstring in inspect module (GH-2743) (GH-28543)
(cherry picked from commit 3f8b23f8dd)

Co-authored-by: Alex Vig <jalexvig@gmail.com>
2021-09-29 12:29:57 +01:00
Miss Islington (bot)
3397e3192c
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 22:01:00 +01:00
Miss Islington (bot)
e0b61b2864
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 23:42:19 +01:00
Miss Islington (bot)
76611038bc
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-20 00:32:30 +01:00
Miss Islington (bot)
db762a9b21
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-19 20:18:41 +01:00
Miss Islington (bot)
7f2d049cce
bpo-45193: Restore IDLE completion boxes on Ubuntu (GH-28343)
The line that should not have been needed on macOS tk 8.6.8 but was,
should not be a problem on Ubuntu, but is.  It is not needed on macOS
tk 8.6.11, installed with 3.10.  Disable it but leave it for
now in case some system needs it.
(cherry picked from commit 1afc7b3219)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-09-19 19:52:34 +01: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
Pablo Galindo
839d789394
Python 3.10.0rc2 2021-09-07 14:18:28 +01:00
Miss Islington (bot)
608a629236
bpo-44860: Make sysconfig posix_user not depend on platlibdir (GH-27655) (GH-28197)
(cherry picked from commit a5c6bcf244)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2021-09-07 12:20:31 +01: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)
af8c781737
Update idlelib/help.html to include idle.rst spelling fix (GH-28191)
The idle.rst fix was GH-27903 two weeks ago.
(cherry picked from commit f05ad92028)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-09-06 21:26:48 -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)
8342c526e9
bpo-45102: unittest: add tests for skipping and errors in cleanup (GH-28166)
(cherry picked from commit 28264269de)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-05 00:55:35 -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)
0f274cb2d7
bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102)
(cherry picked from commit 22fe0eb13c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-08-31 12:21:28 -07:00
Miss Islington (bot)
337c8adf31
bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086)
(cherry picked from commit 54f100514b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-31 10:50:42 -07:00
Miss Islington (bot)
d65fad04fa
bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006)
* Functions registered with addModuleCleanup() were not called unless
  the user defines tearDownModule() in their test module.
* Functions registered with addClassCleanup() were not called if
  tearDownClass is set to None.
* Buffering in TestResult did not work with functions registered
  with addClassCleanup() and addModuleCleanup().
* Errors in functions registered with addClassCleanup() and
  addModuleCleanup() were not handled correctly in buffered and
  debug modes.
* Errors in setUpModule() and functions registered with
  addModuleCleanup() were reported in wrong order.
* And several lesser bugs.
(cherry picked from commit 08d9e597c8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-30 10:38:34 -07:00
Miss Islington (bot)
243b8de0b1
bpo-41620: TestCase.run() now always return a TestResult instance (GH-28030)
Previously it returned None if the test class or method was
decorated with a skipping decorator.

Co-authored-by: Iman Tabrizian <iman.tabrizian@gmail.com>
(cherry picked from commit 7e246a3a7b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-30 06:43:38 -07: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)
532ebba6c8
bpo-42278: Use tempfile.TemporaryDirectory rather than tempfile.mktemp in pydoc (GH-23200)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit c9227df5a9)

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
2021-08-29 05:57:22 -07:00
Miss Islington (bot)
a49398b643
bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
(cherry picked from commit 07d3d54f4e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-29 03:43:48 -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
Erlend Egeberg Aasland
2a80893e5c
[3.10] bpo-27334: roll back transaction if sqlite3 context manager fails to commit (GH-26202) (GH-27943) 2021-08-28 19:26:00 +01: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)
8aa64cc45b
bpo-44962: Fix a race in WeakKeyDict, WeakValueDict and WeakSet when two threads attempt to commit the last pending removal (GH-27921)
Fixes:
Traceback (most recent call last):
  File "/home/graingert/projects/asyncio-demo/demo.py", line 36, in <module>
    sys.exit(main())
  File "/home/graingert/projects/asyncio-demo/demo.py", line 30, in main
    test_all_tasks_threading()
  File "/home/graingert/projects/asyncio-demo/demo.py", line 24, in test_all_tasks_threading
    results.append(f.result())
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 438, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.10/asyncio/runners.py", line 47, in run
    _cancel_all_tasks(loop)
  File "/usr/lib/python3.10/asyncio/runners.py", line 56, in _cancel_all_tasks
    to_cancel = tasks.all_tasks(loop)
  File "/usr/lib/python3.10/asyncio/tasks.py", line 53, in all_tasks
    tasks = list(_all_tasks)
  File "/usr/lib/python3.10/_weakrefset.py", line 60, in __iter__
    with _IterationGuard(self):
  File "/usr/lib/python3.10/_weakrefset.py", line 33, in __exit__
    w._commit_removals()
  File "/usr/lib/python3.10/_weakrefset.py", line 57, in _commit_removals
    discard(l.pop())
IndexError: pop from empty list

Also fixes:
Exception ignored in: weakref callback <function WeakKeyDictionary.__init__.<locals>.remove at 0x00007fe82245d2e0>
Traceback (most recent call last):
  File "/usr/lib/pypy3/lib-python/3/weakref.py", line 390, in remove
    del self.data[k]
KeyError: <weakref at 0x00007fe76e8d8180; dead>
Exception ignored in: weakref callback <function WeakKeyDictionary.__init__.<locals>.remove at 0x00007fe82245d2e0>
Traceback (most recent call last):
  File "/usr/lib/pypy3/lib-python/3/weakref.py", line 390, in remove
    del self.data[k]
KeyError: <weakref at 0x00007fe76e8d81a0; dead>
Exception ignored in: weakref callback <function WeakKeyDictionary.__init__.<locals>.remove at 0x00007fe82245d2e0>
Traceback (most recent call last):
  File "/usr/lib/pypy3/lib-python/3/weakref.py", line 390, in remove
    del self.data[k]
KeyError: <weakref at 0x000056548f1e24a0; dead>

See: https://github.com/agronholm/anyio/issues/362GH-issuecomment-904424310
See also: https://bugs.python.org/issue29519

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 206b21ed9f)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2021-08-28 11:09:21 -07:00
Miss Islington (bot)
719af92e10
bpo-40635: Fix getfqdn() docstring and docs (GH-27971)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit fdcb675eed)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-08-26 12:54:52 -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)
d63114caf9
bpo-44955: Always call stopTestRun() for implicitly created TestResult objects (GH-27831)
Method stopTestRun() is now always called in pair with method startTestRun()
for TestResult objects implicitly created in TestCase.run().
Previously it was not called for test methods and classes decorated with
a skipping decorator.
(cherry picked from commit a9640d7553)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-22 00:55:34 -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