]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-59956: Clarify Runtime State Status Expectations (gh-101308)
Eric Snow [Mon, 30 Jan 2023 19:07:48 +0000 (12:07 -0700)] 
gh-59956:  Clarify Runtime State Status Expectations (gh-101308)

A PyThreadState can be in one of many states in its lifecycle, represented by some status value.  Those statuses haven't been particularly clear, so we're addressing that here.  Specifically:

* made the distinct lifecycle statuses clear on PyThreadState
* identified expectations of how various lifecycle-related functions relate to status
* noted the various places where those expectations don't match the actual behavior

At some point we'll need to address the mismatches.

(This change also includes some cleanup.)

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

2 years agogh-101422: (docs) TarFile default errorlevel argument is 1, not 0 (GH-101424)
Owain Davies [Mon, 30 Jan 2023 17:56:33 +0000 (00:56 +0700)] 
gh-101422: (docs) TarFile default errorlevel argument is 1, not 0 (GH-101424)

2 years agoGH-101291: Refactor the `PyLongObject` struct into object header and PyLongValue...
Mark Shannon [Mon, 30 Jan 2023 10:03:04 +0000 (10:03 +0000)] 
GH-101291: Refactor the `PyLongObject` struct into object header and PyLongValue struct. (GH-101292)

2 years agogh-98831: Support conditional effects; use for LOAD_ATTR (#101333)
Guido van Rossum [Mon, 30 Jan 2023 01:28:39 +0000 (17:28 -0800)] 
gh-98831: Support conditional effects; use for LOAD_ATTR (#101333)

2 years agogh-39615: fix warning on return type mismatch (#101407)
Irit Katriel [Mon, 30 Jan 2023 00:41:27 +0000 (00:41 +0000)] 
gh-39615: fix warning on return type mismatch (#101407)

2 years agogh-89381: Fix invalid signatures of math/cmath.log (#101404)
Sergey B Kirpichev [Sun, 29 Jan 2023 19:50:10 +0000 (22:50 +0300)] 
gh-89381: Fix invalid signatures of math/cmath.log (#101404)

2 years agoFix trivial typo in shebang example (GH-101385)
socal-nerdtastic [Sat, 28 Jan 2023 13:18:04 +0000 (05:18 -0800)] 
Fix trivial typo in shebang example (GH-101385)

The example was showing the current version, but should be pinned to 3.7 to match the example command.

2 years agoGH-100485: Add extended accuracy test. Switch to faster fma() based variant. GH...
Raymond Hettinger [Sat, 28 Jan 2023 12:29:21 +0000 (06:29 -0600)] 
GH-100485:  Add extended accuracy test.  Switch to faster fma() based variant. GH-101383)

2 years agogh-101386: fix typos found by codespell (#101387)
Peter Jiping Xie [Sat, 28 Jan 2023 09:57:40 +0000 (20:57 +1100)] 
gh-101386: fix typos found by codespell (#101387)

2 years agogh-39615: Add warnings.warn() skip_file_prefixes support (#100840)
Gregory P. Smith [Sat, 28 Jan 2023 02:35:14 +0000 (18:35 -0800)] 
gh-39615: Add warnings.warn() skip_file_prefixes support (#100840)

`warnings.warn()` gains the ability to skip stack frames based on code
filename prefix rather than only a numeric `stacklevel=` via a new
`skip_file_prefixes=` keyword argument.

2 years agogh-101341: Remove unncessary enum._power_of_two function (gh-101342)
Dong-hee Na [Sat, 28 Jan 2023 02:08:08 +0000 (11:08 +0900)] 
gh-101341: Remove unncessary enum._power_of_two function (gh-101342)

2 years ago[doc] Add a section on logging handler configuration order. (GH-101380)
Vinay Sajip [Fri, 27 Jan 2023 19:01:30 +0000 (19:01 +0000)] 
[doc] Add a section on logging handler configuration order. (GH-101380)

2 years ago[doc] Add some notices to logging configuration documentation. (GH-101373)
Vinay Sajip [Fri, 27 Jan 2023 14:50:09 +0000 (14:50 +0000)] 
[doc] Add some notices to logging configuration documentation. (GH-101373)

2 years agogh-77532: Minor tweaks to allow compiling with PlatformToolset=ClangCL on Windows...
Steve Dower [Fri, 27 Jan 2023 14:45:08 +0000 (14:45 +0000)] 
gh-77532: Minor tweaks to allow compiling with PlatformToolset=ClangCL on Windows (GH-101352)

To use this, ensure that clang support was selected in Visual Studio Installer, then set the PlatformToolset environment variable to "ClangCL" and build as normal from the command line.
It remains unsupported, but at least is possible now for experimentation.

2 years agoSpeed-up and improve accuracy with Rump Algorithms (3.1) and (5.10) (GH-101366)
Raymond Hettinger [Fri, 27 Jan 2023 07:56:19 +0000 (01:56 -0600)] 
Speed-up and improve accuracy with Rump Algorithms (3.1) and (5.10) (GH-101366)

2 years agogh-101000: Add os.path.splitroot() (#101002)
Barney Gale [Fri, 27 Jan 2023 00:28:27 +0000 (00:28 +0000)] 
gh-101000: Add os.path.splitroot() (#101002)

Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoFix typos in pystate.c file (#101348)
Виталий Дмитриев [Thu, 26 Jan 2023 23:04:11 +0000 (02:04 +0300)] 
Fix typos in pystate.c file (#101348)

2 years agogh-99834: Update bundled copy of Tcl/Tk to 8.6.13.0 on Windows (GH-101307)
Steve Dower [Thu, 26 Jan 2023 20:47:24 +0000 (20:47 +0000)] 
gh-99834: Update bundled copy of Tcl/Tk to 8.6.13.0 on Windows (GH-101307)

2 years agogh-98831: Fix two bugs in case generator (#101349)
Guido van Rossum [Thu, 26 Jan 2023 17:15:05 +0000 (09:15 -0800)] 
gh-98831: Fix two bugs in case generator (#101349)

Fix two bugs in case generator

- UndefinedLocalError when generating metadata for an 'op'
- Accidental newline inserted in test_generator.py

2 years agogh-60580: Fix a wrong type of `ctypes.wintypes.BYTE` (#97579)
Oleg Iarygin [Thu, 26 Jan 2023 14:16:27 +0000 (18:16 +0400)] 
gh-60580: Fix a wrong type of `ctypes.wintypes.BYTE` (#97579)

Created from a patch file attached to an issue, by Anatoly Techtonik.

2 years agogh-85100: Migrate BPO link to the GitHub link for malloc warnings (gh-101343)
Dong-hee Na [Thu, 26 Jan 2023 12:58:35 +0000 (21:58 +0900)] 
gh-85100: Migrate BPO link to the GitHub link for malloc warnings (gh-101343)

2 years agogh-99952: [ctypes] fix refcount issues in from_param() result. (#100169)
Yukihiro Nakadaira [Thu, 26 Jan 2023 08:28:34 +0000 (17:28 +0900)] 
gh-99952: [ctypes] fix refcount issues in from_param() result. (#100169)

Fixes a reference counting issue with `ctypes.Structure` when a `from_param()` method call is used and the structure size is larger than a C pointer `sizeof(void*)`.

This problem existed for a very long time, but became more apparent in 3.8+ by change likely due to garbage collection cleanup timing changes.

2 years agodatetime.rst: improve combine() docs (#101338)
John Belmonte [Thu, 26 Jan 2023 07:25:43 +0000 (16:25 +0900)] 
datetime.rst: improve combine() docs (#101338)

The explanation on handling of datetime as the date arg was confusingly mixed with an unrelated
item, and lacked proper arg name formatting.

2 years agogh-100522 Add a test for 'futures.as_completed' timing out with a non-zero timeout...
JosephSBoyle [Thu, 26 Jan 2023 07:01:11 +0000 (07:01 +0000)] 
gh-100522 Add a test for 'futures.as_completed' timing out with a non-zero timeout value (#100523)

2 years agogh-94518: Rename `group*` to `extra_group*` to avoid confusion (#101054)
Oleg Iarygin [Thu, 26 Jan 2023 06:50:33 +0000 (10:50 +0400)] 
gh-94518: Rename `group*` to `extra_group*` to avoid confusion (#101054)

* Rename `group*` to `extra_group*` to avoid confusion
* Rename `num_groups` into `extra_group_size`
* Rename `groups_list` to `extra_groups_packed`

2 years agogh-98831: rewrite RAISE_VARARGS in the instruction definition DSL (#101306)
Irit Katriel [Wed, 25 Jan 2023 22:29:56 +0000 (22:29 +0000)] 
gh-98831: rewrite RAISE_VARARGS in the instruction definition DSL (#101306)

2 years agoFix incorrect versions in magic number comments (GH-101301)
Brandt Bucher [Wed, 25 Jan 2023 21:30:33 +0000 (13:30 -0800)] 
Fix incorrect versions in magic number comments (GH-101301)

2 years agogh-98831: add variable stack effect support to cases generator (#101309)
Irit Katriel [Wed, 25 Jan 2023 20:41:03 +0000 (20:41 +0000)] 
gh-98831: add variable stack effect support to cases generator (#101309)

2 years agogh-101326: Fix regression when passing None to FutureIter.throw (#101327)
Shantanu [Wed, 25 Jan 2023 20:01:01 +0000 (12:01 -0800)] 
gh-101326: Fix regression when passing None to FutureIter.throw (#101327)

2 years agoGH-88597: Rename uuid's new CLI args to be in line with uuidgen. (#101248)
achhina [Wed, 25 Jan 2023 17:39:42 +0000 (12:39 -0500)] 
GH-88597: Rename uuid's new CLI args to be in line with uuidgen. (#101248)

this way they match an existing uuidgen command line tool.

2 years agoAdd advice how to freeze fewer modules (#101298)
Guido van Rossum [Wed, 25 Jan 2023 17:28:14 +0000 (09:28 -0800)] 
Add advice how to freeze fewer modules (#101298)

(And fix a bug that only occurs when you follow the advice.)

2 years agoGH-98831: Elaborate some cases_generator tests (#101299)
Guido van Rossum [Wed, 25 Jan 2023 16:55:46 +0000 (08:55 -0800)] 
GH-98831: Elaborate some cases_generator tests (#101299)

* Make macro test more elaborate
* Add test for 'register inst()'

2 years agoFix some comments in ceval.c and fix lltrace output (#101297)
Guido van Rossum [Tue, 24 Jan 2023 22:58:18 +0000 (14:58 -0800)] 
Fix some comments in ceval.c and fix lltrace output (#101297)

The comment at the top was rather outdated. :-)

Also added a note about the dangers of dump_stack().

2 years agogh-98831: rewrite pattern matching opcodes in the instruction definition DSL (#101287)
Irit Katriel [Tue, 24 Jan 2023 22:39:13 +0000 (22:39 +0000)] 
gh-98831: rewrite pattern matching opcodes in the instruction definition DSL (#101287)

2 years agoGH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. (GH-101013)
Mark Shannon [Tue, 24 Jan 2023 17:25:37 +0000 (17:25 +0000)] 
GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. (GH-101013)

* Store exception stack depth in YIELD_VALUE's oparg and use it avoid expensive gen.throw() in gen.close() where possible.

2 years agogh-101135: Add backwards compatibility to Windows launcher for older 32-bit versions...
Martin Boisvert [Tue, 24 Jan 2023 16:35:16 +0000 (11:35 -0500)] 
gh-101135: Add backwards compatibility to Windows launcher for older 32-bit versions (GH-101138)

Python 2.x and up to 3.4 did not contain the "-32" in their registry name, so the 32 and 64-bit installs were treated equal. Since 3.5/PEP 514 this is no longer true, but we still want to detect the EOL versions correctly in case people are still using them.

Additionally, the code to replace a node with one with a lower sort key was buggy (wrong node chosen, replace never happened since parent was always NULL, replaced node never freed, etc)

2 years agogh-92123: Adapt _elementtree to multi-phase init (PEP 489) (#101285)
Erlend E. Aasland [Tue, 24 Jan 2023 16:00:24 +0000 (17:00 +0100)] 
gh-92123: Adapt _elementtree to multi-phase init (PEP 489) (#101285)

2 years agoGH-91375: Purge `asyncio` static variables from globals-to-fix list (#101288)
Erlend E. Aasland [Tue, 24 Jan 2023 15:07:27 +0000 (16:07 +0100)] 
GH-91375: Purge `asyncio` static variables from globals-to-fix list (#101288)

2 years agoGH-92123: Pass _elementtree state as parameter (#101189)
Erlend E. Aasland [Tue, 24 Jan 2023 11:45:55 +0000 (12:45 +0100)] 
GH-92123: Pass _elementtree state as parameter (#101189)

2 years agono-issue: Add Dong-hee Na as autoconf codeowner (gh-101281)
Dong-hee Na [Tue, 24 Jan 2023 10:22:22 +0000 (19:22 +0900)] 
no-issue: Add Dong-hee Na as autoconf codeowner (gh-101281)

2 years agogh-101278: Drop -gdwarf-4 flag from the BOLT build (gh-101280)
Dong-hee Na [Tue, 24 Jan 2023 10:22:00 +0000 (19:22 +0900)] 
gh-101278: Drop -gdwarf-4 flag from the BOLT build (gh-101280)

2 years agogh-98831: rewrite CHECK_EG_MATCH opcode in the instruction definition DSL (#101269)
Irit Katriel [Tue, 24 Jan 2023 09:43:16 +0000 (09:43 +0000)] 
gh-98831: rewrite CHECK_EG_MATCH opcode in the instruction definition DSL (#101269)

2 years agogh-101060: conditionally add `-fno-reorder-blocks-and-partition` (gh-101061)
Gregory Szorc [Tue, 24 Jan 2023 09:34:44 +0000 (01:34 -0800)] 
gh-101060: conditionally add `-fno-reorder-blocks-and-partition` (gh-101061)

2 years agogh-101152: Implement PEP 699 (GH-101193)
ram vikram singh [Tue, 24 Jan 2023 09:29:22 +0000 (14:59 +0530)] 
gh-101152:  Implement PEP 699 (GH-101193)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Ken Jin <kenjin@python.org>
2 years ago[docs] Mention how to get/set a bigint PyLong via the C API (#101270)
Gregory P. Smith [Tue, 24 Jan 2023 05:20:53 +0000 (21:20 -0800)] 
[docs] Mention how to get/set a bigint PyLong via the C API (#101270)

We don't need direct C APIs to get at a bigint representation of PyLong but we
do want the few people who need to understand how.

Additional Author:  CAM-Gerlach

2 years agogh-100795: Don't call freeaddrinfo on failure. (#101252)
Gregory P. Smith [Mon, 23 Jan 2023 23:03:26 +0000 (15:03 -0800)] 
gh-100795: Don't call freeaddrinfo on failure. (#101252)

When getaddrinfo returns an error, the output pointer is in an unknown state
Don't call freeaddrinfo on it.  See the issue for discussion and details with
links to reasoning.  _Most_ libc getaddrinfo implementations never modify the
output pointer unless they are returning success.

Co-authored-by: Sergey G. Brester <github@sebres.de>
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2 years agogh-101261: add test for function with > 255 args (#101262)
Irit Katriel [Mon, 23 Jan 2023 20:10:10 +0000 (20:10 +0000)] 
gh-101261: add test for function with > 255 args (#101262)

2 years agogh-59956: Allow the "Trashcan" Mechanism to Work Without a Thread State (gh-101209)
Eric Snow [Mon, 23 Jan 2023 15:30:20 +0000 (08:30 -0700)] 
gh-59956: Allow the "Trashcan" Mechanism to Work Without a Thread State (gh-101209)

We've factored out a struct from the two PyThreadState fields. This accomplishes two things:

* make it clear that the trashcan-related code doesn't need any other parts of PyThreadState
* allows us to use the trashcan mechanism even when there isn't a "current" thread state

We still expect the caller to hold the GIL.

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

2 years agoGH-92123: Store _elementtree state in type contexts (#101190)
Erlend E. Aasland [Mon, 23 Jan 2023 12:20:36 +0000 (13:20 +0100)] 
GH-92123: Store _elementtree state in type contexts (#101190)

- add state pointer to TreeBuilderObject
- add state pointer to XMLParserObject

2 years agoAdded asyncio REPL example to docs. (#101243)
Carlton Gibson [Mon, 23 Jan 2023 11:31:13 +0000 (12:31 +0100)] 
Added asyncio REPL example to docs. (#101243)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-101015: Fix `typing.get_type_hints` with unpacked `*tuple` (PEP 646) (#101031)
Nikita Sobolev [Mon, 23 Jan 2023 07:52:58 +0000 (10:52 +0300)] 
gh-101015: Fix `typing.get_type_hints` with unpacked `*tuple` (PEP 646) (#101031)

2 years agogh-83122: Deprecate testing element truth values in `ElementTree` (#31149)
Jacob Walls [Mon, 23 Jan 2023 01:16:48 +0000 (20:16 -0500)] 
gh-83122: Deprecate testing element truth values in `ElementTree` (#31149)

When testing element truth values, emit a DeprecationWarning in all implementations.

This had emitted a FutureWarning in the rarely used python-only implementation since ~2.7 and has always been documented as a behavior not to rely on.

Matching an element in a tree search but having it test False can be unexpected. Raising the warning enables making the choice to finally raise an exception for this ambiguous behavior in the future.

2 years agoSumprod(): Update citation. Reorder functions. Add final twosum() call. Improve comme...
Raymond Hettinger [Sun, 22 Jan 2023 23:07:52 +0000 (17:07 -0600)] 
Sumprod(): Update citation. Reorder functions. Add final twosum() call. Improve comments. (#101249)

2 years agogh-101047: Remove vestigial references to macOS libtool options (gh-101048)
Gregory Szorc [Sun, 22 Jan 2023 22:26:42 +0000 (14:26 -0800)] 
gh-101047: Remove vestigial references to macOS libtool options (gh-101048)

LIBTOOL_CRUFT and OTHER_LIBTOOL_OPT variables have been unused since commit
19199830f7f880b1e9cff5d92d30706fd8bb4700 in 2011.

2 years agoAdd Erlend Aasland as autoconf codeowner (#101247)
Erlend E. Aasland [Sun, 22 Jan 2023 22:02:15 +0000 (23:02 +0100)] 
Add Erlend Aasland as autoconf codeowner (#101247)

2 years agoGH-101097: Switch from standard interval notation to greater or less than signs for...
Andrew Hong [Sun, 22 Jan 2023 20:58:36 +0000 (15:58 -0500)] 
GH-101097: Switch from standard interval notation to greater or less than signs for random.random()'s documentation (#101119)

2 years agogh-67790: Support float-style formatting for Fraction instances (#100161)
Mark Dickinson [Sun, 22 Jan 2023 18:44:49 +0000 (18:44 +0000)] 
gh-67790: Support float-style formatting for Fraction instances (#100161)

This PR adds support for float-style formatting for `Fraction` objects: it supports the `"e"`, `"E"`, `"f"`, `"F"`, `"g"`, `"G"` and `"%"` presentation types, and all the various bells and whistles of the formatting mini-language for those presentation types. The behaviour almost exactly matches that of `float`, but the implementation works with the exact `Fraction` value and does not do an intermediate conversion to `float`, and so avoids loss of precision or issues with numbers that are outside the dynamic range of the `float` type.

Note that the `"n"` presentation type is _not_ supported. That support could be added later if people have a need for it.

There's one corner-case where the behaviour differs from that of float: for the `float` type, if explicit alignment is specified with a fill character of `'0'` and alignment type `'='`, then thousands separators (if specified) are inserted into the padding string:

```python
>>> format(3.14, '0=11,.2f')
'0,000,003.14'
```

The exact same effect can be achieved by using the `'0'` flag:

```python
>>> format(3.14, '011,.2f')
'0,000,003.14'
```

For `Fraction`, only the `'0'` flag has the above behaviour with respect to thousands separators: there's no special-casing of the particular `'0='` fill-character/alignment combination. Instead, we treat the fill character `'0'` just like any other:

```python
>>> format(Fraction('3.14'), '0=11,.2f')
'00000003.14'
>>> format(Fraction('3.14'), '011,.2f')
'0,000,003.14'
```

The `Fraction` formatter is also stricter about combining these two things: it's not permitted to use both the `'0'` flag _and_ explicit alignment, on the basis that we should refuse the temptation to guess in the face of ambiguity. `float` is less picky:

```python
>>> format(3.14, '0<011,.2f')
'3.140000000'
>>> format(Fraction('3.14'), '0<011,.2f')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mdickinson/Repositories/python/cpython/Lib/fractions.py", line 414, in __format__
    raise ValueError(
ValueError: Invalid format specifier '0<011,.2f' for object of type 'Fraction'; can't use explicit alignment when zero-padding
```

2 years agoRevert "gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#10122...
Kumar Aditya [Sun, 22 Jan 2023 08:47:01 +0000 (14:17 +0530)] 
Revert "gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)" (#101238)

Revert "gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)"

This reverts commit 5f08fe4a2c055880c23c6f9b57ff03005d193bfc.

2 years agogh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)
Sergey G. Brester [Sun, 22 Jan 2023 08:10:00 +0000 (09:10 +0100)] 
gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2 years agoGH-88597: Added command line interface to UUID module. (#99463)
achhina [Sun, 22 Jan 2023 06:59:31 +0000 (01:59 -0500)] 
GH-88597: Added command line interface to UUID module. (#99463)

The `uuid` module now supports command line usage.

```python
❯ ./python.exe -m uuid
5f2d57b1-90e8-417c-ba5d-69b9b6f74289

❯ ./python.exe -m uuid -h
usage: uuid.py [-h] [-u {uuid1,uuid3,uuid4,uuid5}] [-ns NAMESPACE] [-n NAME]
...
```

2 years agogh-100518: Add tests for `ast.NodeTransformer` (#100521)
Nikita Sobolev [Sat, 21 Jan 2023 21:44:41 +0000 (00:44 +0300)] 
gh-100518: Add tests for `ast.NodeTransformer` (#100521)

2 years agogh-100726: Optimize construction of range object for medium sized integers (#100810)
Pieter Eendebak [Sat, 21 Jan 2023 19:33:08 +0000 (20:33 +0100)] 
gh-100726: Optimize construction of range object for medium sized integers (#100810)

Use C long arithmetic instead of PyLong arithmetic to compute the range length, where possible.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2 years agogh-99266: ctypes: Preserve more detailed exception in `ArgumentError`
Kamil Turek [Sat, 21 Jan 2023 13:44:43 +0000 (14:44 +0100)] 
gh-99266: ctypes: Preserve more detailed exception in `ArgumentError`

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agoGH-92123: Move _elementtree heap types to module state (#101187)
Erlend E. Aasland [Sat, 21 Jan 2023 11:01:15 +0000 (12:01 +0100)] 
GH-92123: Move _elementtree heap types to module state (#101187)

2 years agogh-101037: Fix potential memory underallocation for zeros of int subtypes (#101038)
Mark Dickinson [Sat, 21 Jan 2023 10:23:59 +0000 (10:23 +0000)] 
gh-101037: Fix potential memory underallocation for zeros of int subtypes (#101038)

This PR fixes object allocation in long_subtype_new to ensure that there's at least one digit in all cases, and makes sure that the value of that digit is copied over from the source long.

Needs backport to 3.11, but not any further: the change to require at least one digit was only introduced for Python 3.11.

Fixes #101037.

2 years agogh-101143: Remove references to `TimerHandle` from `asyncio.base_events.BaseEventLoop...
J. Nick Koston [Sat, 21 Jan 2023 09:16:07 +0000 (23:16 -1000)] 
gh-101143: Remove references to `TimerHandle` from `asyncio.base_events.BaseEventLoop._add_callback` (#101197)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agoBump Azure Pipelines to ubuntu-22.04 (#101089)
Hugo van Kemenade [Sat, 21 Jan 2023 09:01:31 +0000 (11:01 +0200)] 
Bump Azure Pipelines to ubuntu-22.04 (#101089)

2 years agoFix rst formatting in 3.12 What's New (#101110)
scrazzz [Sat, 21 Jan 2023 08:53:54 +0000 (11:53 +0300)] 
Fix rst formatting in 3.12 What's New (#101110)

2 years agogh-91351: Fix some bugs in importlib handling of re-entrant imports (GH-94504)
Jean-Paul Calderone [Sat, 21 Jan 2023 00:00:39 +0000 (19:00 -0500)] 
gh-91351: Fix some bugs in importlib handling of re-entrant imports (GH-94504)

Co-authored-by: Brett Cannon <brett@python.org>
2 years agogh-100750: pass encoding kwarg in lib/platform.py (#100751)
Thomas Grainger [Fri, 20 Jan 2023 22:25:38 +0000 (22:25 +0000)] 
gh-100750: pass encoding kwarg in lib/platform.py (#100751)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agogh-86610: Use attribute directive in docs for pathlib.PurePath (#101114)
Barney Gale [Fri, 20 Jan 2023 22:13:58 +0000 (22:13 +0000)] 
gh-86610: Use attribute directive in docs for pathlib.PurePath (#101114)

2 years agoGH-101111: Disambigaute origin of const for store_const and append_const (#101121)
Jürgen Gmach [Fri, 20 Jan 2023 22:13:07 +0000 (23:13 +0100)] 
GH-101111: Disambigaute origin of const for store_const and append_const (#101121)

While the documentation for `optparse` mentioned that both `store_const` and
`append_const` store a constant value, it was not clear where this value was
coming from.

A link to `Option.const` makes this explicit.

2 years agoGH-101112: Specify type of pattern for Path.rglob (#101132)
Jürgen Gmach [Fri, 20 Jan 2023 22:11:31 +0000 (23:11 +0100)] 
GH-101112: Specify type of pattern for Path.rglob (#101132)

The documentation for `rglob` did not mention what `pattern` actually
is.

Mentioning and linking to `fnmatch` makes this explicit, as the
documentation for `fnmatch` both shows the syntax and some explanation.

2 years agoFix a typo in whatsnew/3.12.rst (#101150)
caozhanhao [Fri, 20 Jan 2023 22:10:08 +0000 (06:10 +0800)] 
Fix a typo in whatsnew/3.12.rst (#101150)

2 years agoFix minor typos in SSL documentation (#101158)
Simon Robinson [Fri, 20 Jan 2023 22:08:45 +0000 (22:08 +0000)] 
Fix minor typos in SSL documentation (#101158)

2 years agogh-91485: Avoid unnecessary use of non-Python syntax in io docs (#101177)
Shantanu [Fri, 20 Jan 2023 22:06:10 +0000 (14:06 -0800)] 
gh-91485: Avoid unnecessary use of non-Python syntax in io docs (#101177)

2 years agoFix typo in comment in compile.c (#101194)
Ikko Eltociear Ashimine [Fri, 20 Jan 2023 18:34:36 +0000 (03:34 +0900)] 
Fix typo in comment in compile.c (#101194)

2 years agogh-101181: Fix `unused-variable` warning in `pystate.c` (#101188)
Nikita Sobolev [Fri, 20 Jan 2023 18:01:30 +0000 (21:01 +0300)] 
gh-101181: Fix `unused-variable` warning in `pystate.c` (#101188)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-92123: Convert `_elementtree` types to heap types (#99221)
Erlend E. Aasland [Fri, 20 Jan 2023 11:40:06 +0000 (12:40 +0100)] 
gh-92123: Convert `_elementtree` types to heap types (#99221)

2 years agoGH-90699: Clear interned strings in `_elementtree` (#101185)
Erlend E. Aasland [Fri, 20 Jan 2023 11:04:14 +0000 (12:04 +0100)] 
GH-90699: Clear interned strings in `_elementtree` (#101185)

2 years agoProvided better example for logging cookbook (GH-101164)
Vladimir Malinovskii [Fri, 20 Jan 2023 08:54:48 +0000 (11:54 +0300)] 
Provided better example for logging cookbook (GH-101164)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2 years agogh-88324: Clarify documentation for redirected stdout/stderr when using subprocess...
richardhob [Fri, 20 Jan 2023 07:56:13 +0000 (23:56 -0800)] 
gh-88324: Clarify documentation for redirected stdout/stderr when using subprocess in Linux (#94035)

* Update description of stdout, stderr, and stdin.

Changes:
- Move the ``None`` option (which is default) to the front of the list
  of input options
- Move the ``None`` option description up to make the default behavior
  more clear (No redirection)
- Remove mention of Child File Descriptors from ``None`` option description

2 years agogh-101144: Allow open and read_text encoding to be positional. (#101145)
Gregory P. Smith [Fri, 20 Jan 2023 07:04:30 +0000 (23:04 -0800)] 
gh-101144: Allow open and read_text encoding to be positional. (#101145)

The zipfile.Path open() and read_text() encoding parameter can be supplied as a positional argument without causing a TypeError again. 3.10.0b1 included a regression that made it keyword only.

Documentation update included as users writing code to be compatible with a wide range of versions will need to consider this for some time.

2 years agogh-101100: [Enum] Fix sphinx warnings in docs (GH-101122)
Nikita Sobolev [Fri, 20 Jan 2023 02:16:21 +0000 (05:16 +0300)] 
gh-101100: [Enum] Fix sphinx warnings in docs (GH-101122)

* gh-101100: [Enum] Fix sphinx warnings in

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-59956: Fix Function Groupings in pystate.c (gh-101172)
Eric Snow [Fri, 20 Jan 2023 00:23:53 +0000 (17:23 -0700)] 
gh-59956: Fix Function Groupings in pystate.c (gh-101172)

This is a follow-up to gh-101161.  The objective is to make it easier to read Python/pystate.c by grouping the functions there in a consistent way.  This exclusively involves moving code around and adding various kinds of comments.

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

2 years agogh-101167: fix bug in the new test.support.requires_specialization decorator (GH...
Irit Katriel [Thu, 19 Jan 2023 23:45:53 +0000 (23:45 +0000)] 
gh-101167: fix bug in the new test.support.requires_specialization decorator (GH-101171)

Fixes #101167.

Automerge-Triggered-By: GH:iritkatriel
2 years agogh-101169: reduce the implementation of except* by one bytecode instruction (#101170)
Irit Katriel [Thu, 19 Jan 2023 23:30:49 +0000 (23:30 +0000)] 
gh-101169: reduce the implementation of except* by one bytecode instruction (#101170)

2 years agogh-59956: Clarify GILState-related Code (gh-101161)
Eric Snow [Thu, 19 Jan 2023 23:04:14 +0000 (16:04 -0700)] 
gh-59956: Clarify GILState-related Code (gh-101161)

The objective of this change is to help make the GILState-related code easier to understand.  This mostly involves moving code around and some semantically equivalent refactors.  However, there are a also a small number of slight changes in structure and behavior:

* tstate_current is moved out of _PyRuntimeState.gilstate
* autoTSSkey is moved out of _PyRuntimeState.gilstate
* autoTSSkey is initialized earlier
* autoTSSkey is re-initialized (after fork) earlier

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

2 years agogh-98831: register instructions have 0 pushes and pops (#101163)
Irit Katriel [Thu, 19 Jan 2023 21:02:56 +0000 (21:02 +0000)] 
gh-98831: register instructions have 0 pushes and pops (#101163)

2 years agogh-100712: make it possible to disable specialization (for debugging) (#100713)
Irit Katriel [Thu, 19 Jan 2023 18:14:55 +0000 (18:14 +0000)] 
gh-100712: make it possible to disable specialization (for debugging) (#100713)

2 years agogh-100940: Change "char *str" to "const char *str" in KeywordToken: It is an immutab...
Stepfen Shawn [Wed, 18 Jan 2023 21:02:48 +0000 (05:02 +0800)] 
gh-100940: Change "char *str" to "const char *str" in KeywordToken:  It is an immutable string. (#100936)

2 years agogh-100340: Allows -Wno-int-conversion for wasm (#100341)
Kushal Das [Wed, 18 Jan 2023 18:43:49 +0000 (19:43 +0100)] 
gh-100340: Allows -Wno-int-conversion for wasm (#100341)

Fixes #100340 allows -Wno-int-conversion for wasm

2 years agoGH-98831: Move assorted macros from ceval.h to a new header (#101116)
Guido van Rossum [Wed, 18 Jan 2023 18:41:07 +0000 (10:41 -0800)] 
GH-98831: Move assorted macros from ceval.h to a new header (#101116)

2 years agofix typo in 3.12 What's New (#101105)
Tushar Sadhwani [Wed, 18 Jan 2023 16:24:56 +0000 (21:54 +0530)] 
fix typo in 3.12 What's New (#101105)

2 years agoDocs: improve sqlite3 placeholders example (#101092)
Erlend E. Aasland [Wed, 18 Jan 2023 09:36:17 +0000 (10:36 +0100)] 
Docs: improve sqlite3 placeholders example (#101092)

2 years agoFix typo and old link in wasm readme (#101096)
Zac Hatfield-Dodds [Wed, 18 Jan 2023 00:06:38 +0000 (11:06 +1100)] 
Fix typo and old link in wasm readme (#101096)

2 years agoGH-98831: Implement array support in cases generator (#100912)
Guido van Rossum [Tue, 17 Jan 2023 23:59:19 +0000 (15:59 -0800)] 
GH-98831: Implement array support in cases generator (#100912)

You can now write things like this:
```
inst(BUILD_STRING, (pieces[oparg] -- str)) { ... }
inst(LIST_APPEND, (list, unused[oparg-1], v -- list, unused[oparg-1])) { ... }
```
Note that array output effects are only partially supported (they must be named `unused` or correspond to an input effect).

2 years agogh-82052: Don't send partial UTF-8 sequences to the Windows API (GH-101103)
Paul Moore [Tue, 17 Jan 2023 19:23:06 +0000 (19:23 +0000)] 
gh-82052: Don't send partial UTF-8 sequences to the Windows API (GH-101103)

Don't send partial UTF-8 sequences to the Windows API

2 years agoFix typo in `ReprEnum` documentation (#101079)
Viicos [Tue, 17 Jan 2023 10:51:56 +0000 (11:51 +0100)] 
Fix typo in `ReprEnum` documentation (#101079)

2 years agogh-101046: Fix a potential memory leak in the parser when raising MemoryError (#101051)
Pablo Galindo Salgado [Mon, 16 Jan 2023 18:45:37 +0000 (18:45 +0000)] 
gh-101046: Fix a potential memory leak in the parser when raising MemoryError (#101051)