]>
git.ipfire.org Git - thirdparty/Python/cpython.git/log
Nikita Sobolev [Fri, 20 Jan 2023 02:16:21 +0000 (05:16 +0300)]
gh-101100: [Enum] Fix sphinx warnings in docs (GH-101122)
* gh-101100: [Enum] Fix sphinx warnings in
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Eric Snow [Fri, 20 Jan 2023 00:23:53 +0000 (17:23 -0700)]
gh-59956: Fix Function Groupings in pystate.c (gh-101172)
This is a follow-up to gh-101161. The objective is to make it easier to read Python/pystate.c by grouping the functions there in a consistent way. This exclusively involves moving code around and adding various kinds of comments.
https://github.com/python/cpython/issues/59956
Irit Katriel [Thu, 19 Jan 2023 23:45:53 +0000 (23:45 +0000)]
gh-101167: fix bug in the new test.support.requires_specialization decorator (GH-101171)
Fixes #101167.
Automerge-Triggered-By: GH:iritkatriel
Irit Katriel [Thu, 19 Jan 2023 23:30:49 +0000 (23:30 +0000)]
gh-101169: reduce the implementation of except* by one bytecode instruction (#101170)
Eric Snow [Thu, 19 Jan 2023 23:04:14 +0000 (16:04 -0700)]
gh-59956: Clarify GILState-related Code (gh-101161)
The objective of this change is to help make the GILState-related code easier to understand. This mostly involves moving code around and some semantically equivalent refactors. However, there are a also a small number of slight changes in structure and behavior:
* tstate_current is moved out of _PyRuntimeState.gilstate
* autoTSSkey is moved out of _PyRuntimeState.gilstate
* autoTSSkey is initialized earlier
* autoTSSkey is re-initialized (after fork) earlier
https://github.com/python/cpython/issues/59956
Irit Katriel [Thu, 19 Jan 2023 21:02:56 +0000 (21:02 +0000)]
gh-98831: register instructions have 0 pushes and pops (#101163)
Irit Katriel [Thu, 19 Jan 2023 18:14:55 +0000 (18:14 +0000)]
gh-100712: make it possible to disable specialization (for debugging) (#100713)
Stepfen Shawn [Wed, 18 Jan 2023 21:02:48 +0000 (05:02 +0800)]
gh-100940: Change "char *str" to "const char *str" in KeywordToken: It is an immutable string. (#100936)
Kushal Das [Wed, 18 Jan 2023 18:43:49 +0000 (19:43 +0100)]
gh-100340: Allows -Wno-int-conversion for wasm (#100341)
Fixes #100340 allows -Wno-int-conversion for wasm
Guido van Rossum [Wed, 18 Jan 2023 18:41:07 +0000 (10:41 -0800)]
GH-98831: Move assorted macros from ceval.h to a new header (#101116)
Tushar Sadhwani [Wed, 18 Jan 2023 16:24:56 +0000 (21:54 +0530)]
fix typo in 3.12 What's New (#101105)
Erlend E. Aasland [Wed, 18 Jan 2023 09:36:17 +0000 (10:36 +0100)]
Docs: improve sqlite3 placeholders example (#101092)
Zac Hatfield-Dodds [Wed, 18 Jan 2023 00:06:38 +0000 (11:06 +1100)]
Fix typo and old link in wasm readme (#101096)
Guido van Rossum [Tue, 17 Jan 2023 23:59:19 +0000 (15:59 -0800)]
GH-98831: Implement array support in cases generator (#100912)
You can now write things like this:
```
inst(BUILD_STRING, (pieces[oparg] -- str)) { ... }
inst(LIST_APPEND, (list, unused[oparg-1], v -- list, unused[oparg-1])) { ... }
```
Note that array output effects are only partially supported (they must be named `unused` or correspond to an input effect).
Paul Moore [Tue, 17 Jan 2023 19:23:06 +0000 (19:23 +0000)]
gh-82052: Don't send partial UTF-8 sequences to the Windows API (GH-101103)
Don't send partial UTF-8 sequences to the Windows API
Viicos [Tue, 17 Jan 2023 10:51:56 +0000 (11:51 +0100)]
Fix typo in `ReprEnum` documentation (#101079)
Pablo Galindo Salgado [Mon, 16 Jan 2023 18:45:37 +0000 (18:45 +0000)]
gh-101046: Fix a potential memory leak in the parser when raising MemoryError (#101051)
Steve Dower [Mon, 16 Jan 2023 17:01:04 +0000 (17:01 +0000)]
gh-100247: Improve documentation for custom shebang commands in py.exe launcher (GH-101083)
Steve Dower [Mon, 16 Jan 2023 16:05:39 +0000 (16:05 +0000)]
gh-100320: Fix path calculations on Windows when python.exe is moved outside of the normal location (GH-100947)
Mark Shannon [Mon, 16 Jan 2023 12:35:21 +0000 (12:35 +0000)]
GH-100982: Add `COMPARE_AND_BRANCH` instruction (GH-100983)
Nikita Sobolev [Mon, 16 Jan 2023 10:46:07 +0000 (13:46 +0300)]
gh-101056: Fix memory leak in `formatfloat()` in `bytesobject.c` (#101057)
scrazzz [Mon, 16 Jan 2023 10:44:50 +0000 (13:44 +0300)]
Docs: Remove duplicate `TraversableResources` reference (#101068)
Kumar Aditya [Mon, 16 Jan 2023 10:41:57 +0000 (16:11 +0530)]
GH-100997: fix refleak in `_testinternalcapi.c` (#101058)
Oleg Iarygin [Sun, 15 Jan 2023 20:36:31 +0000 (00:36 +0400)]
gh-101041: Fix a misspelled name of `utctimetuple` in a doc warning (GH-101042)
Cristián Maureira-Fredes [Sun, 15 Jan 2023 15:12:37 +0000 (16:12 +0100)]
Fix `ctypes` typo in `set_exception` (#101040)
Kumar Aditya [Sun, 15 Jan 2023 15:09:26 +0000 (20:39 +0530)]
GH-100892: consolidate `HEAD_LOCK/HEAD_UNLOCK` macros (#100953)
Erlend E. Aasland [Sat, 14 Jan 2023 22:58:06 +0000 (23:58 +0100)]
gh-100668: Clarify how sqlite3 maps parameters onto placeholders (#100960)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Oleg Iarygin [Sat, 14 Jan 2023 20:11:04 +0000 (00:11 +0400)]
gh-94518: [_posixsubprocess] Replace variable validity flags with reserved values (#94687)
Have _posixsubprocess.c stop using boolean flags to say if gid and uid values were supplied and action is required. Such an implicit "either initialized or look somewhere else" confused both the reader (another mental connection to constantly track between functions) and a compiler (warnings on potentially uninitialized variables being passed). Instead, we can utilize a special group/user id as a flag value -1 defined by POSIX but used nowhere else. Namely:
gid: call_setgid = False → gid = -1
uid: call_setuid = False → uid = -1
groups: call_setgroups = False → groups = NULL (obtained with (groups_list != Py_None) ? groups : NULL)
This PR is required for #94519.
Bob Kline [Sat, 14 Jan 2023 19:01:27 +0000 (14:01 -0500)]
gh-101021: Document binary parameters as bytes (#101024)
JustAnotherArchivist [Sat, 14 Jan 2023 05:55:35 +0000 (05:55 +0000)]
Sync-up parameter name in equivalent code snippet of `enumerate` (GH-101029)
Guido van Rossum [Sat, 14 Jan 2023 01:06:45 +0000 (17:06 -0800)]
GH-98831: Identify instructions that don't use oparg (#100957)
For these the instr_format field uses IX instead of IB.
Register instructions use IX, IB, IBBX, IBBB, etc.
Also: Include the closing '}' in Block.tokens, for completeness
Raymond Hettinger [Sat, 14 Jan 2023 01:01:22 +0000 (19:01 -0600)]
Add recipes to showcase tee(), zip*, batched, starmap, and product. (GH-101023)
Raymond Hettinger [Sat, 14 Jan 2023 00:53:06 +0000 (18:53 -0600)]
Fix typo in docs (GH-101025)
Yurii Karabas [Sat, 14 Jan 2023 00:05:43 +0000 (02:05 +0200)]
gh-74033: Fix bug when Path takes and ignores **kwargs (GH-19632)
Fix a bug where `Path` takes and ignores `**kwargs` by adding to `PurePath` class `__init__` method which can take only positional arguments.
Automerge-Triggered-By: GH:brettcannon
Guido van Rossum [Fri, 13 Jan 2023 21:24:57 +0000 (13:24 -0800)]
GH-100573: Fix server hang caused by os.stat() on named pipe (Windows) (#100959)
Mark Shannon [Fri, 13 Jan 2023 15:57:39 +0000 (15:57 +0000)]
Don't double count misses. (GH-100984)
Serhiy Storchaka [Fri, 13 Jan 2023 12:40:29 +0000 (14:40 +0200)]
gh-100160: Restore and deprecate implicit creation of an event loop (GH-100410)
Partially revert changes made in GH-93453.
asyncio.DefaultEventLoopPolicy.get_event_loop() now emits a
DeprecationWarning and creates and sets a new event loop instead of
raising a RuntimeError if there is no current event loop set.
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Steve Dower [Fri, 13 Jan 2023 11:49:01 +0000 (11:49 +0000)]
gh-100247: Fix py.exe launcher not using entire shebang command for finding custom commands (GH-100944)
Steve Dower [Fri, 13 Jan 2023 11:31:06 +0000 (11:31 +0000)]
gh-86682: Adds sys._getframemodulename as an alternative to using _getframe (GH-99520)
Also updates calls in collections, doctest, enum, and typing modules to use _getframemodulename first when available.
Raymond Hettinger [Thu, 12 Jan 2023 22:13:56 +0000 (16:13 -0600)]
GH-100942: Fix incorrect cast in property_copy(). (#100965)
Eric Snow [Thu, 12 Jan 2023 20:42:03 +0000 (13:42 -0700)]
GH-100997: Implement Multi-Phase Init for the _testinternalcapi Module (gh-100998)
_testinternalcapi is an internal module used for testing.
https://github.com/python/cpython/issues/100997
Barney Gale [Thu, 12 Jan 2023 19:24:57 +0000 (19:24 +0000)]
gh-96290: Support partial/invalid UNC drives in ntpath.normpath() and splitdrive() (GH-100351)
This brings the Python implementation of `ntpath.normpath()` in line with the C implementation added in
99fcf15
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Matthieu Dartiailh [Thu, 12 Jan 2023 18:23:50 +0000 (19:23 +0100)]
gh-96461: Improve docs for bytecode instructions (GH-96462)
* Clarify the meaning of the oparg for CACHE and COPY opcode in dis doc
* Use STACK to describe stack operation in analogy with a Python list
* Remove (delta) from BEFORE_WITH since BEFORE_WITH does not take an argument
* Fix the description of the stack impact of multiple opcodes
Neil Schemenauer [Thu, 12 Jan 2023 18:03:50 +0000 (10:03 -0800)]
GH-81381: Add longer comment _PyType_AllocNoTrack() (GH-100954)
The details on the "nitems+1" expression is a bit subtle so add a longer
comment about it.
Noam Cohen [Thu, 12 Jan 2023 15:40:29 +0000 (17:40 +0200)]
Fix typo in `enum` module documentation (#100992)
ram vikram singh [Thu, 12 Jan 2023 00:11:12 +0000 (05:41 +0530)]
GH-100894: Updated the doc for `sys.winver` to clarify its usual contents (GH-100913)
Michał Górny [Wed, 11 Jan 2023 21:46:28 +0000 (22:46 +0100)]
gh-98636: Fix detecting gdbm_compat for _dbm module (#98643)
Fix the gdbm_compat library detection logic to actually check for
-lgdbm_compat independently of the ndbm detection.
This fixes the build failure with `--with-dbmliborder=gdbm`,
and implicit fallback to ndbm with the default value.
Carlton Gibson [Wed, 11 Jan 2023 21:17:26 +0000 (22:17 +0100)]
gh-94912: Adjusted check for non-standard coroutine function marker. (#100935)
The initial implementation did not correctly identify explicitly
marked class instances.
Follow up to
532aa4e4e019812d0388920768ede7c04232ebe1
Mark Shannon [Wed, 11 Jan 2023 20:40:43 +0000 (20:40 +0000)]
GH-100923: Embed jump mask in `COMPARE_OP` oparg (GH-100924)
th1722 [Wed, 11 Jan 2023 17:28:57 +0000 (02:28 +0900)]
Ensure some build files include a newline at to avoid warnings (GH-100946)
Steve Dower [Wed, 11 Jan 2023 17:25:46 +0000 (17:25 +0000)]
Skip py.exe launcher tests in full layout CI test (GH-100948)
These tests become flaky when py.exe exists on the test machine but isn't the one that was just built. They also don't provide any useful information for this scenario, so easiest to just skip them.
Nikita Sobolev [Wed, 11 Jan 2023 17:14:41 +0000 (20:14 +0300)]
gh-100871: Improve `copy` module tests (GH-100872)
CC @AlexWaygood as the reviewer of https://github.com/python/cpython/pull/100818
Automerge-Triggered-By: GH:AlexWaygood
Kumar Aditya [Wed, 11 Jan 2023 10:33:31 +0000 (16:03 +0530)]
GH-100892: Fix race in clearing `threading.local` (#100922)
Mariusz Felisiak [Wed, 11 Jan 2023 10:05:41 +0000 (11:05 +0100)]
gh-98763: Prefer "python" over "python3" for command line examples in docs. (#98761)
Nikita Sobolev [Wed, 11 Jan 2023 09:43:45 +0000 (12:43 +0300)]
gh-100931: Test all `pickle` protocols in `test_slice` (#100932)
Thomas Wouters [Tue, 10 Jan 2023 16:40:11 +0000 (17:40 +0100)]
Post 3.12.0a4
Thomas Wouters [Tue, 10 Jan 2023 12:07:54 +0000 (13:07 +0100)]
Python 3.12.0a4
Brandt Bucher [Tue, 10 Jan 2023 10:56:53 +0000 (02:56 -0800)]
GH-100117: Make `co_lines` more efficient (GH-100447)
Yao-Ching Huang [Tue, 10 Jan 2023 10:17:57 +0000 (18:17 +0800)]
gh-100916: Convert argument to appropriate type (GH-100917)
Semen Zhydenko [Tue, 10 Jan 2023 09:04:06 +0000 (10:04 +0100)]
Fix typos in Doc folder (#100880)
Ned Deily [Tue, 10 Jan 2023 05:10:31 +0000 (00:10 -0500)]
gh-100180: Update macOS installer to OpenSSL 1.1.1s (GH-100908)
Ned Deily [Tue, 10 Jan 2023 03:37:10 +0000 (22:37 -0500)]
gh-100893: update bpo reference in Mac README (GH-100905)
Guido van Rossum [Mon, 9 Jan 2023 23:53:01 +0000 (15:53 -0800)]
GH-98831: Refactor instr format code and change to enum (#100895)
Steve Dower [Mon, 9 Jan 2023 23:50:59 +0000 (23:50 +0000)]
gh-100180: Update Windows installer to OpenSSL 1.1.1s (GH-100901)
Ryan Ozawa [Mon, 9 Jan 2023 21:43:09 +0000 (13:43 -0800)]
bpo-28356: Document os.rename() behavior on Windows for differing volumes (GH-27376)
Brandt Bucher [Mon, 9 Jan 2023 20:20:04 +0000 (12:20 -0800)]
GH-100126: Skip incomplete frames in more places (GH-100613)
Nikita Sobolev [Mon, 9 Jan 2023 19:20:25 +0000 (22:20 +0300)]
gh-100882: Improve `test_pickling` case in `test_ast.py` (#100883)
C.A.M. Gerlach [Mon, 9 Jan 2023 17:48:24 +0000 (11:48 -0600)]
gh-99191: Use correct check for MSVC C++ version support in _wmimodule.cpp (GH-100381)
Nikita Sobolev [Mon, 9 Jan 2023 15:51:24 +0000 (18:51 +0300)]
gh-100873: Fix "‘lo’ may be used uninitialized in this function" warning in `mathmodule.c` (#100881)
dgelessus [Mon, 9 Jan 2023 10:13:04 +0000 (11:13 +0100)]
GH-81061: Fix refcount issue when returning `None` from a `ctypes.py_object` callback (#13364)
Chris Withers [Mon, 9 Jan 2023 10:08:56 +0000 (10:08 +0000)]
fix up mock tests coverage (#100874)
Carl Meyer [Mon, 9 Jan 2023 09:05:56 +0000 (02:05 -0700)]
gh-100764: add `pycore_frame.h` to PYTHON_HEADERS and Windows build files(#100765)
dsentinel [Mon, 9 Jan 2023 09:00:40 +0000 (01:00 -0800)]
GH-100813: Add `socket.IP_PKTINFO` constant (#10294)
Ned Deily [Mon, 9 Jan 2023 02:53:56 +0000 (21:53 -0500)]
Update copyright year in README (GH-100863)
Co-authored-by: HARSHA VARDHAN <75431678+Thunder-007@users.noreply.github.com>
Nikita Sobolev [Sun, 8 Jan 2023 22:51:29 +0000 (01:51 +0300)]
gh-87447: Fix walrus comprehension rebind checking (#100581)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Ned Deily [Sun, 8 Jan 2023 22:05:28 +0000 (17:05 -0500)]
Update additional copyright years to 2023. (GH-100859)
Raymond Hettinger [Sun, 8 Jan 2023 19:40:35 +0000 (13:40 -0600)]
GH-100805: Support numpy.array() in random.choice(). (GH-100830)
Mark Dickinson [Sun, 8 Jan 2023 19:40:15 +0000 (19:40 +0000)]
gh-100833: Remove 'volatile' qualifiers in fsum algorithm (#100845)
This PR removes the `volatile` qualifier on various intermediate quantities
in the `math.fsum` implementation, and updates the notes preceding the
algorithm accordingly (as well as fixing some of the exsting notes). See
the linked issue #100833 for discussion.
Raymond Hettinger [Sun, 8 Jan 2023 19:38:24 +0000 (13:38 -0600)]
GH-100485: Tweaks to sumprod() (GH-100857)
Benjamin Peterson [Sun, 8 Jan 2023 15:13:25 +0000 (09:13 -0600)]
Update copyright years to 2023. (gh-100848)
Nnarol [Sun, 8 Jan 2023 13:51:20 +0000 (14:51 +0100)]
GH-90829: Fix empty iterable error message in min/max (#31181)
Nikita Sobolev [Sun, 8 Jan 2023 12:54:40 +0000 (15:54 +0300)]
gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)" (#100745)
* gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)"
This reverts commit
7c83eaa536d2f436ae46211ca48692f576c732f0 .
Shantanu [Sun, 8 Jan 2023 08:51:30 +0000 (00:51 -0800)]
gh-100783: fix os.path.join documentation (#100811)
- Use "drive", not "drive letter", because of UNC paths
- Previous components are not thrown away from relative drive letters
- Use "segment" instead of "component" for consistency with pathlib
- Other miscellaneous improvements
Sergey B Kirpichev [Sun, 8 Jan 2023 08:34:20 +0000 (11:34 +0300)]
gh-91851: Micro optimizations for arithmetic between Fractions (#25518)
Adapted from
https://github.com/python/cpython/pull/24779/commits/
046c84e8f9
This makes arithmetic between Fractions with small components
just as fast as before python/cpython#24779, at some expense of
mixed arithmetic (e.g. Fraction + int).
busywhitespace [Sun, 8 Jan 2023 08:07:16 +0000 (09:07 +0100)]
gh-100824: Fix typo in the documentation of unittest.TestLoader.testNamePatterns (#100825)
Shantanu [Sun, 8 Jan 2023 07:57:41 +0000 (23:57 -0800)]
gh-100776: Fix misleading default value in help(input) (#100788)
Raymond Hettinger [Sun, 8 Jan 2023 03:37:08 +0000 (21:37 -0600)]
GH-100485: Convert from Fast2Sum to 2Sum (GH-100836)
Nikita Sobolev [Sat, 7 Jan 2023 21:29:53 +0000 (00:29 +0300)]
gh-100815: Normalize `types` module usage in `copy` module (#100816)
Nikita Sobolev [Sat, 7 Jan 2023 21:26:05 +0000 (00:26 +0300)]
gh-100792: Make `email.message.Message.__contains__` twice as fast (#100793)
Raymond Hettinger [Sat, 7 Jan 2023 18:46:35 +0000 (12:46 -0600)]
GH-100485: Add math.sumprod() (GH-100677)
FrozenBob [Sat, 7 Jan 2023 17:31:47 +0000 (09:31 -0800)]
gh-100673: Removed erroneous note in the get_type_hints docs (#100701)
Removed erroneous note in the get_type_hints docs
typing.get_type_hints still includes base class type hints.
Carl Meyer [Sat, 7 Jan 2023 12:20:48 +0000 (05:20 -0700)]
gh-88696: clean up dead argument to compiler_make_closure (GH-100806)
Nikita Sobolev [Sat, 7 Jan 2023 10:49:15 +0000 (13:49 +0300)]
gh-96127: Fix `inspect.signature` call on mocks (#96335)
Nikita Sobolev [Sat, 7 Jan 2023 10:25:05 +0000 (13:25 +0300)]
gh-100690: [mock] hide `ATTRIB_DENY_LIST` and make it immutable (#100819)
Barney Gale [Fri, 6 Jan 2023 20:38:12 +0000 (20:38 +0000)]
Add barneygale to CODEOWNERS for pathlib (#100808)
Christian Klein [Fri, 6 Jan 2023 18:38:50 +0000 (19:38 +0100)]
gh-100690: Raise an AttributeError when the assert_ prefix is forgotten when using Mock (#100691)
Mock objects which are not unsafe will now raise an AttributeError when accessing an
attribute that matches the name of an assertion but without the prefix `assert_`, e.g. accessing `called_once` instead of `assert_called_once`.
This is in addition to this already happening for accessing attributes with prefixes assert, assret, asert, aseert, and assrt.
Guido van Rossum [Fri, 6 Jan 2023 16:04:20 +0000 (08:04 -0800)]
GH-98831: Add some tests for generate_cases.py (#100763)
- This doesn't cover everything (far from it) but it's a start.
- This uses pytest, which isn't ideal, but was quickest to get started.
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Sergey B Kirpichev [Fri, 6 Jan 2023 15:37:34 +0000 (18:37 +0300)]
gh-91851: Trivial optimizations in Fraction (#100791)
Make some trivial performance optimizations in Fraction
Uses private class attributes `_numerator` and `_denominator` in place of the `numerator` and `denominator` property accesses.
Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
Irit Katriel [Fri, 6 Jan 2023 14:55:56 +0000 (14:55 +0000)]
gh-100758: Refactor initialisation of frame headers into a single function (_PyFrame_Initialize) (GH-100759)
Mark Shannon [Fri, 6 Jan 2023 14:47:57 +0000 (14:47 +0000)]
GH-99005: More intrinsics (GH-100774)
* Remove UNARY_POSITIVE, LIST_TO_TUPLE and ASYNC_GEN_WRAP, replacing them with intrinsics.