]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agoGH-104102: Optimize `pathlib.Path.glob()` handling of `../` pattern segments (GH...
Barney Gale [Tue, 2 May 2023 23:16:04 +0000 (00:16 +0100)] 
GH-104102: Optimize `pathlib.Path.glob()` handling of `../` pattern segments (GH-104103)

These segments do not require a `stat()` call, as the selector's
`_select_from()` method is called after we've established that the
parent is a directory.

2 years agoGH-104104: Optimize `pathlib.Path.glob()` by avoiding repeated calls to `os.path...
Barney Gale [Tue, 2 May 2023 21:51:18 +0000 (22:51 +0100)] 
GH-104104: Optimize `pathlib.Path.glob()` by avoiding repeated calls to `os.path.normcase()` (GH-104105)

Use `re.IGNORECASE` to implement case-insensitive matching. This
restores behaviour from before GH-31691.

2 years agogh-103822: [Calendar] change return value to enum for day and month APIs (GH-103827)
Prince Roshan [Tue, 2 May 2023 20:13:31 +0000 (01:43 +0530)] 
gh-103822: [Calendar] change return value to enum for day and month APIs (GH-103827)

2 years agogh-65022: Fix description of tuple return value in copyreg (#103892)
Shantanu [Tue, 2 May 2023 18:13:47 +0000 (11:13 -0700)] 
gh-65022: Fix description of tuple return value in copyreg (#103892)

2 years agoGH-103525: Improve exception message from `pathlib.PurePath()` (GH-103526)
Barney Gale [Tue, 2 May 2023 18:08:19 +0000 (19:08 +0100)] 
GH-103525: Improve exception message from `pathlib.PurePath()` (GH-103526)

Check that arguments are strings before calling `os.path.join()`.

Also improve performance of `PurePath(PurePath(...))` while we're in the
area: we now use the *unnormalized* string path of such arguments.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-84436: Add integration C API tests for immortal objects (gh-103962)
Dong-hee Na [Tue, 2 May 2023 15:05:30 +0000 (00:05 +0900)] 
gh-84436: Add integration C API tests for immortal objects (gh-103962)

2 years agogh-103743: Add PyUnstable_Object_GC_NewWithExtraData (GH-103744)
Jurica Bradarić [Tue, 2 May 2023 11:38:46 +0000 (13:38 +0200)] 
gh-103743: Add PyUnstable_Object_GC_NewWithExtraData (GH-103744)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-102997: Update Windows installer to SQLite 3.41.2. (#102999)
Mariusz Felisiak [Tue, 2 May 2023 07:37:57 +0000 (09:37 +0200)] 
gh-102997: Update Windows installer to SQLite 3.41.2. (#102999)

2 years agoGH-103484: Fix redirected permanently URLs (#104001)
Rafael Fontenelle [Tue, 2 May 2023 06:34:44 +0000 (03:34 -0300)] 
GH-103484: Fix redirected permanently URLs (#104001)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2 years agoImprove assert_type phrasing (#104081)
Shantanu [Tue, 2 May 2023 06:05:25 +0000 (23:05 -0700)] 
Improve assert_type phrasing (#104081)

I'd like to make the fact that this does nothing at runtime
really obvious, since I suspect this is unintuitive for users who are
unfamiliar with static type checking.

I thought of this because of
https://discuss.python.org/t/add-arg-check-type-to-types/26384
wherein I'm skeptical that the user really did want `assert_type`.

2 years agogh-102997: Update macOS installer to SQLite 3.41.2. (GH-102998)
Mariusz Felisiak [Tue, 2 May 2023 04:30:43 +0000 (06:30 +0200)] 
gh-102997: Update macOS installer to SQLite 3.41.2. (GH-102998)

2 years agoGH-103472: close response in HTTPConnection._tunnel (#103473)
Thomas Grainger [Tue, 2 May 2023 03:59:42 +0000 (04:59 +0100)] 
GH-103472: close response in HTTPConnection._tunnel (#103473)

Avoid a potential `ResourceWarning` in `http.client.HTTPConnection`
by closing the proxy / tunnel's CONNECT response explicitly.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-88496: IDLE - fix another test on macOS (#104075)
Terry Jan Reedy [Tue, 2 May 2023 02:53:16 +0000 (22:53 -0400)] 
gh-88496: IDLE - fix another test on macOS (#104075)

Needed for Catalina: test_sidebar add 'idletasks' and skip assert.

2 years agogh-94673: Hide Objects in PyTypeObject Behind Accessors (gh-104074)
Eric Snow [Tue, 2 May 2023 02:34:43 +0000 (20:34 -0600)] 
gh-94673: Hide Objects in PyTypeObject Behind Accessors (gh-104074)

This makes it much cleaner to move more PyTypeObject fields to PyInterpreterState.

2 years agogh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter...
Eric Snow [Tue, 2 May 2023 01:36:00 +0000 (19:36 -0600)] 
gh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter (gh-104072)

Until now, we haven't been initializing nor finalizing the per-interpreter state properly.

2 years agogh-104016: Skip test for deeply neste f-strings on wasi (#104071)
Pablo Galindo Salgado [Mon, 1 May 2023 23:55:41 +0000 (01:55 +0200)] 
gh-104016: Skip test for deeply neste f-strings on wasi (#104071)

2 years agogh-104057: Fix direct invocation of test_super (#104064)
Kirill Podoprigora [Mon, 1 May 2023 22:14:49 +0000 (01:14 +0300)] 
gh-104057: Fix direct invocation of test_super (#104064)

2 years agogh-87092: Expose assembler to unit tests (#103988)
Irit Katriel [Mon, 1 May 2023 21:29:30 +0000 (22:29 +0100)] 
gh-87092: Expose assembler to unit tests (#103988)

2 years agogh-97696: asyncio eager tasks factory (#102853)
Itamar Ostricher [Mon, 1 May 2023 21:10:13 +0000 (14:10 -0700)] 
gh-97696: asyncio eager tasks factory (#102853)

Co-authored-by: Jacob Bower <jbower@meta.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2 years agogh-84436: Immortalize in _PyStructSequence_InitBuiltinWithFlags() (gh-104054)
Eric Snow [Mon, 1 May 2023 21:08:34 +0000 (15:08 -0600)] 
gh-84436: Immortalize in _PyStructSequence_InitBuiltinWithFlags() (gh-104054)

This also does some cleanup.

2 years agogh-104057: Fix direct invocation of test_module (GH-104059)
Kirill Podoprigora [Mon, 1 May 2023 20:17:47 +0000 (23:17 +0300)] 
gh-104057: Fix direct invocation of test_module (GH-104059)

2 years agogh-100458: Clarify Enum.__format__() change of mixed-in types in the whatsnew/3.11...
Anže Pečar [Mon, 1 May 2023 19:49:54 +0000 (00:49 +0500)] 
gh-100458: Clarify Enum.__format__() change of mixed-in types in the whatsnew/3.11.rst (GH-100387)

Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2 years agogh-104018: disallow "z" format specifier in %-format of byte strings (GH-104033)
John Belmonte [Mon, 1 May 2023 19:47:14 +0000 (04:47 +0900)] 
gh-104018: disallow "z" format specifier in %-format of byte strings (GH-104033)

PEP-0682 specified that %-formatting would not support the "z" specifier,
but it was unintentionally allowed for bytes. This PR makes use of the "z"
flag an error for %-formatting in a bytestring.

Issue: #104018

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years agogh-104016: Fixed off by 1 error in f string tokenizer (#104047)
jx124 [Mon, 1 May 2023 19:15:47 +0000 (03:15 +0800)] 
gh-104016: Fixed off by 1 error in f string tokenizer (#104047)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2 years agoGH-103629: Update Unpack's repr in compliance with PEP 692 (#104048)
Franek Magiera [Mon, 1 May 2023 17:58:50 +0000 (19:58 +0200)] 
GH-103629: Update Unpack's repr in compliance with PEP 692 (#104048)

2 years agogh-102799: replace sys.exc_info by sys.exception in inspect and traceback modules...
Irit Katriel [Mon, 1 May 2023 17:19:47 +0000 (18:19 +0100)] 
gh-102799: replace sys.exc_info by sys.exception in inspect and traceback modules (#104032)

2 years agoFix typo in "expected" word in few source files (#104034)
chgnrdv [Mon, 1 May 2023 15:45:50 +0000 (18:45 +0300)] 
Fix typo in "expected" word in few source files (#104034)

2 years agogh-103824: fix use-after-free error in Parser/tokenizer.c (#103993)
chgnrdv [Mon, 1 May 2023 15:26:43 +0000 (18:26 +0300)] 
gh-103824: fix use-after-free error in Parser/tokenizer.c (#103993)

2 years agogh-104035: Do not ignore user-defined `__{get,set}state__` in slotted frozen dataclas...
Nikita Sobolev [Mon, 1 May 2023 15:19:06 +0000 (18:19 +0300)] 
gh-104035: Do not ignore user-defined `__{get,set}state__` in slotted frozen dataclasses (#104041)

2 years agogh-104028: Reduce object creation while calling callback function from gc (gh-104030)
Dong-hee Na [Mon, 1 May 2023 14:03:24 +0000 (23:03 +0900)] 
gh-104028: Reduce object creation while calling callback function from gc (gh-104030)

2 years agogh-104036: Fix direct invocation of test_typing (#104037)
Kirill Podoprigora [Mon, 1 May 2023 13:42:59 +0000 (16:42 +0300)] 
gh-104036: Fix direct invocation of test_typing (#104037)

Previously, `python -m test test_typing` worked, but `python Lib/test/test_typing.py` did not.

2 years agogh-102213: Optimize the performance of `__getattr__` (GH-103761)
sunmy2019 [Mon, 1 May 2023 10:10:35 +0000 (18:10 +0800)] 
gh-102213: Optimize the performance of `__getattr__` (GH-103761)

Co-authored-by: Kirill <80244920+Eclips4@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Xiang Wang <34048878+wangxiang-hz@users.noreply.github.com>
2 years agogh-103895: Improve how invalid `Exception.__notes__` are displayed (#103897)
Carey Metcalfe [Mon, 1 May 2023 07:32:04 +0000 (01:32 -0600)] 
gh-103895: Improve how invalid `Exception.__notes__` are displayed (#103897)

2 years agoAdjust expression from `==` to `!=` in alignment with the meaning of the paragraph...
Ben Faulhaber [Mon, 1 May 2023 05:47:34 +0000 (07:47 +0200)] 
Adjust expression from `==` to `!=` in alignment with the meaning of the paragraph. (GH-104021)

2 years agogh-88496: Fix IDLE test hang on macOS (#104025)
Terry Jan Reedy [Mon, 1 May 2023 01:36:27 +0000 (21:36 -0400)] 
gh-88496: Fix IDLE test hang on macOS (#104025)

Replace widget.update() with widget.update_idletasks in two places.

2 years agoImprove int test coverage (#104024)
Shantanu [Mon, 1 May 2023 00:16:38 +0000 (17:16 -0700)] 
Improve int test coverage (#104024)

Following discussion in https://discuss.python.org/t/bug-in-int-42/26360/5

This tests some of the things documented in https://github.com/python/cpython/pull/100436

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-88773: Added teleport method to Turtle library (#103974)
Liam Gersten [Sun, 30 Apr 2023 20:17:36 +0000 (16:17 -0400)] 
gh-88773: Added teleport method to Turtle library (#103974)

Add a `teleport` method to `turtle` module turtle instances that acts a lot like `goto`, _but_ ensures the pen is up while warping to the new position to and can control shape filling behavior as part of the jump.

Based on an educator user feature request.

---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-104015: Fix direct invocation of `test_dataclasses` (#104017)
Nikita Sobolev [Sun, 30 Apr 2023 17:16:55 +0000 (20:16 +0300)] 
gh-104015: Fix direct invocation of `test_dataclasses` (#104017)

Previously, `python -m test test_dataclasses` passed, but `./python.exe Lib/test/test_dataclasses.py` failed

2 years agogh-104012: Ensure test_calendar.CalendarTestCase.test_deprecation_warning consistentl...
Alex Waygood [Sun, 30 Apr 2023 15:51:46 +0000 (16:51 +0100)] 
gh-104012: Ensure test_calendar.CalendarTestCase.test_deprecation_warning consistently passes (#104014)

2 years agogh-103977: compile re expressions in platform.py only if required (#103981)
Pieter Eendebak [Sun, 30 Apr 2023 15:36:19 +0000 (17:36 +0200)] 
gh-103977: compile re expressions in platform.py only if required (#103981)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agogh-98003: Inline call frames for CALL_FUNCTION_EX (GH-98004)
Ken Jin [Sun, 30 Apr 2023 13:08:26 +0000 (21:08 +0800)] 
gh-98003: Inline call frames for CALL_FUNCTION_EX (GH-98004)

2 years agoReplace Netlify with Read the Docs build previews (#103843)
Hugo van Kemenade [Sun, 30 Apr 2023 05:02:03 +0000 (08:02 +0300)] 
Replace Netlify with Read the Docs build previews (#103843)

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoUpdate name in acknowledgements and add mailmap (#103696)
Amethyst Reese [Sun, 30 Apr 2023 03:21:20 +0000 (20:21 -0700)] 
Update name in acknowledgements and add mailmap (#103696)

I changed my name last year, and would like to update my name in the
acknowledgements and git history accordingly.

git-mailmap reference: https://git-scm.com/docs/gitmailmap

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agogh-82054: allow test runner to split test_asyncio to execute in parallel by sharding...
Joshua Herman [Sun, 30 Apr 2023 01:26:24 +0000 (20:26 -0500)] 
gh-82054: allow test runner to split test_asyncio to execute in parallel by sharding. (#103927)

This runs test_asyncio sub-tests in parallel using sharding from Cinder. This suite is typically the longest-pole in runs because it is a test package with a lot of further sub-tests otherwise run serially. By breaking out the sub-tests as independent modules we can run a lot more in parallel.

After porting we can see the direct impact on a multicore system.

Without this change:
  Running make test is 5 min 26 seconds
With this change:
  Running make test takes 3 min 39 seconds

That'll vary based on system and parallelism. On a `-j 4` run similar to what CI and buildbot systems often do, it reduced the overall test suite completion latency by 10%.

The drawbacks are that this implementation is hacky and due to the sorting of the tests it obscures when the asyncio tests occur and involves changing CPython test infrastructure but, the wall time saved it is worth it, especially in low-core count CI runs as it pulls a long tail. The win for productivity and reserved CI resource usage is significant.

Future tests that deserve to be refactored into split up suites to benefit from are test_concurrent_futures and the way the _test_multiprocessing suite gets run for all start methods. As exposed by passing the -o flag to python -m test to get a list of the 10 longest running tests.

---------

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google, LLC]
2 years agoRemove non-existing tools from Sundry skiplist (#103991)
Oleg Iarygin [Sat, 29 Apr 2023 19:11:15 +0000 (23:11 +0400)] 
Remove non-existing tools from Sundry skiplist (#103991)

2 years agogh-103793: Defer formatting task name (#103767)
Itamar Ostricher [Sat, 29 Apr 2023 15:20:09 +0000 (08:20 -0700)] 
gh-103793: Defer formatting task name (#103767)

The default task name is "Task-<counter>" (if no name is passed in during Task creation).
This is initialized in `Task.__init__` (C impl) using string formatting, which can be quite slow.
Actually using the task name in real world code is not very common, so this is wasted init.

Let's defer this string formatting to the first time the name is read (in `get_name` impl),
so we don't need to pay the string formatting cost if the task name is never read.

We don't change the order in which tasks are assigned numbers (if they are) --
the number is set on task creation, as a PyLong instead of a formatted string.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years agogh-87092: change assembler to use instruction sequence instead of CFG (#103933)
Irit Katriel [Sat, 29 Apr 2023 11:06:04 +0000 (12:06 +0100)] 
gh-87092: change assembler to use instruction sequence instead of CFG (#103933)

2 years agogh-103636: issue warning for deprecated calendar constants (#103833)
Prince Roshan [Sat, 29 Apr 2023 07:16:46 +0000 (12:46 +0530)] 
gh-103636: issue warning for deprecated calendar constants (#103833)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years agoVarious small fixes to dis docs (#103923)
Jelle Zijlstra [Sat, 29 Apr 2023 07:02:21 +0000 (00:02 -0700)] 
Various small fixes to dis docs (#103923)

- Fix description of MAKE_CELL, which appeared to be inverted from the
  actual behavior
- Fix stray ".:" (sphinx-contrib/sphinx-lint#63)
- Fix inconsistent indentation
- Add some missing code blocks
- Slight style improvements

2 years agoGH-103082: Code cleanup in instrumentation code (#103474)
Mark Shannon [Sat, 29 Apr 2023 04:51:55 +0000 (05:51 +0100)] 
GH-103082: Code cleanup in instrumentation code (#103474)

2 years agogh-98040: Remove just the `imp` module (#98573)
Barry Warsaw [Fri, 28 Apr 2023 23:17:58 +0000 (16:17 -0700)] 
gh-98040: Remove just the `imp` module (#98573)

2 years agoGH-103971: Forward-port test from GH-103980 (GH-103984)
Tian Gao [Fri, 28 Apr 2023 20:25:48 +0000 (13:25 -0700)] 
GH-103971: Forward-port test from GH-103980 (GH-103984)

2 years agoGH-103944: Check error status when raising DeprecationWarning (#103949)
Paul Ganssle [Fri, 28 Apr 2023 19:44:13 +0000 (13:44 -0600)] 
GH-103944: Check error status when raising DeprecationWarning (#103949)

2 years agogh-103978: avoid using 'class' as an identifier (#103979)
Carl Meyer [Fri, 28 Apr 2023 19:20:50 +0000 (13:20 -0600)] 
gh-103978: avoid using 'class' as an identifier (#103979)

2 years agogh-101100: Add reference doc for __post_init__ (#103818)
Olga Matoula [Fri, 28 Apr 2023 19:10:26 +0000 (13:10 -0600)] 
gh-101100: Add reference doc for __post_init__ (#103818)

Signed-off-by: Olga Matoula <olgamatoula@gmail.com>
2 years agoUpdate itertool recipe: polynomial_from_roots() (GH-103973)
Raymond Hettinger [Fri, 28 Apr 2023 17:25:50 +0000 (12:25 -0500)] 
Update itertool recipe: polynomial_from_roots() (GH-103973)

2 years agoGH-103804: Add test for dis.disco (#103901)
Juhi Chandalia [Fri, 28 Apr 2023 11:11:21 +0000 (05:11 -0600)] 
GH-103804: Add test for dis.disco (#103901)

2 years agogh-100021: Document that sqlite3's executemany() discards resulting rows (#103939)
Erlend E. Aasland [Fri, 28 Apr 2023 08:02:23 +0000 (10:02 +0200)] 
gh-100021: Document that sqlite3's executemany() discards resulting rows (#103939)

2 years agoFix typo in math.log docstring (#103943)
Wes Turner [Fri, 28 Apr 2023 07:31:31 +0000 (03:31 -0400)] 
Fix typo in math.log docstring (#103943)

2 years agogh-83925: Make asyncio.subprocess communicate similar to non-asyncio (#18650)
Marek Marczykowski-Górecki [Fri, 28 Apr 2023 00:30:26 +0000 (20:30 -0400)] 
gh-83925: Make asyncio.subprocess communicate similar to non-asyncio (#18650)

subprocess's communicate(None) closes stdin of the child process, after
sending no (extra) data. Make asyncio variant do the same.
This fixes issues with processes that waits for EOF on stdin before
continuing.

2 years agogh-94673: Fix _PyTypes_InitTypes() and get_type_attr_as_size() (gh-103961)
Eric Snow [Fri, 28 Apr 2023 00:28:51 +0000 (18:28 -0600)] 
gh-94673: Fix _PyTypes_InitTypes() and get_type_attr_as_size() (gh-103961)

This change has two small parts:

1. a follow-up to gh-103940 with one case I missed
2. adding a missing return that I noticed while working on related code

2 years agogh-94673: Ensure Builtin Static Types are Readied Properly (gh-103940)
Eric Snow [Thu, 27 Apr 2023 22:19:43 +0000 (16:19 -0600)] 
gh-94673: Ensure Builtin Static Types are Readied Properly (gh-103940)

There were cases where we do unnecessary work for builtin static types. This also simplifies some work necessary for a per-interpreter GIL.

2 years agogh-102628: Fix sqlite3 CLI prompt in IDLE on Windows (#103945)
Erlend E. Aasland [Thu, 27 Apr 2023 21:22:26 +0000 (23:22 +0200)] 
gh-102628: Fix sqlite3 CLI prompt in IDLE on Windows (#103945)

2 years agoDocs: fix dunders with too many underscores (#103955)
Erlend E. Aasland [Thu, 27 Apr 2023 21:17:43 +0000 (23:17 +0200)] 
Docs: fix dunders with too many underscores (#103955)

2 years agogh-103935: Use `io.open_code()` when executing code in trace and profile modules...
Tian Gao [Thu, 27 Apr 2023 20:29:35 +0000 (13:29 -0700)] 
gh-103935: Use `io.open_code()` when executing code in trace and profile modules (GH-103947)

2 years agogh-98822: Add missing test directories to TESTSUBDIRS (#103942)
Erlend E. Aasland [Thu, 27 Apr 2023 19:43:53 +0000 (21:43 +0200)] 
gh-98822: Add missing test directories to TESTSUBDIRS (#103942)

2 years agogh-87092: update CODEOWNERS for split of compile.c to 3 files (#103941)
Irit Katriel [Thu, 27 Apr 2023 19:35:53 +0000 (20:35 +0100)] 
gh-87092: update CODEOWNERS for split of compile.c to 3 files (#103941)

2 years agogh-102628: Fix sqlite3 CLI prompt for Windows console users (#103898)
Erlend E. Aasland [Thu, 27 Apr 2023 19:23:10 +0000 (21:23 +0200)] 
gh-102628: Fix sqlite3 CLI prompt for Windows console users (#103898)

The prompt will still be incorrect in IDLE on Windows,
as IDLE uses CTRL-D for EOF on all platforms.

2 years agoGH-103903: Test the minimum Sphinx version in CI (#103904)
Adam Turner [Thu, 27 Apr 2023 18:27:38 +0000 (19:27 +0100)] 
GH-103903: Test the minimum Sphinx version in CI (#103904)

2 years agoGH-103857: Deprecate utcnow and utcfromtimestamp (#103858)
Paul Ganssle [Thu, 27 Apr 2023 17:32:30 +0000 (11:32 -0600)] 
GH-103857: Deprecate utcnow and utcfromtimestamp (#103858)

Using `datetime.datetime.utcnow()` and `datetime.datetime.utcfromtimestamp()` will now raise a `DeprecationWarning`.

We also have removed our internal uses of these functions and documented the change.

2 years agoGH-90750: Use datetime.fromisocalendar in _strptime (#103802)
Paul Ganssle [Thu, 27 Apr 2023 16:27:27 +0000 (10:27 -0600)] 
GH-90750: Use datetime.fromisocalendar in _strptime (#103802)

Use datetime.fromisocalendar in _strptime

This unifies the ISO → Gregorian conversion logic and improves handling
of invalid ISO weeks.

2 years agogh-102765: Update ntpath.isdir/isfile/islink/exists to use GetFileInformationByName... 103859/head
Finn Womack [Thu, 27 Apr 2023 14:23:26 +0000 (07:23 -0700)] 
gh-102765: Update ntpath.isdir/isfile/islink/exists to use GetFileInformationByName when available (GH-103485)

2 years agogh-103583: Isolate CJK codec modules (#103869)
Erlend E. Aasland [Thu, 27 Apr 2023 13:02:43 +0000 (15:02 +0200)] 
gh-103583: Isolate CJK codec modules (#103869)

2 years agogh-103092: Isolate _ctypes, part 1 (#103893)
Erlend E. Aasland [Thu, 27 Apr 2023 12:57:54 +0000 (14:57 +0200)] 
gh-103092: Isolate _ctypes, part 1 (#103893)

Establish global state and port the following types to heap types:

- DictRemover_Type
- PyCArg_Type
- PyCThunk_Type
- PyCField_Type
- StructParam_Type

2 years agogh-103590: do not wrap a single exception raised from a try-except* (#103665)
Irit Katriel [Thu, 27 Apr 2023 11:52:15 +0000 (12:52 +0100)] 
gh-103590: do not wrap a single exception raised from a try-except* (#103665)

2 years agogh-103607: Fix `pause_reading` to work when called from `connection_made` in `asyncio...
Itayazolay [Thu, 27 Apr 2023 10:03:29 +0000 (13:03 +0300)] 
gh-103607: Fix `pause_reading` to work when called from `connection_made` in `asyncio`. (#17425)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-103880: Fix `assertRaises` usage in `test_genericalias` (GH-103916)
Nikita Sobolev [Thu, 27 Apr 2023 08:54:59 +0000 (11:54 +0300)] 
gh-103880: Fix `assertRaises` usage in `test_genericalias` (GH-103916)

2 years agogh-103883: Doc: Move PyUnicode_FromObject doc (#103913)
Inada Naoki [Thu, 27 Apr 2023 05:53:11 +0000 (14:53 +0900)] 
gh-103883: Doc: Move PyUnicode_FromObject doc (#103913)

This API is one of Unicode creator APIs.

2 years agogh-89415: Add source-specific multicast constants to socket module (#103684)
Reese Hyde [Thu, 27 Apr 2023 04:05:55 +0000 (00:05 -0400)] 
gh-89415: Add source-specific multicast constants to socket module (#103684)

Add socket options for source-specific multicast when present as C #defines.

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2 years agogh-103656: Transfer f-string buffers to parser to avoid use-after-free (GH-103896)
Lysandros Nikolaou [Thu, 27 Apr 2023 01:33:31 +0000 (19:33 -0600)] 
gh-103656: Transfer f-string buffers to parser to avoid use-after-free (GH-103896)

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2 years agogh-62432: unittest runner: Exit code 5 if no tests were run (#102051)
Stefano Rivera [Thu, 27 Apr 2023 01:28:46 +0000 (18:28 -0700)] 
gh-62432: unittest runner: Exit code 5 if no tests were run (#102051)

As discussed in https://discuss.python.org/t/unittest-fail-if-zero-tests-were-discovered/21498/7

It is common for test runner misconfiguration to fail to find any tests,
This should be an error.

Fixes: #62432
2 years agogh-103629: Update typing.Unpack docs in compliance with PEP 692 (#103894)
Franek Magiera [Wed, 26 Apr 2023 22:39:39 +0000 (00:39 +0200)] 
gh-103629: Update typing.Unpack docs in compliance with PEP 692 (#103894)

2 years agogh-60436: fix curses textbox backspace/del (#103783)
Aidan Melen [Wed, 26 Apr 2023 20:54:07 +0000 (14:54 -0600)] 
gh-60436: fix curses textbox backspace/del (#103783)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Michael Blahay <mblahay@gmail.com>
2 years agogh-48241: Clarify URL needs to be encoded when provided to urlopen and Request (...
Michael Blahay [Wed, 26 Apr 2023 20:52:23 +0000 (14:52 -0600)] 
gh-48241: Clarify URL needs to be encoded when provided to urlopen and Request (#103855)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years agoUpdate MAC_address wikipedia URL in comments (#29019)
180909 [Wed, 26 Apr 2023 20:27:03 +0000 (04:27 +0800)] 
Update MAC_address wikipedia URL in comments (#29019)

2 years agogh-103884: Docs CI: Only attempt nit-picky PR annotations for PRs (#103889)
Hugo van Kemenade [Wed, 26 Apr 2023 20:20:19 +0000 (23:20 +0300)] 
gh-103884: Docs CI: Only attempt nit-picky PR annotations for PRs (#103889)

2 years agogh-103489: Add get/set config methods to sqlite3.Connection (#103506)
Erlend E. Aasland [Wed, 26 Apr 2023 19:57:48 +0000 (21:57 +0200)] 
gh-103489: Add get/set config methods to sqlite3.Connection (#103506)

2 years agogh-103015: Add entrypoint keyword param to sqlite3.Connection.load_extension (#103073)
Erlend E. Aasland [Wed, 26 Apr 2023 19:22:03 +0000 (21:22 +0200)] 
gh-103015: Add entrypoint keyword param to sqlite3.Connection.load_extension (#103073)

2 years agogh-101879: docs - italicize argument in smtplib.SMPT() description (#101886)
Owain Davies [Wed, 26 Apr 2023 19:00:19 +0000 (02:00 +0700)] 
gh-101879: docs - italicize argument in smtplib.SMPT() description (#101886)

2 years agogh-91441: Clarify the docs of asyncio.loop.subprocess_exec() (#91442)
July Tikhonov [Wed, 26 Apr 2023 18:57:19 +0000 (21:57 +0300)] 
gh-91441: Clarify the docs of asyncio.loop.subprocess_exec() (#91442)

Clarify the docs of asyncio.loop.subprocess_exec()

Clarify the documentation of stdin, stdout and stderr arguments of
asyncio.loop.subprocess_exec().

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2 years agoGH-99944: Make dis display the value of oparg of KW_NAMES (#103856)
Juhi Chandalia [Wed, 26 Apr 2023 18:00:36 +0000 (12:00 -0600)] 
GH-99944: Make dis display the value of oparg of KW_NAMES (#103856)

Co-authored-by: chilaxan <chilaxan@gmail.com>
2 years agoAdd willingc to CODEOWNERS for asyncio (#103885)
Carol Willing [Wed, 26 Apr 2023 17:22:52 +0000 (11:22 -0600)] 
Add willingc to CODEOWNERS for asyncio (#103885)

2 years agoDocs build: Add upper bounds to transitive dependencies (#103860)
Alex Waygood [Wed, 26 Apr 2023 17:07:31 +0000 (11:07 -0600)] 
Docs build: Add upper bounds to transitive dependencies (#103860)

2 years agogh-103879: Fix refleak in super specialization (#103882)
Jelle Zijlstra [Wed, 26 Apr 2023 15:50:19 +0000 (08:50 -0700)] 
gh-103879: Fix refleak in super specialization (#103882)

2 years agogh-101786: Clarify docs that asyncio.Server.sockets is a socket-like TransportSocket...
Carol Willing [Wed, 26 Apr 2023 12:32:24 +0000 (06:32 -0600)] 
gh-101786: Clarify docs that asyncio.Server.sockets is a socket-like TransportSocket (#103877)

Clarify that asyncio.Server.sockets is a socket-like TransportSocket

2 years agogh-103875: Use ascii and latin1 singletons in deepfreeze (#103876)
Yichen Yan [Wed, 26 Apr 2023 11:45:58 +0000 (19:45 +0800)] 
gh-103875: Use ascii and latin1 singletons in deepfreeze (#103876)

2 years agogh-103872: Update bundled pip version to 23.1.2 (gh-103873)
Paul Moore [Wed, 26 Apr 2023 10:22:25 +0000 (11:22 +0100)] 
gh-103872: Update bundled pip version to 23.1.2 (gh-103873)

closes: #103872
xref: https://github.com/pypa/pip/pull/12000

<!-- gh-issue-number: gh-103872 -->
* Issue: gh-103872
<!-- /gh-issue-number -->

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years agogh-74940: Allow fallback to UTF-8 encoding on systems with no locales installed ...
Gordon Messmer [Wed, 26 Apr 2023 06:33:09 +0000 (23:33 -0700)] 
gh-74940: Allow fallback to UTF-8 encoding on systems with no locales installed (GH-14925)

This change removes the alias of the 'C' locale to 'en_US'. Because of
this alias, it is currently impossible for an application to use
setlocale() to specify a UTF-8 locale on a system that has no locales
installed, but which supports the C.UTF-8 locale/encoding.

2 years agogh-103578: Fix pdb reading code with non-utf8 encoding (#103581) 31302/head
Tian Gao [Wed, 26 Apr 2023 05:04:51 +0000 (22:04 -0700)] 
gh-103578: Fix pdb reading code with non-utf8 encoding (#103581)

`pdb` should use `io.open_code` to open code to avoid encoding issue.

2 years ago gh-99352: Ensure HTTPSConnection is available before exercising https tests. (...
Senthil Kumaran [Wed, 26 Apr 2023 01:02:27 +0000 (19:02 -0600)] 
  gh-99352: Ensure HTTPSConnection is available before exercising https tests. (#103828)

gh-99352: Ensure HTTPSConnection is available before exercising https
tests.

This will fix the buildbot issue mentioned in

https://github.com/python/cpython/pull/99353