]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agobpo-43224: Add tests for TypeVarTuple substitution in Annotated (GH-31846)
Matthew Rahtz [Sat, 16 Apr 2022 04:24:28 +0000 (05:24 +0100)] 
bpo-43224: Add tests for TypeVarTuple substitution in Annotated (GH-31846)

3 years agogh-82849: revise intro to os.path.rst (GH-32232)
Jack DeVries [Sat, 16 Apr 2022 04:23:07 +0000 (00:23 -0400)] 
gh-82849: revise intro to os.path.rst (GH-32232)

* revise the first paragraph of docs for os.path
* add a mention of `os.PathLike` protocol
* remove warnings rendered irrelevant by :pep:`383` and :pep:`529`

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-69093: Add context manager support to sqlite3.Blob (GH-91562)
Erlend Egeberg Aasland [Sat, 16 Apr 2022 04:21:12 +0000 (06:21 +0200)] 
gh-69093: Add context manager support to sqlite3.Blob (GH-91562)

3 years agoIssue templates: Remove duplicate links to security policy (#91590)
Alex Waygood [Sat, 16 Apr 2022 02:06:51 +0000 (03:06 +0100)] 
Issue templates: Remove duplicate links to security policy (#91590)

* Remove security link from config file
* Delete security.md

3 years agoAdd minimal issue templates (#91569)
Alex Waygood [Sat, 16 Apr 2022 01:20:54 +0000 (02:20 +0100)] 
Add minimal issue templates (#91569)

* Add minimal issue templates
* Wording tweaks
* Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Improve words in `security` template
* Update bug.md
* Update crash.md
* Add link to security vulnerability website from first page
* Never edit on your phone
* Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Update .github/ISSUE_TEMPLATE/config.yml
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* There might not be a traceback if there's a crash
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Update .github/ISSUE_TEMPLATE/config.yml
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Reorder `config.yml` file
* Fix Erlend's nits
* version -> architecture
* Apply suggestions from code review
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
3 years agoAdd link to documentation translation list (#91560)
slateny [Sat, 16 Apr 2022 01:18:10 +0000 (18:18 -0700)] 
Add link to documentation translation list (#91560)

3 years agogh-91487: Optimize asyncio UDP speed (GH-91488)
msoxzw [Fri, 15 Apr 2022 19:59:01 +0000 (19:59 +0000)] 
gh-91487: Optimize asyncio UDP speed (GH-91488)

Fix #91487

When transferring a small file, e.g. 256 KiB, the speed of this PR is comparable. However, if a large file, e.g. 65536 KiB, is transferred, asyncio UDP will be over 100 times faster than the original. The speed is presumably significantly faster if a larger file is transferred, e.g. 1048576 KiB.

Automerge-Triggered-By: GH:gpshead
3 years agogh-91217: deprecate nntplib (GH-91543)
Brett Cannon [Fri, 15 Apr 2022 19:32:56 +0000 (12:32 -0700)] 
gh-91217: deprecate nntplib (GH-91543)

3 years agogh-91276: Make JUMP_IF_TRUE_OR_POP/JUMP_IF_FALSE_OR_POP relative (GH-32215)
Irit Katriel [Fri, 15 Apr 2022 19:19:24 +0000 (20:19 +0100)] 
gh-91276: Make JUMP_IF_TRUE_OR_POP/JUMP_IF_FALSE_OR_POP relative (GH-32215)

3 years agogh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531)
Irit Katriel [Fri, 15 Apr 2022 18:57:47 +0000 (19:57 +0100)] 
gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531)

3 years agogh-69093: improve sqlite3.Connection.blobopen() error handling (GH-91571)
Erlend Egeberg Aasland [Fri, 15 Apr 2022 16:27:39 +0000 (18:27 +0200)] 
gh-69093: improve sqlite3.Connection.blobopen() error handling (GH-91571)

Unless sqlite3_blob_open() returns SQLITE_MISUSE, the error code and
message are available on the connection object. This means we have to
handle SQLITE_MISUSE error messages explicitly.

3 years agogh-91404: Use computed gotos and reduce indirection in re (#91495)
Brandt Bucher [Fri, 15 Apr 2022 16:26:44 +0000 (09:26 -0700)] 
gh-91404: Use computed gotos and reduce indirection in re (#91495)

3 years agogh-69093: Don't allow instantiation of sqlite3.Blob objects (GH-91570)
Erlend Egeberg Aasland [Fri, 15 Apr 2022 16:25:03 +0000 (18:25 +0200)] 
gh-69093: Don't allow instantiation of sqlite3.Blob objects (GH-91570)

3 years agogh-90699: Use _Py_STR(empty) instead of PyUnicode_New(0, 0) for BUILD_STRING (GH...
Dennis Sweeney [Fri, 15 Apr 2022 14:21:35 +0000 (10:21 -0400)] 
gh-90699: Use _Py_STR(empty) instead of PyUnicode_New(0, 0) for BUILD_STRING (GH-91476)

3 years agogh-69093: Expose sqlite3.Blob as a class (GH-91550)
Jelle Zijlstra [Fri, 15 Apr 2022 13:29:57 +0000 (06:29 -0700)] 
gh-69093: Expose sqlite3.Blob as a class (GH-91550)

I noticed this was missing while writing typeshed stubs. It's
useful to expose it for use in annotations and for exploration.

3 years agogh-79156: Add start_tls() method to streams API (#91453)
Oleg Iarygin [Fri, 15 Apr 2022 12:23:14 +0000 (15:23 +0300)] 
gh-79156: Add start_tls() method to streams API (#91453)

The existing event loop `start_tls()` method is not sufficient for
connections using the streams API. The existing StreamReader works
because the new transport passes received data to the original protocol.
The StreamWriter must then write data to the new transport, and the
StreamReaderProtocol must be updated to close the new transport
correctly.

The new StreamWriter `start_tls()` updates itself and the reader
protocol to the new SSL transport.

Co-authored-by: Ian Good <icgood@gmail.com>
3 years agobpo-40376: slightly improved the wording for os.getgrouplist (GH-19702)
Jens Holzkämper [Fri, 15 Apr 2022 03:55:07 +0000 (05:55 +0200)] 
bpo-40376: slightly improved the wording for os.getgrouplist (GH-19702)

The documentation for os.getgrouplist potentially read like it
returned all groups a user belongs to but it potentially doesn't.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agoRemove usage of _Py_IDENTIFIER from unicodedata module. (GH-91532)
Dong-hee Na [Fri, 15 Apr 2022 01:44:05 +0000 (10:44 +0900)] 
Remove usage of _Py_IDENTIFIER from unicodedata module. (GH-91532)

3 years agogh-70979: Fix runpy.run_path parameter name in docs (GH-32265)
Jelle Zijlstra [Fri, 15 Apr 2022 01:06:58 +0000 (18:06 -0700)] 
gh-70979: Fix runpy.run_path parameter name in docs (GH-32265)

Noticed while reviewing GH-30729.

3 years agogh-91520: Rewrite imghdr inlining for clarity and completeness (#91521)
Barry Warsaw [Fri, 15 Apr 2022 00:48:59 +0000 (17:48 -0700)] 
gh-91520: Rewrite imghdr inlining for clarity and completeness (#91521)

* Rewrite imghdr inlining for clarity and completeness

* Move MIMEImage class back closer to the top of the file since it's the
  important thing.
* Use a decorate to mark a given rule function and simplify the rule function
  names for clarity.
* Copy over all the imghdr test data files into the email package's test data
  directory.  This way when imghdr is actually removed, it won't affect the
  MIMEImage guessing tests.
* Rewrite and extend the MIMEImage tests to test for all supported
  auto-detected MIME image subtypes.
* Remove the now redundant PyBanner048.gif data file.

* See https://github.com/python/cpython/pull/91461#discussion_r850313336

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
3 years agogh-69093: Support basic incremental I/O to blobs in `sqlite3` (GH-30680)
Erlend Egeberg Aasland [Fri, 15 Apr 2022 00:02:56 +0000 (02:02 +0200)] 
gh-69093: Support basic incremental I/O to blobs in `sqlite3` (GH-30680)

Authored-by: Aviv Palivoda <palaviv@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@innova.no>
Co-authored-by: palaviv <palaviv@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-91428: include specialized opcodes in _PyOpcode_OpName (GH-91467)
Dennis Sweeney [Thu, 14 Apr 2022 20:00:58 +0000 (16:00 -0400)] 
gh-91428: include specialized opcodes in _PyOpcode_OpName (GH-91467)

3 years agogh-91217: deprecate msilib (GH-91515)
Brett Cannon [Thu, 14 Apr 2022 19:50:11 +0000 (12:50 -0700)] 
gh-91217: deprecate msilib (GH-91515)

3 years agogh-89455: Fix an uninitialized bool in exception print context. (#91466)
Gregory P. Smith [Thu, 14 Apr 2022 18:26:25 +0000 (11:26 -0700)] 
gh-89455: Fix an uninitialized bool in exception print context. (#91466)

Fix an uninitialized bool in exception print context.

`struct exception_print_context.need_close` was uninitialized.

Found by oss-fuzz in a test case running under the undefined behavior sanitizer.

https://oss-fuzz.com/testcase-detail/6217746058182656

```
Python/pythonrun.c:1241:28: runtime error: load of value 253, which is not a valid value for type 'bool'
    #0 0xbf2203 in print_chained cpython3/Python/pythonrun.c:1241:28
    #1 0xbea4bb in print_exception_cause_and_context cpython3/Python/pythonrun.c:1320:19
    #2 0xbea4bb in print_exception_recursive cpython3/Python/pythonrun.c:1470:13
    #3 0xbe9e39 in _PyErr_Display cpython3/Python/pythonrun.c:1517:9
```

Pretty obvious what the ommission was upon code inspection.

3 years agogh-84461: Drop -sWASM, fix building tests for browser (GH-91530)
Christian Heimes [Thu, 14 Apr 2022 14:27:41 +0000 (17:27 +0300)] 
gh-84461: Drop -sWASM, fix building tests for browser (GH-91530)

- drop unnecessary ``=1`` suffix from Emscripten flags
- drop unnecessary ``-sWASM`` flag for side modules
- rename ``build_platform`` to ``build_wasm``. I introduced the target
  for WASM builds a couple of months ago.
- fix ``--enable-test-modules`` for browser builds

3 years agogh-91353: Fix void return type handling in ctypes (GH-32246)
Hood Chatham [Thu, 14 Apr 2022 14:27:01 +0000 (07:27 -0700)] 
gh-91353: Fix void return type handling in ctypes (GH-32246)

3 years agoAdd redirects to Misc/NEWS bpo links (#91454)
Ezio Melotti [Thu, 14 Apr 2022 14:06:01 +0000 (16:06 +0200)] 
Add redirects to Misc/NEWS bpo links (#91454)

3 years agogh-90879: Fix missing parameter for put_nowait() (GH-91514)
slateny [Thu, 14 Apr 2022 08:23:57 +0000 (01:23 -0700)] 
gh-90879: Fix missing parameter for put_nowait() (GH-91514)

3 years agogh-91156: Fix `encoding="locale"` in UTF-8 mode (GH-70056)
Inada Naoki [Thu, 14 Apr 2022 07:00:35 +0000 (16:00 +0900)] 
gh-91156: Fix `encoding="locale"` in UTF-8 mode (GH-70056)

3 years agogh-90699: Remove usage of _Py_IDENTIFIER from bisect module. (GH-91522)
Dong-hee Na [Thu, 14 Apr 2022 05:57:25 +0000 (14:57 +0900)] 
gh-90699: Remove usage of _Py_IDENTIFIER from bisect module. (GH-91522)

3 years agogh-90326: Remove quotes for logging config (GH-91516)
slateny [Thu, 14 Apr 2022 04:15:00 +0000 (21:15 -0700)] 
gh-90326: Remove quotes for logging config (GH-91516)

3 years agogh-91266: refactor bytearray strip methods (GH-32096)
Pieter Eendebak [Thu, 14 Apr 2022 02:20:38 +0000 (04:20 +0200)] 
gh-91266: refactor bytearray strip methods (GH-32096)

3 years agogh-87497: Document that urllib.request sends headers in camel case (GH-24661)
Alix Lourme [Thu, 14 Apr 2022 02:19:16 +0000 (04:19 +0200)] 
gh-87497: Document that urllib.request sends headers in camel case (GH-24661)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agoFill holes in internal compiler structs (#91458)
L. A. F. Pereira [Wed, 13 Apr 2022 22:09:20 +0000 (15:09 -0700)] 
Fill holes in internal compiler structs (#91458)

3 years agogh-90449: Improve accuracy and readability of exceptions tutorial (GH-31899)
Irit Katriel [Wed, 13 Apr 2022 20:45:33 +0000 (21:45 +0100)] 
gh-90449: Improve accuracy and readability of exceptions tutorial (GH-31899)

3 years agogh-91217: deprecate imghdr (#91461)
Brett Cannon [Wed, 13 Apr 2022 17:47:41 +0000 (10:47 -0700)] 
gh-91217: deprecate imghdr (#91461)

* Deprecate imghdr

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Update Doc/whatsnew/3.11.rst

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Inline `imghdr` into `email.mime.image`

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
3 years agogh-91243: Update authors for Required[] and NotRequired[] implementation (GH-91506)
David Foster [Wed, 13 Apr 2022 14:52:19 +0000 (10:52 -0400)] 
gh-91243: Update authors for Required[] and NotRequired[] implementation (GH-91506)

3 years agogh-90971: suppress deprecation warning in `test_lib2to3`(GH-31464)
Nikita Sobolev [Wed, 13 Apr 2022 14:42:25 +0000 (17:42 +0300)] 
gh-90971: suppress deprecation warning in `test_lib2to3`(GH-31464)

Fixes GH-90971

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
3 years agogh-91502: Add a new API to check if a frame is an entry frame (GH-91503)
Pablo Galindo Salgado [Wed, 13 Apr 2022 13:06:56 +0000 (14:06 +0100)] 
gh-91502: Add a new API to check if a frame is an entry frame (GH-91503)

3 years agobpo-43218: Prevent venv creation when the target directory contains a PATH separator...
Dustin Rodrigues [Wed, 13 Apr 2022 08:07:10 +0000 (04:07 -0400)] 
bpo-43218: Prevent venv creation when the target directory contains a PATH separator. (GH-24530)

3 years agobpo-43224: Forbid TypeVar substitution with Unpack (GH-32031)
Serhiy Storchaka [Wed, 13 Apr 2022 03:08:49 +0000 (06:08 +0300)] 
bpo-43224: Forbid TypeVar substitution with Unpack (GH-32031)

3 years agogh-91421: Use constant value check during runtime (GH-91422)
Tobias Stoeckmann [Wed, 13 Apr 2022 03:01:02 +0000 (05:01 +0200)] 
gh-91421: Use constant value check during runtime (GH-91422)

The left-hand side expression of the if-check can be converted to a
constant by the compiler, but the addition on the right-hand side is
performed during runtime.

Move the addition from the right-hand side to the left-hand side by
turning it into a subtraction there. Since the values are known to
be large enough to not turn negative, this is a safe operation.

Prevents a very unlikely integer overflow on 32 bit systems.

Fixes GH-91421.

3 years agogh-91243: Add typing.Required and NotRequired (PEP 655) (GH-32419)
Jelle Zijlstra [Tue, 12 Apr 2022 19:31:02 +0000 (12:31 -0700)] 
gh-91243: Add typing.Required and NotRequired (PEP 655) (GH-32419)

I talked to @davidfstr and I offered to implement the runtime part of PEP 655
to make sure we can get it in before the feature freeze. We're going to defer
the documentation to a separate PR, because it can wait until after the feature
freeze.

The runtime implementation conveniently already exists in typing-extensions,
so I largely copied that.

Co-authored-by: David Foster <david@dafoster.net>
3 years agobpo-47152: Automatically regenerate sre_constants.h (GH-91439)
Serhiy Storchaka [Tue, 12 Apr 2022 15:34:06 +0000 (18:34 +0300)] 
bpo-47152: Automatically regenerate sre_constants.h (GH-91439)

* Move the code for generating Modules/_sre/sre_constants.h from
  Lib/re/_constants.py into a separate script
  Tools/scripts/generate_sre_constants.py.
* Add target `regen-sre` in the makefile.
* Make target `regen-all` depending on `regen-sre`.

3 years agogh-90839: Forward gzip.compress() compresslevel to zlib (gh-31215)
Ilya Leoshkevich [Tue, 12 Apr 2022 13:46:40 +0000 (15:46 +0200)] 
gh-90839: Forward gzip.compress() compresslevel to zlib (gh-31215)

3 years agogh-91276: make space for longer opcodes in dis output (GH-91444)
Irit Katriel [Tue, 12 Apr 2022 13:35:56 +0000 (14:35 +0100)] 
gh-91276: make space for longer opcodes in dis output (GH-91444)

3 years agogh-88513: clarify shutil.copytree's dirs_exist_ok arg (GH-91434)
Jack DeVries [Tue, 12 Apr 2022 00:57:52 +0000 (20:57 -0400)] 
gh-88513: clarify shutil.copytree's dirs_exist_ok arg (GH-91434)

* add a paragraph to document this kwarg in detail
* update docstring in the source accordingly

3 years agogh-79097: Add support for aggregate window functions in sqlite3 (GH-20903)
Erlend Egeberg Aasland [Tue, 12 Apr 2022 00:55:59 +0000 (02:55 +0200)] 
gh-79097: Add support for aggregate window functions in sqlite3 (GH-20903)

3 years agogh-91217: deprecate crypt (GH-91459)
Brett Cannon [Tue, 12 Apr 2022 00:02:19 +0000 (17:02 -0700)] 
gh-91217: deprecate crypt (GH-91459)

3 years agogh-91428: Add _PyOpcode_OpName to opcode.h of debug builds (GH-91430)
Dennis Sweeney [Mon, 11 Apr 2022 22:33:00 +0000 (18:33 -0400)] 
gh-91428: Add _PyOpcode_OpName to opcode.h of debug builds (GH-91430)

3 years agogh-47061: Deprecate `chunk` (GH-91419)
Brett Cannon [Mon, 11 Apr 2022 22:02:41 +0000 (15:02 -0700)] 
gh-47061: Deprecate `chunk` (GH-91419)

3 years agogh-91117: Ensure integer mod and pow operations use cached small ints (GH-31843)
Dennis Sweeney [Mon, 11 Apr 2022 20:07:09 +0000 (16:07 -0400)] 
gh-91117: Ensure integer mod and pow operations use cached small ints (GH-31843)

3 years agoRemove dead "Check PRs with 'CLA not signed' label" (#91429)
Oleg Iarygin [Mon, 11 Apr 2022 16:34:17 +0000 (19:34 +0300)] 
Remove dead "Check PRs with 'CLA not signed' label" (#91429)

3 years agoUpdate Sphinx bpo role to use redirect URI. (#32342)
Ezio Melotti [Mon, 11 Apr 2022 15:59:35 +0000 (17:59 +0200)] 
Update Sphinx bpo role to use redirect URI. (#32342)

3 years agogh-91423: Remove bugs.python.org from bugs.rst (GH-91425)
roy reznik [Mon, 11 Apr 2022 15:10:34 +0000 (18:10 +0300)] 
gh-91423: Remove bugs.python.org from bugs.rst (GH-91425)

* Remove bugs.python.org from bugs.rst

* Update bugs.rst to the github issue tracker

* reflow

* Fix a typo and rephrase a sentence.

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agoGH-89480: Document motivation, design and implementation of 3.11 frame stack. (GH...
Mark Shannon [Mon, 11 Apr 2022 15:05:20 +0000 (16:05 +0100)] 
GH-89480: Document motivation, design and implementation of 3.11 frame stack. (GH-32304)

3 years agobpo-44807: Allow Protocol classes to define __init__ (GH-31628)
Adrian Garcia Badaracco [Mon, 11 Apr 2022 14:51:25 +0000 (09:51 -0500)] 
bpo-44807: Allow Protocol classes to define __init__ (GH-31628)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-45995: add "z" format specifer to coerce negative 0 to zero (GH-30049)
John Belmonte [Mon, 11 Apr 2022 14:34:18 +0000 (23:34 +0900)] 
bpo-45995: add "z" format specifer to coerce negative 0 to zero (GH-30049)

Add "z" format specifier to coerce negative 0 to zero.

See https://github.com/python/cpython/issues/90153 (originally https://bugs.python.org/issue45995) for discussion.
This covers `str.format()` and f-strings.  Old-style string interpolation is not supported.

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
3 years agobpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)
Irit Katriel [Mon, 11 Apr 2022 09:40:24 +0000 (10:40 +0100)] 
bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)

3 years agoReplace contributor-visible mentions of BPO in .github/* (GH-91426)
Oleg Iarygin [Sun, 10 Apr 2022 22:03:27 +0000 (01:03 +0300)] 
Replace contributor-visible mentions of BPO in .github/* (GH-91426)

3 years agoRemove linking to bugs.python.org from the README (#91418)
Łukasz Langa [Sun, 10 Apr 2022 20:50:18 +0000 (22:50 +0200)] 
Remove linking to bugs.python.org from the README (#91418)

Fixes #91424.

3 years agoRemove the issue template config after the migration (GH-32106)
Ezio Melotti [Sun, 10 Apr 2022 19:13:33 +0000 (21:13 +0200)] 
Remove the issue template config after the migration (GH-32106)

3 years agonotify new-bugs-announce on new issue open (#32421)
Ee Durbin [Sun, 10 Apr 2022 17:48:53 +0000 (13:48 -0400)] 
notify new-bugs-announce on new issue open (#32421)

3 years agobpo-40280: WASM docs and smaller browser builds (GH-32412)
Christian Heimes [Sun, 10 Apr 2022 07:29:51 +0000 (10:29 +0300)] 
bpo-40280: WASM docs and smaller browser builds (GH-32412)

Co-authored-by: Brett Cannon <brett@python.org>
3 years agobpo-22295: use python -m pip rather than plain pip in more examples (GH-24003)
Ville Skyttä [Sat, 9 Apr 2022 18:37:01 +0000 (21:37 +0300)] 
bpo-22295: use python -m pip rather than plain pip in more examples (GH-24003)

3 years agoFix some typos in comments (GH-32422)
jonasdlindner [Sat, 9 Apr 2022 09:12:15 +0000 (11:12 +0200)] 
Fix some typos in comments (GH-32422)

3 years agobpo-47000: Add `locale.getencoding()` (GH-32068)
Inada Naoki [Sat, 9 Apr 2022 00:54:54 +0000 (09:54 +0900)] 
bpo-47000: Add `locale.getencoding()` (GH-32068)

3 years agobpo-47061: deprecate cgi and cgitb (GH-32410)
Brett Cannon [Sat, 9 Apr 2022 00:15:35 +0000 (17:15 -0700)] 
bpo-47061: deprecate cgi and cgitb (GH-32410)

Part of PEP 594.

3 years agobpo-47260: Fix os.closerange() potentially being a no-op in a seccomp sandbox (GH...
Alexey Izbyshev [Fri, 8 Apr 2022 17:40:39 +0000 (20:40 +0300)] 
bpo-47260: Fix os.closerange() potentially being a no-op in a seccomp sandbox (GH-32418)

_Py_closerange() currently assumes that close_range() closes
all file descriptors even if it returns an error (other than ENOSYS).
This assumption can be wrong on Linux if a seccomp sandbox denies
the underlying syscall, pretending that it returns EPERM or EACCES.
In this case _Py_closerange() won't close any descriptors at all,
which in the worst case can be a security issue.

Fix this by falling back to other methods in case of any close_range()
error. Note that fallbacks will not be triggered on any problems with
closing individual file descriptors because close_range() is documented
to ignore such errors on both Linux[1] and FreeBSD[2].

[1] https://man7.org/linux/man-pages/man2/close_range.2.html
[2] https://www.freebsd.org/cgi/man.cgi?query=close_range&sektion=2

3 years agoFix bad grammar and import docstring for split/rsplit (GH-32381)
Raymond Hettinger [Fri, 8 Apr 2022 13:36:20 +0000 (08:36 -0500)] 
Fix bad grammar and import docstring for split/rsplit (GH-32381)

3 years agoAdd feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definition (GH-32365)
Petr Viktorin [Fri, 8 Apr 2022 12:35:11 +0000 (14:35 +0200)] 
Add feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definition (GH-32365)

3 years agoAdd new PyFrame_GetLasti C-API function (GH-32413)
Mark Shannon [Fri, 8 Apr 2022 11:18:57 +0000 (12:18 +0100)] 
Add new PyFrame_GetLasti C-API function (GH-32413)

3 years agoClarify that this sentence applies to the above example. GH-32405
Raymond Hettinger [Fri, 8 Apr 2022 02:10:00 +0000 (21:10 -0500)] 
Clarify that this sentence applies to the above example. GH-32405

3 years agobpo-47250: Fix refleak from object.__getstate__() (GH-32403)
Dong-hee Na [Thu, 7 Apr 2022 23:27:00 +0000 (08:27 +0900)] 
bpo-47250: Fix refleak from object.__getstate__() (GH-32403)

Co-authored-by: Brandt Bucher <brandt@python.org>
3 years agobpo-47177: Replace `f_lasti` with `prev_instr` (GH-32208)
Brandt Bucher [Thu, 7 Apr 2022 19:31:01 +0000 (12:31 -0700)] 
bpo-47177: Replace `f_lasti` with `prev_instr` (GH-32208)

3 years agoDeprecate audioop (GH-32392)
Brett Cannon [Thu, 7 Apr 2022 19:27:35 +0000 (12:27 -0700)] 
Deprecate audioop (GH-32392)

3 years agoDoc: Fix spurious comma in the author metadata field (GH-32386)
CAM Gerlach [Thu, 7 Apr 2022 18:27:14 +0000 (13:27 -0500)] 
Doc: Fix spurious comma in the author metadata field (GH-32386)

Signed-off-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agossl docs: Fix typo (GH-32336)
Frederick [Thu, 7 Apr 2022 16:29:23 +0000 (09:29 -0700)] 
ssl docs: Fix typo (GH-32336)

3 years agoc-api docs: There are five fields, not four (GH-32379)
Jelle Zijlstra [Thu, 7 Apr 2022 14:02:54 +0000 (07:02 -0700)] 
c-api docs: There are five fields, not four (GH-32379)

3 years agobpo-40280: Detect missing threading on WASM platforms (GH-32352)
Christian Heimes [Thu, 7 Apr 2022 07:22:47 +0000 (10:22 +0300)] 
bpo-40280: Detect missing threading on WASM platforms (GH-32352)

Co-authored-by: Brett Cannon <brett@python.org>
3 years agoRemove micro-optimization that no longer shows a benefit. (GH-32397)
Raymond Hettinger [Thu, 7 Apr 2022 03:00:47 +0000 (22:00 -0500)] 
Remove micro-optimization that no longer shows a benefit. (GH-32397)

3 years agopickle docs: Fix typos and improve wording (GH-24776)
Géry Ogam [Thu, 7 Apr 2022 01:38:35 +0000 (03:38 +0200)] 
pickle docs: Fix typos and improve wording (GH-24776)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agodoc: Link to `string.capwords` from `str.title` (GH-20913)
Eric Wieser [Thu, 7 Apr 2022 01:31:39 +0000 (02:31 +0100)] 
doc: Link to `string.capwords` from `str.title` (GH-20913)

Since `title()` mentions its own short-comings, it should also mention the library function which does not possess them.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agossl docs: Fix typo (GH-32314)
Frederick [Thu, 7 Apr 2022 00:51:35 +0000 (17:51 -0700)] 
ssl docs: Fix typo (GH-32314)

3 years agopkgutil docs: Link sys constants, add backticks (GH-32356)
Boris Verkhovskiy [Thu, 7 Apr 2022 00:51:05 +0000 (17:51 -0700)] 
pkgutil docs: Link sys constants, add backticks (GH-32356)

Co-authored-by: Éric <merwok@netwok.org>
3 years agobpo-35134: Remove the Include/code.h header file (GH-32385)
Victor Stinner [Thu, 7 Apr 2022 00:29:52 +0000 (02:29 +0200)] 
bpo-35134: Remove the Include/code.h header file (GH-32385)

Remove the Include/code.h header file. C extensions should only
include the main <Python.h> header file.

Python.h includes directly Include/cpython/code.h instead.

3 years agobpo-35134: Add Include/cpython/setobject.h header (GH-32384)
Victor Stinner [Wed, 6 Apr 2022 23:26:24 +0000 (01:26 +0200)] 
bpo-35134: Add Include/cpython/setobject.h header (GH-32384)

3 years agobpo-47239: Fixes py.exe output when run in a virtual environment. (GH-32364)
Steve Dower [Wed, 6 Apr 2022 23:09:54 +0000 (00:09 +0100)] 
bpo-47239: Fixes py.exe output when run in a virtual environment. (GH-32364)

3 years agobpo-35134: Add Include/cpython/complexobject.h header (GH-32383)
Victor Stinner [Wed, 6 Apr 2022 23:05:27 +0000 (01:05 +0200)] 
bpo-35134: Add Include/cpython/complexobject.h header (GH-32383)

Move the private _PyComplex_FormatAdvancedWriter() function to the
internal C API. This function is no longer exported.

3 years agobpo-46576: Speed up test_peg_generator by using a static library for shared sources...
Jeremy Kloth [Wed, 6 Apr 2022 21:55:58 +0000 (15:55 -0600)] 
bpo-46576: Speed up test_peg_generator by using a static library for shared sources (GH-32338)

Speed up test_peg_generator by using a static library for shared sources to avoid recompiling as much code.

3 years agoChange parameter name from *x* for reals to *n* for integers. (GH-32377)
Raymond Hettinger [Wed, 6 Apr 2022 19:35:05 +0000 (14:35 -0500)] 
Change parameter name from *x* for reals to *n* for integers. (GH-32377)

3 years agobpo-47061: use `warnings._deprecated()` with asynchat, asyncore, and smtpd (GH-32350)
Brett Cannon [Wed, 6 Apr 2022 18:22:39 +0000 (11:22 -0700)] 
bpo-47061: use `warnings._deprecated()` with asynchat, asyncore, and smtpd (GH-32350)

3 years agoMinor code nit: Move an unrelated statement out of a try clause in Sequence.index...
Géry Ogam [Wed, 6 Apr 2022 18:03:36 +0000 (20:03 +0200)] 
Minor code nit: Move an unrelated statement out of a try clause in Sequence.index (GH-32330)

3 years agobpo-26579: Add object.__getstate__(). (GH-2821)
Serhiy Storchaka [Wed, 6 Apr 2022 17:00:14 +0000 (20:00 +0300)] 
bpo-26579: Add object.__getstate__(). (GH-2821)

Copying and pickling instances of subclasses of builtin types
bytearray, set, frozenset, collections.OrderedDict, collections.deque,
weakref.WeakSet, and datetime.tzinfo now copies and pickles instance attributes
implemented as slots.

3 years agoRemove python2 support in logging cookbook example. (GH-32362)
Mathieu Dupuy [Wed, 6 Apr 2022 16:57:54 +0000 (18:57 +0200)] 
Remove python2 support in logging cookbook example. (GH-32362)

3 years agobpo-46721: Optimize set.issuperset() for non-set arguments (GH-31280)
Serhiy Storchaka [Wed, 6 Apr 2022 16:57:13 +0000 (19:57 +0300)] 
bpo-46721: Optimize set.issuperset() for non-set arguments (GH-31280)

3 years agobpo-43464: Optimize set.intersection() for non-set arguments (GH-31316)
Serhiy Storchaka [Wed, 6 Apr 2022 16:56:28 +0000 (19:56 +0300)] 
bpo-43464: Optimize set.intersection() for non-set arguments (GH-31316)

3 years agobpo-47227: Suppress expression chaining for more RE parsing errors (GH-32333)
Serhiy Storchaka [Wed, 6 Apr 2022 16:54:44 +0000 (19:54 +0300)] 
bpo-47227: Suppress expression chaining for more RE parsing errors (GH-32333)

3 years agobpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)
Serhiy Storchaka [Wed, 6 Apr 2022 16:53:50 +0000 (19:53 +0300)] 
bpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)

They were undocumented and never working.

3 years agoFix whitespace/indentation issues in test_sys (GH-32369)
Ken Jin [Wed, 6 Apr 2022 15:40:51 +0000 (22:40 +0700)] 
Fix whitespace/indentation issues in test_sys (GH-32369)