]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
Serhiy Storchaka [Sun, 29 Aug 2021 10:07:40 +0000 (13:07 +0300)] 
bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)

4 years agobpo-25130: Make unit-test about restricting the maximum number of nested blocks cpyth...
Carl Friedrich Bolz-Tereick [Sat, 28 Aug 2021 18:33:50 +0000 (20:33 +0200)] 
bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002)

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.

4 years agobpo-44962: Fix a race in WeakKeyDict, WeakValueDict and WeakSet when two threads...
Thomas Grainger [Sat, 28 Aug 2021 17:07:37 +0000 (18:07 +0100)] 
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/362#issuecomment-904424310
See also: https://bugs.python.org/issue29519

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agoFix typo in a comment in Modules/_ssl.c: s/validata/validate/ (GH-27993)
Adam Dangoor [Fri, 27 Aug 2021 11:38:24 +0000 (12:38 +0100)] 
Fix typo in a comment in Modules/_ssl.c: s/validata/validate/ (GH-27993)

4 years agoRefine specialization stats (GH-27992)
Mark Shannon [Fri, 27 Aug 2021 11:01:22 +0000 (12:01 +0100)] 
Refine specialization stats (GH-27992)

4 years agobpo-44997: macOS does not support loadable SQLite extensions (GH-27979)
Erlend Egeberg Aasland [Fri, 27 Aug 2021 10:59:07 +0000 (12:59 +0200)] 
bpo-44997: macOS does not support loadable SQLite extensions (GH-27979)

Authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
4 years agobpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938)
chilaxan [Fri, 27 Aug 2021 10:27:19 +0000 (06:27 -0400)] 
bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agoUpdate ACKS (GH-27988)
Soumendra Ganguly [Fri, 27 Aug 2021 09:35:07 +0000 (04:35 -0500)] 
Update ACKS (GH-27988)

4 years agobpo-44945: Specialize BINARY_ADD (GH-27967)
Mark Shannon [Fri, 27 Aug 2021 08:21:01 +0000 (09:21 +0100)] 
bpo-44945: Specialize BINARY_ADD (GH-27967)

4 years agobpo-41818: ++ termios versionadded markers. (GH-27987)
Gregory P. Smith [Fri, 27 Aug 2021 03:29:27 +0000 (20:29 -0700)] 
bpo-41818: ++ termios versionadded markers. (GH-27987)

overlooked in https://github.com/python/cpython/pull/23686

4 years agobpo-41818: Add termios.tcgetwinsize(), termios.tcsetwinsize(). (GH-23686)
Soumendra Ganguly [Fri, 27 Aug 2021 02:56:26 +0000 (21:56 -0500)] 
bpo-41818: Add termios.tcgetwinsize(), termios.tcsetwinsize(). (GH-23686)

* Add termios.tcgetwinsize(), termios.tcsetwinsize(). Update docs.
* Add TIOCGSIZE support to termios.tcgetwinsize()
* Add TIOCSSIZE support to termios.tcsetwinsize()

Authored-by: Soumendra Ganguly <soumendraganguly@gmail.com>
* termios.tcgetwinsize() and termios.tcsetwinsize() should return/accept two-item tuples instead of lists.
* Refactor tcsetwinsize to share common code and accept any two item sequence, with overflow checking.

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
4 years agobpo-45022: Pin current libffi build to fixed version in preparation for upcoming...
Steve Dower [Thu, 26 Aug 2021 23:57:00 +0000 (00:57 +0100)] 
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.

4 years agobpo-40635: Fix getfqdn() docstring and docs (GH-27971)
andrei kulakov [Thu, 26 Aug 2021 18:40:28 +0000 (14:40 -0400)] 
bpo-40635: Fix getfqdn() docstring and docs (GH-27971)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-45010: Remove support of special method __div__ in unittest.mock (GH-27965)
Serhiy Storchaka [Thu, 26 Aug 2021 18:19:47 +0000 (21:19 +0300)] 
bpo-45010: Remove support of special method __div__ in unittest.mock (GH-27965)

4 years agobpo-45001: Make email date parsing more robust against malformed input (GH-27946)
wouter bolsterlee [Thu, 26 Aug 2021 14:49:03 +0000 (14:49 +0000)] 
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.

4 years agobpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)
Serhiy Storchaka [Thu, 26 Aug 2021 12:48:24 +0000 (15:48 +0300)] 
bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-44967: pydoc: return non-zero exit code when query is not found (GH-27868)
Gregory Anders [Thu, 26 Aug 2021 12:22:02 +0000 (06:22 -0600)] 
bpo-44967: pydoc: return non-zero exit code when query is not found (GH-27868)

4 years agobpo-42238: [doc] Some more make suspicious false positives. (GH-27945)
Julien Palard [Thu, 26 Aug 2021 08:45:01 +0000 (10:45 +0200)] 
bpo-42238: [doc] Some more make suspicious false positives. (GH-27945)

4 years agobpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951)
Objectivitix [Thu, 26 Aug 2021 05:49:02 +0000 (02:49 -0300)] 
bpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951)

4 years agobpo-45000: Update whatsnews about deleting __debug__ (GH-27956)
Dong-hee Na [Thu, 26 Aug 2021 00:36:16 +0000 (00:36 +0000)] 
bpo-45000: Update whatsnews about deleting __debug__ (GH-27956)

4 years agobpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922)
Erlend Egeberg Aasland [Wed, 25 Aug 2021 19:03:11 +0000 (21:03 +0200)] 
bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922)

4 years agobpo-44524: Don't modify MRO when inheriting from typing.Annotated (GH-27841)
Ken Jin [Wed, 25 Aug 2021 18:13:59 +0000 (02:13 +0800)] 
bpo-44524: Don't modify MRO when inheriting from typing.Annotated (GH-27841)

4 years agobpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947)
Dong-hee Na [Wed, 25 Aug 2021 17:54:20 +0000 (17:54 +0000)] 
bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947)

Automerge-Triggered-By: GH:pablogsal
4 years agobpo-44929: [Enum] Fix global repr (GH-27789)
Pablo Galindo Salgado [Wed, 25 Aug 2021 14:24:32 +0000 (15:24 +0100)] 
bpo-44929: [Enum] Fix global repr (GH-27789)

* Fix typo in __repr__ code

* Add more tests for global int flag reprs

* use last module if multi-module string
  - when an enum's `__module__` contains several module names, only
     use the last one

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
4 years agobpo-27334: Fix reference leak introduced by GH-26202 (GH-27942)
Erlend Egeberg Aasland [Wed, 25 Aug 2021 13:57:54 +0000 (15:57 +0200)] 
bpo-27334: Fix reference leak introduced by GH-26202 (GH-27942)

4 years agobpo-44946: Streamline operators and creation of ints for common case of single 'digit...
Mark Shannon [Wed, 25 Aug 2021 13:28:43 +0000 (14:28 +0100)] 
bpo-44946: Streamline operators and creation of ints for common case of single 'digit'. (GH-27832)

4 years agobpo-44990: Change layout of evaluation frames. "Layout B" (GH-27933)
Mark Shannon [Wed, 25 Aug 2021 12:44:20 +0000 (13:44 +0100)] 
bpo-44990: Change layout of evaluation frames. "Layout B" (GH-27933)

Places the locals between the specials and stack. This is the more "natural" layout for a C struct, makes the code simpler and gives a slight speedup (~1%)

4 years agoFormat the Python-tokenize module and fix exit path (GH-27935)
Pablo Galindo Salgado [Wed, 25 Aug 2021 12:41:14 +0000 (13:41 +0100)] 
Format the Python-tokenize module and fix exit path (GH-27935)

4 years agobpo-37596: Make `set` and `frozenset` marshalling deterministic (GH-27926)
Brandt Bucher [Wed, 25 Aug 2021 11:14:34 +0000 (04:14 -0700)] 
bpo-37596: Make `set` and `frozenset` marshalling deterministic (GH-27926)

4 years agobpo-27334: roll back transaction if sqlite3 context manager fails to commit (GH-26202)
Erlend Egeberg Aasland [Wed, 25 Aug 2021 10:59:42 +0000 (12:59 +0200)] 
bpo-27334: roll back transaction if sqlite3 context manager fails to commit (GH-26202)

Co-authored-by: Luca Citi
Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
4 years agobpo-44976: Lazy creation of sqlite3 result rows (GH-27884)
Erlend Egeberg Aasland [Wed, 25 Aug 2021 10:28:47 +0000 (12:28 +0200)] 
bpo-44976: Lazy creation of sqlite3 result rows (GH-27884)

4 years agobpo-39452: Rewrite and expand __main__.rst (#26883)
Jack DeVries [Tue, 24 Aug 2021 17:01:41 +0000 (13:01 -0400)] 
bpo-39452: Rewrite and expand __main__.rst (#26883)

Broadened scope of the document to explicitly discuss and differentiate between ``__main__.py`` in packages versus the ``__name__ == '__main__'`` expression (and the idioms that surround it), as well as ``import __main__``.

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
Co-authored-by: Éric Araujo <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agoAdd tests for the C tokenizer and expose it as a private module (GH-27924)
Pablo Galindo Salgado [Tue, 24 Aug 2021 16:50:05 +0000 (17:50 +0100)] 
Add tests for the C tokenizer and expose it as a private module (GH-27924)

4 years agobpo-42064: Pass module state to `sqlite3` UDF callbacks (GH-27456)
Erlend Egeberg Aasland [Tue, 24 Aug 2021 12:24:09 +0000 (14:24 +0200)] 
bpo-42064: Pass module state to `sqlite3` UDF callbacks (GH-27456)

- Establish common callback context struct
- Convert UDF callbacks to fetch module state from callback context

4 years agobpo-43826: Fix resource warning due to unclosed objects. (GH-25381)
Karthikeyan Singaravelan [Tue, 24 Aug 2021 10:43:46 +0000 (16:13 +0530)] 
bpo-43826: Fix resource warning due to unclosed objects. (GH-25381)

4 years agobpo-34990: Treat the pyc header's mtime in compileall as an unsigned int (GH-19708)
Ammar Askar [Tue, 24 Aug 2021 09:13:32 +0000 (05:13 -0400)] 
bpo-34990: Treat the pyc header's mtime in compileall as an unsigned int (GH-19708)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
4 years agobpo-44690: Adopt binacii.a2b_base64's strict mode in base64.b64decode (GH-27272)
Idan Moral [Mon, 23 Aug 2021 23:44:28 +0000 (02:44 +0300)] 
bpo-44690: Adopt binacii.a2b_base64's strict mode in base64.b64decode (GH-27272)

* Use binascii.a2b_base64 to validate b64decode input.
   This change leads to exception messages changes (mostly).
* Added more information to docstring of b64decode
* Added a reference to binascii.a2b_base64 in the docs

4 years agobpo-42560: simplify/merge architecture info in Tkinter docs (GH-27839)
Mark Roseman [Mon, 23 Aug 2021 19:27:47 +0000 (12:27 -0700)] 
bpo-42560: simplify/merge architecture info in Tkinter docs (GH-27839)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
4 years ago[doc] Fix typo c-api/exceptions.rst (GH-27847)
Sunny Bean [Mon, 23 Aug 2021 19:17:40 +0000 (03:17 +0800)] 
[doc] Fix typo c-api/exceptions.rst (GH-27847)

Co-authored-by: Tianqing Peng <pengtianqing@yimian.com.cn>
4 years ago[doc] Added mailing list link for comp.lang.python (GH-27852)
Mike Smith [Mon, 23 Aug 2021 19:15:52 +0000 (20:15 +0100)] 
[doc] Added mailing list link for comp.lang.python (GH-27852)

4 years agobpo-42560: add warning to Tkinter docs about outdated pre-8.5 documentation online...
Mark Roseman [Mon, 23 Aug 2021 19:00:47 +0000 (12:00 -0700)] 
bpo-42560: add warning to Tkinter docs about outdated pre-8.5 documentation online (GH-27836)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
4 years agobpo-44980: fix test_constructor to return None value (GH-27898)
andrei kulakov [Mon, 23 Aug 2021 18:50:46 +0000 (14:50 -0400)] 
bpo-44980: fix test_constructor to return None value (GH-27898)

4 years agobpo-42560: rewrite of Tkinter docs "life preserver" (GH-27842)
Mark Roseman [Mon, 23 Aug 2021 18:30:53 +0000 (11:30 -0700)] 
bpo-42560: rewrite of Tkinter docs "life preserver" (GH-27842)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)
Serhiy Storchaka [Mon, 23 Aug 2021 18:05:07 +0000 (21:05 +0300)] 
bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)

Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL).

4 years agobpo-38291: Update 3.10 WhatsNew with typing.{io|re} DeprecationWarning (GH-27872)
Ken Jin [Mon, 23 Aug 2021 17:13:51 +0000 (01:13 +0800)] 
bpo-38291: Update 3.10 WhatsNew with typing.{io|re} DeprecationWarning (GH-27872)

4 years ago[doc] Fix typo in idle.rst (GH-27903)
Ikko Ashimine [Mon, 23 Aug 2021 17:12:33 +0000 (02:12 +0900)] 
[doc] Fix typo in idle.rst (GH-27903)

intially -> initially

4 years agoFix bytes.__bytes__ to not truncate at a zero byte (GH-27902)
Mark Dickinson [Mon, 23 Aug 2021 14:24:12 +0000 (15:24 +0100)] 
Fix bytes.__bytes__ to not truncate at a zero byte (GH-27902)

4 years agobpo-24234: Implement bytes.__bytes__ (GH-27901)
Dong-hee Na [Mon, 23 Aug 2021 10:01:51 +0000 (10:01 +0000)] 
bpo-24234: Implement bytes.__bytes__ (GH-27901)

4 years agobpo-24234: implement complex.__complex__ (GH-27887)
Mark Dickinson [Mon, 23 Aug 2021 08:15:49 +0000 (09:15 +0100)] 
bpo-24234: implement complex.__complex__ (GH-27887)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
4 years agobpo-4442: Document use of __new__ for subclasses of immutable types (GH-27866)
Raymond Hettinger [Sun, 22 Aug 2021 19:27:06 +0000 (14:27 -0500)] 
bpo-4442:  Document use of __new__ for subclasses of immutable types (GH-27866)

4 years agobpo-44957: Promote PEP 604 syntax in typing docs (GH-27833)
Sebastian Rittau [Sun, 22 Aug 2021 18:45:01 +0000 (20:45 +0200)] 
bpo-44957: Promote PEP 604 syntax in typing docs (GH-27833)

* Use "X | Y" instead of "Union" where it makes sense.
* Mention that "X | Y" is equivalent to "Union[X, Y]" in Union section.
* Remove "Optional[X]" as shorthand for "Union[X, None]" as the new
  shorthand is now "X | None".
* Mention that "Optional[X]" can be written as "X | None" in section
  about "Optional".

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
4 years ago bpo-42560: reorganize Tkinter docs modules section for clarity (GH-27840)
Mark Roseman [Sun, 22 Aug 2021 18:41:45 +0000 (11:41 -0700)] 
 bpo-42560: reorganize Tkinter docs modules section for clarity (GH-27840)

- 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

4 years agobpo-42560: tweaks to intro of Tkinter docs- add macOS, drop ActiveState (GH-27835)
Mark Roseman [Sun, 22 Aug 2021 18:35:22 +0000 (11:35 -0700)] 
bpo-42560: tweaks to intro of Tkinter docs- add macOS, drop ActiveState (GH-27835)

4 years agobpo-42560: rework external references in Tkinter docs (GH-27838)
Mark Roseman [Sun, 22 Aug 2021 18:34:15 +0000 (11:34 -0700)] 
bpo-42560: rework external references in Tkinter docs (GH-27838)

- 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)

4 years agobpo-41322: Add unit tests for deprecation of test return values (GH-27846)
andrei kulakov [Sun, 22 Aug 2021 18:32:45 +0000 (14:32 -0400)] 
bpo-41322: Add unit tests for deprecation of test return values (GH-27846)

Also fix the traceback of warnings.

4 years agoRemove unused UNKNOWN macros from cursor.h and prepare_protocol.h (GH-27885)
Erlend Egeberg Aasland [Sun, 22 Aug 2021 13:23:45 +0000 (15:23 +0200)] 
Remove unused UNKNOWN macros from cursor.h and prepare_protocol.h (GH-27885)

4 years agobpo-44978: allow Argument Clinic to handle __complex__ special methods (GH-27886)
Mark Dickinson [Sun, 22 Aug 2021 12:13:26 +0000 (13:13 +0100)] 
bpo-44978: allow Argument Clinic to handle __complex__ special methods (GH-27886)

4 years agobpo-44955: Always call stopTestRun() for implicitly created TestResult objects (GH...
Serhiy Storchaka [Sun, 22 Aug 2021 07:33:52 +0000 (10:33 +0300)] 
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.

4 years agobpo-44940: Clarify the documentation of re.findall() (GH-27849)
Serhiy Storchaka [Sun, 22 Aug 2021 07:24:20 +0000 (10:24 +0300)] 
bpo-44940: Clarify the documentation of re.findall() (GH-27849)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Vedran Čačić <vedgar+github@gmail.com>
4 years agobpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870)
Serhiy Storchaka [Sat, 21 Aug 2021 20:09:08 +0000 (23:09 +0300)] 
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.

4 years agobpo-44966: Fix out-of-date traceback message (GH-27867)
Raymond Hettinger [Sat, 21 Aug 2021 18:59:18 +0000 (13:59 -0500)] 
bpo-44966: Fix out-of-date traceback message (GH-27867)

4 years agobpo-44965: Early exit for non-DML statements in sqlite3.Cursor.executemany() (GH...
Erlend Egeberg Aasland [Sat, 21 Aug 2021 18:58:58 +0000 (20:58 +0200)] 
bpo-44965: Early exit for non-DML statements in sqlite3.Cursor.executemany() (GH-27865)

4 years agobpo-44524: Do not set _name of _SpecialForm without need (GH-27861)
Serhiy Storchaka [Sat, 21 Aug 2021 06:47:59 +0000 (09:47 +0300)] 
bpo-44524: Do not set _name of _SpecialForm without need (GH-27861)

Because setting non-empty _name affects behavior of other code.

In most cases __name__ can be derived from __origin__.__name__.

4 years agobpo-44926: `get_type_hints`: Add note about type aliases with forward refs (#27859)
Maximilian Hils [Fri, 20 Aug 2021 14:36:51 +0000 (16:36 +0200)] 
bpo-44926: `get_type_hints`: Add note about type aliases with forward refs (#27859)

4 years agobpo-44960: add regression test for geometric_mean with mixed int/floa… (#27856)
Irit Katriel [Fri, 20 Aug 2021 13:08:21 +0000 (14:08 +0100)] 
bpo-44960: add regression test for geometric_mean with mixed int/floa… (#27856)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
4 years agobpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) 27858/head
Mark Dickinson [Fri, 20 Aug 2021 10:40:11 +0000 (11:40 +0100)] 
bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834)

4 years agoFix reST markup in dataclasses.rst (GH-27843)
Jean-Abou-Samra [Thu, 19 Aug 2021 20:47:16 +0000 (22:47 +0200)] 
Fix reST markup in dataclasses.rst (GH-27843)

The signature of field() had an extraneous colon at the end, causing it
to appear all bold and without the module name.

4 years agobpo-41322: added deprecation warning for tests returning value!=None (GH-27748)
andrei kulakov [Thu, 19 Aug 2021 09:41:04 +0000 (05:41 -0400)] 
bpo-41322: added deprecation warning for tests returning value!=None (GH-27748)

4 years agobpo-36384: [doc] Mention CVE-2021-29921 fix in 3.8.12 (GH-27824)
Łukasz Langa [Thu, 19 Aug 2021 08:55:49 +0000 (10:55 +0200)] 
bpo-36384: [doc] Mention CVE-2021-29921 fix in 3.8.12 (GH-27824)

4 years agobpo-44830: [doc] Restore missing Mozilla devguide link (GH-27818)
Jack DeVries [Thu, 19 Aug 2021 08:10:54 +0000 (04:10 -0400)] 
bpo-44830: [doc] Restore missing Mozilla devguide link (GH-27818)

4 years agobpo-44079: Strip superfluous statement cache from sqlite3.Connection (GH-25998)
Erlend Egeberg Aasland [Wed, 18 Aug 2021 23:37:53 +0000 (01:37 +0200)] 
bpo-44079: Strip superfluous statement cache from sqlite3.Connection (GH-25998)

4 years agobpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814)
Pablo Galindo Salgado [Wed, 18 Aug 2021 20:09:21 +0000 (21:09 +0100)] 
bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814)

4 years agobpo-44874: deprecate Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END (GH-27693)
Irit Katriel [Wed, 18 Aug 2021 19:50:19 +0000 (20:50 +0100)] 
bpo-44874: deprecate Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END (GH-27693)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-44524: Fix cryptic TypeError message when trying to subclass special forms in...
Yurii Karabas [Wed, 18 Aug 2021 19:08:32 +0000 (22:08 +0300)] 
bpo-44524: Fix cryptic TypeError message when trying to subclass special forms in `typing` (GH-27710)

This was a Python 3.9 regression.

4 years agobpo-44949: Fix test_readline auto history tests (#27813)
Victor Stinner [Wed, 18 Aug 2021 17:38:54 +0000 (19:38 +0200)] 
bpo-44949: Fix test_readline auto history tests (#27813)

4 years agobpo-44852: Support filtering over warnings without a set message (GH-27793)
Łukasz Langa [Wed, 18 Aug 2021 11:19:30 +0000 (13:19 +0200)] 
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.

4 years agobpo-44508: [Doc] Document failure mode for loop.call_soon_threadsafe (GH-27688)
meowmeowmeowcat [Tue, 17 Aug 2021 22:55:04 +0000 (06:55 +0800)] 
bpo-44508: [Doc] Document failure mode for loop.call_soon_threadsafe (GH-27688)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agointroduce omitted index default before using it (GH-27775)
Jefferson Oliveira [Tue, 17 Aug 2021 21:19:03 +0000 (18:19 -0300)] 
introduce omitted index default before using it (GH-27775)

4 years agobpo-44935: enable posix_spawn() on Solaris (GH-27795)
Jakub Kulík [Tue, 17 Aug 2021 18:09:48 +0000 (20:09 +0200)] 
bpo-44935: enable posix_spawn() on Solaris (GH-27795)

Enable posix_spawn() on Solaris

4 years agobpo-44698: Restore complex pow behaviour for small integral exponents (GH-27772)
Mark Dickinson [Tue, 17 Aug 2021 16:51:28 +0000 (17:51 +0100)] 
bpo-44698: Restore complex pow behaviour for small integral exponents (GH-27772)

4 years agobpo-44895: Introduce PYTHONDUMPREFSFILE variable for refcount dumping (GH-27767)
Dong-hee Na [Tue, 17 Aug 2021 15:52:50 +0000 (15:52 +0000)] 
bpo-44895: Introduce PYTHONDUMPREFSFILE variable for refcount dumping (GH-27767)

4 years agobpo-44889: Specialize LOAD_METHOD with PEP 659 adaptive interpreter (GH-27722)
Ken Jin [Tue, 17 Aug 2021 14:55:55 +0000 (22:55 +0800)] 
bpo-44889: Specialize LOAD_METHOD with PEP 659 adaptive interpreter (GH-27722)

Adds four new instructions:

* LOAD_METHOD_ADAPTIVE
* LOAD_METHOD_CACHED
* LOAD_METHOD_MODULE
* LOAD_METHOD_CLASS

4 years agobpo-42035: Enhance test_get_type_name() of _testcapi (GH-27649)
Hai Shi [Tue, 17 Aug 2021 14:50:33 +0000 (22:50 +0800)] 
bpo-42035: Enhance test_get_type_name() of _testcapi (GH-27649)

4 years agobpo-42035: Add PyType_GetQualName() to get a type's qualified name. (GH-27551)
Hai Shi [Tue, 17 Aug 2021 13:39:34 +0000 (21:39 +0800)] 
bpo-42035: Add PyType_GetQualName() to get a type's qualified name. (GH-27551)

4 years agobpo-44903: Removed othergui.rst and list of GUI frameworks (GH-27762)
Gautam Chaudhuri [Tue, 17 Aug 2021 09:00:58 +0000 (10:00 +0100)] 
bpo-44903: Removed othergui.rst and list of GUI frameworks (GH-27762)

4 years agobpo-38956: don't print BooleanOptionalAction's default twice (GH-27672)
Maximilian Hils [Mon, 16 Aug 2021 21:42:21 +0000 (23:42 +0200)] 
bpo-38956: don't print BooleanOptionalAction's default twice (GH-27672)

Co-authored-by: Micky Yun Chan <michan@redhat.com>
4 years agobpo-44914: Add tests for some invariants of tp_version_tag (GH-27774)
Ken Jin [Mon, 16 Aug 2021 19:18:36 +0000 (03:18 +0800)] 
bpo-44914: Add tests for some invariants of tp_version_tag (GH-27774)

4 years agoFix a SystemError in code.replace() (#27771)
Guido van Rossum [Mon, 16 Aug 2021 18:34:23 +0000 (11:34 -0700)] 
Fix a SystemError in code.replace() (#27771)

While the comment said 'We don't bother resizing localspluskinds',
this would cause .replace() to crash when it happened.
(Also types.CodeType(), but testing that is tedious, and this tests all
code paths.)

4 years agobpo-44852: Support ignoring specific DeprecationWarnings wholesale in regrtest (GH...
Łukasz Langa [Mon, 16 Aug 2021 18:13:51 +0000 (20:13 +0200)] 
bpo-44852: Support ignoring specific DeprecationWarnings wholesale in regrtest (GH-27634)

4 years agobpo-44900: Add five superinstructions. (GH-27741)
Mark Shannon [Mon, 16 Aug 2021 11:23:13 +0000 (12:23 +0100)] 
bpo-44900: Add five superinstructions. (GH-27741)

* LOAD_FAST LOAD_FAST
* STORE_FAST LOAD_FAST
* LOAD_FAST LOAD_CONST
* LOAD_CONST LOAD_FAST
* STORE_FAST STORE_FAST

4 years agobpo-44914: Maintain invariants of type version tags. (GH-27773)
Mark Shannon [Mon, 16 Aug 2021 11:21:34 +0000 (12:21 +0100)] 
bpo-44914: Maintain invariants of type version tags. (GH-27773)

* Do not invalidate type versions unnecessarily.

4 years agobpo-44895: skip test_no_hang_on_context_chain_cycle2 until the refleak is fixed ...
Irit Katriel [Mon, 16 Aug 2021 08:36:49 +0000 (09:36 +0100)] 
bpo-44895: skip test_no_hang_on_context_chain_cycle2 until the refleak is fixed (GH-27761)

4 years agobpo-44911: Fixed IsolatedAsyncioTestCase from throwing an exception on leaked tasks...
Bar Harel [Mon, 16 Aug 2021 08:21:08 +0000 (11:21 +0300)] 
bpo-44911: Fixed IsolatedAsyncioTestCase from throwing an exception on leaked tasks (GH-27765)

4 years agobpo-16580: [doc] Add examples to int.to_bytes and int.from_bytes (GH-27760)
Gautam Chaudhuri [Sun, 15 Aug 2021 11:29:05 +0000 (12:29 +0100)] 
bpo-16580: [doc] Add examples to int.to_bytes and int.from_bytes (GH-27760)

* added code equivs. for to_bytes and from_bytes

Based on woparry's patch[1] from the relevant issue thread[2].

[1]: https://bugs.python.org/file30372/issue16580.patch
[2]: https://bugs.python.org/issue16580

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
4 years agobpo-44907: Update error messages in tutorial examples (GH-27755)
meowmeowmeowcat [Fri, 13 Aug 2021 23:40:58 +0000 (07:40 +0800)] 
bpo-44907: Update error messages in tutorial examples (GH-27755)

4 years agobpo-30077: Add support for Apple aifc/sowt pseudo-compression (GH-24449)
dnknth [Fri, 13 Aug 2021 11:31:25 +0000 (13:31 +0200)] 
bpo-30077: Add support for Apple aifc/sowt pseudo-compression (GH-24449)

Co-authored-by: Toby Thurston <thurston@eml.cc>
4 years agobpo-36700: [doc] Update base64 RFC references to RFC 4648 (GH-27700)
andrei kulakov [Fri, 13 Aug 2021 10:58:55 +0000 (06:58 -0400)] 
bpo-36700: [doc] Update base64 RFC references to RFC 4648 (GH-27700)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-26228: [doc] Adapt PTY documentation updates from GH-4167 (GH-27754)
Łukasz Langa [Fri, 13 Aug 2021 10:57:07 +0000 (12:57 +0200)] 
bpo-26228: [doc] Adapt PTY documentation updates from GH-4167 (GH-27754)

Co-authored-by: Cornelius Diekmann <c.diekmann@googlemail.com>
4 years agoAdded test case based on recommended test cases from RFC 4648 (GH-27747)
andrei kulakov [Fri, 13 Aug 2021 10:50:37 +0000 (06:50 -0400)] 
Added test case based on recommended test cases from RFC 4648 (GH-27747)

4 years agobpo-44891: Tests `id` preserving on `* 1` for `str` and `bytes` (GH-27745)
Nikita Sobolev [Fri, 13 Aug 2021 10:36:22 +0000 (13:36 +0300)] 
bpo-44891: Tests `id` preserving on `* 1` for `str` and `bytes` (GH-27745)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>