Commit graph

108787 commits

Author SHA1 Message Date
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
Miss Islington (bot)
ca27109c17
[doc] Link to deprecation policy PEP from the DeprecationWarning documentation (GH-28123) (GH-28124)
(cherry picked from commit a7ef15aae8)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-02 17:14:11 +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)
2280bc1163
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:24:48 -07:00
Miss Islington (bot)
c1db759879
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:53:42 -07:00
Łukasz Langa
5f66ad09ff
bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193) (GH-28094)
This is a quasi-backport to 3.9 since the wording in this branch is different.

Co-authored-by: Zachary Kneupper zachary.kneupper@gmail.com
2021-08-31 18:00:16 +02:00
Łukasz Langa
9ab2b48f2b
Post 3.9.7 2021-08-30 23:55:37 +02:00
Łukasz Langa
9ef1843892
bpo-44756: Remove misleading NEWS entries of a change that was reverted before release (GH-28075)
They are misleading because the first one is in Tools/Demos and the other one
is in Documentation so it's not easy to tell the revert happened.
2021-08-30 23:08:20 +02:00
Łukasz Langa
1016ef3790
Python 3.9.7 2021-08-30 21:02:15 +02:00
Serhiy Storchaka
9827710a40
[3.9] bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) (GH-28071)
* 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 19:22:21 +02:00
Miss Islington (bot)
720aef48b5
bpo-44449: faulthandler don't modify frame refcnt (GH-27850)
Fix a crash in the signal handler of the faulthandler module: no
longer modify the reference count of frame objects.
(cherry picked from commit fe997e1a67)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-08-30 06:56:03 -07:00
Miss Islington (bot)
0c5e0aa73f
bpo-41620: TestCase.run() now always return a TestResult instance (GH-28030) (GH-28065)
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 15:42:34 +02:00
Christian Heimes
576803d7a8
[3.9] bpo-45007: Update multissl to openssl 1.1.1l as well (GH-28044) (GH-28062)
This was missed while upgrading CI..
(cherry picked from commit d6cb5dd9e1)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-30 15:07:55 +02:00
Miss Islington (bot)
4b55837e7c
bpo-44689: ctypes.util.find_library() now finds macOS 11+ system libraries when built on older macOS systems (GH-27251) (GH-28053)
Previously, when built on older macOS systems, `find_library` was not able to find macOS system libraries when running on Big Sur due to changes in how system libraries are stored.
(cherry picked from commit 71853a7302)

Co-authored-by: Tobias Bergkvist <tobias@bergkv.ist>
2021-08-30 11:08:16 +02:00
Miss Islington (bot)
d0f94ab014
bpo 45007: Update macOS installer builds to use OpenSSL 1.1.1l. (GH-28051)
(cherry picked from commit 94b2639fad)

Co-authored-by: Ned Deily <nad@python.org>
2021-08-30 00:36:02 -07:00
Łukasz Langa
5720bcac7b
[3.9] bpo-45007: Update to OpenSSL 1.1.1l in Windows build and CI (GH-28009) (GH-28040)
(cherry picked from commit d3bdbbf9a4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2021-08-29 17:07:45 +02: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
Miss Islington (bot)
007221a43e
bpo-44394: Update libexpat copy to 2.4.1 (GH-26945) (GH-28032)
Update the vendored copy of libexpat to 2.4.1 (from 2.2.8) to get the
fix for the CVE-2013-0340 "Billion Laughs" vulnerability. This copy
is most used on Windows and macOS.

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

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-08-29 16:36:36 +02:00
Miss Islington (bot)
45409518c1
bpo-42278: Use tempfile.TemporaryDirectory rather than tempfile.mktemp in pydoc (GH-23200) (GH-28025)
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 14:56:45 +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
dab74d68e3
[3.9] bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) (GH-28023)
(cherry picked from commit 07d3d54)
2021-08-29 14:03:11 +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)
166ad70606
bpo-44962: Fix a race in WeakKeyDict, WeakValueDict and WeakSet when two threads attempt to commit the last pending removal (GH-27921) (GH-28014)
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 20:54:48 +02:00
Miss Islington (bot)
399cd466d0
bpo-45022: Pin current libffi build to fixed version in preparation for upcoming update (GH-27982)
Also improve the build script for libffi, which is not used as part of the regular build.
(cherry picked from commit 969ae7f735)

Co-authored-by: Steve Dower <steve.dower@python.org>
2021-08-27 09:28:30 -07:00
Miss Islington (bot)
2351ff2c8f
Fix typo in a comment in Modules/_ssl.c: s/validata/validate/ (GH-27993) (GH-27998)
(cherry picked from commit 28db1f61f2)

Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
2021-08-27 13:59:23 +02:00
Miss Islington (bot)
9500dd5144
bpo-44997: macOS does not support loadable SQLite extensions (GH-27979) (GH-27995)
Authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
(cherry picked from commit 2ec9428e35)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-08-27 13:36:17 +02: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)
f1e3fc4631
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:55:22 -07: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)
46970fdd8d
bpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951) (GH-27962)
(cherry picked from commit 806e25fd31)

Co-authored-by: Objectivitix <79152594+Objectivitix@users.noreply.github.com>
2021-08-26 10:03:18 +03:00
Erlend Egeberg Aasland
0ec17a2494
[3.9] bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922) (GH-27952)
(cherry picked from commit 7903a10963)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-08-25 20:26:28 +01:00
Erlend Egeberg Aasland
52702e8ba0
[3.9] bpo-27334: roll back transaction if sqlite3 context manager fails to commit (GH-26202) (GH-27944) 2021-08-25 20:02:25 +01: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)
834a2eb945
[doc] Fix typo c-api/exceptions.rst (GH-27847) (GH-27919)
Co-authored-by: Tianqing Peng <pengtianqing@yimian.com.cn>
(cherry picked from commit dcbf7ff6a7)

Co-authored-by: Sunny Bean <ptq008@gmail.com>
2021-08-23 22:09:52 +02:00
Miss Islington (bot)
28de5622ab
[doc] Added mailing list link for comp.lang.python (GH-27852) (GH-27916)
(cherry picked from commit 7b550dfce6)

Co-authored-by: Mike Smith <mikesmith@screamingjoypad.com>
2021-08-23 21:24:12 +02: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)
7543e7fc26
[doc] Fix typo in idle.rst (GH-27903)
intially -> initially
(cherry picked from commit 0e8695ece0)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
2021-08-23 10:57:05 -07:00
Łukasz Langa
ac87b07a10
[3.9] bpo-4442: Document use of __new__ for subclasses of immutable types (GH-27866) (GH-27900)
(cherry picked from commit eec340ea3a)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-08-22 22:14:25 +02:00
Łukasz Langa
c579f0ba62
[3.9] bpo-42560: rework external references in Tkinter docs (GH-27838) (GH-27896)
- reorganized from two sections (tkinter vs. tcl/tk) into three (tkinter, tcl/tk, and books)
- main (recommended) tkinter docs have one tutorial (tkdocs) and one reference (shipman), added better descriptions
- dropped link to Tkinter page on wiki (suggestion by E. Paine; outdated, most material already linked to from python.org)
- replaced Tcl/Tk recent man pages and core dev home with single link to main Tcl/Tk page (which holds both of these)
- updated Modern Tkinter link to book page on TkDocs site (was Amazon link to old version), dropped description
- replaced Grayson book by Moore book (newer, covers ttk)
- changed Ousterhout ref to second edition, covers ttk
- dropped link to Welch book (old).
(cherry picked from commit d1049d1d6b)

Co-authored-by: Mark Roseman <mark@markroseman.com>
2021-08-22 21:06:06 +02:00
Miss Islington (bot)
986750be5c
bpo-42560: reorganize Tkinter docs modules section for clarity (GH-27840) (GH-27895)
- move description of internal modules (_tkinter and tkinter.constants) from section intro to list of additional modules at end of section, as not most important info
- added missing ttk and tix here
- emphasized up front that most apps will need tkinter and ttk
(cherry picked from commit d5dbe8bca7)

Co-authored-by: Mark Roseman <mark@markroseman.com>
2021-08-22 21:05:46 +02:00
Miss Islington (bot)
e74cf8667d
bpo-42560: tweaks to intro of Tkinter docs- add macOS, drop ActiveState (GH-27835) (GH-27892)
(cherry picked from commit 141c7a4fce)

Co-authored-by: Mark Roseman <mark@markroseman.com>
2021-08-22 21:02:12 +02:00
Miss Islington (bot)
d006392245
bpo-44940: Clarify the documentation of re.findall() (GH-27849) (GH-27880)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Vedran Čačić <vedgar+github@gmail.com>
(cherry picked from commit 64f9e7b19d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-22 21:15:38 +03:00
Miss Islington (bot)
4e5162fd36
bpo-44955: Always call stopTestRun() for implicitly created TestResult objects (GH-27831) (GH-27882)
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 21:15:10 +03:00
Miss Islington (bot)
407b3e0bb0
bpo-44966: Fix out-of-date traceback message (GH-27867) (GH-27876) 2021-08-21 19:36:54 -05: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