]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-74895: getaddrinfo no longer raises OverflowError (#2435)
Radek Smejkal [Tue, 14 Feb 2023 01:37:34 +0000 (02:37 +0100)] 
gh-74895: getaddrinfo no longer raises OverflowError (#2435)

`socket.getaddrinfo()` no longer raises `OverflowError` based on the **port** argument. Error reporting (or not) for its value is left up to the underlying C library `getaddrinfo()` implementation.

2 years agogh-101849: Add upgrade codes for old versions of launcher that ended up with later...
Steve Dower [Mon, 13 Feb 2023 20:33:48 +0000 (20:33 +0000)] 
gh-101849: Add upgrade codes for old versions of launcher that ended up with later version numbers (GH-101877)

2 years agogh-101810: Remove duplicated st_ino calculation (GH-101811)
James Lee [Mon, 13 Feb 2023 13:49:44 +0000 (05:49 -0800)] 
gh-101810: Remove duplicated st_ino calculation (GH-101811)

2 years agogh-92547: Purge sqlite3_enable_shared_cache() detection from configure (#101873)
Erlend E. Aasland [Mon, 13 Feb 2023 12:36:42 +0000 (13:36 +0100)] 
gh-92547: Purge sqlite3_enable_shared_cache() detection from configure (#101873)

2 years agoGH-100987: Refactor `_PyInterpreterFrame` a bit, to assist generator improvement...
Mark Shannon [Mon, 13 Feb 2023 11:31:15 +0000 (11:31 +0000)] 
GH-100987: Refactor `_PyInterpreterFrame` a bit, to assist generator improvement. (GH-100988)

Refactor _PyInterpreterFrame a bit, to assist generator improvement.

2 years agoGH-87849: Simplify stack effect of SEND and specialize it for generators and coroutin...
Mark Shannon [Mon, 13 Feb 2023 11:24:55 +0000 (11:24 +0000)] 
GH-87849: Simplify stack effect of SEND and specialize it for generators and coroutines. (GH-101788)

2 years agoCorrect trivial grammar in reset_mock docs (#101861)
Steve Kowalik [Mon, 13 Feb 2023 09:11:43 +0000 (20:11 +1100)] 
Correct trivial grammar in reset_mock docs (#101861)

2 years agogh-101845: pyspecific: Fix i18n for availability directive (GH-101846)
Jean Abou-Samra [Sun, 12 Feb 2023 14:20:11 +0000 (15:20 +0100)] 
gh-101845: pyspecific: Fix i18n for availability directive (GH-101846)

pyspecific: Fix i18n for availability directive

If the directive has content, the previous code would nest paragraph
nodes from that content inside a general paragraph node, which confuses
Sphinx and leads it to drop the content when translating. Instead, use a
container node for the body.

Also use set_source_info so that any warnings have location info.

2 years agogh-89792: Limit test_tools freeze test build parallelism based on the number of cores...
Gregory P. Smith [Sun, 12 Feb 2023 06:07:52 +0000 (22:07 -0800)] 
gh-89792: Limit test_tools freeze test build parallelism based on the number of cores (#101841)

unhardcode freeze test build parallelism. base it on the number of cpus, don't use more than max(2, os.cpu_count()/3).

2 years agogh-85984: Utilize new "winsize" functions from termios in pty tests. (#101831)
Soumendra Ganguly [Sun, 12 Feb 2023 05:24:43 +0000 (23:24 -0600)] 
gh-85984: Utilize new "winsize" functions from termios in pty tests. (#101831)

Utilize new functions termios.tcgetwinsize() and termios.tcsetwinsize in test_pty.py.

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-89792: Prevent test_tools from copying 1000M of "source" in freeze test (#101837)
Gregory P. Smith [Sun, 12 Feb 2023 04:54:28 +0000 (20:54 -0800)] 
gh-89792: Prevent test_tools from copying 1000M of "source" in freeze test (#101837)

Prevent test_tools from copying 1000M of "source"

It doesn't need a git repo, just the checkout.  We skip .git metadata, Doc/build, Doc/venv, and `__pycache__` subdirs, that developers often have in their clients to reduce the size of the source tree copy ten-fold.

This should significantly reduce IO and presumably time on buildbots during this long test.

2 years agoFix typo in test_fstring.py (#101823)
mjoerg [Sat, 11 Feb 2023 15:34:15 +0000 (16:34 +0100)] 
Fix typo in test_fstring.py (#101823)

2 years agoGH-101797: allocate `PyExpat_CAPI` capsule on heap (#101798)
Kumar Aditya [Sat, 11 Feb 2023 08:37:39 +0000 (14:07 +0530)] 
GH-101797: allocate `PyExpat_CAPI` capsule on heap (#101798)

2 years agogh-101390: Fix docs for `imporlib.util.LazyLoader.factory` to properly call it a...
busywhitespace [Fri, 10 Feb 2023 23:29:24 +0000 (00:29 +0100)] 
gh-101390: Fix docs for `imporlib.util.LazyLoader.factory` to properly call it a class method (GH-101391)

2 years agoDocs: Fix getstatus() -> getcode() typos (#101296)
Hugo van Kemenade [Fri, 10 Feb 2023 18:46:12 +0000 (20:46 +0200)] 
Docs: Fix getstatus() -> getcode() typos (#101296)

2 years agoDocs: use parameter list for sqlite3.Cursor.execute* (#101782)
Erlend E. Aasland [Fri, 10 Feb 2023 17:54:04 +0000 (18:54 +0100)] 
Docs: use parameter list for sqlite3.Cursor.execute* (#101782)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-101763: Update bundled copy of libffi to 3.4.4 on Windows (GH-101784)
Steve Dower [Fri, 10 Feb 2023 16:57:30 +0000 (16:57 +0000)] 
gh-101763: Update bundled copy of libffi to 3.4.4 on Windows (GH-101784)

2 years agogh-101517: make bdb avoid looking up in linecache with lineno=None (#101787)
Irit Katriel [Fri, 10 Feb 2023 16:49:29 +0000 (16:49 +0000)] 
gh-101517: make bdb avoid looking up in linecache with lineno=None (#101787)

2 years agogh-101759: Update Windows installer to SQLite 3.40.1 (#101762)
Erlend E. Aasland [Fri, 10 Feb 2023 16:38:26 +0000 (17:38 +0100)] 
gh-101759: Update Windows installer to SQLite 3.40.1 (#101762)

2 years agogh-101277: Finalise isolating itertools (GH-101305)
Erlend E. Aasland [Fri, 10 Feb 2023 11:58:14 +0000 (12:58 +0100)] 
gh-101277: Finalise isolating itertools (GH-101305)

Add repeat, islice, chain, tee, teedataobject, and batched types to module state.

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-101759: Update macOS installer to SQLite 3.40.1 (#101761)
Erlend E. Aasland [Fri, 10 Feb 2023 07:25:02 +0000 (08:25 +0100)] 
gh-101759: Update macOS installer to SQLite 3.40.1 (#101761)

2 years agoFix some typos in asdl_c.py (GH-101757)
abel1502 [Fri, 10 Feb 2023 03:10:46 +0000 (06:10 +0300)] 
Fix some typos in asdl_c.py (GH-101757)

2 years agogh-101747: Fix refleak in new `OrderedDict` repr (GH-101748)
Nikita Sobolev [Fri, 10 Feb 2023 03:00:58 +0000 (06:00 +0300)] 
gh-101747: Fix refleak in new `OrderedDict` repr (GH-101748)

2 years agogh-101430: Update tracemalloc to handle presize properly. (gh-101745)
Dong-hee Na [Thu, 9 Feb 2023 23:30:03 +0000 (08:30 +0900)] 
gh-101430: Update tracemalloc to handle presize properly. (gh-101745)

2 years agoGH-101228: Fix typo in docstring for read method of `_io.TextIOWrapper` class (#101227)
Partha P. Mukherjee [Thu, 9 Feb 2023 17:46:40 +0000 (12:46 -0500)] 
GH-101228: Fix typo in docstring for read method of `_io.TextIOWrapper` class (#101227)

2 years agoFix typo in `test_fstring.py` (#101600)
Ikko Eltociear Ashimine [Thu, 9 Feb 2023 17:45:58 +0000 (02:45 +0900)] 
Fix typo in `test_fstring.py` (#101600)

2 years agogh-101726: Update the OpenSSL version to 1.1.1t (GH-101727)
Gregory P. Smith [Thu, 9 Feb 2023 17:40:51 +0000 (09:40 -0800)] 
gh-101726: Update the OpenSSL version to 1.1.1t (GH-101727)

Fixes CVE-2023-0286 (High) and a couple of Medium security issues.
https://www.openssl.org/news/secadv/20230207.txt

2 years agogh-101283: Fix 'versionchanged' for the shell=True fallback on Windows in 3.12 (GH...
Oleg Iarygin [Thu, 9 Feb 2023 17:36:24 +0000 (21:36 +0400)] 
gh-101283: Fix 'versionchanged' for the shell=True fallback on Windows in 3.12 (GH-101728)

2 years agoLibFFI build requires x64 Cygwin, and skip the ARM build (GH-101743)
Steve Dower [Thu, 9 Feb 2023 17:15:19 +0000 (17:15 +0000)] 
LibFFI build requires x64 Cygwin, and skip the ARM build (GH-101743)

2 years agogh-101670: typo fix in PyImport_ExtendInittab() (#101723)
Sergey B Kirpichev [Thu, 9 Feb 2023 16:49:02 +0000 (19:49 +0300)] 
gh-101670: typo fix in PyImport_ExtendInittab() (#101723)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2 years agoGH-99293: Document that `Py_TPFLAGS_VALID_VERSION_TAG` shouldn't be used. (#GH-101736)
Mark Shannon [Thu, 9 Feb 2023 13:05:53 +0000 (13:05 +0000)] 
GH-99293: Document that `Py_TPFLAGS_VALID_VERSION_TAG` shouldn't be used. (#GH-101736)

Document that Py_TPFLAGS_VALID_VERSION_TAG shouldn't be used.

2 years agono-issue: Add Dong-hee Na as the cjkcodecs codeowner (gh-101731)
Dong-hee Na [Thu, 9 Feb 2023 12:01:32 +0000 (21:01 +0900)] 
no-issue: Add Dong-hee Na as the cjkcodecs codeowner (gh-101731)

2 years agogh-101678: Merge math_1_to_whatever() and math_1() (#101730)
Sergey B Kirpichev [Thu, 9 Feb 2023 09:40:13 +0000 (12:40 +0300)] 
gh-101678: Merge math_1_to_whatever() and math_1() (#101730)

`math_1_to_whatever()` is no longer useful, since all existing uses of it convert to `float`.
Earlier versions of Python used `math_1_to_whatever` with an integer target; see
gh-16991 for the PR where that use was removed.

2 years agogh-101678: refactor the math module to use special functions from c11 (GH-101679)
Sergey B Kirpichev [Thu, 9 Feb 2023 08:40:52 +0000 (11:40 +0300)] 
gh-101678: refactor the math module to use special functions from c11 (GH-101679)

Shouldn't affect users, hence no news.

Automerge-Triggered-By: GH:mdickinson
2 years agogh-85984: Remove legacy Lib/pty.py code. (#92365)
Soumendra Ganguly [Thu, 9 Feb 2023 01:00:17 +0000 (19:00 -0600)] 
gh-85984: Remove legacy Lib/pty.py code. (#92365)

Refactored the implementation of pty.fork to use os.login_tty.

A DeprecationWarning is now raised by pty.master_open() and pty.slave_open(). They were
undocumented and deprecated long long ago in the docstring in favor of pty.openpty.

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-98831: Use opcode metadata for stack_effect() (#101704)
Guido van Rossum [Thu, 9 Feb 2023 00:23:19 +0000 (16:23 -0800)] 
gh-98831: Use opcode metadata for stack_effect() (#101704)

* Write output and metadata in a single run
  This halves the time to run the cases generator
  (most of the time goes into parsing the input).
* Declare or define opcode metadata based on NEED_OPCODE_TABLES
* Use generated metadata for stack_effect()
* compile.o depends on opcode_metadata.h
* Return -1 from _PyOpcode_num_popped/pushed for unknown opcode

2 years agogh-101283: Version was just released, so should be changed in 3.11.3 (GH-101719)
Steve Dower [Wed, 8 Feb 2023 23:52:03 +0000 (23:52 +0000)] 
gh-101283: Version was just released, so should be changed in 3.11.3 (GH-101719)

2 years agogh-101283: Fix use of unbound variable (GH-101712)
Steve Dower [Wed, 8 Feb 2023 23:38:56 +0000 (23:38 +0000)] 
gh-101283: Fix use of unbound variable (GH-101712)

2 years agogh-101283: Improved fallback logic for subprocess with shell=True on Windows (GH...
Oleg Iarygin [Wed, 8 Feb 2023 22:12:19 +0000 (02:12 +0400)] 
gh-101283: Improved fallback logic for subprocess with shell=True on Windows (GH-101286)

2 years agogh-101277: Port more itertools static types to heap types (#101304)
Erlend E. Aasland [Wed, 8 Feb 2023 20:25:42 +0000 (21:25 +0100)] 
gh-101277: Port more itertools static types to heap types (#101304)

Add accumulate, compress, count, filterfalse, pairwise, product,
and zip_longest types to module state.

2 years agogh-98831: Modernize CALL and family (#101508)
Guido van Rossum [Wed, 8 Feb 2023 19:40:10 +0000 (11:40 -0800)] 
gh-98831: Modernize CALL and family (#101508)

Includes a slight improvement to `DECREF_INPUTS()`.

2 years agoGH-101696: invalidate type version tag in `_PyStaticType_Dealloc` (#101697)
Kumar Aditya [Wed, 8 Feb 2023 18:02:15 +0000 (23:32 +0530)] 
GH-101696: invalidate type version tag in `_PyStaticType_Dealloc` (#101697)

2 years agogh-100221: Fix creating dirs in `make sharedinstall` (GH-100329)
Michał Górny [Wed, 8 Feb 2023 16:50:43 +0000 (17:50 +0100)] 
gh-100221: Fix creating dirs in `make sharedinstall` (GH-100329)

Fix creating install directories in `make sharedinstall` if they exist already outside `DESTDIR`.  The previous make rules assumed that the directories would be created via a dependency on a rule for `$(DESTSHARED)` that did not fire if the directory did exist outside `$(DESTDIR)`.

While technically `$(DESTDIR)` could be prepended to the rule name, moving the rules for creating directories straight into the `sharedinstall` rule seems to fit the common practices better. Since the rule explicitly checks whether the individual directories exist anyway, there seems to be no reason to rely on make determining that implicitly as well.

2 years agogh-101670: typo fix in PyImport_AppendInittab() (GH-101672)
Sergey B Kirpichev [Wed, 8 Feb 2023 15:49:04 +0000 (18:49 +0300)] 
gh-101670: typo fix in PyImport_AppendInittab() (GH-101672)

2 years agogh-101196: Make isdir/isfile/exists faster on Windows (GH-101324)
Michael Droettboom [Wed, 8 Feb 2023 14:34:24 +0000 (09:34 -0500)] 
gh-101196: Make isdir/isfile/exists faster on Windows (GH-101324)

Co-authored-by: Eryk Sun <eryksun@gmail.com>
2 years agogh-101614: Don't treat python3_d.dll as a Python DLL when checking extension modules...
David Hewitt [Wed, 8 Feb 2023 14:23:57 +0000 (14:23 +0000)] 
gh-101614: Don't treat python3_d.dll as a Python DLL when checking extension modules for incompatibility (GH-101615)

2 years agogh-100933: Improve `check_element` helper in `test_xml_etree` (#100934)
Nikita Sobolev [Wed, 8 Feb 2023 10:13:43 +0000 (13:13 +0300)] 
gh-100933: Improve `check_element` helper in `test_xml_etree` (#100934)

Items checked by this test are always `str` and `dict` instances.

2 years agoGH-101578: Normalize the current exception (GH-101607)
Mark Shannon [Wed, 8 Feb 2023 09:31:12 +0000 (09:31 +0000)] 
GH-101578: Normalize the current exception (GH-101607)

* Make sure that the current exception is always normalized.

* Remove redundant type and traceback fields for the current exception.

* Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException

* Add new API functions: PyException_GetArgs, PyException_SetArgs

2 years agogh-47937: Note that Popen attributes are read-only (#93070)
Stanley [Wed, 8 Feb 2023 08:12:46 +0000 (00:12 -0800)] 
gh-47937: Note that Popen attributes are read-only (#93070)

* Note that Popen attributes aren't meant to be set by users by rewording the text about the attributes.
* Also update some universal_newlines references to mention the modern text parameter name while in the area.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-98831: Modernize CALL_FUNCTION_EX (#101627)
Guido van Rossum [Wed, 8 Feb 2023 04:03:22 +0000 (20:03 -0800)] 
gh-98831: Modernize CALL_FUNCTION_EX (#101627)

New generator feature: Move CHECK_EVAL_BREAKER() call to just before DISPATCH().

2 years agogh-101446: Change `repr` of `collections.OrderedDict` (#101661)
Nikita Sobolev [Wed, 8 Feb 2023 02:01:10 +0000 (05:01 +0300)] 
gh-101446: Change `repr` of `collections.OrderedDict` (#101661)

2 years agogh-98831: Modernize FORMAT_VALUE (#101628)
Guido van Rossum [Wed, 8 Feb 2023 01:35:55 +0000 (17:35 -0800)] 
gh-98831: Modernize FORMAT_VALUE (#101628)

Generator update: support balanced parentheses and brackets in conditions and size expressions.

2 years agogh-98831: Finish the UNPACK_SEQUENCE family (#101666)
Guido van Rossum [Tue, 7 Feb 2023 23:44:37 +0000 (15:44 -0800)] 
gh-98831: Finish the UNPACK_SEQUENCE family (#101666)

New generator feature: Generate useful glue for output arrays, so you can just write values to the output array (no bounds checking). Rewrote UNPACK_SEQUENCE_TWO_TUPLE to use this, and also UNPACK_SEQUENCE_{TUPLE,LIST}.

2 years agogh-101632: Add the new RETURN_CONST opcode (#101633)
penguin_wwy [Tue, 7 Feb 2023 22:32:21 +0000 (06:32 +0800)] 
gh-101632: Add the new RETURN_CONST opcode (#101633)

2 years agoMerge branch 'main' of https://github.com/python/cpython into main
Thomas Wouters [Tue, 7 Feb 2023 22:13:53 +0000 (23:13 +0100)] 
Merge branch 'main' of https://github.com/python/cpython into main

2 years agoPost 3.12.0a5
Thomas Wouters [Tue, 7 Feb 2023 22:13:10 +0000 (23:13 +0100)] 
Post 3.12.0a5

2 years agogh-101656: Fix "conversion from Py_ssize_t to int" warning in `_testcapimodule` ...
Nikita Sobolev [Tue, 7 Feb 2023 21:43:33 +0000 (00:43 +0300)] 
gh-101656: Fix "conversion from Py_ssize_t to int" warning in `_testcapimodule` (#101657)

2 years agogh-98831: rewrite UNPACK_EX, UNPACK_SEQUENCE, UNPACK_SEQUENCE_TWO_TUPLE in the instru...
Irit Katriel [Tue, 7 Feb 2023 20:37:43 +0000 (20:37 +0000)] 
gh-98831: rewrite UNPACK_EX, UNPACK_SEQUENCE, UNPACK_SEQUENCE_TWO_TUPLE in the instruction definition DSL  (#101641)

2 years agogh-97725: Fix documentation for the default file of `asyncio.Task.print_stack` (...
Oleg Iarygin [Tue, 7 Feb 2023 18:04:31 +0000 (22:04 +0400)] 
gh-97725: Fix documentation for the default file of `asyncio.Task.print_stack` (#101652)

2 years agoMake use of TESTFN_ASCII in test_fileio (GH-101645)
Zachary Ware [Tue, 7 Feb 2023 17:22:58 +0000 (11:22 -0600)] 
Make use of TESTFN_ASCII in test_fileio (GH-101645)

testBytesOpen requires an ASCII filename, but TESTFN usually isn't ASCII.

Automerge-Triggered-By: GH:zware
2 years agogh-98831: Modernize the FOR_ITER family of instructions (#101626)
Guido van Rossum [Tue, 7 Feb 2023 16:28:28 +0000 (08:28 -0800)] 
gh-98831: Modernize the FOR_ITER family of instructions (#101626)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2 years agoFix nesting of 'Pending Removal in Python 3.14' (#101637)
Oleg Iarygin [Tue, 7 Feb 2023 14:54:47 +0000 (18:54 +0400)] 
Fix nesting of 'Pending Removal in Python 3.14' (#101637)

2 years agoDoctest: Pin sphinxext-opengraph==0.7.5 to prevent importing NumPy (#101642)
Hugo van Kemenade [Tue, 7 Feb 2023 13:59:26 +0000 (15:59 +0200)] 
Doctest: Pin sphinxext-opengraph==0.7.5 to prevent importing NumPy (#101642)

2 years agoPython 3.12.0a5 v3.12.0a5
Thomas Wouters [Tue, 7 Feb 2023 12:17:26 +0000 (13:17 +0100)] 
Python 3.12.0a5

2 years ago[gh-101072] Fix Blurb for GH-101127
Łukasz Langa [Tue, 7 Feb 2023 09:50:39 +0000 (10:50 +0100)] 
[gh-101072] Fix Blurb for GH-101127

2 years agogh-101072: support default and kw default in PyEval_EvalCodeEx for 3.11+ (#101127)
Matthieu Dartiailh [Tue, 7 Feb 2023 09:34:21 +0000 (10:34 +0100)] 
gh-101072: support default and kw default in PyEval_EvalCodeEx  for 3.11+ (#101127)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years agogh-85747: Active voice & suggested edits, 'running/stopping loop' & 'callbacks' subse...
Brian Skinn [Tue, 7 Feb 2023 05:25:42 +0000 (00:25 -0500)] 
gh-85747: Active voice & suggested edits, 'running/stopping loop' & 'callbacks' subsections of asyncio-eventloop.rst (#100270)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-98831: Move DSL documentation here from ideas repo (#101629)
Guido van Rossum [Tue, 7 Feb 2023 05:03:58 +0000 (21:03 -0800)] 
gh-98831: Move DSL documentation here from ideas repo (#101629)

2 years agogh-99108: Replace SHA2-224 & 256 with verified code from HACL* (#99109)
Jonathan Protzenko [Tue, 7 Feb 2023 02:11:01 +0000 (18:11 -0800)] 
gh-99108: Replace SHA2-224 & 256 with verified code from HACL* (#99109)

replacing hashlib primitives (for the non-OpenSSL case) with verified implementations from HACL*. This is the first PR in the series, and focuses specifically on SHA2-256 and SHA2-224.

This PR imports Hacl_Streaming_SHA2 into the Python tree. This is the HACL* implementation of SHA2, which combines a core implementation of SHA2 along with a layer of buffer management that allows updating the digest with any number of bytes. This supersedes the previous implementation in the tree.

@franziskuskiefer was kind enough to benchmark the changes: in addition to being verified (thus providing significant safety and security improvements), this implementation also provides a sizeable performance boost!

```
---------------------------------------------------------------
Benchmark                     Time             CPU   Iterations
---------------------------------------------------------------
Sha2_256_Streaming            3163 ns      3160 ns       219353     // this PR
LibTomCrypt_Sha2_256          5057 ns      5056 ns       136234     // library used by Python currently
```

The changes in this PR are as follows:
- import the subset of HACL* that covers SHA2-256/224 into `Modules/_hacl`
- rewire sha256module.c to use the HACL* implementation

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-59956: Add a Test to Verify GILState Matches the "Current" Thread State (gh-101625)
Eric Snow [Mon, 6 Feb 2023 22:53:31 +0000 (15:53 -0700)] 
gh-59956: Add a Test to Verify GILState Matches the "Current" Thread State (gh-101625)

This test should have been in gh-101431.

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

2 years agogh-98831: rewrite COPY and SWAP in the instruction definition DSL (#101620)
Irit Katriel [Mon, 6 Feb 2023 22:45:18 +0000 (22:45 +0000)] 
gh-98831: rewrite COPY and SWAP in the instruction definition DSL (#101620)

2 years agoGH-101616: Mention the Docs Discourse forum in the "reporting docs issues" (GH-101617)
Mariatta Wijaya [Mon, 6 Feb 2023 21:59:45 +0000 (13:59 -0800)] 
GH-101616: Mention the Docs Discourse forum in the "reporting docs issues" (GH-101617)

Fixes https://github.com/python/cpython/issues/101616

2 years agogh-59956: Partial Fix for GILState API Compatibility with Subinterpreters (gh-101431)
Eric Snow [Mon, 6 Feb 2023 21:39:25 +0000 (14:39 -0700)] 
gh-59956: Partial Fix for GILState API Compatibility with Subinterpreters (gh-101431)

The GILState API (PEP 311) implementation from 2003 made the assumption that only one thread state would ever be used for any given OS thread, explicitly disregarding the case of subinterpreters.  However, PyThreadState_Swap() still facilitated switching between subinterpreters, meaning the "current" thread state (holding the GIL), and the GILState thread state could end up out of sync, causing problems (including crashes).

This change addresses the issue by keeping the two in sync in PyThreadState_Swap().  I verified the fix against gh-99040.

Note that the other GILState-subinterpreter incompatibility (with autoInterpreterState) is not resolved here.

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

2 years agogh-101609: Fix "‘state’ may be used uninitialized" warning in `_xxinterpchannelsmodul...
Nikita Sobolev [Mon, 6 Feb 2023 21:05:41 +0000 (00:05 +0300)] 
gh-101609: Fix "‘state’ may be used uninitialized" warning in `_xxinterpchannelsmodule` (GH-101610)

I went with the easiest solution: just removing the offending line. See the issue description with my reasoning.

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

2 years agogh-101562: typing: add tests for inheritance with NotRequired & Required in parent...
Eclips4 [Mon, 6 Feb 2023 19:28:24 +0000 (22:28 +0300)] 
gh-101562: typing: add tests for inheritance with NotRequired & Required in parent fields (#101563)

2 years agogh-101543: Ensure Windows registry path is only used when stdlib can't be found ...
Steve Dower [Mon, 6 Feb 2023 15:55:32 +0000 (15:55 +0000)] 
gh-101543: Ensure Windows registry path is only used when stdlib can't be found (GH-101544)

2 years agogh-76961: Fix buildbot failures in test_pep3118 (#101587) 101604/head
Mark Dickinson [Mon, 6 Feb 2023 12:25:31 +0000 (12:25 +0000)] 
gh-76961: Fix buildbot failures in test_pep3118 (#101587)

This PR fixes the buildbot failures introduced by the merge of #5561, by restricting the relevant tests to something that should work on both 32-bit and 64-bit platforms. It also silences some compiler warnings introduced in that PR.

2 years agogh-101372: Fix unicodedata.is_normalized to properly handle the UCD 3… (gh-101388)
Dong-hee Na [Mon, 6 Feb 2023 04:58:00 +0000 (13:58 +0900)] 
gh-101372: Fix unicodedata.is_normalized to properly handle the UCD 3… (gh-101388)

2 years agogh-101541: [Enum] create flag psuedo-member without calling original __new__ (GH...
Ethan Furman [Mon, 6 Feb 2023 03:29:06 +0000 (19:29 -0800)] 
gh-101541: [Enum] create flag psuedo-member without calling original __new__ (GH-101590)

2 years agoTrivial Change: Remove unhelpful doc in `datetime.timedelta` (#100164)
Matty G [Mon, 6 Feb 2023 02:55:37 +0000 (18:55 -0800)] 
Trivial Change: Remove unhelpful doc in `datetime.timedelta` (#100164)

2 years agogh-101334: Don't force USTAR format in test_tarfile. (GH-101572)
Gregory P. Smith [Sun, 5 Feb 2023 17:44:57 +0000 (09:44 -0800)] 
gh-101334: Don't force USTAR format in test_tarfile. (GH-101572)

That causes the test to fail when run using a high UID as that ancient format
cannot represent it. The current default (PAX) and the old default (GNU) both
support high UIDs.

2 years agobpo-33591: Add support for path like objects to `ctypes.CDLL` (#7032)
mrh1997 [Sun, 5 Feb 2023 17:36:57 +0000 (18:36 +0100)] 
bpo-33591: Add support for path like objects to `ctypes.CDLL` (#7032)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2 years agogh-76961: Fix the PEP3118 format string for ctypes.Structure (#5561)
Eric Wieser [Sun, 5 Feb 2023 17:10:53 +0000 (17:10 +0000)] 
gh-76961: Fix the PEP3118 format string for ctypes.Structure (#5561)

The summary of this diff is that it:

* adds a `_ctypes_alloc_format_padding` function to append strings like `37x` to a format string to indicate 37 padding bytes
* removes the branches that amount to "give up on producing a valid format string if the struct is packed"
* combines the resulting adjacent `if (isStruct) {`s now that neither is `if (isStruct && !isPacked) {`
* invokes `_ctypes_alloc_format_padding` to add padding between structure fields, and after the last structure field. The computation used for the total size is unchanged from ctypes already used.

This patch does not affect any existing aligment computation; all it does is use subtraction to deduce the amount of paddnig introduced by the existing code.

---

Without this fix, it would never include padding bytes - an assumption that was only
valid in the case when `_pack_` was set - and this case was explicitly not implemented.

This should allow conversion from ctypes structs to numpy structs

Fixes https://github.com/numpy/numpy/issues/10528

2 years agoRevert "gh-89381: Fix invalid signatures of math/cmath.log (#101404)" (#101580)
Mark Dickinson [Sun, 5 Feb 2023 16:36:33 +0000 (16:36 +0000)] 
Revert "gh-89381: Fix invalid signatures of math/cmath.log (#101404)" (#101580)

This reverts commit 0ef92d979311ba82d4c41b22ef38e12e1b08b13d.

2 years agogh-101570: Update bundled pip version to 23.0 (#101571)
Pradyun Gedam [Sun, 5 Feb 2023 11:30:44 +0000 (11:30 +0000)] 
gh-101570: Update bundled pip version to 23.0 (#101571)

Update bundled pip version to 23.0

This is the current latest version of `pip`.

---------

Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years agogh-101266: Fix __sizeof__ for subclasses of int (#101394)
Mark Dickinson [Sun, 5 Feb 2023 10:02:53 +0000 (10:02 +0000)] 
gh-101266: Fix __sizeof__ for subclasses of int (#101394)

Fix the behaviour of the `__sizeof__` method (and hence the results returned by `sys.getsizeof`) for subclasses of `int`. Previously, `int` subclasses gave identical results to the `int` base class, ignoring the presence of the instance dictionary.

<!-- gh-issue-number: gh-101266 -->
* Issue: gh-101266
<!-- /gh-issue-number -->

2 years agogh-101221: Add options in the documentation of timeit command (#101222)
busywhitespace [Sun, 5 Feb 2023 09:55:36 +0000 (10:55 +0100)] 
gh-101221: Add options in the documentation of timeit command (#101222)

2 years agoAdd missing preposition in argparse docs (#101548)
alnoki [Sun, 5 Feb 2023 09:45:07 +0000 (01:45 -0800)] 
Add missing preposition in argparse docs (#101548)

2 years agoFix detection of presence of time.tzset (gh-101539) (#101540)
Alexander Belopolsky [Sun, 5 Feb 2023 07:14:15 +0000 (11:14 +0400)] 
Fix detection of presence of time.tzset (gh-101539) (#101540)

Resolves gh-101539
Related to gh-31898

2 years agoGH-100485: Create an alternative code path when an accurate fma() implementation...
Raymond Hettinger [Sat, 4 Feb 2023 23:54:44 +0000 (17:54 -0600)] 
GH-100485: Create an alternative code path when an accurate fma() implementation is not available (#101567)

2 years agogh-101322: Ensure test_zlib.ZlibDecompressorTest runs, fix errors in ZlibDecompressor...
Ruben Vorderman [Sat, 4 Feb 2023 20:07:30 +0000 (21:07 +0100)] 
gh-101322: Ensure test_zlib.ZlibDecompressorTest runs, fix errors in ZlibDecompressor (#101323)

* Ensure test_zlib.ZlibDecompressorTest actually runs, fix errors in ZlibDecompressor.

2 years agogh-101282: Update BOLT --split-functions flag not to use deprecated u… (gh-101557)
Dong-hee Na [Sat, 4 Feb 2023 07:55:31 +0000 (16:55 +0900)] 
gh-101282: Update BOLT --split-functions flag not to use deprecated u… (gh-101557)

gh-101282: Update BOLT --split-functions flag not to use deprecated usage

2 years agoGH-56426: Add cross-reference to the documentation for faulthandler, traceback, and...
Furkan Onder [Sat, 4 Feb 2023 03:49:29 +0000 (03:49 +0000)] 
GH-56426: Add cross-reference to the documentation for faulthandler, traceback, and pdb. (#101157)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoAdd missing `versionadded` directive for `PyCode_Addr2Location` (#101347)
Max Bachmann [Sat, 4 Feb 2023 03:33:28 +0000 (04:33 +0100)] 
Add missing `versionadded` directive for `PyCode_Addr2Location` (#101347)

2 years agogh-101524: Split Up the _xxsubinterpreters Module (gh-101526)
Eric Snow [Sat, 4 Feb 2023 01:14:43 +0000 (18:14 -0700)] 
gh-101524: Split Up the _xxsubinterpreters Module (gh-101526)

This is step 1 in potentially dropping all the "channel"-related code. Channels have already been removed from PEP 554.

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

2 years agogh-84559: Remove the new multiprocessing warning, too disruptive. (#101551)
Gregory P. Smith [Fri, 3 Feb 2023 23:20:46 +0000 (15:20 -0800)] 
gh-84559: Remove the new multiprocessing warning, too disruptive. (#101551)

This reverts the core of #100618 while leaving relevant documentation
improvements and minor refactorings in place.

2 years agogh-101522: Allow overriding Windows dependencies versions and paths using MSBuild...
Steve Dower [Fri, 3 Feb 2023 18:08:34 +0000 (18:08 +0000)] 
gh-101522: Allow overriding Windows dependencies versions and paths using MSBuild properties (GH-101523)

2 years agogh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL...
Irit Katriel [Fri, 3 Feb 2023 14:40:45 +0000 (14:40 +0000)] 
gh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL (#101529)

2 years agogh-98831: rewrite SEND, GET_YIELD_FROM_ITER, RETURN_GENERATOR in the instruction...
Irit Katriel [Fri, 3 Feb 2023 11:30:21 +0000 (11:30 +0000)] 
gh-98831: rewrite SEND, GET_YIELD_FROM_ITER, RETURN_GENERATOR in the instruction definition DSL (#101516)

2 years agogh-101277: Port more `itertools` static types to heap types (#101303)
Erlend E. Aasland [Fri, 3 Feb 2023 09:54:27 +0000 (10:54 +0100)] 
gh-101277: Port more `itertools` static types to heap types (#101303)

Add dropwhile, takewhile, starmap, combinations*, and permutations types to module state.