]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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)

2 years agoFix typo in exception message in `multiprocessing.pool` (#99900)
Arne de Laat [Wed, 30 Nov 2022 15:27:28 +0000 (16:27 +0100)] 
Fix typo in exception message in `multiprocessing.pool` (#99900)

2 years agogh-87092: move all localsplus preparation into separate function called from assemble...
Irit Katriel [Wed, 30 Nov 2022 12:37:30 +0000 (12:37 +0000)] 
gh-87092: move all localsplus preparation into separate function called from assembler stage (GH-99869)

2 years agogh-99891: Fix infinite recursion in the tokenizer when showing warnings (GH-99893)
Pablo Galindo Salgado [Wed, 30 Nov 2022 11:36:06 +0000 (11:36 +0000)] 
gh-99891: Fix infinite recursion in the tokenizer when showing warnings (GH-99893)

Automerge-Triggered-By: GH:pablogsal
2 years agogh-99824: Document that sqlite3.connect implicitly open a transaction if autocommit...
Géry Ogam [Wed, 30 Nov 2022 11:33:50 +0000 (12:33 +0100)] 
gh-99824: Document that sqlite3.connect implicitly open a transaction if autocommit=False (#99825)

Authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoGH-81057: remove static state from suggestions.c (#99411)
Kumar Aditya [Wed, 30 Nov 2022 11:25:16 +0000 (16:55 +0530)] 
GH-81057: remove static state from suggestions.c (#99411)

2 years agoImprove zip64 limit error message (#95892)
dmjohnsson23 [Wed, 30 Nov 2022 11:14:41 +0000 (04:14 -0700)] 
Improve zip64 limit error message (#95892)

2 years agogh-98253: Break potential reference cycles in external code worsened by typing.py...
Wenzel Jakob [Wed, 30 Nov 2022 08:33:32 +0000 (09:33 +0100)] 
gh-98253: Break potential reference cycles in external code worsened by typing.py lru_cache (#98591)

2 years agogh-99127: Allow some features of syslog to the main interpreter only (gh-99128)
Dong-hee Na [Tue, 29 Nov 2022 22:58:20 +0000 (07:58 +0900)] 
gh-99127: Allow some features of syslog to the main interpreter only (gh-99128)

2 years agogh-82836: fix private network check (#97733)
Pete Wicken [Tue, 29 Nov 2022 21:32:18 +0000 (21:32 +0000)] 
gh-82836: fix private network check (#97733)

Fixes private checks for network objects. The previous method would incorrectly return True for a private check in cases such as "0.0.0.0/0".

2 years agoDocs: improve accuracy of socketserver reference (#24767)
Géry Ogam [Tue, 29 Nov 2022 20:34:52 +0000 (21:34 +0100)] 
Docs: improve accuracy of socketserver reference (#24767)

2 years agowhatsnew-3.10: Mention PEP 647 in the Release highlights section. (#99853)
Yilei "Dolee" Yang [Tue, 29 Nov 2022 20:30:58 +0000 (12:30 -0800)] 
whatsnew-3.10: Mention PEP 647 in the Release highlights section. (#99853)

Mention PEP 647 in the Release highlights section.

Also re-ordered the list so it matches the order in the details sections below.

2 years agogh-90717: Update the documentation for the altchars paremeter in base64 library ...
Sam Ezeh [Tue, 29 Nov 2022 16:21:01 +0000 (16:21 +0000)] 
gh-90717: Update the documentation for the altchars paremeter in base64 library (GH-94187)

2 years agogh-99845: Clean up _PyObject_VAR_SIZE() usage (#99847)
Victor Stinner [Tue, 29 Nov 2022 11:15:21 +0000 (12:15 +0100)] 
gh-99845: Clean up _PyObject_VAR_SIZE() usage (#99847)

* code_sizeof() now uses an unsigned type (size_t) to compute the result.
* Fix _PyObject_ComputedDictPointer(): cast _PyObject_VAR_SIZE() to
  Py_ssize_t, rather than long: it's a different type on 64-bit Windows.
* Clarify that _PyObject_VAR_SIZE() uses an unsigned type (size_t).

2 years agogh-99845: Change _PyDict_KeysSize() return type to size_t (#99848)
Victor Stinner [Tue, 29 Nov 2022 11:12:17 +0000 (12:12 +0100)] 
gh-99845: Change _PyDict_KeysSize() return type to size_t (#99848)

* Change _PyDict_KeysSize() and shared_keys_usable_size() return type
  from signed (Py_ssize_t) to unsigned (size_t) type.
* new_values() argument type is now unsigned (size_t).
* init_inline_values() now uses size_t rather than int for the 'i'
  iterator variable.
* type.__sizeof__() implementation now uses unsigned (size_t) type.

2 years agoGH-91375: Port `_asyncio` static types to heap types and module state (#99122)
Kumar Aditya [Tue, 29 Nov 2022 10:07:37 +0000 (15:37 +0530)] 
GH-91375: Port `_asyncio` static types to heap types and module state (#99122)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-99593: Add tests for Unicode C API (part 1) (GH-99651)
Serhiy Storchaka [Tue, 29 Nov 2022 07:59:56 +0000 (09:59 +0200)] 
gh-99593: Add tests for Unicode C API (part 1) (GH-99651)

Add tests for functions corresponding to the str class methods.

2 years agogh-99344, gh-99379, gh-99382: Fix issues in substitution of ParamSpec and TypeVarTupl...
Serhiy Storchaka [Tue, 29 Nov 2022 07:46:52 +0000 (09:46 +0200)] 
gh-99344, gh-99379, gh-99382: Fix issues in substitution of ParamSpec and TypeVarTuple (GH-99412)

* Fix substitution of TypeVarTuple and ParamSpec together in user generics.

* Fix substitution of ParamSpec followed by TypeVarTuple in generic aliases.

* Check the number of arguments in substitution in user generics containing a
  TypeVarTuple and one or more TypeVar.

2 years agogh-99811: Use correct variable to search for time in format string (GH-99812)
cemysce [Mon, 28 Nov 2022 18:25:03 +0000 (13:25 -0500)] 
gh-99811: Use correct variable to search for time in format string (GH-99812)

Use correct variable to search for asctime

2 years ago`fnmatch` docs: link to `fnmatch.filter()`, not `builtins.filter()` (#99819)
Matthew Hughes [Mon, 28 Nov 2022 18:08:08 +0000 (18:08 +0000)] 
`fnmatch` docs: link to `fnmatch.filter()`, not `builtins.filter()` (#99819)

2 years agoUse _Py_RVALUE() in macros (#99844)
Victor Stinner [Mon, 28 Nov 2022 16:42:22 +0000 (17:42 +0100)] 
Use _Py_RVALUE() in macros (#99844)

The following macros are modified to use _Py_RVALUE(), so they can no
longer be used as l-value:

* DK_LOG_SIZE()
* _PyCode_CODE()
* _PyList_ITEMS()
* _PyTuple_ITEMS()
* _Py_SLIST_HEAD()
* _Py_SLIST_ITEM_NEXT()

_PyCode_CODE() is private and other macros are part of the internal
C API.

2 years agoGrammatical improvements for ctypes 'winmode' documentation (GH-19167)
David Miguel Susano Pinto [Mon, 28 Nov 2022 16:05:21 +0000 (16:05 +0000)] 
Grammatical improvements for ctypes 'winmode' documentation (GH-19167)

2 years agogh-89653: PEP 670: Convert macros to functions (#99843)
Victor Stinner [Mon, 28 Nov 2022 15:40:08 +0000 (16:40 +0100)] 
gh-89653: PEP 670: Convert macros to functions (#99843)

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

* DK_ENTRIES()
* DK_UNICODE_ENTRIES()
* PyCode_GetNumFree()
* PyFloat_AS_DOUBLE()
* PyInstanceMethod_GET_FUNCTION()
* PyMemoryView_GET_BASE()
* PyMemoryView_GET_BUFFER()
* PyMethod_GET_FUNCTION()
* PyMethod_GET_SELF()
* PySet_GET_SIZE()
* _PyHeapType_GET_MEMBERS()

Changes:

* PyCode_GetNumFree() casts PyCode_GetNumFree.co_nfreevars from int
  to Py_ssize_t to be future proof, and because Py_ssize_t is
  commonly used in the C API.
* PyCode_GetNumFree() doesn't cast its argument: the replaced macro
  already required the exact type PyCodeObject*.
* Add assertions in some functions using "CAST" macros to check
  the arguments type when Python is built with assertions
  (debug build).
* Remove an outdated comment in unicodeobject.h.

2 years agobpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and segfaults (#18640)
Zackery Spytz [Mon, 28 Nov 2022 10:46:40 +0000 (02:46 -0800)] 
bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and segfaults (#18640)

Co-authored-by: Oren Milman <orenmn@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agobpo-41825: restructure docs for the os.wait*() family (GH-22356)
Georg Brandl [Mon, 28 Nov 2022 09:41:24 +0000 (10:41 +0100)] 
bpo-41825: restructure docs for the os.wait*() family (GH-22356)

2 years agogh-99249: Clarify "read-only" slots tp_bases & tp_mro (GH-99342)
Petr Viktorin [Mon, 28 Nov 2022 08:22:08 +0000 (09:22 +0100)] 
gh-99249: Clarify "read-only" slots tp_bases & tp_mro (GH-99342)

These slots are marked "should be treated as read-only" in the
table at the start of the document.  That doesn't say anything about
setting them in the static struct.

`tp_bases` docs did say that it should be ``NULL`` (TIL!). If you
ignore that, seemingly nothing bad happens. However, some slots
may not be inherited, depending on which sub-slot structs are present.
(FWIW, NumPy sets tp_bases and is affected by the quirk -- though to
be fair, its DUAL_INHERIT code probably predates tp_bases docs, and
also the result happens to be benign.)

This patch makes things explicit.
It also makes the summary table legend easier to scan.

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-51524: Fix bug when calling trace.CoverageResults with valid infile (#99629)
Furkan Onder [Mon, 28 Nov 2022 06:49:10 +0000 (09:49 +0300)] 
gh-51524: Fix bug when calling trace.CoverageResults with valid infile (#99629)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agoDocs: both sqlite3 "point examples" now adapt to str (#99823)
Erlend E. Aasland [Sun, 27 Nov 2022 21:08:30 +0000 (22:08 +0100)] 
Docs: both sqlite3 "point examples" now adapt to str (#99823)

2 years agogh-91340: Document multiprocessing.set_start_method force parameter (GH-32339)
Sam Ezeh [Sun, 27 Nov 2022 17:58:39 +0000 (17:58 +0000)] 
gh-91340: Document multiprocessing.set_start_method force parameter (GH-32339)

#91340

https://bugs.python.org/issue47184

Automerge-Triggered-By: GH:kumaraditya303
2 years agoDocs: Move .PHONY to each section to avoid copy/paste omissions (#99396)
Hugo van Kemenade [Sun, 27 Nov 2022 17:48:29 +0000 (19:48 +0200)] 
Docs: Move .PHONY to each section to avoid copy/paste omissions (#99396)

2 years agogh-99677: Deduplicate self-type in `mro` in `inspect._getmembers` (#99678)
Nikita Sobolev [Sun, 27 Nov 2022 11:15:26 +0000 (14:15 +0300)] 
gh-99677: Deduplicate self-type in `mro` in `inspect._getmembers` (#99678)

Closes #99677

2 years agogh-99815: remove unused 'invalid' sentinel value and code that checks for it in inspe...
Anthony Sottile [Sun, 27 Nov 2022 11:01:02 +0000 (06:01 -0500)] 
gh-99815: remove unused 'invalid' sentinel value and code that checks for it in inspect.signature parsing (GH-21104)

2 years agoGH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on macOS (#99768)
Ronald Oussoren [Sun, 27 Nov 2022 10:56:14 +0000 (11:56 +0100)] 
GH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on macOS (#99768)

On macOS all file descriptors for a particular file in /dev/fd
share the same file offset, that is ``open("/dev/fd/9", "r")`` behaves
more like ``dup(9)`` than a regular open.

This causes problems when a user tries to run "/dev/fd/9" as a script
because zipimport changes the file offset to try to read a zipfile
directory. Therefore change zipimport to reset the file offset after
trying to read the zipfile directory.

2 years agoRemove unused local variables in inspect.py (#24218)
Yonatan Goldschmidt [Sun, 27 Nov 2022 10:39:23 +0000 (12:39 +0200)] 
Remove unused local variables in inspect.py (#24218)

2 years agogh-85988: Change documentation for sys.float_info.rounds (GH-99675)
Brad Wolfe [Sun, 27 Nov 2022 10:25:12 +0000 (11:25 +0100)] 
gh-85988: Change documentation for sys.float_info.rounds (GH-99675)

* Change documentation for sys.float_info.rounds

Change the documentation for sys.float_info.rounds to remove
references to C99 section 5.2.4.2.2 and instead place the
available values inline.

* Correction to previous documentation change

Newlines were not preserved in generated HTML on previous
commit. I have changes the list to a comma-separated list
of values and their meanings.

* Clarify source for value of FLT_ROUNDS

Clarify the source of the FLT_ROUNDS value and
change 'floating-point addition' to 'floating-point
arithmetic' to indicate that the rounding mode
applies to all arithmetic operations.

2 years agodoc: Remove backslashes in doctest grammar docs (#29346)
George Zhang [Sun, 27 Nov 2022 06:38:39 +0000 (01:38 -0500)] 
doc: Remove backslashes in doctest grammar docs (#29346)

2 years agobpo-43327: Fix the docs for PyImport_ImportFrozenModuleObject() (#24659)
Zackery Spytz [Sun, 27 Nov 2022 06:27:41 +0000 (22:27 -0800)] 
bpo-43327: Fix the docs for PyImport_ImportFrozenModuleObject() (#24659)

The docs stated that PyImport_ImportFrozenModuleObject() returns a
new reference, but it actually returns an int.

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agoGH-66285: fix forking in asyncio (#99769)
Kumar Aditya [Sun, 27 Nov 2022 05:54:48 +0000 (11:24 +0530)] 
GH-66285: fix forking in asyncio (#99769)

Closes #66285