]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agogh-97922: Run the GC only on eval breaker (#97920)
Pablo Galindo Salgado [Sat, 8 Oct 2022 14:57:09 +0000 (07:57 -0700)] 
gh-97922: Run the GC only on eval breaker (#97920)

3 years agoGitHub Workflows security hardening (#96492)
Alex [Sat, 8 Oct 2022 08:13:34 +0000 (11:13 +0300)] 
GitHub Workflows security hardening (#96492)

* Update project-updater.yml

Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
* Update project-updater.yml

repository-projects: write is not needed because a separate secrets.ADD_TO_PROJECT_PAT is used

Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
3 years agoAdd `@ezio-melotti` as codeowner for `.github/`. (#98079)
Ezio Melotti [Sat, 8 Oct 2022 07:11:38 +0000 (09:11 +0200)] 
Add `@ezio-melotti` as codeowner for `.github/`. (#98079)

3 years agogh-97913 Docs: Add walrus operator to the index (#97921)
Hugo van Kemenade [Sat, 8 Oct 2022 06:54:16 +0000 (23:54 -0700)] 
gh-97913 Docs: Add walrus operator to the index (#97921)

* Add walrus operator to the index

* Add named expression to the index

Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
* Fix indentation and add missing newline

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years ago[doc] Fix broken links to C extensions accelerating stdlib modules (#96914)
partev [Sat, 8 Oct 2022 05:55:35 +0000 (01:55 -0400)] 
[doc] Fix broken links to C extensions accelerating stdlib modules (#96914)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agogh-97822: Fix http.server documentation reference to test() function (#98027)
JasonYZ [Sat, 8 Oct 2022 04:46:23 +0000 (05:46 +0100)] 
gh-97822: Fix http.server documentation reference to test() function (#98027)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-91052: Add PyDict_Unwatch for unwatching a dictionary (#98055)
Carl Meyer [Sat, 8 Oct 2022 00:37:46 +0000 (17:37 -0700)] 
gh-91052: Add PyDict_Unwatch for unwatching a dictionary (#98055)

3 years agoGH-98023: Change default child watcher to PidfdChildWatcher on supported systems...
Kumar Aditya [Sat, 8 Oct 2022 00:29:09 +0000 (05:59 +0530)] 
GH-98023: Change default child watcher to PidfdChildWatcher on supported systems (#98024)

3 years agoGH-94182: Run the PidfdChildWatcher on the running loop (#94184)
Thomas Grainger [Sat, 8 Oct 2022 00:24:01 +0000 (01:24 +0100)] 
GH-94182: Run the PidfdChildWatcher on the running loop (#94184)

There is no reason for this watcher to be attached to any particular loop.
This should make it safe to use regardless of the lifetime of the event loop running in the main thread
(relative to other loops).

Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-92886: make test_ast pass with -O (assertions off) (GH-98058)
Irit Katriel [Fri, 7 Oct 2022 23:30:23 +0000 (00:30 +0100)] 
gh-92886: make test_ast pass with -O (assertions off) (GH-98058)

-O does not strip docstrings.

Automerge-Triggered-By: GH:iritkatriel
3 years agogh-92886: make test_coroutines pass with -O (assertions off) (GH-98060)
Irit Katriel [Fri, 7 Oct 2022 23:12:28 +0000 (00:12 +0100)] 
gh-92886: make test_coroutines pass with -O (assertions off) (GH-98060)

Automerge-Triggered-By: GH:iritkatriel
3 years agogh-57179: Add note on symlinks for os.walk (#94799)
Stanley [Fri, 7 Oct 2022 22:51:50 +0000 (15:51 -0700)] 
gh-57179: Add note on symlinks for os.walk (#94799)

3 years agogh-94808: Fix regex on exotic platforms (#98036)
Jelle Zijlstra [Fri, 7 Oct 2022 22:39:53 +0000 (15:39 -0700)] 
gh-94808: Fix regex on exotic platforms (#98036)

The test failed on a buildbot because the pointer was only 7 hex characters. To be safe,
I bumped it down to 3: 4 in case we have 32-bit platforms, and 3 in case the pointer is very small.

3 years agogh-90085: Remove vestigial -t and -c timeit options (#94941)
Shantanu [Fri, 7 Oct 2022 22:38:20 +0000 (15:38 -0700)] 
gh-90085: Remove vestigial -t and -c timeit options (#94941)

See bpo-28240. The functionality was removed in 3d7feb9ac2.
The options had been deprecated since Python 3.3

3 years agoGH-83901: Improve Signature.bind error message for missing keyword-only params (...
Frazer McLean [Fri, 7 Oct 2022 22:24:17 +0000 (00:24 +0200)] 
GH-83901: Improve Signature.bind error message for missing keyword-only params (#95347)

Fixes GH-83901

3 years agogh-61105: Add default param, note on using cookiejar subclass (#95427)
Stanley [Fri, 7 Oct 2022 22:21:13 +0000 (15:21 -0700)] 
gh-61105: Add default param, note on using cookiejar subclass (#95427)

3 years agogh-96288: Add a sentence to `os.mkdir`'s docstring. (#96271)
Hagai Helman Tov [Fri, 7 Oct 2022 22:06:16 +0000 (01:06 +0300)] 
gh-96288: Add a sentence to `os.mkdir`'s docstring. (#96271)

3 years agogh-96073: fix backticks in NEWS entry (GH-98056)
Jelle Zijlstra [Fri, 7 Oct 2022 21:44:56 +0000 (14:44 -0700)] 
gh-96073: fix backticks in NEWS entry (GH-98056)

Automerge-Triggered-By: GH:JelleZijlstra
3 years agogh-92886: [clinic.py] raise exception on invalid input instead of assertion (GH-98051)
Irit Katriel [Fri, 7 Oct 2022 21:41:35 +0000 (22:41 +0100)] 
gh-92886: [clinic.py] raise exception on invalid input instead of assertion (GH-98051)

Tests should pass with -O (assertions off).

Automerge-Triggered-By: GH:iritkatriel
3 years agogh-97997: Add col_offset field to tokenizer and use that for AST nodes (#98000)
Lysandros Nikolaou [Fri, 7 Oct 2022 21:38:35 +0000 (14:38 -0700)] 
gh-97997: Add col_offset field to tokenizer and use that for AST nodes (#98000)

3 years agoGH-88968: Reject socket that is already used as a transport (#98010)
Guido van Rossum [Fri, 7 Oct 2022 19:56:50 +0000 (12:56 -0700)] 
GH-88968: Reject socket that is already used as a transport (#98010)

3 years agogh-96346: Use double caching for re._compile() (#96347)
Serhiy Storchaka [Fri, 7 Oct 2022 19:21:42 +0000 (22:21 +0300)] 
gh-96346: Use double caching for re._compile() (#96347)

3 years agogh-91708: Revert params note in urllib.parse.urlparse table (#96699)
Stanley [Fri, 7 Oct 2022 19:19:36 +0000 (12:19 -0700)] 
gh-91708: Revert params note in urllib.parse.urlparse table (#96699)

Revert params note in urllib.parse.urlparse table

3 years agogh-96265: Fix some formatting in faq/design.rst (#96924)
Stanley [Fri, 7 Oct 2022 19:15:41 +0000 (12:15 -0700)] 
gh-96265: Fix some formatting in faq/design.rst (#96924)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agogh-73196: Add namespace/scope clarification for inheritance section (#92840)
Stanley [Fri, 7 Oct 2022 19:04:14 +0000 (12:04 -0700)] 
gh-73196: Add namespace/scope clarification for inheritance section (#92840)

Add namespace/scope clarification for inheritance section

3 years agogh-97646: Change `.js` and `.mjs` files mimetype to conform to RFC 9239 (#97934)
Noam Cohen [Fri, 7 Oct 2022 19:00:53 +0000 (22:00 +0300)] 
gh-97646: Change `.js` and `.mjs` files mimetype to conform to RFC 9239 (#97934)

3 years agogh-97923: Always run Ubuntu SSL tests with others in CI (#97940)
Nikita Sobolev [Fri, 7 Oct 2022 18:58:46 +0000 (21:58 +0300)] 
gh-97923: Always run Ubuntu SSL tests with others in CI (#97940)

3 years agogh-97956: Mention `generate_global_objects.py` in `AC How-To` (#97957)
Nikita Sobolev [Fri, 7 Oct 2022 18:54:45 +0000 (21:54 +0300)] 
gh-97956: Mention `generate_global_objects.py` in `AC How-To` (#97957)

3 years agogh-96959: Update HTTP links which are redirected to HTTPS (#98039)
180909 [Fri, 7 Oct 2022 18:52:45 +0000 (02:52 +0800)] 
gh-96959: Update HTTP links which are redirected to HTTPS (#98039)

3 years agoAdd a warning message about PyOS_snprintf (#95993)
Eric Wieser [Fri, 7 Oct 2022 18:49:53 +0000 (11:49 -0700)] 
Add a warning message about PyOS_snprintf (#95993)

3 years agoGH-96073: Fix wild replacement in inspect.formatannotation (#96074)
Anh71me [Fri, 7 Oct 2022 18:23:06 +0000 (02:23 +0800)] 
GH-96073: Fix wild replacement in inspect.formatannotation (#96074)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-65496: Correct wording on csv's skipinitialspace argument (#96170)
Stanley [Fri, 7 Oct 2022 18:15:34 +0000 (11:15 -0700)] 
gh-65496: Correct wording on csv's skipinitialspace argument (#96170)

3 years agogh-64921: Clarify wording for open()'s newline arg (#96171)
Stanley [Fri, 7 Oct 2022 18:12:08 +0000 (11:12 -0700)] 
gh-64921: Clarify wording for open()'s newline arg (#96171)

3 years agogh-97955: Migrate `zoneinfo` to Argument Clinic (#97958)
Nikita Sobolev [Fri, 7 Oct 2022 18:06:23 +0000 (21:06 +0300)] 
gh-97955: Migrate `zoneinfo` to Argument Clinic (#97958)

3 years agogh-97669: Move difflib examples to Doc/includes/ (#97964)
Victor Stinner [Fri, 7 Oct 2022 17:57:48 +0000 (19:57 +0200)] 
gh-97669: Move difflib examples to Doc/includes/ (#97964)

Remove diff.py and ndiff.py scripts of Tools/scripts/: move them to
Doc/includes/.

* diff.py and ndiff.py files are no longer executable. Remove also
  their shebang ("#!/usr/bin/env python3").
* Remove the -profile command from ndiff.py to simply the code.
* Remove ndiff.py copyright and history command. The Python
  documentation examples are distributed under the "Zero Clause BSD
  License".

3 years agoMake _symtable_entry.ste_type's comment consistent wit _Py_block_ty (#92414)
zikcheng [Fri, 7 Oct 2022 17:53:07 +0000 (01:53 +0800)] 
Make _symtable_entry.ste_type's comment consistent wit _Py_block_ty (#92414)

_Py_block_ty defines four types of block, FunctionBlock, ClassBlock, ModuleBlock and AnnotationBlock.
But _symtable_entry.ste_type only comments three of them, I think it's better both sides are consistent.

3 years agoFix a mistake in isSet() deprecated message doc (#95720)
Marc Monfort [Fri, 7 Oct 2022 17:42:35 +0000 (19:42 +0200)] 
Fix a mistake in isSet() deprecated message doc (#95720)

3 years agogh-64373: Convert `_functools` to Argument Clinic (#96640)
Nikita Sobolev [Fri, 7 Oct 2022 17:36:40 +0000 (20:36 +0300)] 
gh-64373: Convert `_functools` to Argument Clinic (#96640)

3 years agogh-96415: Remove `types._cell_factory` from a module namespace (#96416)
Nikita Sobolev [Fri, 7 Oct 2022 17:27:14 +0000 (20:27 +0300)] 
gh-96415: Remove `types._cell_factory` from a module namespace (#96416)

Closes #96415

3 years agoAdd more syslog tests (GH-97953)
Serhiy Storchaka [Fri, 7 Oct 2022 17:17:08 +0000 (20:17 +0300)] 
Add more syslog tests (GH-97953)

3 years agoAdd note on capture_output arg to subprocess.run() docstring (#98012)
andrei kulakov [Fri, 7 Oct 2022 17:08:08 +0000 (13:08 -0400)] 
Add note on capture_output arg to subprocess.run() docstring (#98012)

add note on capture_output arg to the docstring

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)