]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agogh-94808: Cover `%p` in `PyUnicode_FromFormat` (#96677)
Nikita Sobolev [Fri, 7 Oct 2022 16:53:42 +0000 (19:53 +0300)] 
gh-94808: Cover `%p` in `PyUnicode_FromFormat` (#96677)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agoFix memory leaks in test_capi (#98017)
Carl Meyer [Fri, 7 Oct 2022 15:17:41 +0000 (08:17 -0700)] 
Fix memory leaks in test_capi (#98017)

3 years agogh-97983: Revert "Lay the foundation for further work in asyncio.test_streams: port...
Oleg Iarygin [Fri, 7 Oct 2022 14:14:28 +0000 (18:14 +0400)] 
gh-97983: Revert "Lay the foundation for further work in asyncio.test_streams: port server cases to IsolatedAsyncioTestCase" (#98015)

This PR reverts gh-93369 and gh-97896 because they've made asyncio tests unstable. After these PRs were merged, random GitHub action jobs of random commits started to fail unrelated tests and test framework methods.

The reverting is necessary because such shrapnel failures are a symptom of some underlying bug that must be found and fixed first.

I had a hope that it's a server overload because we already have extremely rare disc access errors. However, one and a half day passed, and the failures continue to emerge both in PRs and commits.

Affected issue: gh-93357.
First reported in https://github.com/python/cpython/pull/97940#issuecomment-1270004134.

* Revert "gh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 (#97896)"

This reverts commit 09aea94d291fed2f3e96558dcd6db04014c3e2fb.

* Revert "gh-93357: Start porting asyncio server test cases to IsolatedAsyncioTestCase (#93369)"

This reverts commit ce8fc186ac81bce1727bf4192205148daabf5c2e.

3 years agogh-71316: Update dis documentation to include changes to jump arguments (GH-95798)
Christopher Chianelli [Fri, 7 Oct 2022 13:54:21 +0000 (09:54 -0400)] 
gh-71316: Update dis documentation to include changes to jump arguments (GH-95798)

3 years agoMisc updates to the itertools recipes and tests (GH-98018)
Raymond Hettinger [Fri, 7 Oct 2022 08:37:21 +0000 (03:37 -0500)] 
Misc updates to the itertools recipes and tests (GH-98018)

3 years agoDoc: sphinx-lint finds two other default roles. (GH-98019)
Julien Palard [Fri, 7 Oct 2022 07:10:51 +0000 (09:10 +0200)] 
Doc: sphinx-lint finds two other default roles. (GH-98019)

3 years agogh-86298: Ensure that __loader__ and __spec__.loader agree in warnings.warn_explicit...
Barry Warsaw [Fri, 7 Oct 2022 02:32:53 +0000 (19:32 -0700)] 
gh-86298: Ensure that __loader__ and __spec__.loader agree in warnings.warn_explicit() (GH-97803)

In `_warnings.c`, in the C equivalent of `warnings.warn_explicit()`, if the module globals are given (and not None), the warning will attempt to get the source line for the issued warning.  To do this, it needs the module's loader.

Previously, it would only look up `__loader__` in the module globals.  In https://github.com/python/cpython/issues/86298 we want to defer to the `__spec__.loader` if available.

The first step on this journey is to check that `loader == __spec__.loader` and issue another warning if it is not.  This commit does that.

Since this is a PoC, only manual testing for now.

```python
# /tmp/foo.py
import warnings

import bar

warnings.warn_explicit(
    'warning!',
    RuntimeWarning,
    'bar.py', 2,
    module='bar knee',
    module_globals=bar.__dict__,
    )
```

```python
# /tmp/bar.py
import sys
import os
import pathlib

# __loader__ = pathlib.Path()
```

Then running this: `./python.exe -Wdefault /tmp/foo.py`

Produces:

```
bar.py:2: RuntimeWarning: warning!
  import os
```

Uncomment the `__loader__ = ` line in `bar.py` and try it again:

```
sys:1: ImportWarning: Module bar; __loader__ != __spec__.loader (<_frozen_importlib_external.SourceFileLoader object at 0x109f7dfa0> != PosixPath('.'))
bar.py:2: RuntimeWarning: warning!
  import os
```

Automerge-Triggered-By: GH:warsaw
3 years agogh-82874: Convert remaining importlib format uses to f-str. (#98005)
Gregory P. Smith [Fri, 7 Oct 2022 01:27:51 +0000 (18:27 -0700)] 
gh-82874: Convert remaining importlib format uses to f-str. (#98005)

f-yes

3 years agoDocs: Fix backtick errors found by sphinx-lint (#97998)
Hugo van Kemenade [Fri, 7 Oct 2022 01:01:30 +0000 (18:01 -0700)] 
Docs: Fix backtick errors found by sphinx-lint (#97998)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-97850: Remove deprecated functions from `importlib.utils` (#97898)
Nikita Sobolev [Fri, 7 Oct 2022 00:57:10 +0000 (03:57 +0300)] 
gh-97850: Remove deprecated functions from `importlib.utils` (#97898)

* gh-97850: Remove deprecated functions from `importlib.utils`

* Rebase and remove `set_package` from diff

3 years agoRemove extra spaces in custom openSSL documentation. (#93568)
Xiao Chen [Fri, 7 Oct 2022 00:42:08 +0000 (08:42 +0800)] 
Remove extra spaces in custom openSSL documentation. (#93568)

3 years agoGH-90985: Revert "Deprecate passing a message into cancel()" (#97999)
Guido van Rossum [Fri, 7 Oct 2022 00:30:27 +0000 (17:30 -0700)] 
GH-90985: Revert  "Deprecate passing a message into cancel()" (#97999)

Reason: we were too hasty in deprecating this.
We shouldn't deprecate it before we have a replacement.

3 years agobpo-35540 dataclasses.asdict now supports defaultdict fields (gh-32056)
Tiger [Fri, 7 Oct 2022 00:11:59 +0000 (19:11 -0500)] 
bpo-35540 dataclasses.asdict now supports defaultdict fields (gh-32056)

3 years agoGH-91052: Add C API for watching dictionaries (GH-31787)
Carl Meyer [Fri, 7 Oct 2022 00:08:00 +0000 (17:08 -0700)] 
GH-91052: Add C API for watching dictionaries (GH-31787)

3 years agobpo-38693: Use f-strings instead of str.format() within importlib (#17058)
Gregory P. Smith [Thu, 6 Oct 2022 23:43:16 +0000 (16:43 -0700)] 
bpo-38693: Use f-strings instead of str.format() within importlib (#17058)

This is a small performance improvement, especially for one or two hot
places such as _handle_fromlist() that are called a lot and the
.format() method was being used just to join two strings with a dot.

Otherwise it is merely a readability improvement.

We keep `_ERR_MSG` and `_ERR_MSG_PREFIX` as those may be used elsewhere for canonical looking error messages.

3 years agoGH-97002: Prevent `_PyInterpreterFrame`s from backing more than one `PyFrameObject...
Brandt Bucher [Thu, 6 Oct 2022 23:20:01 +0000 (16:20 -0700)] 
GH-97002: Prevent `_PyInterpreterFrame`s from backing more than one `PyFrameObject` (GH-97996)

3 years agogh-97973: Return all necessary information from the tokenizer (GH-97984)
Lysandros Nikolaou [Thu, 6 Oct 2022 23:07:17 +0000 (16:07 -0700)] 
gh-97973: Return all necessary information from the tokenizer (GH-97984)

Right now, the tokenizer only returns type and two pointers to the start and end of the token.
This PR modifies the tokenizer to return the type and set all of the necessary information,
so that the parser does not have to this.

3 years agofixes gh-96078: os.sched_yield release the GIL while calling sched_yield(2). (gh...
Dong-hee Na [Thu, 6 Oct 2022 22:57:37 +0000 (07:57 +0900)] 
fixes gh-96078: os.sched_yield release the GIL while calling sched_yield(2). (gh-97965)

3 years agogh-65961: Do not rely solely on `__cached__` (GH-97990)
Brett Cannon [Thu, 6 Oct 2022 22:40:22 +0000 (15:40 -0700)] 
gh-65961: Do not rely solely on `__cached__` (GH-97990)

Make sure `__spec__.cached` (at minimum) can be used.

3 years agogh-97850: Remove the open issues section from the import reference (#97935)
Brett Cannon [Thu, 6 Oct 2022 21:01:06 +0000 (14:01 -0700)] 
gh-97850: Remove the open issues section from the import reference (#97935)

Remove the open issues section from the import reference

Tracking in https://github.com/python/cpython/issues/97850 instead.

3 years agoDocs: pin sphinx-lint (GH-97992)
Hugo van Kemenade [Thu, 6 Oct 2022 20:58:41 +0000 (13:58 -0700)] 
Docs: pin sphinx-lint (GH-97992)

3 years agogh-94590: add signatures to operator itemgetter, attrgetter, methodcaller (#94591)
Erik Welch [Thu, 6 Oct 2022 20:35:53 +0000 (15:35 -0500)] 
gh-94590: add signatures to operator itemgetter, attrgetter, methodcaller (#94591)

These were intentionally skipped when operator was updated to use the argument clinic:
https://github.com/python/cpython/issues/64385#issuecomment-1093641466

However, by not using the argument clinic, they missed out on getting signatures.
This is a narrow PR to update the docstrings so that `__text_signature__` can be
extracted from them.  Updating to use the argument clinic is beyond scope.

`methodcaller` uses `*args, **kwargs` to match variadic names used elsewhere,
including in `operator.call`.

3 years agoAdd Pynche's move to the What's new in 3.11 (#97974)
Barry Warsaw [Thu, 6 Oct 2022 20:29:52 +0000 (13:29 -0700)] 
Add Pynche's move to the What's new in 3.11 (#97974)

* Add Pynche's move to the What's new in 3.11

* Update Doc/whatsnew/3.11.rst

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-97781: Apply changes from importlib_metadata 5. (GH-97785)
Jason R. Coombs [Thu, 6 Oct 2022 19:25:24 +0000 (15:25 -0400)] 
gh-97781: Apply changes from importlib_metadata 5. (GH-97785)

* gh-97781: Apply changes from importlib_metadata 5.

* Apply changes from upstream

* Apply changes from upstream.

3 years agogh-86482: Document assignment expression need for ()s (#23291)
Terry Jan Reedy [Thu, 6 Oct 2022 19:24:17 +0000 (15:24 -0400)] 
gh-86482: Document assignment expression need for ()s (#23291)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-97943: PyFunction_GetAnnotations should return a borrowed reference. (#97949)
larryhastings [Thu, 6 Oct 2022 19:23:20 +0000 (12:23 -0700)] 
gh-97943: PyFunction_GetAnnotations should return a borrowed reference. (#97949)

3 years agogh-94808: Coverage: Test that maximum indentation level is handled (#95926)
Michael Droettboom [Thu, 6 Oct 2022 17:39:17 +0000 (13:39 -0400)] 
gh-94808: Coverage: Test that maximum indentation level is handled (#95926)

* gh-94808: Coverage: Test that maximum indentation level is handled

* Use "compile" rather than "exec"

3 years agoGH-88050: fix race in closing subprocess pipe in asyncio (#97951)
Kumar Aditya [Thu, 6 Oct 2022 17:18:19 +0000 (22:48 +0530)] 
GH-88050: fix race in closing subprocess pipe in asyncio  (#97951)

Check for None when iterating over `self._pipes.values()`.

3 years agogh-93738: Disallow pre-v3 syntax in the C domain (#97962)
Adam Turner [Thu, 6 Oct 2022 17:11:37 +0000 (18:11 +0100)] 
gh-93738: Disallow pre-v3 syntax in the C domain (#97962)

Also, disable using invalid sphinx-lint 0.6.2.

3 years agogh-95986: Fix the example using match keyword (#95989)
180909 [Thu, 6 Oct 2022 16:52:21 +0000 (00:52 +0800)] 
gh-95986: Fix the example using match keyword (#95989)

3 years agogh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK (GH-97944)
Ned Deily [Thu, 6 Oct 2022 16:11:47 +0000 (09:11 -0700)] 
gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK (GH-97944)

The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls.
 Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a
 segfault if cpython is built with the macOS 13 SDK but run on an earlier
 version of macOS. Prevent this by adding runtime support for detection of
 these system calls ("weaklinking") as is done for other newer syscalls on
 macOS.

3 years agogh-94808: Cover `PyUnicode_Count` in CAPI (#96929)
Nikita Sobolev [Thu, 6 Oct 2022 15:20:22 +0000 (18:20 +0300)] 
gh-94808: Cover `PyUnicode_Count` in CAPI (#96929)

3 years agogh-94808: Cover `PyObject_PyBytes` case with custom `__bytes__` method (#96610)
Nikita Sobolev [Thu, 6 Oct 2022 12:16:16 +0000 (15:16 +0300)] 
gh-94808: Cover `PyObject_PyBytes` case with custom `__bytes__` method (#96610)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-95691: Doc BufferedWriter and BufferedReader (#95703)
180909 [Wed, 5 Oct 2022 23:57:42 +0000 (07:57 +0800)] 
gh-95691: Doc BufferedWriter and BufferedReader (#95703)

3 years agoGH-88968: Add notes about socket ownership transfers (#97936)
Guido van Rossum [Wed, 5 Oct 2022 23:42:01 +0000 (16:42 -0700)] 
GH-88968: Add notes about socket ownership transfers (#97936)

3 years agogh-96865: [Enum] fix Flag to use CONFORM boundary (GH-97528)
Ethan Furman [Wed, 5 Oct 2022 22:25:55 +0000 (15:25 -0700)] 
gh-96865: [Enum] fix Flag to use CONFORM boundary (GH-97528)

3 years agogh-65961: Raise `DeprecationWarning` when `__package__` differs from `__spec__.parent...
Brett Cannon [Wed, 5 Oct 2022 22:00:45 +0000 (15:00 -0700)] 
gh-65961: Raise `DeprecationWarning` when `__package__` differs from `__spec__.parent` (#97879)

Also remove `importlib.util.set_package()` which was already slated for removal.

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
3 years agodocs(typing): add "see PEP 675" to LiteralString (#97926)
Simon Legner [Wed, 5 Oct 2022 20:08:07 +0000 (22:08 +0200)] 
docs(typing): add "see PEP 675" to LiteralString (#97926)

3 years agogh-97850: Remove all known instances of module_repr() (#97876)
Barry Warsaw [Wed, 5 Oct 2022 18:42:26 +0000 (11:42 -0700)] 
gh-97850: Remove all known instances of module_repr() (#97876)

Remove all known instances of module_repr()

3 years agoI changed my surname early this year (#96671)
Tshepang Mbambo [Wed, 5 Oct 2022 18:16:45 +0000 (20:16 +0200)] 
I changed my surname early this year (#96671)

* I recently changed my name

* Update ACKS

3 years agogh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)
Adam Turner [Wed, 5 Oct 2022 18:01:14 +0000 (19:01 +0100)] 
gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)

:c:type:`<C type>` -> :c:expr:`<C type>`

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agogh-91539: improve performance of get_proxies_environment (#91566)
Pieter Eendebak [Wed, 5 Oct 2022 17:57:52 +0000 (19:57 +0200)] 
gh-91539: improve performance of get_proxies_environment  (#91566)

* improve performance of get_proxies_environment when there are many environment variables

* 📜🤖 Added by blurb_it.

* fix case of short env name

* fix formatting

* fix whitespace

* whitespace

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>
* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>
* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>
* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>
* whitespace

* Update Misc/NEWS.d/next/Library/2022-04-15-11-29-38.gh-issue-91539.7WgVuA.rst

Co-authored-by: Carl Meyer <carl@oddbird.net>
* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
3 years agobuild(deps): bump actions/stale from 5 to 6 (#97701)
dependabot[bot] [Wed, 5 Oct 2022 17:56:42 +0000 (10:56 -0700)] 
build(deps): bump actions/stale from 5 to 6 (#97701)

Bumps [actions/stale](https://github.com/actions/stale) from 5 to 6.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5...v6)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years agoGH-95172 Make the same version `versionadded` oneline (#95172)
180909 [Wed, 5 Oct 2022 17:52:59 +0000 (01:52 +0800)] 
GH-95172 Make the same version `versionadded` oneline (#95172)

* Make the same version versionadded oneline

* Format versionadded for enum.rst

* Format versionadded

A single line versionadded was reading better.

Co-authored-by: Senthil Kumaran <senthil@python.org>
3 years agogh-88050: Fix asyncio subprocess to kill process cleanly when process is blocked...
Kumar Aditya [Wed, 5 Oct 2022 17:15:31 +0000 (22:45 +0530)] 
gh-88050: Fix asyncio subprocess to kill process cleanly when process is blocked (#32073)

3 years agogh-93738: Documentation C syntax (Function glob patterns -> literal markup) (#97774)
Adam Turner [Wed, 5 Oct 2022 15:22:28 +0000 (16:22 +0100)] 
gh-93738: Documentation C syntax (Function glob patterns -> literal markup) (#97774)

3 years agogh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 (#97896)
Oleg Iarygin [Wed, 5 Oct 2022 14:31:43 +0000 (18:31 +0400)] 
gh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 (#97896)

This fixes the buildbots.

3 years agogh-95196: Disable incorrect pickling of the C implemented classmethod descriptors...
Serhiy Storchaka [Wed, 5 Oct 2022 11:21:16 +0000 (14:21 +0300)] 
gh-95196: Disable incorrect pickling of the C implemented classmethod descriptors (GH-96383)

3 years agogh-97758: Fix a crash in getpath_joinpath() called without arguments (GH-97759)
Serhiy Storchaka [Wed, 5 Oct 2022 09:51:58 +0000 (12:51 +0300)] 
gh-97758: Fix a crash in getpath_joinpath() called without arguments (GH-97759)

3 years agogh-74696: Pass root_dir to custom archivers which support it (GH-94251)
Serhiy Storchaka [Wed, 5 Oct 2022 09:48:59 +0000 (12:48 +0300)] 
gh-74696: Pass root_dir to custom archivers which support it (GH-94251)

Co-authored-by: Éric <merwok@netwok.org>
3 years agogh-97661: Improve accuracy of sqlite3.Cursor.fetchone docs (#97662)
Jia Junjie [Wed, 5 Oct 2022 08:47:54 +0000 (16:47 +0800)] 
gh-97661: Improve accuracy of sqlite3.Cursor.fetchone docs (#97662)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agogh-87092: bring compiler code closer to a preprocessing-opt-assembler organisation...
Irit Katriel [Wed, 5 Oct 2022 07:52:35 +0000 (08:52 +0100)] 
gh-87092: bring compiler code closer to a preprocessing-opt-assembler organisation (GH-97644)

3 years agoGH-96704: Add {Task,Handle}.get_context(), use it in call_exception_handler() (#96756)
Guido van Rossum [Wed, 5 Oct 2022 06:49:10 +0000 (23:49 -0700)] 
GH-96704: Add {Task,Handle}.get_context(), use it in call_exception_handler() (#96756)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
3 years agogh-93738: Documentation C syntax (:c:type:`PyTypeObject*` -> :c:expr:`PyTypeObject...
Adam Turner [Wed, 5 Oct 2022 00:56:20 +0000 (01:56 +0100)] 
gh-93738: Documentation C syntax (:c:type:`PyTypeObject*` -> :c:expr:`PyTypeObject*`) (#97778)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-97825: fix AttributeError when calling subprocess.check_output(input=None) with...
andrei kulakov [Wed, 5 Oct 2022 00:47:49 +0000 (20:47 -0400)] 
gh-97825: fix AttributeError when calling subprocess.check_output(input=None) with encoding or errors args (#97826)

* fix AttributeError, add unit test

3 years agoAdd re.VERBOSE flag documentation example (#97678)
Athos Ribeiro [Wed, 5 Oct 2022 00:39:42 +0000 (21:39 -0300)] 
Add re.VERBOSE flag documentation example (#97678)

The current re.VERBOSE documentation example leaves space for ambiguous
interpretation. One may read that spaces within the `(?:` token are
spaces inside the non-capturing group (such as `(?: )`). This patch
removes the ambiguity by including examples after the statement.

3 years agogh-97654: Add auto exception chaining example to tutorial (#97703)
Shahriar Heidrich [Wed, 5 Oct 2022 00:36:04 +0000 (02:36 +0200)] 
gh-97654: Add auto exception chaining example to tutorial (#97703)

Add auto exception chaining example to tutorial

3 years agoGH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510)
Mark Shannon [Wed, 5 Oct 2022 00:34:03 +0000 (01:34 +0100)] 
GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510)

3 years agoGH-97779: Ensure that *all* frame objects are backed by "complete" frames (GH-97845)
Brandt Bucher [Wed, 5 Oct 2022 00:30:03 +0000 (17:30 -0700)] 
GH-97779: Ensure that *all* frame objects are backed by "complete" frames (GH-97845)

3 years agogh-97837: Change deprecation warning message in `unittest` (#97838)
Nikita Sobolev [Wed, 5 Oct 2022 00:29:18 +0000 (03:29 +0300)] 
gh-97837: Change deprecation warning message in `unittest` (#97838)

3 years agogh-95913: Copyedit/improve Implementation Changes What's New section (#97720)
C.A.M. Gerlach [Wed, 5 Oct 2022 00:03:58 +0000 (19:03 -0500)] 
gh-95913: Copyedit/improve Implementation Changes What's New section (#97720)

* Add and refine reST/Sphinx syntax for implementation changes section

* Clarify and refine wording in the Implementation Changes section

* Elide unnecessary comma

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. cases) (#97775)
Adam Turner [Tue, 4 Oct 2022 23:32:27 +0000 (00:32 +0100)] 
gh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. cases) (#97775)

* :c:type: to :c:expr:

* Update Doc/whatsnew/2.4.rst

3 years agogh-93738: Documentation C syntax (:c:type:`FILE` -> :c:expr:`FILE`) (#97769)
Adam Turner [Tue, 4 Oct 2022 23:27:29 +0000 (00:27 +0100)] 
gh-93738: Documentation C syntax (:c:type:`FILE` -> :c:expr:`FILE`) (#97769)

:c:type:`FILE` -> :c:expr:`FILE`

3 years agogh-93738: Documentation C syntax (:c:type:`TYPE` -> :c:expr:`TYPE`) (#97770)
Adam Turner [Tue, 4 Oct 2022 23:26:36 +0000 (00:26 +0100)] 
gh-93738: Documentation C syntax (:c:type:`TYPE` -> :c:expr:`TYPE`) (#97770)

:c:type:`TYPE` -> :c:expr:`TYPE`

3 years agogh-93738: Documentation C syntax (Use `c:struct`) (#97772)
Adam Turner [Tue, 4 Oct 2022 23:26:14 +0000 (00:26 +0100)] 
gh-93738: Documentation C syntax (Use `c:struct`) (#97772)

Use `c:struct`

3 years agogh-93738: Documentation C syntax (:c:data:`view->obj` -> :c:expr:`view->obj`) (#97773)
Adam Turner [Tue, 4 Oct 2022 23:18:09 +0000 (00:18 +0100)] 
gh-93738: Documentation C syntax (:c:data:`view->obj` -> :c:expr:`view->obj`) (#97773)

:c:data:`view->obj` -> :c:expr:`view->obj`

3 years agogh-95913: Copyedit/improve Other Language Changes What's New section (#97719)
C.A.M. Gerlach [Tue, 4 Oct 2022 23:16:37 +0000 (18:16 -0500)] 
gh-95913: Copyedit/improve Other Language Changes What's New section (#97719)

* Add/refine cross references to items in other lang changes section

* Unify context manager exception changes into single non-repetitive item

* More clearly describe the intent and consequences of the -P option

* Apply minor clarifications & copyedits to rest of section

* Tweak the formatting of module references

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-93738: Documentation C syntax (:c:type:`PyObject` -> :c:expr:`PyObject`) (#97776)
Adam Turner [Tue, 4 Oct 2022 23:13:03 +0000 (00:13 +0100)] 
gh-93738: Documentation C syntax (:c:type:`PyObject` -> :c:expr:`PyObject`) (#97776)

:c:type:`PyObject` -> :c:expr:`PyObject`

3 years agogh-93738: Documentation C syntax (:c:type:`PyInterpreterState *` -> :c:expr:`PyInterp...
Adam Turner [Tue, 4 Oct 2022 23:12:22 +0000 (00:12 +0100)] 
gh-93738: Documentation C syntax (:c:type:`PyInterpreterState *` -> :c:expr:`PyInterpreterState *`) (#97777)

:c:type:`PyInterpreterState *` -> :c:expr:`PyInterpreterState *`

3 years agogh-93738: Documentation C syntax (:c:type:`PyTupleObject*` -> :c:expr:`PyTupleObject...
Adam Turner [Tue, 4 Oct 2022 23:11:54 +0000 (00:11 +0100)] 
gh-93738: Documentation C syntax (:c:type:`PyTupleObject*` -> :c:expr:`PyTupleObject*`) (#97780)

:c:type:`PyTupleObject*` -> :c:expr:`PyTupleObject*`

3 years agogh-93738: Documentation C syntax (:c:type:`PyBytesObject*` -> :c:expr:`PyBytesObject...
Adam Turner [Tue, 4 Oct 2022 23:11:34 +0000 (00:11 +0100)] 
gh-93738: Documentation C syntax (:c:type:`PyBytesObject*` -> :c:expr:`PyBytesObject*`) (#97782)

:c:type:`PyBytesObject*` -> :c:expr:`PyBytesObject*`

3 years agogh-93738: Documentation C syntax (:c:type:`PyUnicodeObject*` -> :c:expr:`PyUnicodeObj...
Adam Turner [Tue, 4 Oct 2022 23:11:20 +0000 (00:11 +0100)] 
gh-93738: Documentation C syntax (:c:type:`PyUnicodeObject*` -> :c:expr:`PyUnicodeObject*`) (#97783)

:c:type:`PyUnicodeObject*` -> :c:expr:`PyUnicodeObject*`

3 years agogh-93738: Documentation C syntax (:c:type:`Py_UNICODE*` -> :c:expr:`Py_UNICODE*`...
Adam Turner [Tue, 4 Oct 2022 23:10:57 +0000 (00:10 +0100)] 
gh-93738: Documentation C syntax (:c:type:`Py_UNICODE*` -> :c:expr:`Py_UNICODE*`) (#97784)

:c:type:`Py_UNICODE*` -> :c:expr:`Py_UNICODE*`

3 years agogh-88355: Fix backslashes in AF_PIPE (#96543)
cousteau [Tue, 4 Oct 2022 22:54:03 +0000 (23:54 +0100)] 
gh-88355: Fix backslashes in AF_PIPE (#96543)

Fix backslashes in AF_PIPE (#88355)

The correct syntax for AF_PIPE addresses is `\\.\pipe\blahblah`, not `\.\pipe{blahblah}`, but the syntax markup messed up the backslashes.

3 years agogh-95913: Move py.exe to appropriate What's New section & refine text (#97718)
C.A.M. Gerlach [Tue, 4 Oct 2022 22:50:34 +0000 (17:50 -0500)] 
gh-95913: Move py.exe to appropriate What's New section & refine text (#97718)

* Move Windows py.exe improvements from Typing section to New Features

* Add ref target label and use literal for py.exe

* Be clearer/explict about what legacy version arg components reprisent

* Apply other minor clarity and textual fixes to py.exe launcher text

* Refine phrasing of legacy sentence of py.exe desc

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-58451: Add optional delete_on_close parameter to NamedTemporaryFile (GH-97015)
Ev2geny [Tue, 4 Oct 2022 22:37:33 +0000 (00:37 +0200)] 
gh-58451: Add optional delete_on_close parameter to NamedTemporaryFile (GH-97015)

3 years agogh-97008: Add a Python implementation of AttributeError and NameError suggestions...
Łukasz Langa [Tue, 4 Oct 2022 22:31:16 +0000 (15:31 -0700)] 
gh-97008: Add a Python implementation of AttributeError and NameError suggestions (#97022)

Relevant tests moved from test_exceptions to test_traceback to be able to
compare both implementations.

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
3 years agogh-96448: fix documentation for _thread.lock.acquire (#96449)
Daniel Giger [Tue, 4 Oct 2022 22:18:04 +0000 (18:18 -0400)] 
gh-96448: fix documentation for _thread.lock.acquire (#96449)

* fix documentation for _thread.lock.acquire

* update formatting of _thread.lock.acquire() doc

3 years agogh-90301: Doc: Add references to PEP 686 (#96816)
Inada Naoki [Tue, 4 Oct 2022 22:04:44 +0000 (07:04 +0900)] 
gh-90301: Doc: Add references to PEP 686 (#96816)

Doc: Add references to PEP 686.

3 years agoGH-95913: Update what's new in 3.11 for asyncio (#97806)
Guido van Rossum [Tue, 4 Oct 2022 18:36:20 +0000 (11:36 -0700)] 
GH-95913: Update what's new in 3.11 for asyncio (#97806)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-93357: Start porting asyncio server test cases to IsolatedAsyncioTestCase (#93369)
Oleg Iarygin [Tue, 4 Oct 2022 17:56:47 +0000 (21:56 +0400)] 
gh-93357: Start porting asyncio server test cases to IsolatedAsyncioTestCase (#93369)

Lay the foundation for further work in `asyncio.test_streams`.

3 years agogh-96142: add missing params to `dataclass._DataclassParams` (gh-96382)
Nikita Sobolev [Tue, 4 Oct 2022 16:53:28 +0000 (19:53 +0300)] 
gh-96142: add missing params to `dataclass._DataclassParams` (gh-96382)

3 years agoGH-82604: fix docs about configuring selector (#97755)
Kumar Aditya [Tue, 4 Oct 2022 16:45:37 +0000 (22:15 +0530)] 
GH-82604: fix docs about configuring selector (#97755)

3 years agogh-97754: Update doc for default location of per-user installs on Windows (GH-97756)
Ben Faulhaber [Tue, 4 Oct 2022 16:04:41 +0000 (18:04 +0200)] 
gh-97754: Update doc for default location of per-user installs on Windows (GH-97756)

3 years agogh-97731: fix distclean target to clean docs (#97732)
Skip Montanaro [Tue, 4 Oct 2022 14:38:19 +0000 (09:38 -0500)] 
gh-97731: fix distclean target to clean docs (#97732)

fix distclean target to clean docs

3 years agogh-97670: Remove sys.getdxp() and analyze_dxp.py script (#97671)
Victor Stinner [Tue, 4 Oct 2022 13:28:57 +0000 (15:28 +0200)] 
gh-97670: Remove sys.getdxp() and analyze_dxp.py script (#97671)

Remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py
script. DXP stands for "dynamic execution pairs". They were related
to DYNAMIC_EXECUTION_PROFILE and DXPAIRS macros which have been
removed in Python 3.11. Python can now be built with "./configure
--enable-pystats" to gather statistics on Python opcodes.

3 years agoAdjust stable ABI internal documentation (GH-96896)
William Woodruff [Tue, 4 Oct 2022 13:05:53 +0000 (08:05 -0500)] 
Adjust stable ABI internal documentation (GH-96896)

I was perusing this file, and noticed that this part of the documentation is slightly out of date: the `struct` items in this TOML file currently contain `struct_abi_kind` members, which distinguish between the different types of ABI compatibility described in the comment.

I've updated the comment to reflect this.

3 years agogh-97669: Remove outdated example scripts (#97675)
Victor Stinner [Tue, 4 Oct 2022 08:49:00 +0000 (10:49 +0200)] 
gh-97669: Remove outdated example scripts (#97675)

Remove outdated example scripts of the Tools/scripts/ directory. A
copy can be found in the old-demos project:
https://github.com/gvanrossum/old-demos

Removed scripts (39):

* byext.py
* byteyears.py
* cleanfuture.py
* copytime.py
* crlf.py
* db2pickle.py
* dutree.doc
* dutree.py
* find-uname.py
* find_recursionlimit.py
* finddiv.py
* findlinksto.py
* findnocoding.py
* fixcid.py
* fixdiv.py
* fixheader.py
* fixnotice.py
* fixps.py
* get-remote-certificate.py
* google.py
* highlight.py
* ifdef.py
* import_diagnostics.py
* lfcr.py
* linktree.py
* lll.py
* mailerdaemon.py
* make_ctype.py
* mkreal.py
* objgraph.py
* pdeps.py
* pickle2db.py
* pindent.py
* pysource.py
* reindent-rst.py
* rgrep.py
* suff.py
* texi2html.py
* which.py

Changes:

* Remove test_fixcid, test_lll, test_pdeps and test_pindent
  of test.test_tools.
* Remove get-remote-certificate.py changelog entry, since the script
  was removed.

Note: there is a copy of crlf.py in Lib/test/test_lib2to3/data/.

3 years agogh-97709: Included newline separator in Mandelbrot set (#97737)
matheusja [Tue, 4 Oct 2022 05:34:02 +0000 (02:34 -0300)] 
gh-97709: Included newline separator in Mandelbrot set (#97737)

Included newline separator in Mandelbrot set

Now the Mandelbrot set one-liner example on separates the lines with a '\n' character.

3 years agogh-97816: Remove unused variables in `mutliprocessing.managers.Server` (#97817)
Koki Saito [Tue, 4 Oct 2022 05:29:17 +0000 (14:29 +0900)] 
gh-97816: Remove unused variables in `mutliprocessing.managers.Server` (#97817)

Remove unused local variables.

3 years agogh-93738: Documentation C syntax (:c:data:`0` -> ``0``) (#97771)
Adam Turner [Tue, 4 Oct 2022 01:46:30 +0000 (02:46 +0100)] 
gh-93738: Documentation C syntax (:c:data:`0` -> ``0``) (#97771)

:c:data:`0` -> ``0``

3 years agogh-97639: Remove `tokenize.NL` check from `tabnanny` (#97640)
Nikita Sobolev [Tue, 4 Oct 2022 00:41:29 +0000 (03:41 +0300)] 
gh-97639: Remove `tokenize.NL` check from `tabnanny` (#97640)

* gh-97639: Remove `tokenize.NL` check from `tabnanny`

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agoAdd comment to subtle dataclass code (gh-96133)
Shantanu [Tue, 4 Oct 2022 00:30:04 +0000 (17:30 -0700)] 
Add comment to subtle dataclass code (gh-96133)

In the PR that made this change, 1st1 left a "note to self: add a
comment explaining this". This comment was never added.
https://github.com/python/cpython/pull/9518/files#r280608117

I was reading this code and it wasn't obvious to me why we weren't
exec-ing directly into locals. So I got to learn something new :-)
https://docs.python.org/3/reference/executionmodel.html#interaction-with-dynamic-features

3 years agoRemove space. (GH-97807)
Benjamin Peterson [Tue, 4 Oct 2022 00:12:36 +0000 (17:12 -0700)] 
Remove space. (GH-97807)

Automerge-Triggered-By: GH:benjaminp
3 years agoAdd `sprint` issues to the Sprint 2022 project. (#97788)
Ezio Melotti [Mon, 3 Oct 2022 23:45:18 +0000 (01:45 +0200)] 
Add `sprint` issues to the Sprint 2022 project. (#97788)

3 years agoGH-97752: Clear the `previous` member of newly-created generator/coroutine frames...
Brandt Bucher [Mon, 3 Oct 2022 23:36:52 +0000 (16:36 -0700)] 
GH-97752: Clear the `previous` member of newly-created generator/coroutine frames (GH-97795)

3 years agoMinor grammar changes to http.client docs (#96221)
Rohan Shah [Mon, 3 Oct 2022 23:19:39 +0000 (19:19 -0400)] 
Minor grammar changes to http.client docs (#96221)

Minor grammar changes

3 years agoUpdate http.client.rst (#24803)
Géry Ogam [Mon, 3 Oct 2022 23:18:36 +0000 (01:18 +0200)] 
Update http.client.rst (#24803)

* Update http.client.rst

* Apply suggestions from code review

Co-authored-by: Éric <merwok@netwok.org>
* Update http.client.rst

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Senthil Kumaran <senthil@python.org>
3 years agogh-97799: use inspect.get_annotations in dataclass (#97800)
larryhastings [Mon, 3 Oct 2022 22:46:09 +0000 (15:46 -0700)] 
gh-97799: use inspect.get_annotations in dataclass (#97800)

dataclass used to get the annotations on a class object using
cls.__dict__.get('__annotations__').  Now that it always imports
inspect, it can use inspect.get_annotations, which is modern
best practice for coping with annotations.

3 years agomultiprocessing docs: Remove extra option ELLIPSIS from section with code (#96625)
Ivan Kapeykin [Mon, 3 Oct 2022 22:41:08 +0000 (01:41 +0300)] 
multiprocessing docs: Remove extra option ELLIPSIS from section with code (#96625)