]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agobpo-45898: Remove duplicate symbols from _ctypes/cfield.c (GH-29791)
Christian Heimes [Thu, 24 Feb 2022 19:51:57 +0000 (21:51 +0200)] 
bpo-45898: Remove duplicate symbols from _ctypes/cfield.c (GH-29791)

3 years agobpo-45107: Specialize `LOAD_METHOD` for instances with dict. (GH-31531)
Mark Shannon [Thu, 24 Feb 2022 19:34:57 +0000 (19:34 +0000)] 
bpo-45107: Specialize `LOAD_METHOD` for instances with dict. (GH-31531)

3 years agobpo-46430: Fix memory leak in interned strings of deep-frozen modules (GH-31549)
Kumar Aditya [Thu, 24 Feb 2022 16:54:06 +0000 (22:24 +0530)] 
bpo-46430: Fix memory leak in interned strings of deep-frozen modules (GH-31549)

3 years agobpo-45459: C API uses type names rather than structure names (GH-31528)
Victor Stinner [Thu, 24 Feb 2022 16:51:59 +0000 (17:51 +0100)] 
bpo-45459: C API uses type names rather than structure names (GH-31528)

Thanks to the new pytypedefs.h, it becomes to use type names like
PyObject rather like structure names like "struct _object".

3 years agobpo-45459: Add pytypedefs.h header file (GH-31527)
Victor Stinner [Thu, 24 Feb 2022 16:07:12 +0000 (17:07 +0100)] 
bpo-45459: Add pytypedefs.h header file (GH-31527)

Move forward declarations of Python C API types to a new pytypedefs.h
header file to solve interdependency issues between header files.

pytypedefs.h contains forward declarations of the following types:

* PyCodeObject
* PyFrameObject
* PyGetSetDef
* PyInterpreterState
* PyLongObject
* PyMemberDef
* PyMethodDef
* PyModuleDef
* PyObject
* PyThreadState
* PyTypeObject

3 years agobpo-46823: Implement LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE superinstruction (GH-31484)
Dennis Sweeney [Thu, 24 Feb 2022 14:55:59 +0000 (09:55 -0500)] 
bpo-46823: Implement LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE superinstruction (GH-31484)

3 years agobpo-46659: Enhance LocaleTextCalendar for C locale (GH-31214)
Victor Stinner [Thu, 24 Feb 2022 13:29:08 +0000 (14:29 +0100)] 
bpo-46659: Enhance LocaleTextCalendar for C locale (GH-31214)

If the LC_TIME locale is "C", use the user preferred locale.

3 years agoAdd (undocumented) _co_quickened attribute for code object. (GH-31552)
Mark Shannon [Thu, 24 Feb 2022 12:10:53 +0000 (12:10 +0000)] 
Add (undocumented) _co_quickened attribute for code object. (GH-31552)

3 years agobpo-46771: Implement task cancel requests counter (GH-31513)
Tin Tvrtković [Thu, 24 Feb 2022 02:17:00 +0000 (03:17 +0100)] 
bpo-46771: Implement task cancel requests counter (GH-31513)

This changes cancelling() and uncancel() to return the count of pending cancellations.

This can be used to avoid bugs in certain edge cases (e.g. two timeouts going off at the same time).

3 years agobuild(deps): bump actions/upload-artifact from 2.2.4 to 2.3.1 (GH-30325)
dependabot[bot] [Wed, 23 Feb 2022 21:16:47 +0000 (23:16 +0200)] 
build(deps): bump actions/upload-artifact from 2.2.4 to 2.3.1 (GH-30325)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.4 to 2.3.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.4...v2.3.1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years agobpo-40421: What's New in Python 3.11: PyFrameObject.f_lasti (GH-31536)
Victor Stinner [Wed, 23 Feb 2022 19:20:03 +0000 (20:20 +0100)] 
bpo-40421: What's New in Python 3.11: PyFrameObject.f_lasti (GH-31536)

Suggest replacing PyCode_Addr2Line() with PyFrame_GetLineNumber().

3 years agobpo-44337: Shrink the LOAD_ATTR/STORE_ATTR caches (GH-31517)
Brandt Bucher [Wed, 23 Feb 2022 18:53:24 +0000 (10:53 -0800)] 
bpo-44337: Shrink the LOAD_ATTR/STORE_ATTR caches (GH-31517)

3 years agobpo-40421: Fix PyFrame_GetCode() documentation (GH-31535)
Victor Stinner [Wed, 23 Feb 2022 18:49:21 +0000 (19:49 +0100)] 
bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535)

Fix PyFrame_GetBack() and PyFrame_GetCode() return type in
the documentation.

3 years agocloses bpo-46736: SimpleHTTPRequestHandler now uses HTML5. (GH-31533)
Dong-hee Na [Wed, 23 Feb 2022 17:59:32 +0000 (02:59 +0900)] 
closes bpo-46736: SimpleHTTPRequestHandler now uses HTML5. (GH-31533)

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
3 years agobpo-45412: Add _PY_SHORT_FLOAT_REPR macro (GH-31171)
Victor Stinner [Wed, 23 Feb 2022 17:16:23 +0000 (18:16 +0100)] 
bpo-45412: Add _PY_SHORT_FLOAT_REPR macro (GH-31171)

Remove the HAVE_PY_SET_53BIT_PRECISION macro (moved to the internal
C API).

* Move HAVE_PY_SET_53BIT_PRECISION macro to pycore_pymath.h.
* Replace PY_NO_SHORT_FLOAT_REPR macro with _PY_SHORT_FLOAT_REPR
  macro which is always defined. gcc -Wundef emits a warning when
  using _PY_SHORT_FLOAT_REPR but the macro is not defined, if
  pycore_pymath.h include was forgotten.

3 years agobpo-45885: Don't un-adapt `COMPARE_OP` when collecting stats (GH-31516)
Brandt Bucher [Wed, 23 Feb 2022 11:06:25 +0000 (03:06 -0800)] 
bpo-45885: Don't un-adapt `COMPARE_OP` when collecting stats (GH-31516)

3 years agobpo-46329: Fix test failure when `Py_STATS` is enabled (GH-31511)
Brandt Bucher [Wed, 23 Feb 2022 11:00:28 +0000 (03:00 -0800)] 
bpo-46329: Fix test failure when `Py_STATS` is enabled (GH-31511)

3 years agobpo-46757: Add a test to verify dataclass's __post_init__ isn't being automatically...
Eric V. Smith [Wed, 23 Feb 2022 05:14:35 +0000 (00:14 -0500)] 
bpo-46757: Add a test to verify dataclass's __post_init__ isn't being automatically added. (GH-31523)

3 years agoMinor fixes to C API docs (GH-31501)
Jelle Zijlstra [Wed, 23 Feb 2022 04:34:17 +0000 (20:34 -0800)] 
Minor fixes to C API docs (GH-31501)

* C API docs: move PyErr_SetImportErrorSubclass docs

It was in the section about warnings, but it makes more sense to
put it with PyErr_SetImportError.

* C API docs: document closeit argument to PyRun_AnyFileExFlags

It was already documented for PyRun_SimpleFileExFlags.

* textual fixes to unicode docs

* Move paragraph about tp_dealloc into tp_dealloc section

* __aiter__ returns an async iterator, not an awaitable

3 years agobpo-46794: Bump up the libexpat version into 2.4.6 (GH-31487)
Dong-hee Na [Wed, 23 Feb 2022 01:40:30 +0000 (10:40 +0900)] 
bpo-46794: Bump up the libexpat version into 2.4.6 (GH-31487)

3 years agobpo-46522: fix concurrent.futures and io AttributeError messages (GH-30887)
Thomas Grainger [Wed, 23 Feb 2022 00:25:00 +0000 (00:25 +0000)] 
bpo-46522: fix concurrent.futures and io AttributeError messages (GH-30887)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-46765: Replace Locally Cached Strings with Statically Initialized Objects (gh...
Eric Snow [Wed, 23 Feb 2022 00:23:51 +0000 (17:23 -0700)] 
bpo-46765: Replace Locally Cached Strings with Statically Initialized Objects (gh-31366)

https://bugs.python.org/issue46765

3 years agoInherit asyncio proactor datagram transport from asyncio.DatagramTransport (#31512)
Andrew Svetlov [Tue, 22 Feb 2022 23:39:24 +0000 (01:39 +0200)] 
Inherit asyncio proactor datagram transport from asyncio.DatagramTransport (#31512)

3 years agobpo-45459: Rename buffer.h to pybuffer.h (#31201)
Victor Stinner [Tue, 22 Feb 2022 22:11:48 +0000 (23:11 +0100)] 
bpo-45459: Rename buffer.h to pybuffer.h (#31201)

Rename Include/buffer.h header file to Include/pybuffer.h to avoid
conflicts with projects having an existing "buffer.h" header file.

* Incude pybuffer.h before object.h in Python.h.
* Remove #include "buffer.h" from Include/cpython/object.h.
* Add a forward declaration of the PyObject type in pybuffer.h to fix
  an inter-dependency issue.

3 years agobpo-46659: Deprecate locale.getdefaultlocale() (GH-31206)
Victor Stinner [Tue, 22 Feb 2022 21:06:43 +0000 (22:06 +0100)] 
bpo-46659: Deprecate locale.getdefaultlocale() (GH-31206)

The locale.getdefaultlocale() function is deprecated and will be
removed in Python 3.13. Use locale.setlocale(),
locale.getpreferredencoding(False) and locale.getlocale() functions
instead.

3 years agobpo-46659: Fix the MBCS codec alias on Windows (GH-31218)
Victor Stinner [Tue, 22 Feb 2022 21:04:07 +0000 (22:04 +0100)] 
bpo-46659: Fix the MBCS codec alias on Windows (GH-31218)

3 years agobpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)
Thomas Grainger [Tue, 22 Feb 2022 20:35:57 +0000 (20:35 +0000)] 
bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-46729: add number of sub-exceptions in str() of BaseExceptionGroup (GH-31294)
Irit Katriel [Tue, 22 Feb 2022 18:28:58 +0000 (18:28 +0000)] 
bpo-46729: add number of sub-exceptions in str() of BaseExceptionGroup (GH-31294)

3 years agobpo-20923 : [doc] Explain ConfigParser 'valid section name' and .SECTCRE (GH-31413)
vidhya [Tue, 22 Feb 2022 18:06:41 +0000 (13:06 -0500)] 
bpo-20923 : [doc] Explain ConfigParser 'valid section name'  and .SECTCRE (GH-31413)

3 years agobpo-36557: Updated wording for using/windows (GH-31457)
slateny [Tue, 22 Feb 2022 17:36:13 +0000 (09:36 -0800)] 
bpo-36557: Updated wording for using/windows (GH-31457)

3 years agobpo-46725: Document starred expressions in for statements (GH-31481)
Pablo Galindo Salgado [Tue, 22 Feb 2022 17:26:46 +0000 (17:26 +0000)] 
bpo-46725: Document starred expressions in for statements (GH-31481)

Automerge-Triggered-By: GH:pablogsal
3 years agoFix reporting of specialization stats. (GH-31503)
Mark Shannon [Tue, 22 Feb 2022 17:18:10 +0000 (17:18 +0000)] 
Fix reporting of specialization stats. (GH-31503)

3 years agobpo-46822: Increase timeout for test_create_server_ssl_over_ssl to match underlying...
Steve Dower [Tue, 22 Feb 2022 16:25:05 +0000 (16:25 +0000)] 
bpo-46822: Increase timeout for test_create_server_ssl_over_ssl to match underlying timeouts (GH-31502)

3 years agoRemove pair-counts from specialization stats. (GH-31500)
Mark Shannon [Tue, 22 Feb 2022 15:44:31 +0000 (15:44 +0000)] 
Remove pair-counts from specialization stats. (GH-31500)

3 years agoMove call specializations from CALL to PRECALL. (GH-31496)
Mark Shannon [Tue, 22 Feb 2022 14:57:01 +0000 (14:57 +0000)] 
Move call specializations from CALL to PRECALL. (GH-31496)

3 years agodict: Add dk_log2_index_bytes (GH-31439)
Inada Naoki [Tue, 22 Feb 2022 11:03:15 +0000 (20:03 +0900)] 
dict: Add dk_log2_index_bytes (GH-31439)

3 years agobpo-46820: Fix a SyntaxError in a numeric literal followed by "not in" (GH-31479)
Serhiy Storchaka [Tue, 22 Feb 2022 07:51:51 +0000 (09:51 +0200)] 
bpo-46820: Fix a SyntaxError in a numeric literal followed by "not in" (GH-31479)

Fix parsing a numeric literal immediately (without spaces) followed by
"not in" keywords, like in "1not in x". Now the parser only emits
a warning, not a syntax error.

3 years agobpo-46606: Reduce stack usage of getgroups and setgroups (GH-31073)
Inada Naoki [Tue, 22 Feb 2022 02:59:27 +0000 (11:59 +0900)] 
bpo-46606: Reduce stack usage of getgroups and setgroups (GH-31073)

NGROUPS_MAX was 32 before Linux 2.6.4 but 65536 since Linux 2.6.4.

3 years agobpo-45390: Propagate CancelledError's message from cancelled task to its awaiter...
Andrew Svetlov [Mon, 21 Feb 2022 20:59:04 +0000 (22:59 +0200)] 
bpo-45390: Propagate CancelledError's message from cancelled task to its awaiter (GH-31383)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 years agobpo-46329: Streamline calling sequence a bit. (GH-31465)
Mark Shannon [Mon, 21 Feb 2022 18:26:47 +0000 (18:26 +0000)] 
bpo-46329: Streamline calling sequence a bit. (GH-31465)

* Move handling of bound-methods to PRECALL.

* Remove call_shape.postcall_shrink

* Remove call_shape.callable

* Remove call_shape.callable. Change CALL oparg to match PRECALL oparg.

* Move KW_NAMES before PRECALL.

* Update opcode docs in dis.rst

3 years agofix __bool__ docstring (GH-31301)
Jelle Zijlstra [Mon, 21 Feb 2022 15:42:27 +0000 (07:42 -0800)] 
fix __bool__ docstring (GH-31301)

3 years agobpo-46811: Make test suite support Expat >=2.4.5 (GH-31453)
Sebastian Pipping [Mon, 21 Feb 2022 14:48:32 +0000 (15:48 +0100)] 
bpo-46811: Make test suite support Expat >=2.4.5 (GH-31453)

Curly brackets were never allowed in namespace URIs
according to RFC 3986, and so-called namespace-validating
XML parsers have the right to reject them a invalid URIs.

libexpat >=2.4.5 has become strcter in that regard due to
related security issues; with ET.XML instantiating a
namespace-aware parser under the hood, this test has no
future in CPython.

References:
- https://datatracker.ietf.org/doc/html/rfc3968
- https://www.w3.org/TR/xml-names/

Also, test_minidom.py: Support Expat >=2.4.5

3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from pyexpat (GH-31468)
Dong-hee Na [Mon, 21 Feb 2022 14:46:52 +0000 (23:46 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from pyexpat (GH-31468)

3 years agobpo-46796: Simplify handling of removed parameter "loop" in asyncio (GH-31431)
Serhiy Storchaka [Mon, 21 Feb 2022 11:25:52 +0000 (13:25 +0200)] 
bpo-46796: Simplify handling of removed parameter "loop" in asyncio (GH-31431)

3 years agobpo-46232: Fix parsing of certs with bit string in DN (GH-30351)
Christian Heimes [Sun, 20 Feb 2022 20:42:31 +0000 (22:42 +0200)] 
bpo-46232: Fix parsing of certs with bit string in DN (GH-30351)

3 years agobpo-39327: Close file descriptors as soon as possible in shutil.rmtree (GH-31384)
Lital Natan [Sun, 20 Feb 2022 16:02:10 +0000 (18:02 +0200)] 
bpo-39327: Close file descriptors as soon as possible in shutil.rmtree (GH-31384)

It fixes the "Text File Busy" OSError when using 'rmtree' on a
windows-managed filesystem in via the VirtualBox shared folder
(and possible other scenarios like a windows-managed network file
system).

3 years agoreplace `self` param with more appropriate `cls` in classmethods (GH-31402)
Josh Smith [Sun, 20 Feb 2022 12:31:09 +0000 (07:31 -0500)] 
replace `self` param with more appropriate `cls` in classmethods (GH-31402)

3 years agoRaise TypeError if SSLSocket is passed to asyncio transport-based methods (GH-31442)
Andrew Svetlov [Sun, 20 Feb 2022 12:17:15 +0000 (14:17 +0200)] 
Raise TypeError if SSLSocket is passed to asyncio transport-based methods (GH-31442)

3 years agobpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187)
Nikita Sobolev [Sun, 20 Feb 2022 10:24:00 +0000 (13:24 +0300)] 
bpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
3 years agobpo-46752: Uniform TaskGroup.__repr__ (GH-31409)
Andrew Svetlov [Sun, 20 Feb 2022 10:07:00 +0000 (12:07 +0200)] 
bpo-46752: Uniform TaskGroup.__repr__ (GH-31409)

3 years agoImprove discussion about how __getattr__ is invoked. (GH-31435)
Raymond Hettinger [Sun, 20 Feb 2022 05:02:30 +0000 (23:02 -0600)] 
Improve discussion about how __getattr__ is invoked. (GH-31435)

3 years agobpo-46066: Check DeprecationWarning in test_typing (GH-31428)
Jelle Zijlstra [Sun, 20 Feb 2022 01:44:51 +0000 (17:44 -0800)] 
bpo-46066: Check DeprecationWarning in test_typing (GH-31428)

3 years agoUse raw string to avoid deprecation warning (GH-31427)
Dennis Sweeney [Sat, 19 Feb 2022 05:57:36 +0000 (00:57 -0500)] 
Use raw string to avoid deprecation warning (GH-31427)

3 years agodict: Use DK_LOG_SIZE in hot loop. (GH-31405)
Inada Naoki [Sat, 19 Feb 2022 04:15:20 +0000 (13:15 +0900)] 
dict: Use DK_LOG_SIZE in hot loop. (GH-31405)

DK_LOG_SIZE(key) < 8 is faster than DK_SIZE(key) <= 0xff, at least on GCC.

3 years agoCounter doc mentions three methods, but lists four (GH-30706)
Charles Brunet [Sat, 19 Feb 2022 02:23:53 +0000 (21:23 -0500)] 
Counter doc mentions three methods, but lists four (GH-30706)

Was probably caused by the addition of the `total()` method

3 years agobpo-46685: improve test coverage of `Self` and `Never` in `typing` (GH-31222)
Nikita Sobolev [Sat, 19 Feb 2022 01:56:30 +0000 (04:56 +0300)] 
bpo-46685: improve test coverage of `Self` and `Never` in `typing` (GH-31222)

3 years agobpo-46603: improve coverage of `typing._strip_annotations` (GH-31063)
Nikita Sobolev [Sat, 19 Feb 2022 01:54:01 +0000 (04:54 +0300)] 
bpo-46603: improve coverage of `typing._strip_annotations` (GH-31063)

3 years agobpo-46571: improve `typing.no_type_check` to skip foreign objects (GH-31042)
Nikita Sobolev [Sat, 19 Feb 2022 01:53:29 +0000 (04:53 +0300)] 
bpo-46571: improve `typing.no_type_check` to skip foreign objects (GH-31042)

There are several changes:
1. We now don't explicitly check for any base / sub types, because new name check covers it
2. I've also checked that `no_type_check` do not modify foreign functions. It was the same as with `type`s
3. I've also covered `except TypeError` in `no_type_check` with a simple test case, it was not covered at all
4. I also felt like adding `lambda` test is a good idea: because `lambda` is a bit of both in class bodies: a function and an assignment

<!-- issue-number: [bpo-46571](https://bugs.python.org/issue46571) -->
https://bugs.python.org/issue46571
<!-- /issue-number -->

3 years ago[docs] Correct typos in SSLContext.sni_callback (GH-30623)
Jörn Heissler [Sat, 19 Feb 2022 01:49:04 +0000 (02:49 +0100)] 
[docs] Correct typos in SSLContext.sni_callback (GH-30623)

Co-authored-by: Jörn Heissler <nosuchaddress@joern-heissler.de>
3 years agobpo-46784: Add newly exported expat symbols to the namespace. (GH-31397)
Yilei "Dolee" Yang [Fri, 18 Feb 2022 22:33:06 +0000 (14:33 -0800)] 
bpo-46784: Add newly exported expat symbols to the namespace. (GH-31397)

The libexpat 2.4.1 upgrade from  introduced the following new exported symbols:

* `testingAccountingGetCountBytesDirect`
* `testingAccountingGetCountBytesIndirect`
* `unsignedCharToPrintable`
* `XML_SetBillionLaughsAttackProtectionActivationThreshold`
* `XML_SetBillionLaughsAttackProtectionMaximumAmplification`

We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h)

(The newer libexpat upgrade  has no new symbols).

Automerge-Triggered-By: GH:gpshead
3 years agoProcess more stale PRs, oldest first (GH-31407)
Hugo van Kemenade [Fri, 18 Feb 2022 19:28:12 +0000 (21:28 +0200)] 
Process more stale PRs, oldest first (GH-31407)

3 years ago"Own" pattern matching and peepholing (GH-31412)
Brandt Bucher [Fri, 18 Feb 2022 18:57:02 +0000 (10:57 -0800)] 
"Own" pattern matching and peepholing (GH-31412)

3 years agoReduce flakiness of taskgroups test 13 (GH-31411)
Guido van Rossum [Fri, 18 Feb 2022 17:28:56 +0000 (09:28 -0800)] 
Reduce flakiness of taskgroups test 13 (GH-31411)

3 years agobpo-46329: Change calling sequence (again) (GH-31373)
Mark Shannon [Fri, 18 Feb 2022 17:19:08 +0000 (17:19 +0000)] 
bpo-46329: Change calling sequence (again) (GH-31373)

* Change calling sequence: Add PUSH_NULL. Merge PRECALL_FUNCTION and PRECALL_METHOD into PRECALL.

3 years agobpo-46709: check eval breaker in specialized `CALL` opcodes (GH-31404)
Nikita Sobolev [Fri, 18 Feb 2022 12:56:23 +0000 (15:56 +0300)] 
bpo-46709: check eval breaker in specialized `CALL` opcodes (GH-31404)

3 years agobpo-46724: Fix dis support for overflow args (GH-31285)
Saul Shanabrook [Fri, 18 Feb 2022 09:56:23 +0000 (04:56 -0500)] 
bpo-46724: Fix dis support for overflow args (GH-31285)

3 years agobpo-46777: Fix incorrect use of directives in asyncio documentation (GH-31388)
Serhiy Storchaka [Fri, 18 Feb 2022 08:58:48 +0000 (10:58 +0200)] 
bpo-46777: Fix incorrect use of directives in asyncio documentation (GH-31388)

3 years agobpo-46752: Slight improvements to TaskGroup API (GH-31398)
Guido van Rossum [Fri, 18 Feb 2022 05:30:44 +0000 (21:30 -0800)] 
bpo-46752: Slight improvements to TaskGroup API (GH-31398)

* Remove task group names (for now)

We're not sure that they are needed, and once in the code
we would never be able to get rid of them.

Yury wrote:

> Ideally, there should be a way for someone to build a "trace"
> of taskgroups/task leading to the current running task.
> We could do that using contextvars, but I'm not sure we should
> do that in 3.11.

* Pass optional name on to task in create_task()

* Remove a bunch of unused stuff

3 years agoFix missing spaces in os.walk example (GH-29918)
辰冢 [Fri, 18 Feb 2022 04:10:33 +0000 (12:10 +0800)] 
Fix missing spaces in os.walk example (GH-29918)

3 years agoFix mistake in barry_as_FLUFL test (GH-31392)
Patrick Reader [Fri, 18 Feb 2022 01:45:35 +0000 (01:45 +0000)] 
Fix mistake in barry_as_FLUFL test (GH-31392)

Use assertEqual(), not assertTrue(lineno, 2)

3 years agodocs: Link `match` statement in tutorial (GH-31396)
William Andrea [Fri, 18 Feb 2022 00:02:42 +0000 (19:02 -0500)] 
docs: Link `match` statement in tutorial (GH-31396)

Add a link to the `match` statement from its section in the tutorial.

This should be backported to 3.10.

[Initially submitted as #31395 but against the wrong branch. Thanks @Mariatta]

Automerge-Triggered-By: GH:Mariatta
3 years agoFix typo in compileall.py's docstring (GH-29865)
Alexander Münch [Thu, 17 Feb 2022 20:45:27 +0000 (21:45 +0100)] 
Fix typo in compileall.py's docstring (GH-29865)

3 years agobpo-29418: Add inspect.ismethodwrapper to whatsnew (GH-31377)
Hakan Çelik [Thu, 17 Feb 2022 19:45:55 +0000 (22:45 +0300)] 
bpo-29418: Add inspect.ismethodwrapper to whatsnew (GH-31377)

3 years agobpo-46730: Fix refleak and tighten NULL checks (GH-31389)
Christian Heimes [Thu, 17 Feb 2022 19:27:42 +0000 (21:27 +0200)] 
bpo-46730: Fix refleak and tighten NULL checks (GH-31389)

``PyType_GetQualName`` returns a new reference.

Signed-off-by: Christian Heimes <christian@python.org>
3 years agobpo-46778: Enable multiprocess compilation for source files when building on Windows...
Jeremy Kloth [Thu, 17 Feb 2022 18:40:33 +0000 (11:40 -0700)] 
bpo-46778: Enable multiprocess compilation for source files when building on Windows (GH-31390)

3 years agoUpdate html.parser.rst (GH-30678)
Géry Ogam [Thu, 17 Feb 2022 12:20:40 +0000 (13:20 +0100)] 
Update html.parser.rst (GH-30678)

This PR for the documentation of the [html.parser](https://docs.python.org/3/library/html.parser.html) module will

- fix a terminology mistake (‘start of a tag’ -> ‘start tag of an element’);
- mention the parameter names of the `HTMLParser.handle_*` methods where missing.

3 years agobpo-41086: Add exception for uninstantiated interpolation (configparser) (GH-21062)
Brian Faherty [Thu, 17 Feb 2022 12:17:43 +0000 (07:17 -0500)] 
bpo-41086: Add exception for uninstantiated interpolation (configparser) (GH-21062)

* Add exception for uninstantiated interpolation (configparser)

The current feedback when users try to pass an uninstantiated
interpolation into a ConfigParser is an error message that does not help
users solve the problem. This current error of `TypeError: before_set()
missing 1 required positional argument: 'value'` does not display until
the parser is used, which usually results in the assumption that
instantiation of the parser was done correctly. The new exception of
InterpolationTypeError, will be raised on the line where the
ConfigParser is instantiated. This will result in users see the line
that has the error in their backtrace for faster debugging.

There have been a number of bugs created in the issue tracker, which
could have been addressed by:
https://bugs.python.org/issue26831 and https://bugs.python.org/issue26469

* 📜🤖 Added by blurb_it.

* Replace custom Error with TypeError

Per feedback from @iritkatriel, the custom InterpolationTypeError has
been dropped in favour of a TypeError with a custom message, and the
unittests have been expanded.

* More verbose message

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agoClose stale PRs without signed CLA (GH-30500)
Erlend Egeberg Aasland [Thu, 17 Feb 2022 08:20:40 +0000 (09:20 +0100)] 
Close stale PRs without signed CLA (GH-30500)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
3 years agobpo-46745: Fix typo in PositionsIterator (#31322)
Robert-André Mauchin [Thu, 17 Feb 2022 05:20:06 +0000 (06:20 +0100)] 
bpo-46745: Fix typo in PositionsIterator (#31322)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from array module (GH-31376)
Dong-hee Na [Thu, 17 Feb 2022 04:02:17 +0000 (13:02 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from array module (GH-31376)

3 years agobpo-46333: Honor `module` parameter in ForwardRef (GH-30536)
aha79 [Thu, 17 Feb 2022 03:28:18 +0000 (04:28 +0100)] 
bpo-46333: Honor `module` parameter in ForwardRef (GH-30536)

The `module` parameter carries semantic information about the forward ref.
Forward refs are different if they refer to different module even if they
have the same name. This affects the `__eq__`, `__repr__` and `__hash__` methods.

Co-authored-by: Andreas Hangauer <andreas.hangauer@siemens.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
3 years agobpo-46066: Deprecate kwargs syntax for TypedDict definitions (GH-31126)
97littleleaf11 [Thu, 17 Feb 2022 03:26:07 +0000 (11:26 +0800)] 
bpo-46066: Deprecate kwargs syntax for TypedDict definitions (GH-31126)

Closes python/typing#981

https://bugs.python.org/issue46066

3 years agoBecome a CODEOWNER for typing (#31374)
Jelle Zijlstra [Wed, 16 Feb 2022 19:02:06 +0000 (11:02 -0800)] 
Become a CODEOWNER for typing (#31374)

3 years agobpo-46072: Add detailed failure stats for BINARY_OP (GH-31289)
Brandt Bucher [Wed, 16 Feb 2022 16:49:58 +0000 (08:49 -0800)] 
bpo-46072: Add detailed failure stats for BINARY_OP (GH-31289)

3 years agobpo-46702: Specialize UNPACK_SEQUENCE (GH-31240)
Brandt Bucher [Wed, 16 Feb 2022 16:48:16 +0000 (08:48 -0800)] 
bpo-46702: Specialize UNPACK_SEQUENCE (GH-31240)

3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from mmap module (GH-31375)
Dong-hee Na [Wed, 16 Feb 2022 16:04:38 +0000 (01:04 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from mmap module (GH-31375)

3 years agobpo-46541: Replace _Py_IDENTIFIER with _Py_ID in sqlite3 (GH-31351)
Erlend Egeberg Aasland [Wed, 16 Feb 2022 15:24:44 +0000 (16:24 +0100)] 
bpo-46541: Replace _Py_IDENTIFIER with _Py_ID in sqlite3 (GH-31351)

3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from csv module (GH-31372)
Dong-hee Na [Wed, 16 Feb 2022 15:24:03 +0000 (00:24 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from csv module (GH-31372)

3 years agobpo-29418: Implement inspect.ismethodwrapper and fix inspect.isroutine for cases...
Hakan Çelik [Wed, 16 Feb 2022 12:46:20 +0000 (15:46 +0300)] 
bpo-29418: Implement inspect.ismethodwrapper and fix inspect.isroutine for cases where methodwrapper is given (GH-19261)

Automerge-Triggered-By: GH:isidentical
3 years agoRemove offsets from expected output in test.test_dis (GH-31369)
Mark Shannon [Wed, 16 Feb 2022 12:19:09 +0000 (12:19 +0000)] 
Remove offsets from expected output in test.test_dis (GH-31369)

3 years agobpo-46762: Fix an assert failure in f-strings where > or < is the last character...
Eric V. Smith [Wed, 16 Feb 2022 10:54:09 +0000 (05:54 -0500)] 
bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (#31365)

3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from dbms modules (GH-31358)
Dong-hee Na [Wed, 16 Feb 2022 09:57:28 +0000 (18:57 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from dbms modules (GH-31358)

3 years agobpo-46730: Add more info to @property AttributeError messages (GH-31311)
Alex-Blade [Wed, 16 Feb 2022 07:07:34 +0000 (10:07 +0300)] 
bpo-46730: Add more info to @property AttributeError messages (GH-31311)

On `obj.read_only_property = x`, raise `AttributeError: property 'read_only_property' of 'A' object has no setter`.

3 years agobpo-46541: Scan Fewer Files in generate_global_objects.py (gh-31364)
Eric Snow [Wed, 16 Feb 2022 03:07:11 +0000 (20:07 -0700)] 
bpo-46541: Scan Fewer Files in generate_global_objects.py (gh-31364)

https://bugs.python.org/issue46541

3 years agobpo-46541: Drop the check for orphaned global strings. (gh-31363)
Eric Snow [Wed, 16 Feb 2022 03:06:38 +0000 (20:06 -0700)] 
bpo-46541: Drop the check for orphaned global strings. (gh-31363)

https://bugs.python.org/issue46541

3 years agobpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270)
Guido van Rossum [Tue, 15 Feb 2022 23:42:04 +0000 (15:42 -0800)] 
bpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270)

asyncio/taskgroups.py is an adaptation of taskgroup.py from EdgeDb, with the following key changes:

- Allow creating new tasks as long as the last task hasn't finished
- Raise [Base]ExceptionGroup (directly) rather than TaskGroupError deriving from MultiError
- Instead of monkey-patching the parent task's cancel() method,
  add a new public API to Task

The Task class has a new internal flag, `_cancel_requested`, which is set when `.cancel()` is called successfully. The `.cancelling()` method returns the value of this flag. Further `.cancel()` calls while this flag is set return False. To reset this flag, call `.uncancel()`.

Thus, a Task that catches and ignores `CancelledError` should call `.uncancel()` if it wants to be cancellable again; until it does so, it is deemed to be busy with uninterruptible cleanup.

This new Task API helps solve the problem where TaskGroup needs to distinguish between whether the parent task being cancelled "from the outside" vs. "from inside".

Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-46737: Add default arguments to random.gauss and normalvariate (GH-31360)
Zackery Spytz [Tue, 15 Feb 2022 23:12:15 +0000 (15:12 -0800)] 
bpo-46737: Add default arguments to random.gauss and normalvariate (GH-31360)

3 years agobpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327)
Alex Waygood [Tue, 15 Feb 2022 16:39:28 +0000 (16:39 +0000)] 
bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327)

The docstring for `BufferedProtocol` states that the class is still an "experimental API", but it has been considered stable since 3.8.

3 years agoFix copyright years in `README.rst` (#31347)
Nikita Sobolev [Tue, 15 Feb 2022 15:22:00 +0000 (18:22 +0300)] 
Fix copyright years in `README.rst` (#31347)

3 years agobpo-44011: New asyncio ssl implementation (#31275)
Kumar Aditya [Tue, 15 Feb 2022 13:04:00 +0000 (18:34 +0530)] 
bpo-44011: New asyncio ssl implementation (#31275)

* bpo-44011: New asyncio ssl implementation

Co-Authored-By: Andrew Svetlov <andrew.svetlov@gmail.com>
* fix warning

* fix typo

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>