]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agobpo-46442: improve and rename testExceptionCleanupNames (GH-30758)
Yellow Dusk [Sat, 22 Jan 2022 07:09:34 +0000 (23:09 -0800)] 
bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)

The test tested that explicitly deleting the local variable bound to the exception
did not cause problems, but it did not test what it actually claimed to test, i.e.
that the variable is deleted automatically.

3 years agoImprove the Windows release build scripts (GH-30771)
Steve Dower [Sat, 22 Jan 2022 01:13:16 +0000 (01:13 +0000)] 
Improve the Windows release build scripts (GH-30771)

Update to windows-2022 image
Promote queue variables to parameters for better UI
Structure build steps using parameters instead of conditions for simpler status display

3 years agobpo-29882: _Py_popcount32() doesn't need 64x64 multiply (GH-30774)
Victor Stinner [Fri, 21 Jan 2022 23:54:42 +0000 (00:54 +0100)] 
bpo-29882: _Py_popcount32() doesn't need 64x64 multiply (GH-30774)

32x32 bits multiply is enough for _Py_popcount32().

3 years agobpo-46417: Use _PyType_CAST() in Objects directory (GH-30764)
Victor Stinner [Fri, 21 Jan 2022 22:33:43 +0000 (23:33 +0100)] 
bpo-46417: Use _PyType_CAST() in Objects directory (GH-30764)

3 years agobpo-46417: Use _PyType_CAST() in Python directory (GH-30769)
Victor Stinner [Fri, 21 Jan 2022 22:30:17 +0000 (23:30 +0100)] 
bpo-46417: Use _PyType_CAST() in Python directory (GH-30769)

3 years agobpo-46417: Add _PyType_GetSubclasses() function (GH-30761)
Victor Stinner [Fri, 21 Jan 2022 22:29:10 +0000 (23:29 +0100)] 
bpo-46417: Add _PyType_GetSubclasses() function (GH-30761)

Add a new _PyType_GetSubclasses() function to get type's subclasses.

_PyType_GetSubclasses(type) returns a list which holds strong
refererences to subclasses. It is safer than iterating on
type->tp_subclasses which yields weak references and can be modified
in the loop.

_PyType_GetSubclasses(type) now holds a reference to the tp_subclasses
dict while creating the list of subclasses.

set_collection_flag_recursive() of _abc.c now uses
_PyType_GetSubclasses().

3 years agobpo-46463: Fixes escape4chm.py script used when building the CHM documentation file...
Steve Dower [Fri, 21 Jan 2022 21:51:15 +0000 (21:51 +0000)] 
bpo-46463: Fixes escape4chm.py script used when building the CHM documentation file (GH-30768)

3 years agobpo-46445: Cover multiple inheritance of `TypedDict` in `test_typing` (GH-30719)
Nikita Sobolev [Fri, 21 Jan 2022 21:38:23 +0000 (00:38 +0300)] 
bpo-46445: Cover multiple inheritance of `TypedDict` in `test_typing` (GH-30719)

3 years agobpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' (GH-30285)
Weipeng Hong [Fri, 21 Jan 2022 21:24:33 +0000 (05:24 +0800)] 
bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' (GH-30285)

3 years agobpo-46124: Update zoneinfo to rely on importlib.resources traversable API. (GH-30190)
Jason R. Coombs [Fri, 21 Jan 2022 21:18:31 +0000 (16:18 -0500)] 
bpo-46124: Update zoneinfo to rely on importlib.resources traversable API. (GH-30190)

Automerge-Triggered-By: GH:jaraco
3 years agoUpdate generated files list and add `diff=generated` attribute (GH-30745)
Erlend Egeberg Aasland [Fri, 21 Jan 2022 20:59:45 +0000 (21:59 +0100)] 
Update generated files list and add `diff=generated` attribute (GH-30745)

As a side effect, the list of generated files is relocated after the language aware diff settings.

Closes python/core-workflow#425

Automerge-Triggered-By: GH:zware
3 years agobpo-46417: Add _PyType_CAST() macro (GH-30760)
Victor Stinner [Fri, 21 Jan 2022 20:39:01 +0000 (21:39 +0100)] 
bpo-46417: Add _PyType_CAST() macro (GH-30760)

In debug mode, the macro makes sure that its argument is a type using
an assertion.

3 years agobpo-46434: Handle missing docstrings in pdb help (GH-30705)
Tom Sparrow [Fri, 21 Jan 2022 17:00:48 +0000 (17:00 +0000)] 
bpo-46434: Handle missing docstrings in pdb help (GH-30705)

3 years agobpo-46417: Add missing types of _PyTypes_InitTypes() (GH-30749)
Victor Stinner [Fri, 21 Jan 2022 16:53:13 +0000 (17:53 +0100)] 
bpo-46417: Add missing types of _PyTypes_InitTypes() (GH-30749)

Add types removed by mistake by the commit adding
_PyTypes_FiniTypes().

Move also PyBool_Type at the end, since it depends on PyLong_Type.

PyBytes_Type and PyUnicode_Type no longer depend explicitly on
PyBaseObject_Type: it's the default of PyType_Ready().

3 years agobpo-46417: Revert remove_subclass() change (GH-30750) 30753/head
Victor Stinner [Fri, 21 Jan 2022 15:45:14 +0000 (16:45 +0100)] 
bpo-46417: Revert remove_subclass() change (GH-30750)

remove_subclass() doesn't clear the tp_subclasses dict if the dict
becomes empty.

3 years agobpo-46417: Py_Finalize() clears static types (GH-30743)
Victor Stinner [Fri, 21 Jan 2022 12:06:34 +0000 (13:06 +0100)] 
bpo-46417: Py_Finalize() clears static types (GH-30743)

Add _PyTypes_FiniTypes() best-effort function to clear static types:
don't deallocate a type if it still has subclasses.

remove_subclass() now sets tp_subclasses to NULL when removing the
last subclass.

3 years agobpo-46417: Call _PyDebug_PrintTotalRefs() later (GH-30744)
Victor Stinner [Fri, 21 Jan 2022 12:05:26 +0000 (13:05 +0100)] 
bpo-46417: Call _PyDebug_PrintTotalRefs() later (GH-30744)

"python -X showrefcount" now shows the total reference count after
clearing and destroyed the main Python interpreter. Previously, it
was shown before.

Py_FinalizeEx() now calls _PyDebug_PrintTotalRefs() after
finalize_interp_delete().

3 years agobpo-46426: Improve tests for the dir_fd argument (GH-30668)
Serhiy Storchaka [Fri, 21 Jan 2022 07:54:50 +0000 (09:54 +0200)] 
bpo-46426: Improve tests for the dir_fd argument (GH-30668)

Ensure that directory file descriptors refer to directories different
from the current directory, and that src_dir_fd and dst_dir_fd refer
to different directories.

Add context manager open_dir_fd() in test.support.os_helper.

3 years agobpo-30512: Add CAN Socket support for NetBSD (GH-30066)
Thomas Klausner [Fri, 21 Jan 2022 07:44:05 +0000 (08:44 +0100)] 
bpo-30512: Add CAN Socket support for NetBSD (GH-30066)

3 years agobpo-21987: Fix TarFile.getmember getting a dir with a trailing slash (GH-30283)
andrei kulakov [Fri, 21 Jan 2022 07:40:32 +0000 (02:40 -0500)] 
bpo-21987: Fix TarFile.getmember getting a dir with a trailing slash (GH-30283)

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.