]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-37596: Clean up the set/frozenset marshalling code (GH-28068)
Brandt Bucher [Tue, 31 Aug 2021 16:18:33 +0000 (09:18 -0700)] 
bpo-37596: Clean up the set/frozenset marshalling code (GH-28068)

4 years agobpo-45061: Detect Py_DECREF(Py_True) bug (GH-28089)
Victor Stinner [Tue, 31 Aug 2021 16:05:15 +0000 (18:05 +0200)] 
bpo-45061: Detect Py_DECREF(Py_True) bug (GH-28089)

Add a deallocator to the bool type to detect refcount bugs in C
extensions which call Py_DECREF(Py_True) or Py_DECREF(Py_False) by
mistake.

4 years agobpo-44135: [docs] Fix inline markup (GH-28095)
Ken Jin [Tue, 31 Aug 2021 16:01:17 +0000 (00:01 +0800)] 
bpo-44135: [docs] Fix inline markup (GH-28095)

4 years agobpo-45061: Enhance faulthandler traceback wit no Python frame (GH-28090)
Victor Stinner [Tue, 31 Aug 2021 15:34:29 +0000 (17:34 +0200)] 
bpo-45061: Enhance faulthandler traceback wit no Python frame (GH-28090)

Fix indentation of <no Python frame> message in a faulthandler
traceback or a Fatal Python error traceback. Example:

Current thread 0x00007f03896fb740 (most recent call first):
  Garbage-collecting
  <no Python frame>

4 years agobpo-45060: Get rid of few uses of the equality operators with None (GH-28087)
Serhiy Storchaka [Tue, 31 Aug 2021 13:59:52 +0000 (16:59 +0300)] 
bpo-45060: Get rid of few uses of the equality operators with None (GH-28087)

4 years agobpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193)
Zack Kneupper [Tue, 31 Aug 2021 13:39:19 +0000 (09:39 -0400)] 
bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193)

Co-authored-by: Zachary Kneupper <zachary.kneupper@gmail.com>
4 years agobpo-42064: Offset arguments for PyObject_Vectorcall in the _sqlite module (GH-27931)
Petr Viktorin [Tue, 31 Aug 2021 12:34:44 +0000 (14:34 +0200)] 
bpo-42064: Offset arguments for PyObject_Vectorcall in the _sqlite module (GH-27931)

This allows e.g. methods to be called efficiently by providing
space for a "self" argument; see PY_VECTORCALL_ARGUMENTS_OFFSET docs.

4 years agobpo-44991: Make GIL handling more explicit in `sqlite3` callbacks (GH-27934)
Erlend Egeberg Aasland [Tue, 31 Aug 2021 12:18:43 +0000 (14:18 +0200)] 
bpo-44991: Make GIL handling more explicit in `sqlite3` callbacks (GH-27934)

- acquire the GIL at the very start[1]
- release the GIL at the very end

[1] The trace callback performs a sanity check before acquiring the GIL

Automerge-Triggered-By: GH:encukou
4 years agobpo-44925: [docs] Fix confusing deprecation notice for typing.IO (GH-28004)
DonnaDia [Tue, 31 Aug 2021 09:44:27 +0000 (12:44 +0300)] 
bpo-44925: [docs] Fix confusing deprecation notice for typing.IO (GH-28004)

4 years agobpo-39218: Improve accuracy of variance calculation (GH-27960)
Raymond Hettinger [Tue, 31 Aug 2021 01:57:30 +0000 (20:57 -0500)] 
bpo-39218: Improve accuracy of variance calculation (GH-27960)

4 years agobpo-45019: Add a tool to generate list of modules to include for frozen modules ...
Eric Snow [Mon, 30 Aug 2021 23:25:11 +0000 (17:25 -0600)] 
bpo-45019: Add a tool to generate list of modules to include for frozen modules (gh-27980)

Frozen modules must be added to several files in order to work properly. Before this change this had to be done manually. Here we add a tool to generate the relevant lines in those files instead. This helps us avoid mistakes and omissions.

https://bugs.python.org/issue45019

4 years agobpo-44756: Remove misleading NEWS entries of a change that was reverted before releas...
Łukasz Langa [Mon, 30 Aug 2021 21:54:47 +0000 (23:54 +0200)] 
bpo-44756: Remove misleading NEWS entries of a change that was reverted before release (GH-28075)

4 years agobpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074)
Erlend Egeberg Aasland [Mon, 30 Aug 2021 21:14:27 +0000 (23:14 +0200)] 
bpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074)

4 years agobpo-16379: expose SQLite error codes and error names in `sqlite3` (GH-27786)
Erlend Egeberg Aasland [Mon, 30 Aug 2021 18:32:21 +0000 (20:32 +0200)] 
bpo-16379: expose SQLite error codes and error names in `sqlite3` (GH-27786)

4 years agobpo-43398: Add test for defect connection factories (GH-27966)
Erlend Egeberg Aasland [Mon, 30 Aug 2021 17:49:34 +0000 (19:49 +0200)] 
bpo-43398: Add test for defect connection factories (GH-27966)

4 years agobpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006)
Serhiy Storchaka [Mon, 30 Aug 2021 16:25:59 +0000 (19:25 +0300)] 
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.

4 years agobpo-41620: TestCase.run() now always return a TestResult instance (GH-28030)
Serhiy Storchaka [Mon, 30 Aug 2021 13:16:25 +0000 (16:16 +0300)] 
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>
4 years agobpo-45007: Update multissl to openssl 1.1.1l as well (GH-28044)
Łukasz Langa [Mon, 30 Aug 2021 12:24:51 +0000 (14:24 +0200)] 
bpo-45007: Update multissl to openssl 1.1.1l as well (GH-28044)

This was missed while upgrading CI.

4 years agobpo-45045: Optimize mapping patterns of structural pattern matching (GH-28043)
Dong-hee Na [Mon, 30 Aug 2021 10:02:32 +0000 (10:02 +0000)] 
bpo-45045: Optimize mapping patterns of structural pattern matching (GH-28043)

4 years agobpo 45007: Update macOS installer builds to use OpenSSL 1.1.1l. (GH-28051)
Ned Deily [Mon, 30 Aug 2021 07:10:21 +0000 (03:10 -0400)] 
bpo 45007: Update macOS installer builds to use OpenSSL 1.1.1l. (GH-28051)

4 years agobpo-44689: ctypes.util.find_library() now finds macOS 11+ system libraries when built...
Tobias Bergkvist [Mon, 30 Aug 2021 06:55:47 +0000 (08:55 +0200)] 
bpo-44689: ctypes.util.find_library() now finds macOS 11+ system libraries when built on older macOS systems (#27251)

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.

4 years agobpo-45007: Update to OpenSSL 1.1.1l in Windows build and CI (GH-28009)
Steve Dower [Sun, 29 Aug 2021 14:18:57 +0000 (15:18 +0100)] 
bpo-45007: Update to OpenSSL 1.1.1l in Windows build and CI (GH-28009)

4 years agobpo-43124: Fix smtplib multiple CRLF injection (GH-25987)
Miguel Brito [Sun, 29 Aug 2021 14:10:50 +0000 (15:10 +0100)] 
bpo-43124: Fix smtplib multiple CRLF injection (GH-25987)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-44394: Update libexpat copy to 2.4.1 (GH-26945)
Victor Stinner [Sun, 29 Aug 2021 14:08:24 +0000 (16:08 +0200)] 
bpo-44394: Update libexpat copy to 2.4.1 (GH-26945)

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>
4 years agobpo-42278: Use tempfile.TemporaryDirectory rather than tempfile.mktemp in pydoc ...
E-Paine [Sun, 29 Aug 2021 11:07:51 +0000 (12:07 +0100)] 
bpo-42278: Use tempfile.TemporaryDirectory rather than tempfile.mktemp in pydoc (GH-23200)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005)
Serhiy Storchaka [Sun, 29 Aug 2021 11:04:40 +0000 (14:04 +0300)] 
bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005)

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.