summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Misc updates to the itertools recipes and tests (GH-98018)Raymond Hettinger2022-10-071-6/+40
|
* Doc: sphinx-lint finds two other default roles. (GH-98019)Julien Palard2022-10-072-3/+3
|
* gh-86298: Ensure that __loader__ and __spec__.loader agree in ↵Barry Warsaw2022-10-075-3/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* gh-82874: Convert remaining importlib format uses to f-str. (#98005)Gregory P. Smith2022-10-075-28/+24
| | | f-yes
* Docs: Fix backtick errors found by sphinx-lint (#97998)Hugo van Kemenade2022-10-0755-98/+90
| | | Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-97850: Remove deprecated functions from `importlib.utils` (#97898)Nikita Sobolev2022-10-076-373/+4
| | | | | * gh-97850: Remove deprecated functions from `importlib.utils` * Rebase and remove `set_package` from diff
* Remove extra spaces in custom openSSL documentation. (#93568)Xiao Chen2022-10-071-10/+10
|
* GH-90985: Revert "Deprecate passing a message into cancel()" (#97999)Guido van Rossum2022-10-078-102/+12
| | | | | Reason: we were too hasty in deprecating this. We shouldn't deprecate it before we have a replacement.
* bpo-35540 dataclasses.asdict now supports defaultdict fields (gh-32056)Tiger2022-10-073-2/+28
|
* GH-91052: Add C API for watching dictionaries (GH-31787)Carl Meyer2022-10-0710-17/+487
|
* bpo-38693: Use f-strings instead of str.format() within importlib (#17058)Gregory P. Smith2022-10-063-26/+1807
| | | | | | | | | 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.
* GH-97002: Prevent `_PyInterpreterFrame`s from backing more than one ↵Brandt Bucher2022-10-063-6/+91
| | | | `PyFrameObject` (GH-97996)
* gh-97973: Return all necessary information from the tokenizer (GH-97984)Lysandros Nikolaou2022-10-066-146/+159
| | | | | 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.
* fixes gh-96078: os.sched_yield release the GIL while calling sched_yield(2). ↵Dong-hee Na2022-10-062-1/+8
| | | | (gh-97965)
* gh-65961: Do not rely solely on `__cached__` (GH-97990)Brett Cannon2022-10-0611-35/+130
| | | Make sure `__spec__.cached` (at minimum) can be used.
* gh-97850: Remove the open issues section from the import reference (#97935)Brett Cannon2022-10-061-19/+0
| | | | | Remove the open issues section from the import reference Tracking in https://github.com/python/cpython/issues/97850 instead.
* Docs: pin sphinx-lint (GH-97992)Hugo van Kemenade2022-10-061-1/+1
|
* gh-94590: add signatures to operator itemgetter, attrgetter, methodcaller ↵Erik Welch2022-10-061-6/+3
| | | | | | | | | | | | | (#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`.
* Add Pynche's move to the What's new in 3.11 (#97974)Barry Warsaw2022-10-061-0/+4
| | | | | | | | | * 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>
* gh-97781: Apply changes from importlib_metadata 5. (GH-97785)Jason R. Coombs2022-10-065-302/+88
| | | | | | | * gh-97781: Apply changes from importlib_metadata 5. * Apply changes from upstream * Apply changes from upstream.
* gh-86482: Document assignment expression need for ()s (#23291)Terry Jan Reedy2022-10-062-0/+8
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-97943: PyFunction_GetAnnotations should return a borrowed reference. (#97949)larryhastings2022-10-062-2/+7
|
* gh-94808: Coverage: Test that maximum indentation level is handled (#95926)Michael Droettboom2022-10-061-1/+21
| | | | | * gh-94808: Coverage: Test that maximum indentation level is handled * Use "compile" rather than "exec"
* GH-88050: fix race in closing subprocess pipe in asyncio (#97951)Kumar Aditya2022-10-061-1/+3
| | | Check for None when iterating over `self._pipes.values()`.
* gh-93738: Disallow pre-v3 syntax in the C domain (#97962)Adam Turner2022-10-067-33/+11
| | | Also, disable using invalid sphinx-lint 0.6.2.
* gh-95986: Fix the example using match keyword (#95989)1809092022-10-061-0/+1
|
* gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK (GH-97944)Ned Deily2022-10-063-8/+80
| | | | | | | | 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.
* gh-94808: Cover `PyUnicode_Count` in CAPI (#96929)Nikita Sobolev2022-10-062-0/+59
|
* gh-94808: Cover `PyObject_PyBytes` case with custom `__bytes__` method (#96610)Nikita Sobolev2022-10-061-0/+16
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-95691: Doc BufferedWriter and BufferedReader (#95703)1809092022-10-051-1/+1
|
* GH-88968: Add notes about socket ownership transfers (#97936)Guido van Rossum2022-10-052-0/+48
|
* gh-96865: [Enum] fix Flag to use CONFORM boundary (GH-97528)Ethan Furman2022-10-053-2/+11
|
* gh-65961: Raise `DeprecationWarning` when `__package__` differs from ↵Brett Cannon2022-10-059-102/+45
| | | | | | | `__spec__.parent` (#97879) Also remove `importlib.util.set_package()` which was already slated for removal. Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* docs(typing): add "see PEP 675" to LiteralString (#97926)Simon Legner2022-10-051-0/+2
|
* gh-97850: Remove all known instances of module_repr() (#97876)Barry Warsaw2022-10-056-35/+7
| | | Remove all known instances of module_repr()
* I changed my surname early this year (#96671)Tshepang Mbambo2022-10-052-2/+2
| | | | | * I recently changed my name * Update ACKS
* gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)Adam Turner2022-10-0534-241/+241
| | | | | :c:type:`<C type>` -> :c:expr:`<C type>` Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-91539: improve performance of get_proxies_environment (#91566)Pieter Eendebak2022-10-052-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* build(deps): bump actions/stale from 5 to 6 (#97701)dependabot[bot]2022-10-051-1/+1
| | | | | | | | | 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>
* GH-95172 Make the same version `versionadded` oneline (#95172)1809092022-10-051-2/+1
| | | | | | | | | | | * 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>
* gh-88050: Fix asyncio subprocess to kill process cleanly when process is ↵Kumar Aditya2022-10-053-6/+33
| | | | blocked (#32073)
* gh-93738: Documentation C syntax (Function glob patterns -> literal markup) ↵Adam Turner2022-10-057-20/+20
| | | | (#97774)
* gh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 (#97896)Oleg Iarygin2022-10-051-29/+15
| | | This fixes the buildbots.
* gh-95196: Disable incorrect pickling of the C implemented classmethod ↵Serhiy Storchaka2022-10-053-1/+20
| | | | descriptors (GH-96383)
* gh-97758: Fix a crash in getpath_joinpath() called without arguments (GH-97759)Serhiy Storchaka2022-10-051-1/+1
|
* gh-74696: Pass root_dir to custom archivers which support it (GH-94251)Serhiy Storchaka2022-10-055-17/+77
| | | | Co-authored-by: Éric <merwok@netwok.org>
* gh-97661: Improve accuracy of sqlite3.Cursor.fetchone docs (#97662)Jia Junjie2022-10-051-1/+3
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-87092: bring compiler code closer to a preprocessing-opt-assembler ↵Irit Katriel2022-10-052-40/+62
| | | | organisation (GH-97644)
* GH-96704: Add {Task,Handle}.get_context(), use it in ↵Guido van Rossum2022-10-0510-2/+129
| | | | | call_exception_handler() (#96756) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-93738: Documentation C syntax (:c:type:`PyTypeObject*` -> ↵Adam Turner2022-10-052-2/+2
| | | | | :c:expr:`PyTypeObject*`) (#97778) Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>