]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-45020: Add tests for the -X "frozen_modules" option. (gh-28997)
Eric Snow [Mon, 25 Oct 2021 21:26:41 +0000 (15:26 -0600)] 
bpo-45020: Add tests for the -X "frozen_modules" option. (gh-28997)

We hadn't explicitly added any tests for this, so here they are.

https://bugs.python.org/issue45020

4 years agobpo-45548: FreeBSD doesn't like auto vars in makesetup (GH-29216)
Christian Heimes [Mon, 25 Oct 2021 18:52:55 +0000 (21:52 +0300)] 
bpo-45548: FreeBSD doesn't like auto vars in makesetup (GH-29216)

4 years agobpo-45548: Add missing extensions to Modules/Setup (GH-29199)
Christian Heimes [Mon, 25 Oct 2021 18:01:52 +0000 (21:01 +0300)] 
bpo-45548: Add missing extensions to Modules/Setup (GH-29199)

Adds _ctypes, _decimal, _multiprocessing, _posixshmem, _scproxy, _sqlite3,
and _uuid.

Use Makefile variables to build OpenSSL and TCL/TK modules.

Drop ``-lm`` from math lines. Extensions are always linked against libm.

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-45595: Make extensions depend on header files (GH-29198)
Christian Heimes [Mon, 25 Oct 2021 18:01:03 +0000 (21:01 +0300)] 
bpo-45595: Make extensions depend on header files (GH-29198)

``setup.py`` and ``makesetup`` now track build dependencies on all Python
header files and module specific header files.

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-45548: Remove checks for finite and gamma (GH-29206)
Christian Heimes [Mon, 25 Oct 2021 16:25:43 +0000 (19:25 +0300)] 
bpo-45548: Remove checks for finite and gamma (GH-29206)

4 years agobpo-45548: Remove _math.c workarounds for pre-C99 libm (GH-29179)
Christian Heimes [Mon, 25 Oct 2021 08:25:27 +0000 (11:25 +0300)] 
bpo-45548: Remove _math.c workarounds for pre-C99 libm (GH-29179)

The :mod:`math` and :mod:`cmath` implementation now require a C99 compatible
``libm`` and no longer ship with workarounds for missing acosh, asinh,
expm1, and log1p functions.

The changeset also removes ``_math.c`` and moves the last remaining
workaround into ``_math.h``. This simplifies static builds with
``Modules/Setup`` and resolves symbol conflicts.

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
Co-authored-by: Brett Cannon <brett@python.org>
Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-45530: speed listobject.c's unsafe_tuple_compare() (GH-29076)
Tim Peters [Mon, 25 Oct 2021 03:27:24 +0000 (22:27 -0500)] 
bpo-45530: speed listobject.c's unsafe_tuple_compare() (GH-29076)

Keep track of whether unsafe_tuple_compare() calls are resolved by the very
first tuple elements, and adjust strategy accordingly. This can significantly
cut the number of calls made to the full-blown PyObject_RichCompareBool(),
and especially when duplicates are rare.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-45566: `test_frozen_pickle` checks all `pickle` protocols (GH-29150)
Nikita Sobolev [Sun, 24 Oct 2021 13:06:32 +0000 (16:06 +0300)] 
bpo-45566: `test_frozen_pickle` checks all `pickle` protocols (GH-29150)

Refs https://github.com/python/cpython/pull/29147

Automerge-Triggered-By: GH:ericvsmith
4 years agoExpand about soft keywords in the docs for keyword.py (GH-29139)
William Andrea [Sat, 23 Oct 2021 16:24:02 +0000 (12:24 -0400)] 
Expand about soft keywords in the docs for keyword.py (GH-29139)

Add link at the top and fix the existing links to point to the "[soft keywords](https://docs.python.org/3.10/reference/lexical_analysis.html#soft-keywords)" section created in the Python 3.10 docs.

Changes should be backported to 3.10 as well.

4 years agobpo-45516: add protocol description to the TraversableResources documentation (#29173)
Filipe Laíns [Sat, 23 Oct 2021 15:47:55 +0000 (16:47 +0100)] 
bpo-45516: add protocol description to the TraversableResources documentation (#29173)

Signed-off-by: Filipe Laíns <lains@riseup.net>
4 years agobpo-45506: Normalize _PyPathConfig.stdlib_dir when calculated. (#29040)
Eric Snow [Fri, 22 Oct 2021 23:20:03 +0000 (17:20 -0600)] 
bpo-45506: Normalize _PyPathConfig.stdlib_dir when calculated. (#29040)

The recently added PyConfig.stdlib_dir was being set with ".." entries. When __file__ was added for from modules this caused a problem on out-of-tree builds. This PR fixes that by normalizing "stdlib_dir" when it is calculated in getpath.c.

https://bugs.python.org/issue45506

4 years agobpo-45292: [PEP 654] add the ExceptionGroup and BaseExceptionGroup classes (GH-28569)
Irit Katriel [Fri, 22 Oct 2021 23:13:46 +0000 (00:13 +0100)] 
bpo-45292: [PEP 654] add the ExceptionGroup and BaseExceptionGroup classes (GH-28569)

4 years agobpo-45574: fix warning about `print_escape` being unused (GH-29172)
Nikita Sobolev [Fri, 22 Oct 2021 21:57:24 +0000 (00:57 +0300)] 
bpo-45574: fix warning about `print_escape` being unused (GH-29172)

It used to be like this:
<img width="1232" alt="Снимок экрана 2021-10-22 в 23 07 40" src="https://user-images.githubusercontent.com/4660275/138516608-fef6ec01-a96a-40f4-81ef-52265b0f536b.png">

Quick `grep` tells that it is just used in one place under `Py_DEBUG`: https://github.com/python/cpython/blame/f6e8b80d20159596cf641305bad3a833bedd2f4f/Parser/tokenizer.c#L1047-L1051
<img width="752" alt="Снимок экрана 2021-10-22 в 23 08 09" src="https://user-images.githubusercontent.com/4660275/138516684-ea503136-1e92-48a5-95bb-419e190d5866.png">

I am not sure, but it also looks like a private thing, it should not affect other users.

Automerge-Triggered-By: GH:pablogsal
4 years agobpo-30570: Use Py_EnterRecursiveCall() in issubclass() (GH-29048)
Dennis Sweeney [Fri, 22 Oct 2021 21:24:08 +0000 (17:24 -0400)] 
bpo-30570: Use Py_EnterRecursiveCall() in issubclass() (GH-29048)

* Use Py_EnterRecursiveCall() in issubclass()

Reviewed-by: Gregory P. Smith <greg@krypto.org> [Google]
4 years agobpo-45571: use PY_CFLAGS_NODIST for shared Modules/Setup (GH-29161)
Christian Heimes [Fri, 22 Oct 2021 18:02:54 +0000 (21:02 +0300)] 
bpo-45571: use PY_CFLAGS_NODIST for shared Modules/Setup (GH-29161)

4 years agobpo-45570: Simplify setup macros for pyexpat (GH-29159)
Christian Heimes [Fri, 22 Oct 2021 16:28:23 +0000 (19:28 +0300)] 
bpo-45570: Simplify setup macros for pyexpat (GH-29159)

* ``HAVE_EXPAT_CONFIG_H`` is not used by our code and not used by
  system-wide expat header files
* ``USE_PYEXPAT_CAPI`` is no longer used by our code
* ``XML_POOR_ENTROPY`` should be defined in expat_config.h

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-45502: Fix test_shelve (GH-29003)
Serhiy Storchaka [Fri, 22 Oct 2021 14:14:58 +0000 (17:14 +0300)] 
bpo-45502: Fix test_shelve (GH-29003)

Run test_shelve with all underlying dbm implementations and pickle protocols.
Also make test_shelve discoverable.

4 years agobpo-43974: Move Py_BUILD_CORE_MODULE into module code (GH-29157)
Christian Heimes [Fri, 22 Oct 2021 13:36:28 +0000 (16:36 +0300)] 
bpo-43974: Move Py_BUILD_CORE_MODULE into module code (GH-29157)

setup.py no longer defines Py_BUILD_CORE_MODULE. Instead every
module defines the macro before #include "Python.h" unless
Py_BUILD_CORE_BUILTIN is already defined.

Py_BUILD_CORE_BUILTIN is defined for every module that is built by
Modules/Setup.

The PR also simplifies Modules/Setup. Makefile and makesetup
already define Py_BUILD_CORE_BUILTIN and include Modules/internal
for us.

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-45562: Only show debug output from the parser in debug builds (GH-29140)
Pablo Galindo Salgado [Fri, 22 Oct 2021 08:52:24 +0000 (09:52 +0100)] 
bpo-45562: Only show debug output from the parser in debug builds (GH-29140)

4 years agobpo-43795: Add a test for Stable ABI symbol availability using ctypes (GH-26354)
Petr Viktorin [Fri, 22 Oct 2021 08:12:06 +0000 (10:12 +0200)] 
bpo-43795: Add a test for Stable ABI symbol availability using ctypes (GH-26354)

This is a cross-platform check that the symbols are actually
exported in the ABI, not e.g. hidden in a macro.

Caveat: PyModule_Create2 & PyModule_FromDefAndSpec2 are skipped.

These aren't exported on some of our buildbots. This is a bug
(bpo-44133). This test now makes sure all the others don't regress.

4 years agobpo-43592: Raise RLIMIT_NOFILE in test.libregrtest (GH-29127)
Gregory P. Smith [Fri, 22 Oct 2021 01:22:25 +0000 (18:22 -0700)] 
bpo-43592: Raise RLIMIT_NOFILE in test.libregrtest (GH-29127)

Raise RLIMIT_NOFILE in test.libregrtest.

On macOS the default is often too low for our testsuite to succeed.

Co-authored by reviewer: Victor Stinner

4 years agobpo-45548: Make `Modules/Setup` easier to read (GH-29143)
Brett Cannon [Fri, 22 Oct 2021 00:07:26 +0000 (17:07 -0700)] 
bpo-45548: Make `Modules/Setup` easier to read (GH-29143)

4 years agobpo-29844: Remove obsolete paragraph from Tools/msi/README.txt (GH-29141)
Zachary Ware [Fri, 22 Oct 2021 00:02:12 +0000 (19:02 -0500)] 
bpo-29844: Remove obsolete paragraph from Tools/msi/README.txt (GH-29141)

4 years agobpo-43706: Use PEP 590 vectorcall to speed up enumerate() (GH-25154)
Dong-hee Na [Thu, 21 Oct 2021 23:20:43 +0000 (08:20 +0900)] 
bpo-43706: Use PEP 590 vectorcall to speed up enumerate() (GH-25154)

4 years agobpo-44019: Add test_all_exported_names for operator module (GH-29124)
Dong-hee Na [Thu, 21 Oct 2021 22:58:04 +0000 (07:58 +0900)] 
bpo-44019: Add test_all_exported_names for operator module (GH-29124)

4 years agobpo-44547: Make Fractions objects instances of typing.SupportsInt (GH-27851)
Mark Dickinson [Thu, 21 Oct 2021 22:09:47 +0000 (23:09 +0100)] 
bpo-44547: Make Fractions objects instances of typing.SupportsInt (GH-27851)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-41983: add availability info to socket docs (GH-27519)
andrei kulakov [Thu, 21 Oct 2021 21:13:37 +0000 (17:13 -0400)] 
bpo-41983: add availability info to socket docs (GH-27519)

* add availability info to AF_PACKET section

* add availability for AF_QIPCRTR as well

4 years agobpo-45526: obmalloc radix use 64 addr bits (GH-29062)
Neil Schemenauer [Thu, 21 Oct 2021 21:05:46 +0000 (14:05 -0700)] 
bpo-45526: obmalloc radix use 64 addr bits (GH-29062)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-44344: Document that pow can return a complex number for non-complex inputs....
Mark Dickinson [Thu, 21 Oct 2021 20:57:49 +0000 (21:57 +0100)] 
bpo-44344: Document that pow can return a complex number for non-complex inputs. (GH-27853)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-45557: Fix underscore_numbers in pprint.pprint(). (GH-29129)
Eric V. Smith [Thu, 21 Oct 2021 20:42:55 +0000 (16:42 -0400)] 
bpo-45557: Fix underscore_numbers in pprint.pprint(). (GH-29129)

4 years agoAdd workflow_dispatch trigger to GHA workflows (GH-27873)
Ryan Mast [Thu, 21 Oct 2021 20:34:18 +0000 (13:34 -0700)] 
Add workflow_dispatch trigger to GHA workflows (GH-27873)

4 years agobpo-45160: Ttk optionmenu only set variable once (GH-28291)
E-Paine [Thu, 21 Oct 2021 20:25:52 +0000 (21:25 +0100)] 
bpo-45160: Ttk optionmenu only set variable once (GH-28291)

4 years agoMove several typing tests to a proper class, refs GH-28563 (GH-29126)
Nikita Sobolev [Thu, 21 Oct 2021 20:16:50 +0000 (23:16 +0300)] 
Move several typing tests to a proper class, refs GH-28563 (GH-29126)

4 years agobpo-45521: Fix a bug in the obmalloc radix tree code. (GH-29051)
Neil Schemenauer [Thu, 21 Oct 2021 13:38:36 +0000 (06:38 -0700)] 
bpo-45521: Fix a bug in the obmalloc radix tree code. (GH-29051)

MAP_BOT_LENGTH was incorrectly used to compute MAP_TOP_MASK instead of
MAP_TOP_LENGTH. On 64-bit machines, the error causes the tree to hold
46-bits of virtual addresses, rather than the intended 48-bits.

4 years agobpo-45522: Allow to disable freelists on build time (GH-29056)
Christian Heimes [Thu, 21 Oct 2021 13:12:20 +0000 (16:12 +0300)] 
bpo-45522: Allow to disable freelists on build time (GH-29056)

Freelists for object structs can now be disabled. A new ``configure``
option ``--without-freelists`` can be used to disable all freelists
except empty tuple singleton. Internal Py*_MAXFREELIST macros can now
be defined as 0 without causing compiler warnings and segfaults.

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-34451: Document prompt and output toggle feature in html tutorial (GH-27105)
Thomas [Thu, 21 Oct 2021 10:19:20 +0000 (03:19 -0700)] 
bpo-34451: Document prompt and output toggle feature in html tutorial (GH-27105)

4 years agobpo-44019: Add operator.call() to __all__ for the operator module (GH-29110)
Kreus Amredes [Thu, 21 Oct 2021 10:05:36 +0000 (11:05 +0100)] 
bpo-44019: Add operator.call() to __all__ for the operator module (GH-29110)

4 years agobpo-45315: PyType_FromSpec: Copy spec->name and have the type own the memory for...
Petr Viktorin [Thu, 21 Oct 2021 09:46:20 +0000 (11:46 +0200)] 
bpo-45315: PyType_FromSpec: Copy spec->name and have the type own the memory for its name (GH-29103)

4 years agobpo-44220: Export PyStructSequence_UnnamedField in the limited API (GH-26331)
Ken Jin [Thu, 21 Oct 2021 08:46:48 +0000 (16:46 +0800)] 
bpo-44220: Export PyStructSequence_UnnamedField in the limited API (GH-26331)

4 years agobpo-44174: [Enum] add reference to name mangling (GH-29116)
Ethan Furman [Thu, 21 Oct 2021 03:32:11 +0000 (20:32 -0700)] 
bpo-44174: [Enum] add reference to name mangling (GH-29116)

4 years agobpo-45548: add some missing entries to `Modules/Setup` (GH-29115)
Brett Cannon [Thu, 21 Oct 2021 00:34:49 +0000 (17:34 -0700)] 
bpo-45548: add some missing entries to `Modules/Setup` (GH-29115)

Also remove a duplicate entry for `_weakref`.

4 years agobpo-35673: Add a public alias for namespace package __loader__ attribute (#29049)
Barry Warsaw [Wed, 20 Oct 2021 21:05:29 +0000 (14:05 -0700)] 
bpo-35673: Add a public alias for namespace package __loader__ attribute (#29049)

Rename namespace package __loader__ class to be public.

Make the old name, i.e. _NamespaceLoader, an alias for the public name, for backward compatibility.

4 years agobpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str...
Kyungmin Lee [Wed, 20 Oct 2021 19:54:41 +0000 (04:54 +0900)] 
bpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str (GH-28323)

An object implementing the os.PathLike protocol can represent a file
system path as a str or bytes object.
Therefore, _infer_return_type function should infer os.PathLike[str]
object as str type and os.PathLike[bytes] object as bytes type.

4 years agobpo-45527: Don't count cache hits, just misses. (GH-29092)
Mark Shannon [Wed, 20 Oct 2021 18:53:48 +0000 (19:53 +0100)] 
bpo-45527: Don't count cache hits, just misses. (GH-29092)

4 years agobpo-45320: Remove long-deprecated inspect methods (GH-28618)
Hugo van Kemenade [Wed, 20 Oct 2021 18:48:55 +0000 (21:48 +0300)] 
bpo-45320: Remove long-deprecated inspect methods (GH-28618)

4 years agobpo-41374: Remove obsolete exclusion of netinet/tcp.h on Cygwin (GH-21649)
Zackery Spytz [Wed, 20 Oct 2021 17:14:59 +0000 (10:14 -0700)] 
bpo-41374: Remove obsolete exclusion of netinet/tcp.h on Cygwin (GH-21649)

4 years agobpo-45532: Replace 'default' with 'main' as default in sys.version (GH-29100)
Jeong YunWon [Wed, 20 Oct 2021 17:09:03 +0000 (02:09 +0900)] 
bpo-45532: Replace 'default' with 'main' as default in sys.version (GH-29100)

4 years agobpo-45464: [doc] Explain that subclassing multiple exceptions is fragile (GH-29094)
Łukasz Langa [Wed, 20 Oct 2021 16:54:31 +0000 (18:54 +0200)] 
bpo-45464: [doc] Explain that subclassing multiple exceptions is fragile (GH-29094)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
4 years agoCleanup a couple of comments left on PR 28775 post-merge. (GH-29079)
Gregory P. Smith [Wed, 20 Oct 2021 16:17:52 +0000 (09:17 -0700)] 
Cleanup a couple of comments left on PR 28775 post-merge. (GH-29079)

4 years agobpo-45536: Check OpenSSL APIs in configure (GH-29088)
Christian Heimes [Wed, 20 Oct 2021 15:18:34 +0000 (18:18 +0300)] 
bpo-45536: Check OpenSSL APIs in configure (GH-29088)

4 years agoAdd PEPs 593 & 647 to list of PEPs at top of typing docs (GH-29097)
Alex Waygood [Wed, 20 Oct 2021 15:15:59 +0000 (16:15 +0100)] 
Add PEPs 593 & 647 to list of PEPs at top of typing docs (GH-29097)

4 years agoAdd a comment about how to fix bogus test_host_resolution_bad_address failures (...
Barry Warsaw [Wed, 20 Oct 2021 15:08:57 +0000 (08:08 -0700)] 
Add a comment about how to fix bogus test_host_resolution_bad_address failures (#29085)

4 years agobpo-44525: Specialize simple Python calls. (GH-29033)
Mark Shannon [Wed, 20 Oct 2021 15:08:28 +0000 (16:08 +0100)] 
bpo-44525: Specialize simple Python calls. (GH-29033)

4 years agobpo-45229: Make doctest tests discoverable (GH-28986)
Serhiy Storchaka [Wed, 20 Oct 2021 14:36:27 +0000 (17:36 +0300)] 
bpo-45229: Make doctest tests discoverable (GH-28986)

4 years agobpo-25625: [doc] fix async/aync typo (GH-29091)
Thomas Grainger [Wed, 20 Oct 2021 13:51:07 +0000 (14:51 +0100)] 
bpo-25625: [doc] fix async/aync typo (GH-29091)

4 years agobpo-45474: Exclude all of marshal.h if Py_LIMITED_API is defined (GH-29061)
Petr Viktorin [Wed, 20 Oct 2021 09:32:14 +0000 (11:32 +0200)] 
bpo-45474: Exclude all of marshal.h if Py_LIMITED_API is defined (GH-29061)

Also, reword the What's New messages: this doesn't change the limited API, it only brings the Py_LIMITED_API macro closer to the ideal of only allowing the limited API.

Automerge-Triggered-By: GH:encukou
4 years agobpo-38371: Remove remaining use of tk.split from bigmem tcl test (GH-29082)
Zachary Ware [Wed, 20 Oct 2021 03:34:23 +0000 (22:34 -0500)] 
bpo-38371: Remove remaining use of tk.split from bigmem tcl test (GH-29082)

4 years agobpo-45436: Fix tkinter tests with Tcl/Tk 8.6.11+ (GH-29077)
Zachary Ware [Wed, 20 Oct 2021 02:54:19 +0000 (21:54 -0500)] 
bpo-45436: Fix tkinter tests with Tcl/Tk 8.6.11+ (GH-29077)

Since v8.6.11, a few configuration options seem to accept an empty value
where they did not previously; particularly the `type` of a `Menu`
widget, and the `compound` of any ttk widget with a label.  Providing an
explicit expected error message to `checkEnumParam` bypasses the check
of an empty value, which no longer raises `TclError`.

4 years agobpo-44525: Specialize ``CALL_FUNCTION`` for C function calls (GH-26934)
Ken Jin [Tue, 19 Oct 2021 23:16:36 +0000 (07:16 +0800)] 
bpo-44525: Specialize ``CALL_FUNCTION`` for C function calls (GH-26934)

4 years agobpo-25625: add contextlib.chdir (GH-28271)
Filipe Laíns [Tue, 19 Oct 2021 22:19:27 +0000 (23:19 +0100)] 
bpo-25625: add contextlib.chdir (GH-28271)

Added non parallel-safe :func:`~contextlib.chdir` context manager to change
the current working directory and then restore it on exit. Simple wrapper
around :func:`~os.chdir`.

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-39679: Add tests for classmethod/staticmethod singledispatchmethods (GH-29034)
Alex Waygood [Tue, 19 Oct 2021 20:30:27 +0000 (21:30 +0100)] 
bpo-39679: Add tests for classmethod/staticmethod singledispatchmethods (GH-29034)

In Python 3.8 and 3.9, stacking `@functools.singledispatchmethod` on top of
`@classmethod` or `@staticmethod` caused an exception to be raised if the
method was registered using type-annotations rather than
`@method.register(int)`. This was not caught by unit tests, however, as the
tests only tested the `@method.register(int)` way of registering additional
implementations. The bug is no longer present in Python 3.10+, but
`test_functools.py` is still lacking regression tests for these cases. This
commit adds these test cases.

4 years agobpo-45506: Go back to not running most of test_embed in out-of-tree builds. (gh-29063)
Eric Snow [Tue, 19 Oct 2021 20:11:16 +0000 (14:11 -0600)] 
bpo-45506: Go back to not running most of test_embed in out-of-tree builds. (gh-29063)

In gh-28954 I adjusted how test_embed determines if it should be skipped. That broke out-of-tree builds. This change fixes them.

https://bugs.python.org/issue45506

4 years agobpo-45494: Fix parser crash when reporting errors involving invalid continuation...
Pablo Galindo Salgado [Tue, 19 Oct 2021 19:24:12 +0000 (20:24 +0100)] 
bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters (GH-28993)

There are two errors that this commit fixes:

* The parser was not correctly computing the offset and the string
  source for E_LINECONT errors due to the incorrect usage of strtok().
* The parser was not correctly unwinding the call stack when a tokenizer
  exception happened in rules involving optionals ('?', [...]) as we
  always make them return valid results by using the comma operator. We
  need to check first if we don't have an error before continuing.

4 years ago[doc]: Fix missing space in c-api/init.rst and add rstlint rule (GH-28988)
Julien Palard [Tue, 19 Oct 2021 19:13:24 +0000 (21:13 +0200)] 
[doc]: Fix missing space in c-api/init.rst and add rstlint rule (GH-28988)

4 years agobpo-45500: Rewrite test_dbm (GH-29002)
Serhiy Storchaka [Tue, 19 Oct 2021 19:11:28 +0000 (22:11 +0300)] 
bpo-45500: Rewrite test_dbm (GH-29002)

* Generate test classes at import time. It allows to filter them when
  run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after
  test. It guarantees that all created files and directories be removed
  and will not conflict with other dbm tests.
* Restore dbm._defaultmod after tests. Previously it was set to the last
  dbm module (dbm.dumb) which affected other tests.
* Enable the whichdb test for dbm.dumb.
* Move test_keys to the correct test class. It does not test whichdb().
* Remove some outdated code and comments.

4 years agobpo-42174: fallback to sane values if the columns or lines are 0 in get_terminal_size...
Filipe Laíns [Tue, 19 Oct 2021 18:42:13 +0000 (19:42 +0100)] 
bpo-42174: fallback to sane values if the columns or lines are 0 in get_terminal_size (GH-29046)

I considered only falling back when both were 0, but that still seems
wrong, and the highly popular rich[1] library does it this way, so I
thought we should probably inherit that behavior.

[1] https://github.com/willmcgugan/rich

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-42222: Improve tests for invalid argument types in randrange() (GH-29021)
Serhiy Storchaka [Tue, 19 Oct 2021 18:40:30 +0000 (21:40 +0300)] 
bpo-42222: Improve tests for invalid argument types in randrange() (GH-29021)

4 years agobpo-40360: Make the 2to3 deprecation more obvious. (GH-29064)
Gregory P. Smith [Tue, 19 Oct 2021 18:28:27 +0000 (11:28 -0700)] 
bpo-40360: Make the 2to3 deprecation more obvious. (GH-29064)

4 years agobpo-45449: add note about PEP 585 in collections.abc's documentation (GH-29047)
Filipe Laíns [Tue, 19 Oct 2021 18:18:50 +0000 (19:18 +0100)] 
bpo-45449: add note about PEP 585 in collections.abc's documentation (GH-29047)

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agoAdd zoneinfo to the datetime documentation (GH-29038)
Paul Ganssle [Tue, 19 Oct 2021 18:09:41 +0000 (14:09 -0400)] 
Add zoneinfo to the datetime documentation (GH-29038)

We should have done this way back when 3.9 was released, but it fell off
the radar.

Co-authored-by: Paul Ganssle <git@m.ganssle.io>
4 years agoRecord cache hits for BINARY_SUBSCR specializations (GH-29060)
Ken Jin [Tue, 19 Oct 2021 16:25:31 +0000 (00:25 +0800)] 
Record cache hits for BINARY_SUBSCR specializations (GH-29060)

4 years agobpo-42064: Add module backref to `sqlite3` callback context (GH-28242)
Erlend Egeberg Aasland [Tue, 19 Oct 2021 13:44:45 +0000 (15:44 +0200)] 
bpo-42064: Add module backref to `sqlite3` callback context (GH-28242)

4 years agobpo-43851: Build SQLite with SQLITE_OMIT_AUTOINIT on Windows (GH-25414)
Erlend Egeberg Aasland [Tue, 19 Oct 2021 10:59:57 +0000 (12:59 +0200)] 
bpo-43851: Build SQLite with SQLITE_OMIT_AUTOINIT on Windows (GH-25414)

4 years agobpo-45434: Only exclude <stdlib.h> in Python 3.11 limited C API (GH-29027)
Victor Stinner [Tue, 19 Oct 2021 10:10:22 +0000 (12:10 +0200)] 
bpo-45434: Only exclude <stdlib.h> in Python 3.11 limited C API (GH-29027)

The Python 3.11 limited C API no longer includes stdlib.h, stdio.h,
string.h and errno.h.

* Exclude Py_MEMCPY() from Python 3.11 limited C API.
* xxlimited C extension is now built with Python 3.11 limited C API.

4 years agobpo-45475: Revert `__iter__` optimization for GzipFile, BZ2File, and LZMAFile. (GH...
Inada Naoki [Tue, 19 Oct 2021 02:51:48 +0000 (11:51 +0900)] 
bpo-45475: Revert `__iter__` optimization for GzipFile, BZ2File, and LZMAFile. (GH-29016)

This reverts commit d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e.

4 years agobpo-45516: use documentation links in TraversableResources' description (GH-29045)
Filipe Laíns [Tue, 19 Oct 2021 00:52:28 +0000 (01:52 +0100)] 
bpo-45516: use documentation links in TraversableResources' description (GH-29045)

I think this makes the documentation much more digestible :)

Signed-off-by: Filipe Laíns <lains@riseup.net>
4 years agobpo-35134: Add Include/cpython/longobject.h (GH-29044)
Victor Stinner [Tue, 19 Oct 2021 00:04:52 +0000 (02:04 +0200)] 
bpo-35134: Add Include/cpython/longobject.h (GH-29044)

Move Include/longobject.h non-limited API to a new
Include/cpython/longobject.h header file.

Move the following definitions to the internal C API:

* _PyLong_DigitValue
* _PyLong_FormatAdvancedWriter()
* _PyLong_FormatWriter()

4 years agobpo-35134: Split warnings.h and weakrefobject.h (GH-29042)
Victor Stinner [Mon, 18 Oct 2021 23:31:57 +0000 (01:31 +0200)] 
bpo-35134: Split warnings.h and weakrefobject.h (GH-29042)

Split header files to move the non-limited API to Include/cpython/:

* Include/warnings.h => Include/cpython/warnings.h
* Include/weakrefobject.h => Include/cpython/weakrefobject.h

Exclude PyWeakref_GET_OBJECT() from the limited C API. It never
worked since the PyWeakReference structure is opaque in the limited C
API.

Move _PyWarnings_Init() and _PyErr_WarnUnawaitedCoroutine() to the
internal C API.

4 years agobpo-45516: add protocol description to the Traversable documentation (#29039)
Filipe Laíns [Mon, 18 Oct 2021 22:58:13 +0000 (23:58 +0100)] 
bpo-45516: add protocol description to the Traversable documentation (#29039)

* bpo-45516: add protocol description to the Traversable documentation

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Update Doc/library/importlib.rst

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* Update Lib/importlib/abc.py

* Update Doc/library/importlib.rst

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
4 years agobpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py (GH-29031)
andrei kulakov [Mon, 18 Oct 2021 18:26:23 +0000 (14:26 -0400)] 
bpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py (GH-29031)

4 years agobpo-43760: Rename _PyThreadState_DisableTracing() (GH-29032)
Victor Stinner [Mon, 18 Oct 2021 16:40:43 +0000 (18:40 +0200)] 
bpo-43760: Rename _PyThreadState_DisableTracing() (GH-29032)

* Rename _PyThreadState_DisableTracing()
  to _PyThreadState_PauseTracing()
* Rename _PyThreadState_ResetTracing()
  to _PyThreadState_ResumeTracing()

4 years agobpo-45256: Avoid C calls for most Python to Python calls. (GH-28937)
Mark Shannon [Mon, 18 Oct 2021 08:57:24 +0000 (09:57 +0100)] 
bpo-45256: Avoid C calls for most Python to Python calls. (GH-28937)

* Avoid making C calls for most calls to Python functions.

* Change initialize_locals(steal=true) and _PyTuple_FromArraySteal to consume the argument references regardless of whether they succeed or fail.

4 years agobpo-45434: Include stdlib.h for specialize stat (GH-29015)
Dong-hee Na [Mon, 18 Oct 2021 08:31:18 +0000 (17:31 +0900)] 
bpo-45434: Include stdlib.h for specialize stat (GH-29015)

4 years agoImprove multiserver queue recipe (GH-29012)
Raymond Hettinger [Sun, 17 Oct 2021 23:20:34 +0000 (18:20 -0500)] 
Improve multiserver queue recipe (GH-29012)

4 years agobpo-45229: Make test_http_cookiejar discoverable (GH-29004)
Serhiy Storchaka [Sun, 17 Oct 2021 12:06:40 +0000 (15:06 +0300)] 
bpo-45229: Make test_http_cookiejar discoverable (GH-29004)

4 years agoFix contributor person name in rst files (GH-29005)
Benjamin Szőke [Sun, 17 Oct 2021 11:59:22 +0000 (13:59 +0200)] 
Fix contributor person name in rst files (GH-29005)

4 years agobpo-45495: Add 'case' and 'match' to IDLE completions list. (GH-29000)
Terry Jan Reedy [Sat, 16 Oct 2021 22:44:00 +0000 (18:44 -0400)] 
bpo-45495: Add 'case' and 'match' to IDLE completions list. (GH-29000)

Since the keyword list is frozen, only compute it once per
session.  The colorizer already handles context keywords.

4 years agobpo-45020: Default to using frozen modules unless running from source tree. (gh-28940)
Eric Snow [Sat, 16 Oct 2021 19:16:08 +0000 (13:16 -0600)] 
bpo-45020: Default to using frozen modules unless running from source tree. (gh-28940)

The default was "off".  Switching it to "on" means users get the benefit of frozen stdlib modules without having to do anything.  There's a special-case for running-in-source-tree, so contributors don't get surprised when their stdlib changes don't get used.

https://bugs.python.org/issue45020

4 years agobpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)
Pablo Galindo Salgado [Sat, 16 Oct 2021 17:27:43 +0000 (18:27 +0100)] 
bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)

4 years agobpo-42222: Remove deprecated support for non-integer values (GH-28983)
Raymond Hettinger [Sat, 16 Oct 2021 15:16:53 +0000 (10:16 -0500)] 
bpo-42222: Remove deprecated support for non-integer values (GH-28983)

4 years agobpo-45489: Update ForwardRef to support | operator. (GH-28991)
Dong-hee Na [Sat, 16 Oct 2021 15:12:58 +0000 (00:12 +0900)] 
bpo-45489: Update ForwardRef to support | operator. (GH-28991)

4 years agobpo-45463: Clarify that global statements allows multiple names (GH-28851)
Luca Chiodini [Sat, 16 Oct 2021 12:55:12 +0000 (14:55 +0200)] 
bpo-45463: Clarify that global statements allows multiple names (GH-28851)

The global statement allows specifying a list of identifiers
(https://docs.python.org/3/reference/simple_stmts.html#the-global-statement).

The "Execution model" chapter described the global statement as if it
only allowed one single name. Pluralize "name" in the appropriate places.

4 years agobpo-45442: Add deactivate step to venv tutorial. (GH-28981)
srinivasan [Fri, 15 Oct 2021 21:24:25 +0000 (02:54 +0530)] 
bpo-45442: Add deactivate step to venv tutorial. (GH-28981)

@vsajip Sorry for the trouble—made a [fairly significant] git error in the previous PR.

Have edited the patch as you had said in #28959.

Automerge-Triggered-By: GH:vsajip
4 years agobpo-45440: Remove pymath.c fallbacks (GH-28977)
Victor Stinner [Fri, 15 Oct 2021 17:45:34 +0000 (19:45 +0200)] 
bpo-45440: Remove pymath.c fallbacks (GH-28977)

Remove fallbacks for missing round(), copysign() and hypot() in
Python/pymath.c. Python now requires these functions to build.

These fallbacks were needed on Visual Studio 2012 and older. They are
no longer needed since Visual Stuido 2013. Python is now built with
Visual Studio 2017 or newer since Python 3.6.

4 years agobpo-30459: Use (void) in macros setting variables (GH-28982)
Victor Stinner [Fri, 15 Oct 2021 17:44:35 +0000 (19:44 +0200)] 
bpo-30459: Use (void) in macros setting variables (GH-28982)

Convert the result of macros setting variables to void to avoid risks
of misusing them:

* _PyGCHead_SET_NEXT()
* asdl_seq_SET()
* asdl_seq_SET_UNTYPED()

4 years agobpo-43760: Add PyThreadState_EnterTracing() (GH-28542)
Victor Stinner [Fri, 15 Oct 2021 14:06:30 +0000 (16:06 +0200)] 
bpo-43760: Add PyThreadState_EnterTracing() (GH-28542)

Add PyThreadState_EnterTracing() and PyThreadState_LeaveTracing()
functions to the limited C API to suspend and resume tracing and
profiling.

Add an unit test on the PyThreadState C API to _testcapi.

Add also internal _PyThreadState_DisableTracing() and
_PyThreadState_ResetTracing().

4 years agobpo-45482: Rename namespaceobject.h to pycore_namespace.h (GH-28975)
Victor Stinner [Fri, 15 Oct 2021 13:21:21 +0000 (15:21 +0200)] 
bpo-45482: Rename namespaceobject.h to pycore_namespace.h (GH-28975)

Rename Include/namespaceobject.h to
Include/internal/pycore_namespace.h.

The _testmultiphase extension is now built with the
Py_BUILD_CORE_MODULE macro defined to access _PyNamespace_Type.

object.c: remove unused "pycore_context.h" include.

4 years agobpo-44113: Move the What's New entry to Deprecate section (GH-28974)
Victor Stinner [Fri, 15 Oct 2021 11:43:44 +0000 (13:43 +0200)] 
bpo-44113: Move the What's New entry to Deprecate section (GH-28974)

4 years agobpo-45445: Remove incorrectly commited test file (GH-28972)
Pablo Galindo Salgado [Fri, 15 Oct 2021 11:18:22 +0000 (12:18 +0100)] 
bpo-45445: Remove incorrectly commited test file (GH-28972)

4 years agobpo-45434: Remove Include/eval.h header file (GH-28973)
Victor Stinner [Fri, 15 Oct 2021 11:06:05 +0000 (13:06 +0200)] 
bpo-45434: Remove Include/eval.h header file (GH-28973)

Move Include/eval.h content into Include/ceval.h and
Include/cpython/ceval.h, and remove Include/eval.h.