]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-45581: Raise `MemoryError` in `sqlite3.connect` if SQLite signals memory error...
Erlend Egeberg Aasland [Fri, 29 Oct 2021 20:21:58 +0000 (22:21 +0200)] 
bpo-45581: Raise `MemoryError` in `sqlite3.connect` if SQLite signals memory error (GH-29171)

4 years agobpo-45600: Enhanced / clarified the docs for os.environ and os.environb (GH-29204)
andrei kulakov [Fri, 29 Oct 2021 20:18:45 +0000 (16:18 -0400)] 
bpo-45600: Enhanced / clarified the docs for os.environ and os.environb (GH-29204)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200)
Ian Fisher [Fri, 29 Oct 2021 20:17:22 +0000 (16:17 -0400)] 
bpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200)

4 years agobpo-45548: Some test modules must be built as shared libs (GH-29268)
Christian Heimes [Fri, 29 Oct 2021 15:49:57 +0000 (18:49 +0300)] 
bpo-45548: Some test modules must be built as shared libs (GH-29268)

Some test cases don't work when test modules are static extensions.

Add dependency on Modules/config.c to trigger a rebuild whenever a
module build type is changed.

``makesetup`` puts shared extensions into ``Modules/`` directory. Create
symlinks from pybuilddir so the extensions can be imported.

Note: It is not possible to use the content of pybuilddir.txt as a build
target. Makefile evaluates target variables in the first pass. The
pybuilddir.txt file does not exist at that point.

4 years agobpo-45655: Add ref to union type expressions at top of typing docs (GH-29309)
Alex Waygood [Fri, 29 Oct 2021 13:56:21 +0000 (14:56 +0100)] 
bpo-45655: Add ref to union type expressions at top of typing docs (GH-29309)

4 years agobpo-45628: Check all parts of the suffix for an extension match. (GH-29310)
Vinay Sajip [Fri, 29 Oct 2021 13:40:37 +0000 (14:40 +0100)] 
bpo-45628: Check all parts of the suffix for an extension match. (GH-29310)

4 years agobpo-45621: Small changes to mmap (GH-29247)
Tim Golden [Fri, 29 Oct 2021 08:20:21 +0000 (09:20 +0100)] 
bpo-45621: Small changes to mmap (GH-29247)

* Small tidy-ups / comments
* Use randomized names when testing tagged mmaps to avoid any risk of parallel tests treading on each others' toes

4 years agobpo-45395: Make custom frozen modules additions instead of replacements. (gh-28778)
Eric Snow [Thu, 28 Oct 2021 21:04:33 +0000 (15:04 -0600)] 
bpo-45395: Make custom frozen modules additions instead of replacements. (gh-28778)

Currently custom modules (the array set on PyImport_FrozenModules) replace all the frozen stdlib modules. That can be problematic and is unlikely to be what the user wants. This change treats the custom frozen modules as additions instead. They take precedence over all other frozen modules except for those needed to bootstrap the import system. If the "code" field of an entry in the custom array is NULL then that frozen module is treated as disabled, which allows a custom entry to disable a frozen stdlib module.

This change allows us to get rid of is_essential_frozen_module() and simplifies the logic for which frozen modules should be ignored.

https://bugs.python.org/issue45395

4 years agobpo-45577: test all pickle protocols in `test_zoneinfo` (GH-29167)
Nikita Sobolev [Thu, 28 Oct 2021 20:22:24 +0000 (23:22 +0300)] 
bpo-45577: test all pickle protocols in `test_zoneinfo` (GH-29167)

4 years agobpo-45379: add custom error string for FROZEN_DISABLED (GH-29190)
Filipe Laíns [Thu, 28 Oct 2021 20:20:07 +0000 (21:20 +0100)] 
bpo-45379: add custom error string for FROZEN_DISABLED (GH-29190)

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Gareth Rees <gdr@garethrees.org>
4 years agobpo-45624: make test_graphlib not depend on the iteration order of sets (GH-29233)
Carl Friedrich Bolz-Tereick [Thu, 28 Oct 2021 20:01:35 +0000 (22:01 +0200)] 
bpo-45624: make test_graphlib not depend on the iteration order of sets (GH-29233)

the current test depended on integer sets being iterated on in a certain
fixed order. That order is different on PyPy (insertion based) and could
change in CPython in the future in theory. Make the test robust against
a different iteration order by sorting.

4 years agobpo-45655: Add "relevant PEPs" section to ``typing`` documentation (GH-29280)
Alex Waygood [Thu, 28 Oct 2021 19:55:50 +0000 (20:55 +0100)] 
bpo-45655: Add "relevant PEPs" section to ``typing`` documentation (GH-29280)

The list of PEPs at the top of the documentation for the ``typing`` module has
become too long to be readable. This PR proposes presenting this
information in a more structured and readable way by adding a new "relevant
PEPs" section to the ``typing`` docs.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-45612: Add sqlite3 module docstring (GH-29224)
Erlend Egeberg Aasland [Thu, 28 Oct 2021 19:55:27 +0000 (21:55 +0200)] 
bpo-45612: Add sqlite3 module docstring (GH-29224)

4 years agobpo-45583: Correct datamodel documentation of int() (GH-29182)
Arthur Milchior [Thu, 28 Oct 2021 19:48:37 +0000 (21:48 +0200)] 
bpo-45583: Correct datamodel documentation of int() (GH-29182)

It should be noted that this part of the documentation is redundant with
function.rst's documentation of int. This one was correctly updated with Python 3.8.

4 years agoFixed typos (GH-29211)
MalikIdreesHasanKhan [Thu, 28 Oct 2021 19:39:27 +0000 (01:09 +0530)] 
Fixed typos (GH-29211)

4 years agobpo-45604: add `level` argument to `multiprocessing.log_to_stderr` func (GH-29226)
Nikita Sobolev [Thu, 28 Oct 2021 19:38:14 +0000 (22:38 +0300)] 
bpo-45604: add `level` argument to `multiprocessing.log_to_stderr` func (GH-29226)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
4 years agobpo-45608: Document missing `sqlite3` DB-API attributes and methods (GH-29219)
Erlend Egeberg Aasland [Thu, 28 Oct 2021 19:35:51 +0000 (21:35 +0200)] 
bpo-45608: Document missing `sqlite3` DB-API attributes and methods (GH-29219)

4 years agobpo-44828: Avoid tkinter file dialog failure on macOS 12 Monterey (GH-29276)
Ned Deily [Thu, 28 Oct 2021 18:22:05 +0000 (14:22 -0400)] 
bpo-44828: Avoid tkinter file dialog failure on macOS 12 Monterey (GH-29276)

when using the Tk 8.6.11 provided by python.org macOS installers.
Patch by Marc Culler of the Tk project.

4 years agobpo-45562: Ensure all tokenizer debug messages are printed to stderr (GH-29270)
Pablo Galindo Salgado [Thu, 28 Oct 2021 17:06:15 +0000 (18:06 +0100)] 
bpo-45562: Ensure all tokenizer debug messages are printed to stderr (GH-29270)

4 years agoStore actual ints, not pointers to them in the interpreter state. (GH-29274)
Mark Shannon [Thu, 28 Oct 2021 16:35:43 +0000 (17:35 +0100)] 
Store actual ints, not pointers to them in the interpreter state. (GH-29274)

4 years agobpo-45629: Add a test for the "freeze" tool. (gh-29222)
Eric Snow [Thu, 28 Oct 2021 16:14:37 +0000 (10:14 -0600)] 
bpo-45629: Add a test for the "freeze" tool. (gh-29222)

The "freeze" tool has been part of the repo for a long time. However, it hasn't had any tests in the test suite to guard against regressions. We add such a test here. This is especially important as there has been a lot of change recently related to frozen modules, with more to come.

Note that as part of the test we build Python out-of-tree and install it in a temp dir.

https://bugs.python.org/issue45629

4 years agobpo-45256: Rationalize code around Python-to-Python calls a bit. (GH-29235)
Mark Shannon [Thu, 28 Oct 2021 15:14:59 +0000 (16:14 +0100)] 
bpo-45256: Rationalize code around Python-to-Python calls a bit. (GH-29235)

4 years agobpo-44525: Add recursive checks for `CALL_FUNCTION_BUILTIN_O` (GH-29271)
Ken Jin [Thu, 28 Oct 2021 15:02:34 +0000 (23:02 +0800)] 
bpo-44525: Add recursive checks for `CALL_FUNCTION_BUILTIN_O` (GH-29271)

4 years agobpo-45637: Store the frame pointer in the cframe (GH-29267)
Mark Shannon [Thu, 28 Oct 2021 12:59:11 +0000 (13:59 +0100)] 
bpo-45637: Store the frame pointer in the cframe (GH-29267)

* Rename 'frame' to 'current_frame'

4 years agoFix typo in Counter documentation (GH-29223)
Justinas Petuchovas [Thu, 28 Oct 2021 10:43:09 +0000 (13:43 +0300)] 
Fix typo in Counter documentation (GH-29223)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
4 years agobpo-30570: Fix segfault on buildbots caused by stack overflow from recursion in tests...
Dennis Sweeney [Thu, 28 Oct 2021 10:11:18 +0000 (06:11 -0400)] 
bpo-30570: Fix segfault on buildbots caused by stack overflow from recursion in tests (GH-29258)

* Don't stackoveflow on debug builds

* Also catch the pickletester case

4 years agobpo-45548: Fix out-of-tree and Debian builds (GH-29263)
Christian Heimes [Thu, 28 Oct 2021 09:57:38 +0000 (12:57 +0300)] 
bpo-45548: Fix out-of-tree and Debian builds (GH-29263)

Add Modules subdirs to SRCDIRS to generate directories for out-of-tree
object files.

Debian wants ncurses lib. Works on Fedora, too.

Debian also needs pkg-config to detect correct flags.

Remove more outdated comments. Makefile now tracks header dependencies
-lintl is injected by configure when needed. Build _dbm with
gdbm-compat.

Group some modules by purpose. socket, select, and mmap work on Windows,
too.

4 years agobpo-44904: Fix classmethod property bug in doctest module (GH-28838)
Alex Waygood [Thu, 28 Oct 2021 07:48:02 +0000 (08:48 +0100)] 
bpo-44904: Fix classmethod property bug in doctest module (GH-28838)

The doctest module raised an error if a docstring contained an example that
attempted to access a classmethod property. (Stacking '@classmethod' on top of
`@property` has been supported since Python 3.9; see
https://docs.python.org/3/howto/descriptor.html#class-methods.)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-45438: format of inspect.Signature with generic builtins (#29212)
Martin Rueckl [Wed, 27 Oct 2021 21:36:41 +0000 (23:36 +0200)] 
bpo-45438: format of inspect.Signature with generic builtins (#29212)

Use types.GenericAlias in inspect.formatannotation to correctly add
type arguments of builtin types to the string representation of
Signatures.

Co-authored-by: Martin Rückl <martin.rueckl@codecentric.de>
4 years agobpo-45562: Print tokenizer debug messages to stderr (GH-29250)
Pablo Galindo Salgado [Wed, 27 Oct 2021 21:27:34 +0000 (22:27 +0100)] 
bpo-45562: Print tokenizer debug messages to stderr (GH-29250)

4 years agobpo-28737: Document when tp_dealloc should call PyObject_GC_UnTrack() (GH-29246)
Sam Gross [Wed, 27 Oct 2021 19:15:13 +0000 (15:15 -0400)] 
bpo-28737: Document when tp_dealloc should call PyObject_GC_UnTrack() (GH-29246)

Objects that support garbage collection ("container" objects) should
call PyObject_GC_UnTrack() from their destructors before clearing any
fields which may point to other "container" objects.

4 years agoDon't make a call at the C level when calling bound-methods from Python code. (GH...
Mark Shannon [Wed, 27 Oct 2021 14:26:22 +0000 (15:26 +0100)] 
Don't make a call at the C level when calling bound-methods from Python code. (GH-29238)

4 years agobpo-45618: Fix documentation build by pinning Docutils version to 0.17.1 (GH-29230)
m-aciek [Wed, 27 Oct 2021 14:21:29 +0000 (16:21 +0200)] 
bpo-45618: Fix documentation build by pinning Docutils version to 0.17.1 (GH-29230)

Co-authored-by: Maciej Olko <maciej.olko@yougov.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
4 years agobpo-42064: Convert `sqlite3` global state to module state (GH-29073)
Erlend Egeberg Aasland [Wed, 27 Oct 2021 11:12:21 +0000 (13:12 +0200)] 
bpo-42064: Convert `sqlite3` global state to module state (GH-29073)

4 years agobpo-44511: Improve the bytecode for class and mapping patterns (GH-26922)
Brandt Bucher [Wed, 27 Oct 2021 09:45:35 +0000 (02:45 -0700)] 
bpo-44511: Improve the bytecode for class and mapping patterns (GH-26922)

* Refactor mapping patterns and speed up class patterns.

* Simplify MATCH_KEYS and MATCH_CLASS.

* Add COPY opcode.

4 years agoRemove unused variables. (GH-29231)
Benjamin Peterson [Tue, 26 Oct 2021 23:22:34 +0000 (16:22 -0700)] 
Remove unused variables. (GH-29231)

4 years agobpo-40915: Fix mmap resize bugs on Windows (GH-29213)
Tim Golden [Tue, 26 Oct 2021 21:56:43 +0000 (22:56 +0100)] 
bpo-40915: Fix mmap resize bugs on Windows (GH-29213)

(original patch by eryksun)

Correctly hand various failure modes when resizing an mmap on Windows:

* Resizing a pagefile-backed mmap now creates a new mmap and copies data
* Attempting to resize when another mapping is held on the same file raises an OSError
* Attempting to resize a nametagged mmap raises an OSError if another mapping is held with the same nametag

4 years agobpo-45548: makesetup improvements (GH-29225)
Christian Heimes [Tue, 26 Oct 2021 08:58:43 +0000 (11:58 +0300)] 
bpo-45548: makesetup improvements (GH-29225)

* record which modules are build as shared extensions
* put object files in same directory as source files
* remove dependency on deleted _math.c

Signed-off-by: Christian Heimes <christian@python.org>
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