]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agobpo-46425: Fix direct invocation of `test_contextlib` (GH-30681)
Nikita Sobolev [Fri, 21 Jan 2022 07:36:19 +0000 (10:36 +0300)] 
bpo-46425: Fix direct invocation of `test_contextlib` (GH-30681)

3 years agobpo-46417: signal uses PyStructSequence_NewType() (GH-30735)
Victor Stinner [Fri, 21 Jan 2022 03:02:38 +0000 (04:02 +0100)] 
bpo-46417: signal uses PyStructSequence_NewType() (GH-30735)

The signal module now creates its struct_siginfo type as a heap type
using PyStructSequence_NewType(), rather than using a static type.

Add 'siginfo_type' member to the global signal_state_t structure.

3 years agobpo-46417: _curses uses PyStructSequence_NewType() (GH-30736)
Victor Stinner [Fri, 21 Jan 2022 02:30:20 +0000 (03:30 +0100)] 
bpo-46417: _curses uses PyStructSequence_NewType() (GH-30736)

The _curses module now creates its ncurses_version type as a heap
type using PyStructSequence_NewType(), rather than using a static
type.

* Move _PyStructSequence_FiniType() definition to pycore_structseq.h.
* test.pythoninfo: log curses.ncurses_version.

3 years agobpo-46417: time module uses PyStructSequence_NewType() (GH-30734)
Victor Stinner [Fri, 21 Jan 2022 01:52:43 +0000 (02:52 +0100)] 
bpo-46417: time module uses PyStructSequence_NewType() (GH-30734)

The time module now creates its struct_time type as a heap
type using PyStructSequence_NewType(), rather than using a static
type.

* Add a module state to the time module: add traverse, clear and free
  functions.
* Use PyModule_AddType().
* Remove the 'initialized' variable.

3 years agobpo-46417: _thread uses PyStructSequence_NewType() (GH-30733)
Victor Stinner [Fri, 21 Jan 2022 01:51:04 +0000 (02:51 +0100)] 
bpo-46417: _thread uses PyStructSequence_NewType() (GH-30733)

The _thread module now creates its _ExceptHookArgs type as a heap
type using PyStructSequence_NewType(), rather than using a static
type.

3 years agobpo-46417: _testembed.c avoids Py_SetProgramName() (GH-30732)
Victor Stinner [Fri, 21 Jan 2022 01:12:18 +0000 (02:12 +0100)] 
bpo-46417: _testembed.c avoids Py_SetProgramName() (GH-30732)

* _testembed_Py_Initialize() now uses the PyConfig API, rather than
  deprecated Py_SetProgramName().
* Reduce INIT_LOOPS from 16 to 4: test_embed now takes 8.7 seconds
  rather than 14.7 seconds.

3 years agobpo-46417: Finalize structseq types at exit (GH-30645)
Victor Stinner [Fri, 21 Jan 2022 00:42:25 +0000 (01:42 +0100)] 
bpo-46417: Finalize structseq types at exit (GH-30645)

Add _PyStructSequence_FiniType() and _PyStaticType_Dealloc()
functions to finalize a structseq static type in Py_Finalize().
Currrently, these functions do nothing if Python is built in release
mode.

Clear static types:

* AsyncGenHooksType: sys.set_asyncgen_hooks()
* FlagsType: sys.flags
* FloatInfoType: sys.float_info
* Hash_InfoType: sys.hash_info
* Int_InfoType: sys.int_info
* ThreadInfoType: sys.thread_info
* UnraisableHookArgsType: sys.unraisablehook
* VersionInfoType: sys.version
* WindowsVersionType: sys.getwindowsversion()

3 years agobpo-41857: mention timeout argument units in select.poll() and select.depoll() doc...
Zane Bitter [Thu, 20 Jan 2022 23:08:44 +0000 (18:08 -0500)] 
bpo-41857: mention timeout argument units in select.poll() and select.depoll() doc-strings (GH-22406)

3 years agobpo-46080: fix argparse help generation exception in edge case (GH-30111)
Felix Fontein [Thu, 20 Jan 2022 22:48:48 +0000 (23:48 +0100)] 
bpo-46080: fix argparse help generation exception in edge case (GH-30111)

Fix an uncaught exception during help text generation when
argparse.BooleanOptionalAction is used with default=argparse.SUPPRESS
and help is specified.

3 years agobpo-46441: Add a boilerplate to test syntax errors in interactive mode (GH-30720)
Batuhan Taskaya [Thu, 20 Jan 2022 20:07:43 +0000 (23:07 +0300)] 
bpo-46441: Add a boilerplate to test syntax errors in interactive mode (GH-30720)

3 years agobpo-46316: optimize `pathlib.Path.iterdir()` (GH-30501)
Barney Gale [Thu, 20 Jan 2022 19:20:00 +0000 (19:20 +0000)] 
bpo-46316: optimize `pathlib.Path.iterdir()` (GH-30501)

`os.listdir()` doesn't return entries for `.` or `..`, so we don't need to
check for them here.

3 years agobpo-40280: Misc fixes for wasm32-emscripten (GH-30722)
Christian Heimes [Thu, 20 Jan 2022 17:56:33 +0000 (19:56 +0200)] 
bpo-40280: Misc fixes for wasm32-emscripten (GH-30722)

3 years agobpo-46429: Merge all deepfrozen files into one (GH-30572)
Kumar Aditya [Thu, 20 Jan 2022 16:38:39 +0000 (22:08 +0530)] 
bpo-46429: Merge all deepfrozen files into one (GH-30572)

3 years agoFix the caret position in some syntax errors in interactive mode (GH-30718)
Pablo Galindo Salgado [Thu, 20 Jan 2022 15:34:13 +0000 (15:34 +0000)] 
Fix the caret position in some syntax errors in interactive mode (GH-30718)

3 years agobpo-46409: Make generators in bytecode (GH-30633)
Mark Shannon [Thu, 20 Jan 2022 11:46:39 +0000 (11:46 +0000)] 
bpo-46409: Make generators in bytecode (GH-30633)

* Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes.

* Trim frame and generator by word each.

* Minor refactor of frame.c

* Update test.test_sys to account for smaller frames.

* Treat generator functions as normal functions when evaluating and specializing.

3 years agono-issue: Fix documentation typos. (GH-30576)
Piotr Fusik [Thu, 20 Jan 2022 08:17:15 +0000 (09:17 +0100)] 
no-issue: Fix documentation typos. (GH-30576)

3 years agobpo-46443: deepfreeze: use small ints and singleton zero bytes (GH-30715)
Kumar Aditya [Thu, 20 Jan 2022 06:13:21 +0000 (11:43 +0530)] 
bpo-46443: deepfreeze: use small ints and singleton zero bytes (GH-30715)

3 years agobpo-46437: remove useless `hasattr` from `test_typing` (#30704)
Nikita Sobolev [Wed, 19 Jan 2022 21:24:27 +0000 (00:24 +0300)] 
bpo-46437: remove useless `hasattr` from `test_typing` (#30704)

3 years agodoc: Clarify os.urandom return type (#30282)
Florian Bruhin [Wed, 19 Jan 2022 21:22:15 +0000 (22:22 +0100)] 
doc: Clarify os.urandom return type (#30282)

Other descriptions in the same file also use 'bytestring' to refer to bytes objects

3 years agodocs: correct outdated MappingProxyType docstrings (#30281)
Joshua Bronson [Wed, 19 Jan 2022 21:20:43 +0000 (16:20 -0500)] 
docs: correct outdated MappingProxyType docstrings (#30281)

The docstrings for MappingProxyType's keys(), values(), and items()
methods were never updated to reflect the changes that Python 3 brought
to these APIs, namely returning views rather than lists.

3 years agoUpdate documentation in datetime module strftime-and-strptime-behavior fix typo in...
Evan [Wed, 19 Jan 2022 17:39:57 +0000 (18:39 +0100)] 
Update documentation in datetime module strftime-and-strptime-behavior fix typo in '%W' format code description (GH-30232)

A small change to the documentation of datetime module , in the format codes section of stftime and strptime. Changed the description of format code '%W' from 'as a decimal number' to 'a zero padded   decimal number' so it's in line with the example having leading zeros.  Similar to the format code '%U' above.

Automerge-Triggered-By: GH:pganssle
3 years agoMark all clinic headers as generated (GH-30679)
Erlend Egeberg Aasland [Wed, 19 Jan 2022 16:54:45 +0000 (17:54 +0100)] 
Mark all clinic headers as generated (GH-30679)

3 years agobpo-45680: Minor formatting fix in stdtypes.rst (GH-30690)
Ken Jin [Wed, 19 Jan 2022 15:37:05 +0000 (23:37 +0800)] 
bpo-45680: Minor formatting fix in stdtypes.rst (GH-30690)

Makes quotation consistent with rest of docs in commit 0eae9a2a2db6cc5a72535f61bb988cc417011640.

3 years agobpo-46413: properly test `__{r}or__` code paths in `_SpecialGenericAlias` (GH-30640)
Nikita Sobolev [Wed, 19 Jan 2022 15:32:25 +0000 (18:32 +0300)] 
bpo-46413: properly test `__{r}or__` code paths in `_SpecialGenericAlias` (GH-30640)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
3 years agobpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335)
Alex Waygood [Wed, 19 Jan 2022 14:53:41 +0000 (14:53 +0000)] 
bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335)

The documentation on ``GenericAlias`` objects implies at multiple points that
only container classes can define ``__class_getitem__``. This is misleading.
This PR proposes a rewrite of the documentation to clarify that non-container
classes can define ``__class_getitem__``, and to clarify what it means when a
non-container class is parameterized.

See also: initial discussion of issues with this piece of documentation in
GH-29308, and previous BPO issue [42280](https://bugs.python.org/issue42280).

Also improved references in glossary and typing docs. Fixed some links.

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
3 years agobpo-46416: Allow direct invocation of `Lib/test/test_typing.py` (GH-30641)
Nikita Sobolev [Wed, 19 Jan 2022 14:13:38 +0000 (17:13 +0300)] 
bpo-46416: Allow direct invocation of `Lib/test/test_typing.py` (GH-30641)

Use `__name__`

3 years agobpo-22039: [doc] clarify that there are no plans to disable deleting an attribute...
Irit Katriel [Wed, 19 Jan 2022 12:03:51 +0000 (12:03 +0000)] 
bpo-22039: [doc] clarify that there are no plans to disable deleting an attribute via PyObject_SetAttr (GH-30639)

3 years ago bpo-43869: Time Epoch is the same on all platforms (GH-30664)
Victor Stinner [Wed, 19 Jan 2022 10:27:11 +0000 (11:27 +0100)] 
  bpo-43869: Time Epoch is the same on all platforms (GH-30664)

3 years agobpo-45535: [Enum] include special dunders in dir() (GH-30677)
Ethan Furman [Tue, 18 Jan 2022 23:13:13 +0000 (15:13 -0800)] 
bpo-45535: [Enum] include special dunders in dir() (GH-30677)

Include the `__dunders__` in `dir()` that make `Enum` special:

- `__contains__`
- `__getitem__`
- `__iter__`
- `__len__`
- `__members__`

3 years agobpo-45554: Document multiprocessing.Process.exitcode values (GH-30142)
John Marshall [Tue, 18 Jan 2022 21:31:27 +0000 (21:31 +0000)] 
bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142)

This addresses [bpo-45554]() by expanding the `exitcode` documentation to also describe what `exitcode` will be in cases of normal termination, `sys.exit()` called, and on uncaught exceptions.

Automerge-Triggered-By: GH:pitrou
3 years agobpo-44024: Improve the TypeError message in getattr and hasattr (GH-25863)
Géry Ogam [Tue, 18 Jan 2022 20:46:26 +0000 (21:46 +0100)] 
bpo-44024: Improve the TypeError message in getattr and hasattr (GH-25863)

Use common error message for non-string attribute name in the builtin
functions getattr and hasattr.
The special check no longer needed since Python 3.0.

3 years agobpo-46045: Do not use POSIX semaphores on NetBSD (GH-30047)
Thomas Klausner [Tue, 18 Jan 2022 20:38:35 +0000 (21:38 +0100)] 
bpo-46045: Do not use POSIX semaphores on NetBSD (GH-30047)

This fixes hanging tests test_compileall,, test_multiprocessing_fork and test_concurrent_futures.

3 years agobpo-20823: Clarify copyreg.pickle() documentation (GH-30230)
Kumar Aditya [Tue, 18 Jan 2022 19:53:43 +0000 (01:23 +0530)] 
bpo-20823: Clarify copyreg.pickle() documentation (GH-30230)

3 years agobpo-46425: Fix direct invocation of multiple test modules (GH-30666)
Nikita Sobolev [Tue, 18 Jan 2022 19:28:18 +0000 (22:28 +0300)] 
bpo-46425: Fix direct invocation of multiple test modules (GH-30666)

3 years agobpo-43869: Improve epoch docs (GH-25777)
Miguel Brito [Tue, 18 Jan 2022 15:55:16 +0000 (15:55 +0000)] 
bpo-43869: Improve epoch docs (GH-25777)

3 years agobpo-46028: Calculate base_executable by resolving symlinks in a venv (GH-30144)
Steve Dower [Tue, 18 Jan 2022 15:46:26 +0000 (15:46 +0000)] 
bpo-46028: Calculate base_executable by resolving symlinks in a venv (GH-30144)

3 years agobpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663)
Nikita Sobolev [Tue, 18 Jan 2022 14:43:51 +0000 (17:43 +0300)] 
bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663)

3 years agobpo-46402: Promote SQLite URI tricks in `sqlite3` docs (GH-30660)
Erlend Egeberg Aasland [Tue, 18 Jan 2022 12:37:02 +0000 (13:37 +0100)] 
bpo-46402: Promote SQLite URI tricks in `sqlite3` docs (GH-30660)

Provide some examples of URI parameters in sqlite connect().

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
3 years agobpo-46339: Include clarification on assert in 'get_error_line_from_tokenizer_buffers...
Pablo Galindo Salgado [Tue, 18 Jan 2022 11:13:00 +0000 (11:13 +0000)] 
bpo-46339: Include clarification on assert in 'get_error_line_from_tokenizer_buffers' (#30545)

3 years agobpo-42161: Hoist the _PyLong_GetOne() call out of the inner loop. (GH-30656)
Raymond Hettinger [Tue, 18 Jan 2022 08:02:35 +0000 (02:02 -0600)] 
bpo-42161: Hoist the _PyLong_GetOne() call out of the inner loop. (GH-30656)

3 years agobpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638)
Irit Katriel [Tue, 18 Jan 2022 07:05:16 +0000 (07:05 +0000)] 
bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638)

3 years agobpo-44934: Add optional feature AppendPath to Windows MSI installer (GH-27889)
bneuburg [Tue, 18 Jan 2022 00:18:44 +0000 (01:18 +0100)] 
bpo-44934: Add optional feature AppendPath to Windows MSI installer (GH-27889)

The option must be enabled from the command line

3 years agoRestore MSIX signing and ensure expired certificates are not selected (GH-30649)
Steve Dower [Mon, 17 Jan 2022 20:22:52 +0000 (20:22 +0000)] 
Restore MSIX signing and ensure expired certificates are not selected (GH-30649)

Reverts the change in d6c6e6b and applies a better fix.

3 years agobpo-46418: [Enum] simplify `MODULE` declaration in tests (GH-30647)
Nikita Sobolev [Mon, 17 Jan 2022 20:16:56 +0000 (23:16 +0300)] 
bpo-46418: [Enum] simplify `MODULE` declaration in tests (GH-30647)

3 years agoSkip signing side-loadable MSIX for Windows (GH-30644)
Steve Dower [Mon, 17 Jan 2022 18:05:16 +0000 (18:05 +0000)] 
Skip signing side-loadable MSIX for Windows (GH-30644)

We currently do not release these files, and so there's nothing lost by signing them.
Our code signing certificate is somehow incompatible with signing MSIX files. We may be able to re-enable this when we next renew, or if Microsoft updates their signing tool to work with our certificate.

3 years agobpo-46161: Fix bug in starunpack_helper in compile.c (GH-30235)
zq1997 [Mon, 17 Jan 2022 17:45:44 +0000 (01:45 +0800)] 
bpo-46161: Fix bug in starunpack_helper in compile.c (GH-30235)

3 years agobpo-40066: [Enum] fix tests (GH-30643)
Ethan Furman [Mon, 17 Jan 2022 16:52:42 +0000 (08:52 -0800)] 
bpo-40066: [Enum] fix tests (GH-30643)

- skip doctest that changes depending on target system
- skip doctest that only fails on CI
- substitute in values that change depending on target system

3 years agobpo-46405: fix msvc compiler warnings (GH-30627)
Kumar Aditya [Mon, 17 Jan 2022 16:30:10 +0000 (22:00 +0530)] 
bpo-46405: fix msvc compiler warnings (GH-30627)

3 years agobpo-40066: [Enum] skip failing doc test (GH-30637)
Kumar Aditya [Mon, 17 Jan 2022 15:18:13 +0000 (20:48 +0530)] 
bpo-40066: [Enum] skip failing doc test (GH-30637)

3 years agobpo-44133: Skip PyThread_get_thread_native_id() if not available (GH-30636)
Victor Stinner [Mon, 17 Jan 2022 13:49:20 +0000 (14:49 +0100)] 
bpo-44133: Skip PyThread_get_thread_native_id() if not available (GH-30636)

test_capi.test_export_symbols() doesn't check if Python exports the
"PyThread_get_thread_native_id" symbol if the _thread.get_native_id()
function is not available (if the PY_HAVE_THREAD_NATIVE_ID macro is
not defined).

3 years agobpo-13886: Skip PTY non-ASCII tests if readline is loaded (GH-30631)
Victor Stinner [Mon, 17 Jan 2022 13:00:50 +0000 (14:00 +0100)] 
bpo-13886: Skip PTY non-ASCII tests if readline is loaded (GH-30631)

Skip test_builtin PTY tests on non-ASCII characters if the readline
module is loaded. The readline module changes input() behavior, but
test_builtin is not intented to test the readline module.

When the readline module is loaded, PyOS_Readline() uses the readline
implementation. In some cases, the Python readline callback
rlhandler() is called by readline with a string without non-ASCII
characters.

3 years agoRevert "bpo-40066: [Enum] update str() and format() output (GH-30582)" (GH-30632)
Victor Stinner [Mon, 17 Jan 2022 12:58:40 +0000 (13:58 +0100)] 
Revert "bpo-40066:  [Enum] update str() and format() output (GH-30582)" (GH-30632)

This reverts commit acf7403f9baea3ae1119fc6b4a3298522188bf96.

3 years agobpo-40280: Change subprocess imports for cleaner error on wasm32 (GH-30620)
Christian Heimes [Mon, 17 Jan 2022 06:23:36 +0000 (08:23 +0200)] 
bpo-40280: Change subprocess imports for cleaner error on wasm32 (GH-30620)

3 years agobpo-40280: Add requires_fork test helper (GH-30622)
Christian Heimes [Sun, 16 Jan 2022 21:52:43 +0000 (23:52 +0200)] 
bpo-40280: Add requires_fork test helper (GH-30622)

3 years agobpo-46361: Fix "small" `int` caching (GH-30583)
Brandt Bucher [Sun, 16 Jan 2022 16:06:37 +0000 (08:06 -0800)] 
bpo-46361: Fix "small" `int` caching (GH-30583)

3 years agobpo-46386: improve `test_typing:test_immutability_by_copy_and_pickle` (GH-30613)
Nikita Sobolev [Sun, 16 Jan 2022 07:32:11 +0000 (10:32 +0300)] 
bpo-46386: improve `test_typing:test_immutability_by_copy_and_pickle` (GH-30613)

3 years agobpo-40066: [Enum] update str() and format() output (GH-30582)
Ethan Furman [Sun, 16 Jan 2022 06:41:43 +0000 (22:41 -0800)] 
bpo-40066:  [Enum] update str() and format() output (GH-30582)

Undo rejected PEP-663 changes:

- restore `repr()` to its 3.10 status
- restore `str()` to its 3.10 status

New changes:

- `IntEnum` and `IntFlag` now leave `__str__` as the original `int.__str__` so that str() and format() return the same result
- zero-valued flags without a name have a slightly changed repr(), e.g. `repr(Color(0)) == '<Color: 0>'`
- update `dir()` for mixed-in types to return all the methods and attributes of the mixed-in type
- added `_numeric_repr_` to `Flag` to control display of unnamed values
- enums without doc strings have a more comprehensive doc string added
- `ReprEnum` added -- inheriting from this makes it so only `__repr__` is replaced, not `__str__` nor `__format__`; `IntEnum`, `IntFlag`, and `StrEnum` all inherit from `ReprEnum`

3 years agobpo-46387: test all pickle protos in `test_field_descriptor` in `test_collections...
Nikita Sobolev [Sun, 16 Jan 2022 04:33:28 +0000 (07:33 +0300)] 
bpo-46387: test all pickle protos in `test_field_descriptor` in `test_collections` (GH-30614)

3 years agobpo-46388: Test NotImplemented code path for functools.total_ordering (GH-30616)
Russel Webber [Sat, 15 Jan 2022 22:15:32 +0000 (22:15 +0000)] 
bpo-46388: Test NotImplemented code path for functools.total_ordering (GH-30616)

3 years agobpo-46258: Streamline isqrt fast path (#30333)
Mark Dickinson [Sat, 15 Jan 2022 09:58:04 +0000 (09:58 +0000)] 
bpo-46258: Streamline isqrt fast path (#30333)

3 years agobpo-46383: Fix signature of zoneinfo module_free function (GH-30607)
Christian Heimes [Sat, 15 Jan 2022 08:52:19 +0000 (10:52 +0200)] 
bpo-46383: Fix signature of zoneinfo module_free function (GH-30607)

3 years agobpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footn...
Hugo van Kemenade [Fri, 14 Jan 2022 22:49:12 +0000 (00:49 +0200)] 
bpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footnote (GH-30354)

3 years agobpo-46242: [Enum] better error message for extending `Enum` with members (GH-30357)
Nikita Sobolev [Fri, 14 Jan 2022 22:18:00 +0000 (01:18 +0300)] 
bpo-46242: [Enum] better error message for extending `Enum` with members (GH-30357)

3 years agoMerge remote-tracking branch 'upstream/main'
Pablo Galindo [Fri, 14 Jan 2022 21:20:56 +0000 (21:20 +0000)] 
Merge remote-tracking branch 'upstream/main'

3 years agoPost 3.11.0a4
Pablo Galindo [Fri, 14 Jan 2022 21:20:41 +0000 (21:20 +0000)] 
Post 3.11.0a4

3 years agobpo-46380: Apply tests to both C and Python version (GH-30606)
Nikita Sobolev [Fri, 14 Jan 2022 21:13:45 +0000 (00:13 +0300)] 
bpo-46380: Apply tests to both C and Python version (GH-30606)

3 years agobpo-45569: Change PYLONG_BITS_IN_DIGIT default to 30 (GH-30497)
Mark Dickinson [Fri, 14 Jan 2022 18:54:56 +0000 (18:54 +0000)] 
bpo-45569: Change PYLONG_BITS_IN_DIGIT default to 30 (GH-30497)

3 years agobpo-40280: Block more syscalls that are causing crashes in tests (GH-30601)
Christian Heimes [Fri, 14 Jan 2022 17:48:44 +0000 (19:48 +0200)] 
bpo-40280: Block more syscalls that are causing crashes in tests (GH-30601)

3 years agobpo-23183: Document the timeit output (GH-30359)
Hugo van Kemenade [Fri, 14 Jan 2022 17:25:36 +0000 (19:25 +0200)] 
bpo-23183: Document the timeit output (GH-30359)

Co-authored-by: Robert Collins <robertc@robertcollins.net>
3 years agobpo-46362: Ensure abspath() tests pass through environment variables to subprocess...
neonene [Fri, 14 Jan 2022 15:31:15 +0000 (00:31 +0900)] 
bpo-46362: Ensure abspath() tests pass through environment variables to subprocess (GH-30595)

3 years agobpo-40280: Build WASM stdlib bundle and more modules for node (GH-30597)
Christian Heimes [Fri, 14 Jan 2022 11:11:49 +0000 (13:11 +0200)] 
bpo-40280: Build WASM stdlib bundle and more modules for node (GH-30597)

3 years agobpo-46280: Fix tracemalloc_copy_domain() (GH-30591)
Victor Stinner [Fri, 14 Jan 2022 04:11:38 +0000 (05:11 +0100)] 
bpo-46280: Fix tracemalloc_copy_domain() (GH-30591)

Test if tracemalloc_copy_traces() failed to allocated memory in
tracemalloc_copy_domain().

3 years agobpo-45953: Statically initialize all the non-object PyInterpreterState fields we...
Eric Snow [Fri, 14 Jan 2022 00:17:28 +0000 (17:17 -0700)] 
bpo-45953: Statically initialize all the non-object PyInterpreterState fields we can. (gh-30589)

https://bugs.python.org/issue45953

3 years agobpo-45953: Statically initialize all the PyThreadState fields we can. (gh-30590)
Eric Snow [Fri, 14 Jan 2022 00:09:24 +0000 (17:09 -0700)] 
bpo-45953: Statically initialize all the PyThreadState fields we can. (gh-30590)

https://bugs.python.org/issue45953

3 years agobpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571)
neonene [Thu, 13 Jan 2022 23:35:42 +0000 (08:35 +0900)] 
bpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571)

This makes ntpath.abspath()/getpath_abspath() follow normpath(), since some WinAPIs such as PathCchSkipRoot() require backslashed paths.

3 years agoStatically initialize _PyRuntimeState fields. (gh-30588)
Eric Snow [Thu, 13 Jan 2022 23:33:40 +0000 (16:33 -0700)] 
Statically initialize _PyRuntimeState fields. (gh-30588)

https://bugs.python.org/issue45953

3 years agobpo-46370: Move the static initializer for _PyRuntime to its own header file. (gh...
Eric Snow [Thu, 13 Jan 2022 22:54:36 +0000 (15:54 -0700)] 
bpo-46370: Move the static initializer for _PyRuntime to its own header file. (gh-30587)

https://bugs.python.org/issue46370

3 years agobpo-40479: Fix typo, flag must be set for OpenSSL < 3.0.0 (GH-30584)
Christian Heimes [Thu, 13 Jan 2022 20:47:42 +0000 (22:47 +0200)] 
bpo-40479: Fix typo, flag must be set for OpenSSL < 3.0.0 (GH-30584)

3 years agoPython 3.11.0a4 v3.11.0a4
Pablo Galindo [Thu, 13 Jan 2022 19:36:27 +0000 (19:36 +0000)] 
Python 3.11.0a4

3 years agobpo-46070: _PyGC_Fini() untracks objects (GH-30577)
Victor Stinner [Thu, 13 Jan 2022 18:28:32 +0000 (19:28 +0100)] 
bpo-46070: _PyGC_Fini() untracks objects (GH-30577)

Py_EndInterpreter() now explicitly untracks all objects currently
tracked by the GC. Previously, if an object was used later by another
interpreter, calling PyObject_GC_UnTrack() on the object crashed if
the previous or the next object of the PyGC_Head structure became a
dangling pointer.

3 years agobpo-44133: Link Python executable with object files (GH-30556)
Victor Stinner [Thu, 13 Jan 2022 18:24:28 +0000 (19:24 +0100)] 
bpo-44133: Link Python executable with object files (GH-30556)

When Python is built without --enable-shared, the "python" program is
now linked to object files, rather than being linked to the Python
library (libpython.a), to make sure that all symbols are exported.
Previously, the linker omitted some symbols like the Py_FrozenMain()
function.

When Python is configured with --without-static-libpython, the Python
static library (libpython.a) is no longer built.

* Check --without-static-libpython earlier in configure.ac
* Add LINK_PYTHON_OBJS and LINK_PYTHON_DEPS variables to Makefile.
* test_capi now ensures that the "Py_FrozenMain" symbol is exported.

3 years ago bpo-46355: Document PyFrameObject and PyThreadState changes (GH-30558)
Victor Stinner [Thu, 13 Jan 2022 18:21:50 +0000 (19:21 +0100)] 
 bpo-46355: Document PyFrameObject and PyThreadState changes (GH-30558)

Document PyFrameObject and PyThreadState changes in What's New in
Python 3.11 and explain how to port code.

3 years agobpo-46358: modernize `test_asyncio` (GH-30562)
Nikita Sobolev [Thu, 13 Jan 2022 14:28:02 +0000 (17:28 +0300)] 
bpo-46358: modernize `test_asyncio` (GH-30562)

3 years agobpo-46359: Modernize `test_typing` by removing checks for EOL Python versions (GH...
Nikita Sobolev [Thu, 13 Jan 2022 13:09:40 +0000 (16:09 +0300)] 
bpo-46359: Modernize `test_typing` by removing checks for EOL Python versions (GH-30563)

Also removes unused tests meant for older versions of Python.

3 years agobpo-46328: Add sys.exception() (GH-30514)
Irit Katriel [Thu, 13 Jan 2022 12:35:58 +0000 (12:35 +0000)] 
bpo-46328: Add sys.exception() (GH-30514)

3 years agobpo-46344: Fix trace bug in else of try and try-star blocks (GH-30544)
Irit Katriel [Thu, 13 Jan 2022 12:34:38 +0000 (12:34 +0000)] 
bpo-46344: Fix trace bug in else of try and try-star blocks (GH-30544)

3 years agobpo-40479: Fix hashlib's usedforsecurity for OpenSSL 3.0.0 (GH-30455)
Christian Heimes [Thu, 13 Jan 2022 08:46:38 +0000 (10:46 +0200)] 
bpo-40479: Fix hashlib's usedforsecurity for OpenSSL 3.0.0 (GH-30455)

3 years agobpo-46315: Add ifdef HAVE_ feature checks for WASI compatibility (GH-30507)
Christian Heimes [Thu, 13 Jan 2022 08:46:04 +0000 (10:46 +0200)] 
bpo-46315: Add ifdef HAVE_ feature checks for WASI compatibility (GH-30507)

3 years agobpo-46345: Add a test case for implicit `Optional` class attribute (GH-30535)
Nikita Sobolev [Wed, 12 Jan 2022 23:35:44 +0000 (02:35 +0300)] 
bpo-46345: Add a test case for implicit `Optional` class attribute (GH-30535)

3 years agobpo-45953: Statically allocate the main interpreter (and initial thread state). ...
Eric Snow [Wed, 12 Jan 2022 23:28:46 +0000 (16:28 -0700)] 
bpo-45953: Statically allocate the main interpreter (and initial thread state). (gh-29883)

Previously, the main interpreter was allocated on the heap during runtime initialization.  Here we instead embed it into _PyRuntimeState, which means it is statically allocated as part of the _PyRuntime global.  The same goes for the initial thread state (of each interpreter, including the main one).  Consequently there are fewer allocations during runtime/interpreter init, fewer possible failures, and better memory locality.

FYI, this also helps efforts to consolidate globals, which in turns helps work on subinterpreter isolation.

https://bugs.python.org/issue45953

3 years agobpo-46342: make @typing.final introspectable (GH-30530)
Jelle Zijlstra [Wed, 12 Jan 2022 19:38:25 +0000 (11:38 -0800)] 
bpo-46342: make @typing.final introspectable (GH-30530)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
3 years agobpo-40280: Allow to compile _testcapi as builtin module (GH-30559)
Christian Heimes [Wed, 12 Jan 2022 19:27:37 +0000 (21:27 +0200)] 
bpo-40280: Allow to compile _testcapi as builtin module (GH-30559)

3 years agobpo-46020: Optimize long_pow for the common case (GH-30555)
Tim Peters [Wed, 12 Jan 2022 18:55:02 +0000 (12:55 -0600)] 
bpo-46020: Optimize long_pow for the common case (GH-30555)

This cuts a bit of overhead by not initializing the table of small
odd powers unless it's needed for a large exponent.

3 years agobpo-46348: modernize `test_typing` (GH-30547)
Nikita Sobolev [Wed, 12 Jan 2022 16:48:10 +0000 (19:48 +0300)] 
bpo-46348: modernize `test_typing` (GH-30547)

3 years agobpo-40280: Add --with-emscripten-target to build for browser or node (GH-30552)
Christian Heimes [Wed, 12 Jan 2022 15:08:19 +0000 (17:08 +0200)] 
bpo-40280: Add --with-emscripten-target to build for browser or node (GH-30552)

Co-authored-by: Ethan Smith <ethan@ethanhs.me>
3 years agobpo-46347: Yet another fix in the erorr path of PyEval_EvalCodeEx (#30554)
Yury Selivanov [Wed, 12 Jan 2022 00:35:19 +0000 (16:35 -0800)] 
bpo-46347: Yet another fix in the erorr path of PyEval_EvalCodeEx (#30554)

3 years agobpo-46347: Fix PyEval_EvalCodeEx to correctly cleanup in error paths (#30551)
Yury Selivanov [Tue, 11 Jan 2022 23:37:09 +0000 (15:37 -0800)] 
bpo-46347: Fix PyEval_EvalCodeEx to correctly cleanup in error paths (#30551)

3 years agobpo-46303: Fix fileutils.h compiler warnings (GH-30550)
Victor Stinner [Tue, 11 Jan 2022 23:35:26 +0000 (00:35 +0100)] 
bpo-46303: Fix fileutils.h compiler warnings (GH-30550)

Add missing pycore_fileutils.h include in _tkinter.c and
_testconsole.c.

3 years agobpo-46347: Fix memory leak in PyEval_EvalCodeEx. (#30546)
Yury Selivanov [Tue, 11 Jan 2022 22:25:28 +0000 (14:25 -0800)] 
bpo-46347: Fix memory leak in PyEval_EvalCodeEx. (#30546)

First introduced in 0332e569c12d3dc97171546c6dc10e42c27de34b

3 years agobpo-46307: Add string.Template.get_identifiers() method (GH-30493)
Ben Kehoe [Tue, 11 Jan 2022 19:15:42 +0000 (12:15 -0700)] 
bpo-46307: Add string.Template.get_identifiers() method (GH-30493)

Add `string.Template.get_identifiers()` method that returns the identifiers within the template. By default, raises an error if it encounters an invalid identifier (like `substitute()`). The keyword-only argument `raise_on_invalid` can be set to `False` to ignore invalid identifiers (like `safe_substitute()`).

Automerge-Triggered-By: GH:warsaw