]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agoFix: typo (Indention) (GH-99904)
jarrodcolburn [Mon, 12 Dec 2022 12:25:22 +0000 (06:25 -0600)] 
Fix: typo (Indention) (GH-99904)

Example needed to be indented. Was trying to call a context manger `pr` (from ` with cProfile.Profile() as pr:`) wot perform ` pr.print_stats()` once it had already exited.

Automerge-Triggered-By: GH:AlexWaygood
2 years agogh-96715 Remove redundant NULL check in `profile_trampoline` function (#96716)
chgnrdv [Mon, 12 Dec 2022 11:59:27 +0000 (14:59 +0300)] 
gh-96715 Remove redundant NULL check in `profile_trampoline` function (#96716)

Closes #96715

2 years agogh-100176: remove incorrect version compatibility check from argument clinic (#100190)
Shantanu [Mon, 12 Dec 2022 11:52:12 +0000 (03:52 -0800)] 
gh-100176: remove incorrect version compatibility check from argument clinic (#100190)

2 years agoclarify the 4300-digit limit on int-str conversion (#100175)
Ned Batchelder [Mon, 12 Dec 2022 11:39:54 +0000 (03:39 -0800)] 
clarify the 4300-digit limit on int-str conversion (#100175)

2 years agogh-70393: Clarify mention of "middle" scope (#98839)
Shantanu [Mon, 12 Dec 2022 04:15:55 +0000 (20:15 -0800)] 
gh-70393: Clarify mention of "middle" scope (#98839)

2 years agogh-99688: Fix outdated tests in test_unary (#99712)
Yesung(Isaac) Lee [Sun, 11 Dec 2022 23:44:29 +0000 (08:44 +0900)] 
gh-99688: Fix outdated tests in test_unary (#99712)

* Remove duplicates from "L" suffix removal
* test_invert now tests `~`.

2 years agogh-100174: [Enum] Correct PowersOfThree example. (GH-100178)
Beweeted [Sun, 11 Dec 2022 23:20:59 +0000 (15:20 -0800)] 
gh-100174: [Enum] Correct PowersOfThree example. (GH-100178)

Changed from multiples of 3 to powers of 3 to match the class name.

2 years agogh-88500: Reduce memory use of `urllib.unquote` (#96763)
Gregory P. Smith [Sun, 11 Dec 2022 00:17:39 +0000 (16:17 -0800)] 
gh-88500: Reduce memory use of `urllib.unquote` (#96763)

`urllib.unquote_to_bytes` and `urllib.unquote` could both potentially generate `O(len(string))` intermediate `bytes` or `str` objects while computing the unquoted final result depending on the input provided. As Python objects are relatively large, this could consume a lot of ram.

This switches the implementation to using an expanding `bytearray` and a generator internally instead of precomputed `split()` style operations.

Microbenchmarks with some antagonistic inputs like `mess = "\u0141%%%20a%fe"*1000` show this is 10-20% slower for unquote and unquote_to_bytes and no different for typical inputs that are short or lack much unicode or % escaping. But the functions are already quite fast anyways so not a big deal.  The slowdown scales consistently linear with input size as expected.

Memory usage observed manually using `/usr/bin/time -v` on `python -m timeit` runs of larger inputs. Unittesting memory consumption is difficult and does not seem worthwhile.

Observed memory usage is ~1/2 for `unquote()` and <1/3 for `unquote_to_bytes()` using `python -m timeit -s 'from urllib.parse import unquote, unquote_to_bytes; v="\u0141%01\u0161%20"*500_000' 'unquote_to_bytes(v)'` as a test.

2 years agogh-99941: Ensure that asyncio.Protocol.data_received receives immutable bytes (#100053)
DarioDaF [Sat, 10 Dec 2022 23:07:02 +0000 (00:07 +0100)] 
gh-99941: Ensure that asyncio.Protocol.data_received receives immutable bytes (#100053)

2 years agogh-99728: correct typo in `datetime` format codes documentation (#99750)
Brad Wolfe [Sat, 10 Dec 2022 10:20:18 +0000 (11:20 +0100)] 
gh-99728: correct typo in `datetime` format codes documentation (#99750)

2 years agogh-99970 Adding missing `optionflags` parameter in the documentation of `doctest...
busywhitespace [Sat, 10 Dec 2022 10:12:40 +0000 (11:12 +0100)] 
gh-99970 Adding missing `optionflags` parameter in the documentation of `doctest` (#99971)

2 years agoFix potential flakiness in `test_run_until_complete_baseexception` (#100148)
Fantix King [Sat, 10 Dec 2022 10:05:24 +0000 (05:05 -0500)] 
Fix potential flakiness in `test_run_until_complete_baseexception` (#100148)

2 years agoFix potential flakiness in `test_run_until_complete_baseexception` (#100148)
Fantix King [Sat, 10 Dec 2022 10:04:50 +0000 (05:04 -0500)] 
Fix potential flakiness in `test_run_until_complete_baseexception` (#100148)

2 years agoFix potential flakiness in `test_run_until_complete_baseexception` (#100148)
Fantix King [Sat, 10 Dec 2022 10:04:22 +0000 (05:04 -0500)] 
Fix potential flakiness in `test_run_until_complete_baseexception` (#100148)

2 years agogh-99582: freeze `zipimport` into `_bootstrap_python` (#99583)
Kai Zhang [Sat, 10 Dec 2022 09:35:56 +0000 (17:35 +0800)] 
gh-99582: freeze `zipimport` into `_bootstrap_python` (#99583)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-100049: fix `repr` for `mappingproxy` in dictionary view example doc (#100052)
ram vikram singh [Sat, 10 Dec 2022 09:16:00 +0000 (14:46 +0530)] 
gh-100049: fix `repr` for `mappingproxy` in dictionary view example doc (#100052)

2 years agogh-81057: Fix a Reference Leak in the posix Module (gh-100140)
Eric Snow [Fri, 9 Dec 2022 17:18:29 +0000 (10:18 -0700)] 
gh-81057: Fix a Reference Leak in the posix Module (gh-100140)

The leak was introduced in gh-100082.

https://github.com/python/cpython/issues/81057

2 years agogh-81057: Fix the wasm32-wasi Buildbot (gh-100139)
Eric Snow [Fri, 9 Dec 2022 17:17:54 +0000 (10:17 -0700)] 
gh-81057: Fix the wasm32-wasi Buildbot (gh-100139)

The build was broken by gh-100084.

https://github.com/python/cpython/issues/81057

2 years agoGH-98363: Shrink the physical size as well as the logical size (GH-100138)
Raymond Hettinger [Fri, 9 Dec 2022 17:02:35 +0000 (11:02 -0600)] 
GH-98363: Shrink the physical size as well as the logical size (GH-100138)

2 years agobpo-44512: Fix handling of extrasactions arg to csv.DictWriter with mixed or upper...
andrei kulakov [Fri, 9 Dec 2022 16:14:33 +0000 (11:14 -0500)] 
bpo-44512: Fix handling of extrasactions arg to csv.DictWriter with mixed or upper case (#26924)

2 years agobpo-43984: Allow winreg.SetValueEx to set -1 without treating it as an error (GH...
Shreyan Avigyan [Fri, 9 Dec 2022 12:47:18 +0000 (18:17 +0530)] 
bpo-43984: Allow winreg.SetValueEx to set -1 without treating it as an error (GH-25775)

2 years agoGH-98522: Add version number to code objects. (GH-98525)
Mark Shannon [Fri, 9 Dec 2022 12:18:45 +0000 (12:18 +0000)] 
GH-98522: Add version number to code objects. (GH-98525)

* Add version number to code object for better versioning of functions.

* Improves specialization for closures and list comprehensions.

2 years agogh-88267: Avoid DLL exporting functions from static builds on Windows(GH-99888)
Christian Rendina [Fri, 9 Dec 2022 11:16:15 +0000 (12:16 +0100)] 
gh-88267: Avoid DLL exporting functions from static builds on Windows(GH-99888)

2 years agoGH-100110: Specialize FOR_ITER for tuples (GH-100109)
Ken Jin [Fri, 9 Dec 2022 10:27:01 +0000 (18:27 +0800)] 
GH-100110: Specialize FOR_ITER for tuples (GH-100109)

* Specialize FOR_ITER for tuples

2 years agoGH-100113: remove remaining `yield from` usage from `asyncio` tests (#100114)
Kumar Aditya [Fri, 9 Dec 2022 03:52:18 +0000 (09:22 +0530)] 
GH-100113: remove remaining `yield from` usage from `asyncio` tests  (#100114)

2 years agogh-99087: Add missing newline for prompts in docs (GH-98993)
Stanley [Fri, 9 Dec 2022 03:31:19 +0000 (19:31 -0800)] 
gh-99087: Add missing newline for prompts in docs (GH-98993)

Add newline for prompts so copying to REPL does not cause errors.

2 years agogh-81057: Fix an ifdef in the time module (#100125)
Eric Snow [Fri, 9 Dec 2022 01:16:37 +0000 (18:16 -0700)] 
gh-81057: Fix an ifdef in the time module (#100125)

An earlier commit only defined check_ticks_per_second() when HAVE_TIMES is defined. However, we also need it when HAVE_CLOCK is defined. This primarily affects Windows.

https://github.com/python/cpython/issues/81057

2 years agogh-81057: Move Threading-Related Globals to _PyRuntimeState (#100084)
Eric Snow [Fri, 9 Dec 2022 00:50:58 +0000 (17:50 -0700)] 
gh-81057: Move Threading-Related Globals to _PyRuntimeState (#100084)

https://github.com/python/cpython/issues/81057

2 years agogh-81057: Move Ceval Trampoline Globals to _PyRuntimeState (gh-100083)
Eric Snow [Fri, 9 Dec 2022 00:17:20 +0000 (17:17 -0700)] 
gh-81057: Move Ceval Trampoline Globals to _PyRuntimeState (gh-100083)

https://github.com/python/cpython/issues/81057

2 years agoGH-98831: Generate things in the input order (#100123)
Guido van Rossum [Thu, 8 Dec 2022 23:54:07 +0000 (15:54 -0800)] 
GH-98831: Generate things in the input order (#100123)

This makes it easier to see what changed in the generated code
when converting an instruction to super or macro.

2 years agogh-81057: Move time Globals to _PyRuntimeState (gh-100122)
Eric Snow [Thu, 8 Dec 2022 23:46:09 +0000 (16:46 -0700)] 
gh-81057: Move time Globals to _PyRuntimeState (gh-100122)

https://github.com/python/cpython/issues/81057

2 years agogh-81057: Move OS-Related Globals to _PyRuntimeState (gh-100082)
Eric Snow [Thu, 8 Dec 2022 22:38:06 +0000 (15:38 -0700)] 
gh-81057: Move OS-Related Globals to _PyRuntimeState (gh-100082)

https://github.com/python/cpython/issues/81057

2 years agoGH-98831: Typed stack effects, and more instructions converted (#99764)
Guido van Rossum [Thu, 8 Dec 2022 21:31:27 +0000 (13:31 -0800)] 
GH-98831: Typed stack effects, and more instructions converted (#99764)

Stack effects can now have a type, e.g. `inst(X, (left, right -- jump/uint64_t)) { ... }`.

Instructions converted to the non-legacy format:

* COMPARE_OP
* COMPARE_OP_FLOAT_JUMP
* COMPARE_OP_INT_JUMP
* COMPARE_OP_STR_JUMP
* STORE_ATTR
* DELETE_ATTR
* STORE_GLOBAL
* STORE_ATTR_INSTANCE_VALUE
* STORE_ATTR_WITH_HINT
* STORE_ATTR_SLOT, and complete the store_attr family
* Complete the store_subscr family: STORE_SUBSCR{,DICT,LIST_INT}
  (STORE_SUBSCR was alread half converted,
  but wasn't using cache effects yet.)
* DELETE_SUBSCR
* PRINT_EXPR
* INTERPRETER_EXIT (a bit weird, ends in return)
* RETURN_VALUE
* GET_AITER (had to restructure it some)
  The original had mysterious `SET_TOP(NULL)` before `goto error`.
  I assume those just account for `obj` having been decref'ed,
  so I got rid of them in favor of the cleanup implied by `ERROR_IF()`.
* LIST_APPEND (a bit unhappy with it)
* SET_ADD (also a bit unhappy with it)

Various other improvements/refactorings as well.

2 years agoGH-98363: Have batched() return tuples (GH-100118)
Raymond Hettinger [Thu, 8 Dec 2022 21:08:16 +0000 (15:08 -0600)] 
GH-98363: Have batched() return tuples (GH-100118)

2 years agogh-96250: Improve sqlite3 injection attack example (#99270)
Jia Junjie [Thu, 8 Dec 2022 20:37:08 +0000 (04:37 +0800)] 
gh-96250: Improve sqlite3 injection attack example (#99270)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agotest_ast uses infinite_recursion() to prevent crash (#100104)
Victor Stinner [Thu, 8 Dec 2022 08:26:38 +0000 (09:26 +0100)] 
test_ast uses infinite_recursion() to prevent crash (#100104)

test.test_ast_recursion_limit() now uses infinite_recursion() of
test.support to prevent crashes on debug builds.

Before this change, the test crashed on ARM64 Windows 3.x buildbot
worker which builds Python in debug mode.

2 years agoFix `test_run_until_complete_baseexception` test to check for `KeyboardInterrupt...
Fantix King [Thu, 8 Dec 2022 08:21:04 +0000 (03:21 -0500)] 
Fix `test_run_until_complete_baseexception` test to check for `KeyboardInterrupt` in asyncio (#24477)

2 years agogh-100098: [Enum] insist on actual tuples, no subclasses, for auto (GH-100099)
Ethan Furman [Thu, 8 Dec 2022 06:58:08 +0000 (22:58 -0800)] 
gh-100098: [Enum] insist on actual tuples, no subclasses, for auto (GH-100099)

When checking for auto() instances, only top-level usage is supported,
which means either alone or as part of a regular tuple. Other
containers, such as lists, dicts, or namedtuples, will not have auto()
transformed into a value.

2 years agogh-98030: socket: add missing TCP socket options (#98031)
Matthieu Baerts [Thu, 8 Dec 2022 04:59:37 +0000 (05:59 +0100)] 
gh-98030: socket: add missing TCP socket options (#98031)

A few TCP socket options have been added to the Linux kernel these last
few years.

This commit adds all the ones available in Linux 6.0:

  https://elixir.bootlin.com/linux/v6.0/source/include/uapi/linux/tcp.h#L91

While at it, the TCP_FASTOPEN option has been moved lower in the list
just to keep the same order as in tcp.h to ease future synchronisations.

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
2 years agogh-92120: The docstring of enum.Enum is invalid in reST (GH-92122)
Takeshi KOMIYA [Thu, 8 Dec 2022 02:24:52 +0000 (11:24 +0900)] 
gh-92120: The docstring of enum.Enum is invalid in reST (GH-92122)

Closes #92120

2 years agogh-98778: Update HTTPError to initialize properly even if fp is None (gh-99966)
Dong-hee Na [Thu, 8 Dec 2022 02:20:34 +0000 (11:20 +0900)] 
gh-98778: Update HTTPError to initialize properly even if fp is None (gh-99966)

2 years agogh-100086: Add build info to test.libregrtest (#100093)
Victor Stinner [Thu, 8 Dec 2022 00:38:47 +0000 (01:38 +0100)] 
gh-100086: Add build info to test.libregrtest (#100093)

The Python test runner (libregrtest) now logs Python build information like
"debug" vs "release" build, or LTO and PGO optimizations.

2 years agogh-81057: Move More Globals to _PyRuntimeState (gh-100092)
Eric Snow [Wed, 7 Dec 2022 22:56:31 +0000 (15:56 -0700)] 
gh-81057: Move More Globals to _PyRuntimeState (gh-100092)

https://github.com/python/cpython/issues/81057

2 years agogh-90110: Clean Up the C-analyzer Globals Lists (gh-100091)
Eric Snow [Wed, 7 Dec 2022 22:02:47 +0000 (15:02 -0700)] 
gh-90110: Clean Up the C-analyzer Globals Lists (gh-100091)

https://github.com/python/cpython/issues/90110

2 years agogh-100072: only trigger netlify builds for doc changes (#100074)
Nikita Sobolev [Wed, 7 Dec 2022 19:07:30 +0000 (22:07 +0300)] 
gh-100072: only trigger netlify builds for doc changes (#100074)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-100077: make test_code.test_invalid_bytecode more robust and maintainable (#100078)
Irit Katriel [Wed, 7 Dec 2022 18:09:05 +0000 (18:09 +0000)] 
gh-100077: make test_code.test_invalid_bytecode more robust and maintainable (#100078)

2 years agogh-83035: handle decorator with nested parens in inspect.getsource (#99654)
Carl Meyer [Wed, 7 Dec 2022 16:55:12 +0000 (09:55 -0700)] 
gh-83035: handle decorator with nested parens in inspect.getsource (#99654)

2 years agogh-98724: Fix Py_CLEAR() macro side effects (#99100) (#100070)
Victor Stinner [Wed, 7 Dec 2022 14:22:38 +0000 (15:22 +0100)] 
gh-98724: Fix Py_CLEAR() macro side effects (#99100) (#100070)

The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate
their arguments once. If an argument has side effects, these side
effects are no longer duplicated.

Use temporary variables to avoid duplicating side effects of macro
arguments. If available, use _Py_TYPEOF() to avoid type punning.
Otherwise, use memcpy() for the assignment to prevent a
miscompilation with strict aliasing caused by type punning.

Add _Py_TYPEOF() macro: __typeof__() on GCC and clang.

Add test_py_clear() and test_py_setref() unit tests to _testcapi.

2 years agogh-93018: Fix for the compatibility problems with expat (gh-93900)
Matěj Cepl [Wed, 7 Dec 2022 06:55:49 +0000 (07:55 +0100)] 
gh-93018: Fix for the compatibility problems with expat (gh-93900)

2 years ago[Enum] Remove unused code from `test_enum.py` (GH-96986)
Nikita Sobolev [Wed, 7 Dec 2022 02:44:47 +0000 (05:44 +0300)] 
[Enum] Remove unused code from `test_enum.py` (GH-96986)

2 years agogh-100050: Fix an assertion error when raising unclosed parenthesis errors in the...
Pablo Galindo Salgado [Tue, 6 Dec 2022 23:09:56 +0000 (23:09 +0000)] 
gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer (GH-100065)

Automerge-Triggered-By: GH:pablogsal
2 years agoPyUnicode_KIND() uses _Py_RVALUE() (#100060)
Victor Stinner [Tue, 6 Dec 2022 22:40:05 +0000 (23:40 +0100)] 
PyUnicode_KIND() uses _Py_RVALUE() (#100060)

The PyUnicode_KIND() macro is modified to use _Py_RVALUE(), so it can
no longer be used as a l-value.

2 years agogh-94943: [Enum] improve repr() when inheriting from a dataclass (GH-99740)
Ethan Furman [Tue, 6 Dec 2022 21:43:41 +0000 (13:43 -0800)] 
gh-94943: [Enum] improve repr() when inheriting from a dataclass (GH-99740)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoPost 3.12.0a3
Thomas Wouters [Tue, 6 Dec 2022 21:20:28 +0000 (22:20 +0100)] 
Post 3.12.0a3

2 years agoPython 3.12.0a3 v3.12.0a3
Thomas Wouters [Tue, 6 Dec 2022 18:31:10 +0000 (19:31 +0100)] 
Python 3.12.0a3

2 years agogh-93453: No longer create an event loop in get_event_loop() (#98440)
Serhiy Storchaka [Tue, 6 Dec 2022 17:42:12 +0000 (19:42 +0200)] 
gh-93453: No longer create an event loop in get_event_loop() (#98440)

asyncio.get_event_loop() now always return either running event loop or
the result of get_event_loop_policy().get_event_loop() call. The latter
should now raise an RuntimeError if no current event loop was set
instead of creating and setting a new event loop.

It affects also a number of asyncio functions and constructors which
call get_event_loop() implicitly: ensure_future(), shield(), gather(),
etc.

DeprecationWarning is no longer emitted if there is no running event loop but
the current event loop was set.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years agoGH-99729: Unlink frames before clearing them (GH-100030)
Brandt Bucher [Tue, 6 Dec 2022 14:01:38 +0000 (06:01 -0800)] 
GH-99729: Unlink frames before clearing them (GH-100030)

2 years agobpo-37860: re-add netlify.toml to set up deploy previews for docs (#92852)
Ashwin Ramaswami [Tue, 6 Dec 2022 13:37:41 +0000 (08:37 -0500)] 
bpo-37860: re-add netlify.toml to set up deploy previews for docs (#92852)

* Revert "bpo-46184: remove `netlify.toml` (#30272)"

This reverts commit fbaf2e604cd354f1ebc6be029480010c6715a8ca.

* Delete runtime.txt

* Create runtime.txt

* Delete runtime.txt

* Update netlify.toml

* Update netlify.toml

* Add netlify badge

* Update Doc/tools/templates/layout.html

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Update layout.html

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-100008: VS 2017 is required since Python 3.11 (#100045)
Victor Stinner [Tue, 6 Dec 2022 13:35:32 +0000 (14:35 +0100)] 
gh-100008: VS 2017 is required since Python 3.11 (#100045)

2 years agoGH-100026: Include the number of raw input files in summarize_stats.py (GH-100027)
Michael Droettboom [Tue, 6 Dec 2022 11:14:47 +0000 (06:14 -0500)] 
GH-100026: Include the number of raw input files in summarize_stats.py (GH-100027)

2 years agogh-99957: Add `frozen_default` parameter on `dataclass_transform` (#99958)
Erik De Bonte [Tue, 6 Dec 2022 03:35:43 +0000 (19:35 -0800)] 
gh-99957: Add `frozen_default` parameter on `dataclass_transform` (#99958)

2 years agogh-100001: Remove doc typo, add versionadded (#100042)
Gregory P. Smith [Mon, 5 Dec 2022 23:15:13 +0000 (15:15 -0800)] 
gh-100001: Remove doc typo, add versionadded (#100042)

gh-100001: Remove new doc typo, add versionadded.

2 years agogh-100001: Also escape \s in http.server log messages. (#100038)
Gregory P. Smith [Mon, 5 Dec 2022 22:27:55 +0000 (14:27 -0800)] 
gh-100001: Also escape \s in http.server log messages. (#100038)

Also \ escape \s in the http.server BaseHTTPRequestHandler.log_message so
that it is technically possible to parse the line and reconstruct what the
original data was.  Without this a \xHH is ambiguious as to if it is a hex
replacement we put in or the characters r"\x" came through in the original
request line.

2 years agogh-99984: Fix Compiler Warnings (#100036)
Eric Snow [Mon, 5 Dec 2022 21:41:06 +0000 (14:41 -0700)] 
gh-99984: Fix Compiler Warnings (#100036)

https://github.com/python/cpython/issues/99984

2 years agoUse sphinxext-opengraph to generate OpenGraph metadata (#99931)
Hugo van Kemenade [Mon, 5 Dec 2022 21:26:28 +0000 (23:26 +0200)] 
Use sphinxext-opengraph to generate OpenGraph metadata (#99931)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-100001: Omit control characters in http.server stderr logs. (#100002)
Gregory P. Smith [Mon, 5 Dec 2022 20:55:45 +0000 (12:55 -0800)] 
gh-100001: Omit control characters in http.server stderr logs. (#100002)

Replace control characters in http.server.BaseHTTPRequestHandler.log_message with an escaped \xHH sequence to avoid causing problems for the terminal the output is printed to.

2 years agogh-99741: Implement Multi-Phase Init for the _xxsubinterpreters Module (gh-99742)
Eric Snow [Mon, 5 Dec 2022 20:40:20 +0000 (13:40 -0700)] 
gh-99741: Implement Multi-Phase Init for the _xxsubinterpreters Module (gh-99742)

_xxsubinterpreters is an internal module used for testing.

https://github.com/python/cpython/issues/99741

2 years agodataclasses.rst: Prevent horizontal scrolling (gh-100025)
Ram Rachum [Mon, 5 Dec 2022 18:56:13 +0000 (20:56 +0200)] 
dataclasses.rst: Prevent horizontal scrolling (gh-100025)

2 years agobpo-44817: Ignore additional errors in ntpath.realpath (GH-27574)
Michael Förderer [Mon, 5 Dec 2022 17:34:00 +0000 (18:34 +0100)] 
bpo-44817: Ignore additional errors in ntpath.realpath (GH-27574)

2 years agogh-98680: Add PyBUF_* constants to the Limited API listing (GH-100018)
Petr Viktorin [Mon, 5 Dec 2022 17:02:36 +0000 (18:02 +0100)] 
gh-98680: Add PyBUF_* constants to the Limited API listing (GH-100018)

``PyBUF_*`` constants are marked as part of Limited API of Python 3.11+.
These were available in 3.11.0 with `Py_LIMITED_API` defined for 3.11,
and are necessary to use the buffer API. Omitting them in `stable_abi.toml`
was a mistake.

2 years agogh-60203: Revert changes in cycle.__setstate__ (#99982)
Serhiy Storchaka [Mon, 5 Dec 2022 16:27:40 +0000 (18:27 +0200)] 
gh-60203: Revert changes in cycle.__setstate__ (#99982)

In case if only True/False be supported as boolean arguments in future,
we should continue to support 1/0 here.

2 years agogh-99892: test_unicodedata: skip test on download failure (#100011)
Victor Stinner [Mon, 5 Dec 2022 15:37:40 +0000 (16:37 +0100)] 
gh-99892: test_unicodedata: skip test on download failure (#100011)

Skip test_normalization() of test_unicodedata if it fails to download
NormalizationTest.txt file from pythontest.net.

2 years agogh-100008: Document Python build requirements (#100009)
Victor Stinner [Mon, 5 Dec 2022 14:41:44 +0000 (15:41 +0100)] 
gh-100008: Document Python build requirements (#100009)

Document also configure --without-freelists option added to Python
3.11.

2 years agogh-100005: Skip test_script_as_dev_fd() on FreeBSD (#100006)
Victor Stinner [Mon, 5 Dec 2022 13:23:35 +0000 (14:23 +0100)] 
gh-100005: Skip test_script_as_dev_fd() on FreeBSD (#100006)

On FreeBSD, skip test_script_as_dev_fd() of test_cmd_line_script if
fdescfs is not mounted (at /dev/fd).

2 years agogh-93464: [Enum] Add versionchanged tag (#99997)
Ethan Furman [Mon, 5 Dec 2022 10:35:31 +0000 (02:35 -0800)] 
gh-93464: [Enum] Add versionchanged tag (#99997)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agono-issue: Fix typo in pycore_object.h (gh-99994)
Ikko Ashimine [Mon, 5 Dec 2022 05:42:38 +0000 (14:42 +0900)] 
no-issue: Fix typo in pycore_object.h (gh-99994)

2 years agogh-98248: Normalizing the error messages in function struct.pack (GH-98252)
Felix Ye [Sun, 4 Dec 2022 20:24:18 +0000 (15:24 -0500)] 
gh-98248: Normalizing the error messages in function struct.pack (GH-98252)

Provide consistent and informative error messages in function struct.pack when its integral arguments are not in range.

2 years ago[Enum] Fix typos in the documentation (GH-99960)
Géry Ogam [Sun, 4 Dec 2022 19:49:31 +0000 (20:49 +0100)] 
[Enum] Fix typos in the documentation (GH-99960)

2 years agogh-98458: unittest: bugfix for infinite loop while handling chained exceptions that...
AlexTate [Sun, 4 Dec 2022 19:37:55 +0000 (12:37 -0700)] 
gh-98458: unittest: bugfix for infinite loop while handling chained exceptions that contain cycles (#98459)

* Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks()
* Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out)
* adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes

2 years agoGH-91054: Reset static events counts in code watchers tests (#99978)
Itamar Ostricher [Sun, 4 Dec 2022 12:38:21 +0000 (04:38 -0800)] 
GH-91054: Reset static events counts in code watchers tests (#99978)

2 years agogh-60203: Always pass True/False as boolean arguments in tests (GH-99983)
Serhiy Storchaka [Sun, 4 Dec 2022 12:28:56 +0000 (14:28 +0200)] 
gh-60203: Always pass True/False as boolean arguments in tests (GH-99983)

Unless we explicitly test non-bool values.

2 years agogh-85747: "Preface" section of asyncio-eventloop.rst: Switch to active voice and...
Brian Skinn [Sun, 4 Dec 2022 00:48:41 +0000 (19:48 -0500)] 
gh-85747: "Preface" section of asyncio-eventloop.rst: Switch to active voice and suggest other edits (#99784)

2 years agobpo-15999: Accept arbitrary values for boolean parameters. (#15609)
Serhiy Storchaka [Sat, 3 Dec 2022 19:52:21 +0000 (21:52 +0200)] 
bpo-15999: Accept arbitrary values for boolean parameters. (#15609)

builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.

2 years agogh-99934: test_marshal.py: add more elements in test_deterministic_sets (GH-99935)
Alexander Kanavin [Sat, 3 Dec 2022 16:53:20 +0000 (17:53 +0100)] 
gh-99934: test_marshal.py: add more elements in test_deterministic_sets (GH-99935)

Existing elements do produce different output on x86_64, but they
do not on x86. Let's make the data longer to ensure it differs.

2 years agoGH-66285: remove redundant `time.sleep` from `test_fork_signal_handling` (GH-99963)
Kumar Aditya [Sat, 3 Dec 2022 06:15:36 +0000 (11:45 +0530)] 
GH-66285: remove redundant `time.sleep` from `test_fork_signal_handling` (GH-99963)

2 years agoGH-98831: Support cache effects in super- and macro instructions (#99601)
Guido van Rossum [Sat, 3 Dec 2022 03:57:30 +0000 (19:57 -0800)] 
GH-98831: Support cache effects in super- and macro instructions (#99601)

2 years agogh-99741: Clean Up the _xxsubinterpreters Module (gh-99940)
Eric Snow [Fri, 2 Dec 2022 18:36:57 +0000 (11:36 -0700)] 
gh-99741: Clean Up the _xxsubinterpreters Module (gh-99940)

This cleanup up resolves a few subtle bugs and makes the implementation for multi-phase init much cleaner.

https://github.com/python/cpython/issues/99741

2 years agogh-99955: standardize return values of functions in assembler and optimizer. (#99956)
Irit Katriel [Fri, 2 Dec 2022 17:43:10 +0000 (17:43 +0000)] 
gh-99955: standardize return values of functions in assembler and optimizer. (#99956)

2 years agogh-99741: Fix the Cross-Interpreter Data API (gh-99939)
Eric Snow [Fri, 2 Dec 2022 17:39:17 +0000 (10:39 -0700)] 
gh-99741: Fix the Cross-Interpreter Data API (gh-99939)

There were some minor issues that showed up while I was working on porting _xxsubinterpreters to multi-phase init. This fixes them.

https://github.com/python/cpython/issues/99741

2 years agoGH-91054: Add code object watchers API (GH-99859)
Itamar Ostricher [Fri, 2 Dec 2022 17:28:27 +0000 (09:28 -0800)] 
GH-91054: Add code object watchers API (GH-99859)

* Add API to allow extensions to set callback function on creation and destruction of PyCodeObject

Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
2 years agogh-99894: Ensure the local names don't collide with the test file in traceback sugges...
Pablo Galindo Salgado [Thu, 1 Dec 2022 13:05:56 +0000 (13:05 +0000)] 
gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking (#99895)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (GH-99613)
Serhiy Storchaka [Thu, 1 Dec 2022 12:54:51 +0000 (14:54 +0200)] 
gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (GH-99613)

Previously *consumed was not set in this case.

2 years agoDoc: Add summary line to isolation_level & autocommit sqlite3.connect params (#99917)
C.A.M. Gerlach [Thu, 1 Dec 2022 07:19:41 +0000 (01:19 -0600)] 
Doc: Add summary line to isolation_level & autocommit sqlite3.connect params (#99917)

Add summary lines to isolation_level and autocommit connect() params

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2 years agoGH-98906 ```re``` module: ```search() vs. match()``` section should mention ```fullma...
ram vikram singh [Wed, 30 Nov 2022 22:52:21 +0000 (04:22 +0530)] 
GH-98906 ```re``` module: ```search() vs. match()``` section should mention ```fullmatch()``` (GH-98916)

Mention fullmatch along with search and match.

2 years agogh-89189: More compact range iterator (GH-27986)
Serhiy Storchaka [Wed, 30 Nov 2022 21:04:30 +0000 (23:04 +0200)] 
gh-89189: More compact range iterator (GH-27986)

2 years agobpo-47220: Document the optional callback parameter of weakref.WeakMethod (GH-25491)
Géry Ogam [Wed, 30 Nov 2022 19:44:10 +0000 (20:44 +0100)] 
bpo-47220: Document the optional callback parameter of weakref.WeakMethod (GH-25491)

2 years agoGH-99905: Fix output of misses in summarize_stats.py execution counts (GH-99906)
Michael Droettboom [Wed, 30 Nov 2022 19:17:08 +0000 (14:17 -0500)] 
GH-99905: Fix output of misses in summarize_stats.py execution counts (GH-99906)

This was an indentation error introduced in 2844aa6a

2 years agogh-99845: PEP 670: Convert PyObject macros to functions (#99850)
Victor Stinner [Wed, 30 Nov 2022 17:17:50 +0000 (18:17 +0100)] 
gh-99845: PEP 670: Convert PyObject macros to functions (#99850)

Convert macros to static inline functions to avoid macro pitfalls,
like duplication of side effects:

* _PyObject_SIZE()
* _PyObject_VAR_SIZE()

The result type is size_t (unsigned).

2 years agogh-99845: Use size_t type in __sizeof__() methods (#99846)
Victor Stinner [Wed, 30 Nov 2022 16:22:52 +0000 (17:22 +0100)] 
gh-99845: Use size_t type in __sizeof__() methods (#99846)

The implementation of __sizeof__() methods using _PyObject_SIZE() now
use an unsigned type (size_t) to compute the size, rather than a signed
type (Py_ssize_t).

Cast explicitly signed (Py_ssize_t) values to unsigned type
(Py_ssize_t).

2 years agoGH-99877)
Irit Katriel [Wed, 30 Nov 2022 16:16:54 +0000 (16:16 +0000)] 
GH-99877)