]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-105184: document that marshal functions can fail and need to be checked with PyErr...
Irit Katriel [Fri, 2 Jun 2023 07:59:18 +0000 (08:59 +0100)] 
gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (#105185)

2 years agogh-104799: Default missing lists in AST to the empty list (#104834)
Jelle Zijlstra [Fri, 2 Jun 2023 01:39:39 +0000 (18:39 -0700)] 
gh-104799: Default missing lists in AST to the empty list (#104834)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-85275: Remove old buffer APIs (#105137)
Inada Naoki [Fri, 2 Jun 2023 01:12:40 +0000 (10:12 +0900)] 
gh-85275: Remove old buffer APIs (#105137)

They are now abi-only.

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-92536: Remove PyUnicode_READY() calls (#105210)
Victor Stinner [Thu, 1 Jun 2023 23:33:17 +0000 (01:33 +0200)] 
gh-92536: Remove PyUnicode_READY() calls (#105210)

Since Python 3.12, PyUnicode_READY() does nothing and always
returns 0.

2 years agogh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)
Victor Stinner [Thu, 1 Jun 2023 23:31:58 +0000 (01:31 +0200)] 
gh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)

Since Python 3.12, PyUnicode_READY() does nothing and always
returns 0.

Argument Clinic now also checks for .cpp files (PC/_wmimodule.cpp).

2 years agogh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() (gh-105122)
Eric Snow [Thu, 1 Jun 2023 22:28:31 +0000 (16:28 -0600)] 
gh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() (gh-105122)

When I added the relevant condition to type_ready_set_bases() in gh-103912, I had missed that the function also sets tp_base and ob_type (if necessary).  That led to problems for third-party static types.

We fix that here, by making those extra operations distinct and by adjusting the condition to be more specific.

2 years agogh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the Current Thread...
Eric Snow [Thu, 1 Jun 2023 22:24:10 +0000 (16:24 -0600)] 
gh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the Current Thread (gh-105109)

This avoids the problematic race in drop_gil() by skipping the FORCE_SWITCHING code there for finalizing threads.

(The idea for this approach came out of discussions with @markshannon.)

2 years agoGH-89886: Bump to GNU Autoconf v2.71 (#104925)
Erlend E. Aasland [Thu, 1 Jun 2023 21:44:25 +0000 (23:44 +0200)] 
GH-89886: Bump to GNU Autoconf v2.71 (#104925)

Co-authored-by: Christian Heimes <christian@python.org>
2 years agogh-105140: remove unused arg of _PyErr_ChainStackItem (#105141)
Irit Katriel [Thu, 1 Jun 2023 20:57:28 +0000 (21:57 +0100)] 
gh-105140: remove unused arg of _PyErr_ChainStackItem (#105141)

2 years agogh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (#105174)
Gregory P. Smith [Thu, 1 Jun 2023 16:42:18 +0000 (09:42 -0700)] 
gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (#105174)

Upgrade builds to OpenSSL 1.1.1u.

This OpenSSL version addresses a pile if less-urgent CVEs since 1.1.1t.

The Mac/BuildScript/build-installer.py was already updated.

Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9, and adds a new _ssl_data_31.h file from 3.1.1 along with the ssl.c code to use it.

Manual edits to the _ssl_data_300.h file prevent it from removing any existing definitions in case those exist in some peoples builds and were important (avoiding regressions during backporting).

backports of this prior to 3.12 will not include the openssl 3.1 header.

2 years agogh-105191: Cleanup peg generator; keep only necessary files (#105197)
Lysandros Nikolaou [Thu, 1 Jun 2023 15:24:15 +0000 (17:24 +0200)] 
gh-105191: Cleanup peg generator; keep only necessary files (#105197)

2 years agogh-105145: Deprecate Py_GetPath() function (#105179)
Victor Stinner [Thu, 1 Jun 2023 12:06:32 +0000 (14:06 +0200)] 
gh-105145: Deprecate Py_GetPath() function (#105179)

Deprecate old Python initialization functions:

* PySys_ResetWarnOptions()
* Py_GetExecPrefix()
* Py_GetPath()
* Py_GetPrefix()
* Py_GetProgramFullPath()
* Py_GetProgramName()
* Py_GetPythonHome()

_tkinter.c uses sys.executable instead of Py_GetProgramName()
and uses sys.prefix instead of Py_GetPrefix().

2 years agogh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)
Victor Stinner [Thu, 1 Jun 2023 11:41:56 +0000 (13:41 +0200)] 
gh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)

Remove functions in the C API:

* PyEval_AcquireLock()
* PyEval_ReleaseLock()
* PyEval_InitThreads()
* PyEval_ThreadsInitialized()

But keep these functions in the stable ABI.

Mention "make regen-limited-abi" in "make regen-all".

2 years agogh-89886: Rely on HAVE_SYS_TIME_H (#105058)
Erlend E. Aasland [Thu, 1 Jun 2023 11:37:40 +0000 (13:37 +0200)] 
gh-89886: Rely on HAVE_SYS_TIME_H (#105058)

Quoting autoconf (v2.71):

    All current systems provide time.h; it need not be checked for.
    Not all systems provide sys/time.h, but those that do, all allow
    you to include it and time.h simultaneously.

2 years agoremove unused #includes of pycore_pymem.h (#105166)
Irit Katriel [Thu, 1 Jun 2023 11:12:53 +0000 (12:12 +0100)] 
remove unused #includes of pycore_pymem.h (#105166)

2 years agogh-103224: Use the realpath of the Python executable in `test_venv` (GH-103243)
Artem Mukhin [Thu, 1 Jun 2023 09:39:59 +0000 (11:39 +0200)] 
gh-103224: Use the realpath of the Python executable in `test_venv` (GH-103243)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2 years agogh-105107: Remove PyCFunction_Call() function (#105181)
Victor Stinner [Thu, 1 Jun 2023 09:25:55 +0000 (11:25 +0200)] 
gh-105107: Remove PyCFunction_Call() function (#105181)

* Keep the function in the stable ABI.
* Add unit tests on PyCFunction_Call() since it remains supported in
  the stable ABI.

2 years agogh-105156: Update Lib/test/clinic.test manually (#105180)
Victor Stinner [Thu, 1 Jun 2023 08:46:17 +0000 (10:46 +0200)] 
gh-105156: Update Lib/test/clinic.test manually (#105180)

Update Lib/test/clinic.test manually for updated Py_UNICODE
converter: it now uses wchar_t type rather than Py_UNICODE.

2 years agoFix docstring of `warnings._deprecated` to show correct `remove` value (#105178)
Nikita Sobolev [Thu, 1 Jun 2023 08:07:52 +0000 (11:07 +0300)] 
Fix docstring of `warnings._deprecated` to show correct `remove` value (#105178)

2 years agogh-105156: Cleanup usage of old Py_UNICODE type (#105158)
Victor Stinner [Thu, 1 Jun 2023 07:18:09 +0000 (09:18 +0200)] 
gh-105156: Cleanup usage of old Py_UNICODE type (#105158)

* refcounts.dat:

  * Remove Py_UNICODE functions.
  * Replace Py_UNICODE argument type with wchar_t.

* _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(),
  _PyUnicode_ToTitlecase() are no longer deprecated in comments.
  It's no longer needed since they now use Py_UCS4 type, rather than
  the deprecated Py_UNICODE type.
* gdb: Remove unused char_width() method.

2 years agogh-105145: Remove old functions to config Python init (#105154)
Victor Stinner [Thu, 1 Jun 2023 07:14:02 +0000 (09:14 +0200)] 
gh-105145: Remove old functions to config Python init (#105154)

Remove the following old functions to configure the Python
initialization, deprecated in Python 3.11:

* PySys_AddWarnOptionUnicode()
* PySys_AddWarnOption()
* PySys_AddXOption()
* PySys_HasWarnOptions()
* PySys_SetArgvEx()
* PySys_SetArgv()
* PySys_SetPath()
* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Most of these functions are kept in the stable ABI, except:

* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Update Doc/extending/embedding.rst and Doc/extending/extending.rst to
use the new PyConfig API.

_testembed.c:

* check_stdio_details() now sets stdio_encoding and stdio_errors
  of PyConfig.
* Add definitions of functions removed from the API but kept in the
  stable ABI.
* test_init_from_config() and test_init_read_set() now use
  PyConfig_SetString() instead of PyConfig_SetBytesString().

Remove _Py_ClearStandardStreamEncoding() internal function.

2 years agogh-105156: Deprecate the old Py_UNICODE type in C API (#105157)
Victor Stinner [Thu, 1 Jun 2023 06:56:35 +0000 (08:56 +0200)] 
gh-105156: Deprecate the old Py_UNICODE type in C API (#105157)

Deprecate the old Py_UNICODE and PY_UNICODE_TYPE types in the C API:
use wchar_t instead.

Replace Py_UNICODE with wchar_t in multiple C files.

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2 years agogh-105172: Fixed functools.lru_cache typed argument docstring. (GH-105173)
Bar Harel [Wed, 31 May 2023 22:56:06 +0000 (23:56 +0100)] 
gh-105172: Fixed functools.lru_cache typed argument docstring. (GH-105173)

2 years agogh-102251: Explicitly free state for test modules with state in test_import (#105085)
sunmy2019 [Wed, 31 May 2023 21:12:10 +0000 (05:12 +0800)] 
gh-102251: Explicitly free state for test modules with state in test_import (#105085)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agoClarify that error messages are better with PEP 701 (#105150)
Pablo Galindo Salgado [Wed, 31 May 2023 21:01:29 +0000 (22:01 +0100)] 
Clarify that error messages are better with PEP 701 (#105150)

Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
2 years agogh-103464: Add checks for arguments of pdb commands (GH-103465)
Tian Gao [Wed, 31 May 2023 20:51:46 +0000 (04:51 +0800)] 
gh-103464: Add checks for arguments of pdb commands (GH-103465)

2 years agogh-105146: Update links at end of Windows installer (uninstall/repair) (GH-105147)
Steve Dower [Wed, 31 May 2023 20:42:54 +0000 (21:42 +0100)] 
gh-105146: Update links at end of Windows installer (uninstall/repair) (GH-105147)

2 years agogh-105148: make _PyASTOptimizeState internal to ast_opt.c (#105149)
Irit Katriel [Wed, 31 May 2023 19:21:46 +0000 (20:21 +0100)] 
gh-105148: make _PyASTOptimizeState internal to ast_opt.c (#105149)

2 years agogh-105156: Argument Clinic avoids Py_UNICODE type (#105161)
Victor Stinner [Wed, 31 May 2023 17:52:33 +0000 (19:52 +0200)] 
gh-105156: Argument Clinic avoids Py_UNICODE type (#105161)

Argument Clinic now uses "const wchar_t*" type instead of
"const Py_UNICODE*" type for the "Py_UNICODE" format.

2 years agogh-105144: Runtime-checkable protocols: move all 'sanity checks' to `_ProtocolMeta...
Alex Waygood [Wed, 31 May 2023 17:02:25 +0000 (18:02 +0100)] 
gh-105144: Runtime-checkable protocols: move all 'sanity checks' to `_ProtocolMeta.__subclasscheck__` (#105152)

2 years agogh-104909: Split BINARY_OP into micro-ops (#104910)
Guido van Rossum [Wed, 31 May 2023 15:09:23 +0000 (08:09 -0700)] 
gh-104909: Split BINARY_OP into micro-ops (#104910)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2 years agogh-105111: remove deprecated macros Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END...
Irit Katriel [Wed, 31 May 2023 14:44:11 +0000 (15:44 +0100)] 
gh-105111: remove deprecated macros Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END (#105112)

2 years agogh-104773: cgi: Fix typo in What's New in Python 3.13 (#105139)
Victor Stinner [Wed, 31 May 2023 12:54:07 +0000 (14:54 +0200)] 
gh-104773: cgi: Fix typo in What's New in Python 3.13 (#105139)

2 years agogh-105096: Deprecate wave getmarkers() method (#105098)
Victor Stinner [Wed, 31 May 2023 12:09:41 +0000 (14:09 +0200)] 
gh-105096: Deprecate wave getmarkers() method (#105098)

wave: Deprecate the getmark(), setmark() and getmarkers() methods of
the Wave_read and Wave_write classes. They will be removed in Python
3.15.

2 years agogh-62948: IOBase finalizer logs close() errors (#105104)
Victor Stinner [Wed, 31 May 2023 11:41:19 +0000 (13:41 +0200)] 
gh-62948: IOBase finalizer logs close() errors (#105104)

2 years agogh-105096: Reformat wave documentation (#105136)
Victor Stinner [Wed, 31 May 2023 11:29:10 +0000 (13:29 +0200)] 
gh-105096: Reformat wave documentation (#105136)

Add ".. class::" markups in the wave documentation.

* Reformat also wave.py (minor PEP 8 changes).
* Remove redundant "import struct": it's already imported at top
  level.
* Remove wave.rst from .nitignore

2 years agogh-105107: Remove PyEval_CallFunction() function (#105108)
Victor Stinner [Wed, 31 May 2023 11:17:06 +0000 (13:17 +0200)] 
gh-105107: Remove PyEval_CallFunction() function (#105108)

Remove 4 functions from the C API, deprecated in Python 3.9:

* PyEval_CallObjectWithKeywords()
* PyEval_CallObject()
* PyEval_CallFunction()
* PyEval_CallMethod()

Keep 3 functions in the stable ABI:

* PyEval_CallObjectWithKeywords()
* PyEval_CallFunction()
* PyEval_CallMethod()

2 years agogh-104922: Make `PY_SSIZE_T_CLEAN` not mandatory again (#105051)
Inada Naoki [Wed, 31 May 2023 09:38:55 +0000 (18:38 +0900)] 
gh-104922: Make `PY_SSIZE_T_CLEAN` not mandatory again (#105051)

2 years agogh-103142: Update macOS installer to use OpenSSL 1.1.1u. (GH-105130)
Ned Deily [Wed, 31 May 2023 05:44:10 +0000 (01:44 -0400)] 
gh-103142: Update macOS installer to use OpenSSL 1.1.1u. (GH-105130)

2 years agogh-97933: add LOAD_FAST_AND_CLEAR to 3.12 What's New bytecode section (#105126)
Carl Meyer [Wed, 31 May 2023 02:19:25 +0000 (20:19 -0600)] 
gh-97933: add LOAD_FAST_AND_CLEAR to 3.12 What's New bytecode section (#105126)

2 years agogh-87729: add LOAD_SUPER_ATTR to 3.12 What's New (#105125)
Carl Meyer [Wed, 31 May 2023 02:19:04 +0000 (20:19 -0600)] 
gh-87729: add LOAD_SUPER_ATTR to 3.12 What's New (#105125)

2 years agogh-105020: Share tp_bases and tp_mro Between Interpreters For All Static Builtin...
Eric Snow [Wed, 31 May 2023 00:13:35 +0000 (18:13 -0600)] 
gh-105020: Share tp_bases and tp_mro Between Interpreters For All Static Builtin Types (gh-105115)

In gh-103912 we added tp_bases and tp_mro to each PyInterpreterState.types.builtins entry.  However, doing so ignored the fact that both PyTypeObject fields are public API, and not documented as internal (as opposed to tp_subclasses).  We address that here by reverting back to shared objects, making them immortal in the process.

2 years agogh-102304: Fix 2 New Stable ABI Functions (gh-104762)
Eric Snow [Tue, 30 May 2023 22:40:07 +0000 (16:40 -0600)] 
gh-102304: Fix 2 New Stable ABI Functions (gh-104762)

2 years agogh-105042: Disable unmatched parens syntax error in python tokenize (#105061)
Lysandros Nikolaou [Tue, 30 May 2023 21:52:52 +0000 (23:52 +0200)] 
gh-105042: Disable unmatched parens syntax error in python tokenize (#105061)

2 years agogh-105069: Add a readline-like callable to the tokenizer to consume input iteratively...
Pablo Galindo Salgado [Tue, 30 May 2023 21:43:34 +0000 (22:43 +0100)] 
gh-105069: Add a readline-like callable to the tokenizer to consume input iteratively (#105070)

2 years agogh-89886: Properly quote Autoconf macro arguments (#105062)
Erlend E. Aasland [Tue, 30 May 2023 21:13:08 +0000 (23:13 +0200)] 
gh-89886: Properly quote Autoconf macro arguments (#105062)

Autoconf 2.70 macros are picky about argument quotation.

2 years agogh-105035: fix super() calls on unusual types (e.g. meta-types) (#105094)
Carl Meyer [Tue, 30 May 2023 20:36:24 +0000 (14:36 -0600)] 
gh-105035: fix super() calls on unusual types (e.g. meta-types) (#105094)

2 years agoGH-73435: Implement recursive wildcards in `pathlib.PurePath.match()` (#101398)
Barney Gale [Tue, 30 May 2023 20:18:09 +0000 (21:18 +0100)] 
GH-73435: Implement recursive wildcards in `pathlib.PurePath.match()` (#101398)

`PurePath.match()` now handles the `**` wildcard as in `Path.glob()`, i.e. it matches any number of path segments.

We now compile a `re.Pattern` object for the entire pattern. This is made more difficult by `fnmatch` not treating directory separators as special when evaluating wildcards (`*`, `?`, etc), and so we arrange the path parts onto separate *lines* in a string, and ensure we don't set `re.DOTALL`.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoCI: Temporarily skip paths with spaces to avoid error (#105110)
Hugo van Kemenade [Tue, 30 May 2023 20:01:58 +0000 (23:01 +0300)] 
CI: Temporarily skip paths with spaces to avoid error (#105110)

* CI: Temporarily skip paths with spaces to avoid "Error: One of your files includes a space"

* Dummy NEWS file to test the action. Will be deleted before merge.

* Revert "Dummy NEWS file to test the action. Will be deleted before merge."

This reverts commit 05cd028fd4c56e3173b134b10dc947c3af471d82.

2 years agogh-105071: add missing versionadded directive (#105097)
Irit Katriel [Tue, 30 May 2023 17:03:20 +0000 (18:03 +0100)] 
gh-105071: add missing versionadded directive (#105097)

2 years agogh-80064: Fix is_valid_wide_char() return type (#105099)
Victor Stinner [Tue, 30 May 2023 16:36:20 +0000 (18:36 +0200)] 
gh-80064: Fix is_valid_wide_char() return type (#105099)

Return a classical int, rather than size_t. The size_t type was
kept from copied/pasted code related to mbstowcs().

2 years agoSmall speedup for dataclass __eq__ and __repr__ (#104904)
Raymond Hettinger [Tue, 30 May 2023 16:35:30 +0000 (11:35 -0500)] 
Small speedup for dataclass __eq__ and __repr__ (#104904)

Faster __repr__ with str.__add__ moved inside the f-string. For __eq__ comp;are field by field instead of building temporary tuples.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agogh-103921: Minor PEP-695 fixes to the `ast` module docs (#105093)
Alex Waygood [Tue, 30 May 2023 16:19:10 +0000 (17:19 +0100)] 
gh-103921: Minor PEP-695 fixes to the `ast` module docs (#105093)

2 years agogh-105091: stable_abi.py: Remove "Unixy" check from --all on other platforms (GH...
Petr Viktorin [Tue, 30 May 2023 15:45:56 +0000 (17:45 +0200)] 
gh-105091: stable_abi.py: Remove "Unixy" check from --all on other platforms (GH-105092)

2 years agogh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in...
Irit Katriel [Tue, 30 May 2023 14:03:36 +0000 (15:03 +0100)] 
gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in the unstable API (#105072)

2 years agogh-105084: Tests: Use setuptools+wheel from sysconfig.get_config_var('WHEEL_PKG_DIR...
Miro Hrončok [Tue, 30 May 2023 10:20:30 +0000 (12:20 +0200)] 
gh-105084: Tests: Use setuptools+wheel from sysconfig.get_config_var('WHEEL_PKG_DIR') if set (#105056)

2 years agogh-88745: Add _winapi.CopyFile2 and update shutil.copy2 to use it (GH-105055)
Steve Dower [Tue, 30 May 2023 10:00:29 +0000 (11:00 +0100)] 
gh-88745: Add _winapi.CopyFile2 and update shutil.copy2 to use it (GH-105055)

2 years agogh-102251: Fix reference leak in _testsinglephase initialization (#105082)
sunmy2019 [Tue, 30 May 2023 09:27:55 +0000 (17:27 +0800)] 
gh-102251: Fix reference leak in _testsinglephase initialization (#105082)

Correctly decref 'initialized' in init_module()

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-83403: Test `parent` param in `Mock.__init__` (#103630)
Nikita Sobolev [Tue, 30 May 2023 07:36:22 +0000 (10:36 +0300)] 
gh-83403: Test `parent` param in `Mock.__init__` (#103630)

2 years agogh-105077: Fix test_tkinter refleak checking (GH-105078)
Zachary Ware [Tue, 30 May 2023 03:53:55 +0000 (22:53 -0500)] 
gh-105077: Fix test_tkinter refleak checking (GH-105078)

Use specific symbols from `test.support` to avoid having `support`
overwritten by `test_tkinter`'s own `support` submodule.

2 years agoGH-104898: Revert pathlib os.PathLike registration change. (GH-105073)
Barney Gale [Mon, 29 May 2023 21:44:51 +0000 (22:44 +0100)] 
GH-104898: Revert pathlib os.PathLike registration change. (GH-105073)

Subclassing `os.PathLike` rather than using `register()` makes
initialisation slower, due to the additional `__isinstance__` work.

This partially reverts commit bd1b6228d132b8e9836fe352cd8dca2b6c1bd98c.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoGH-89455: Add missing attributes (added in 3.11) to traceback module docs (#105044)
Jakub Kuczys [Mon, 29 May 2023 18:28:37 +0000 (20:28 +0200)] 
GH-89455: Add missing attributes (added in 3.11) to traceback module docs (#105044)

2 years agogh-103646: Remove --include-pip-user from default APPX package build (GH-105064)
Steve Dower [Mon, 29 May 2023 16:58:23 +0000 (17:58 +0100)] 
gh-103646: Remove --include-pip-user from default APPX package build (GH-105064)

2 years agoGH-77609: Add follow_symlinks argument to `pathlib.Path.glob()` (GH-102616)
Barney Gale [Mon, 29 May 2023 15:59:52 +0000 (16:59 +0100)] 
GH-77609: Add follow_symlinks argument to `pathlib.Path.glob()` (GH-102616)

Add a keyword-only *follow_symlinks* parameter to `pathlib.Path.glob()` and`rglob()`.

When *follow_symlinks* is `None` (the default), these methods follow symlinks except when evaluating "`**`" wildcards. When set to true or false, symlinks are always or never followed, respectively.

2 years agogh-97908: CAPI docs: Remove repeated struct names from member docs (GH-100054)
Petr Viktorin [Mon, 29 May 2023 11:54:14 +0000 (13:54 +0200)] 
gh-97908: CAPI docs: Remove repeated struct names from member docs (GH-100054)

And add raw HTML fragments to keep old links working.

2 years agogh-104803: Implement ntpath.isdevdrive for checking whether a path is on a Windows...
Steve Dower [Mon, 29 May 2023 09:05:32 +0000 (10:05 +0100)] 
gh-104803: Implement ntpath.isdevdrive for checking whether a path is on a Windows Dev Drive (GH-104805)

2 years agoFix compiler warning in unicodeobject.c (#105050)
Inada Naoki [Mon, 29 May 2023 08:31:03 +0000 (17:31 +0900)] 
Fix compiler warning in unicodeobject.c (#105050)

2 years agoDocument PEP 698 and other new typing features in What's New (#104957)
Jelle Zijlstra [Sun, 28 May 2023 19:13:19 +0000 (12:13 -0700)] 
Document PEP 698 and other new typing features in What's New (#104957)

2 years agoConvert `doc.yml` workflow to be reusable (#103914)
Sviatoslav Sydorenko [Sun, 28 May 2023 15:21:29 +0000 (17:21 +0200)] 
Convert `doc.yml` workflow to be reusable (#103914)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-105017: Include CRLF lines in strings and column numbers (#105030)
Marta Gómez Macías [Sun, 28 May 2023 14:15:53 +0000 (15:15 +0100)] 
gh-105017: Include CRLF lines in strings and column numbers (#105030)

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2 years agogh-104992: [What's New in 3.12] Document unittest.TestProgram.usageExit's deprecation...
Hugo van Kemenade [Sun, 28 May 2023 08:06:31 +0000 (11:06 +0300)] 
gh-104992: [What's New in 3.12] Document unittest.TestProgram.usageExit's deprecation (#104995)

2 years agogh-105013: Fix inspect.getsource with parenthesized multiline lambdas (#105021)
Pablo Galindo Salgado [Sat, 27 May 2023 23:20:42 +0000 (00:20 +0100)] 
gh-105013: Fix inspect.getsource with parenthesized multiline lambdas (#105021)

2 years agogh-104992: Remove deprecated unittest.TestProgram.usageExit (#104993)
Hugo van Kemenade [Sat, 27 May 2023 21:34:14 +0000 (00:34 +0300)] 
gh-104992: Remove deprecated unittest.TestProgram.usageExit (#104993)

2 years agogh-104497: Make tkinter test pass with tk 8.7 (#104789)
Terry Jan Reedy [Sat, 27 May 2023 19:23:56 +0000 (15:23 -0400)] 
gh-104497: Make tkinter test pass with tk 8.7 (#104789)

* gh-104497: Make tkinter test pass with tk 8.7

For test_widgets.MenuTest.test_configure_type, the options
in the error message change to alphabetical order.

* Update Lib/test/test_tkinter/test_widgets.py

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-75552: Remove deprecated tkinter.tix module (GH-104902)
Zachary Ware [Sat, 27 May 2023 17:34:19 +0000 (12:34 -0500)] 
gh-75552: Remove deprecated tkinter.tix module (GH-104902)

2 years agogh-105017: Fix including additional NL token when using CRLF (#105022)
Marta Gómez Macías [Sat, 27 May 2023 16:50:43 +0000 (17:50 +0100)] 
gh-105017: Fix including additional NL token when using CRLF (#105022)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2 years agoFix indentation in Parser/tokenizer.c (#105012)
Petr Vaněk [Sat, 27 May 2023 11:41:50 +0000 (13:41 +0200)] 
Fix indentation in Parser/tokenizer.c (#105012)

2 years agoCI: Precompute hash for config cache key in check_source job (#105008)
Itamar Ostricher [Sat, 27 May 2023 09:43:50 +0000 (02:43 -0700)] 
CI: Precompute hash for config cache key in check_source job (#105008)

2 years agogh-104992: [What's New in 3.11] Document unittest.TestProgram.usageExit's deprecation...
Hugo van Kemenade [Sat, 27 May 2023 02:09:47 +0000 (05:09 +0300)] 
gh-104992: [What's New in 3.11] Document unittest.TestProgram.usageExit's deprecation (#104994)

Document unittest.TestProgram.usageExit's pending removal in 3.13

2 years agogh-104839: Prevent test_venv AddressSanitizer spam (#105005)
Gregory P. Smith [Sat, 27 May 2023 01:15:13 +0000 (18:15 -0700)] 
gh-104839: Prevent test_venv AddressSanitizer spam (#105005)

Pass any ASAN_OPTIONS environment variable through to the child process
so that leak sanitizer being disabled on our CI and buildbots stays
true in the children.

2 years agogh-104976: Ensure trailing dedent tokens are emitted as the previous tokenizer (...
Pablo Galindo Salgado [Fri, 26 May 2023 21:02:26 +0000 (22:02 +0100)] 
gh-104976: Ensure trailing dedent tokens are emitted as the previous tokenizer (#104980)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2 years agoGH-101588: Deprecate pickle/copy/deepcopy support in itertools (GH-104965)
Raymond Hettinger [Fri, 26 May 2023 20:32:53 +0000 (15:32 -0500)] 
GH-101588: Deprecate pickle/copy/deepcopy support in itertools (GH-104965)

2 years agoGH-103631: Fix `PurePosixPath(PureWindowsPath(...))` separator handling (GH-104949)
Barney Gale [Fri, 26 May 2023 18:05:43 +0000 (19:05 +0100)] 
GH-103631: Fix `PurePosixPath(PureWindowsPath(...))` separator handling (GH-104949)

For backwards compatibility, accept backslashes as path separators in
`PurePosixPath` if an instance of `PureWindowsPath` is supplied.
This restores behaviour from Python 3.11.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agoGH-104947: Make pathlib.PureWindowsPath comparisons consistent across platforms ...
Barney Gale [Fri, 26 May 2023 18:04:02 +0000 (19:04 +0100)] 
GH-104947: Make pathlib.PureWindowsPath comparisons consistent across platforms (GH-104948)

Use `str.lower()` rather than `ntpath.normcase()` to normalize case of
Windows paths. This restores behaviour from Python 3.11.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-103921: Document PEP 695 (#104642)
Jelle Zijlstra [Fri, 26 May 2023 17:48:17 +0000 (10:48 -0700)] 
gh-103921: Document PEP 695 (#104642)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-104983: Fix test_peg_generator (#104985)
Lysandros Nikolaou [Fri, 26 May 2023 17:06:45 +0000 (19:06 +0200)] 
gh-104983: Fix test_peg_generator (#104985)

2 years agogh-104984: remove kwargs and starargs from Call & ClassDef (#104986)
Shaygan Hooshyari [Fri, 26 May 2023 16:43:58 +0000 (18:43 +0200)] 
gh-104984: remove kwargs and starargs from Call & ClassDef (#104986)

These fields are removed in https://github.com/python/cpython/commit/025e9ebd0a0a19f50ca83af6ada0ac65be1fa2a1

2 years agogh-104972: Ensure that line attributes in tokens in the tokenize module are correct...
Pablo Galindo Salgado [Fri, 26 May 2023 14:46:22 +0000 (15:46 +0100)] 
gh-104972: Ensure that line attributes in tokens in the tokenize module are correct (#104975)

2 years agoRemove raw asserts in test_typing.py (#104951)
Jelle Zijlstra [Fri, 26 May 2023 14:03:02 +0000 (07:03 -0700)] 
Remove raw asserts in test_typing.py (#104951)

2 years agogh-104804: Remove webbrowser.MacOSX class, deprecated in Python 3.11 (#104816)
Hugo van Kemenade [Fri, 26 May 2023 13:54:15 +0000 (16:54 +0300)] 
gh-104804: Remove webbrowser.MacOSX class, deprecated in Python 3.11 (#104816)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-100238: Use setuptools in peg-generator and reenable tests (#104798)
Lysandros Nikolaou [Fri, 26 May 2023 13:32:03 +0000 (15:32 +0200)] 
gh-100238: Use setuptools in peg-generator and reenable tests (#104798)

2 years agogh-104773: PEP 594: Remove the imghdr module (#104777)
Victor Stinner [Fri, 26 May 2023 13:29:45 +0000 (15:29 +0200)] 
gh-104773: PEP 594: Remove the imghdr module (#104777)

* Remove the Lib/test/imghdrdata/ directory.
* Copy 5 pictures (gif, png, ppm, pgm, xbm) from removed
  Lib/test/imghdrdata/ to a new Lib/test/tkinterdata/ directory.
* Update Sphinx from 4.5 to 6.2 in Doc/requirements.txt.

2 years agogh-104799: Move location of type_params AST fields (#104828)
Jelle Zijlstra [Fri, 26 May 2023 12:54:37 +0000 (05:54 -0700)] 
gh-104799: Move location of type_params AST fields (#104828)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-104955: Fix __release_buffer__ signature (#104956)
Jelle Zijlstra [Fri, 26 May 2023 12:44:23 +0000 (05:44 -0700)] 
gh-104955: Fix __release_buffer__ signature (#104956)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-104924: Fix `read()able` in `http.client` log messages (gh-104926)
Oleg Iarygin [Fri, 26 May 2023 11:39:51 +0000 (15:39 +0400)] 
gh-104924: Fix `read()able` in `http.client` log messages (gh-104926)

2 years agoGH-89091: raise `RuntimeWarning` for unawaited async generator methods (#104611)
Kumar Aditya [Fri, 26 May 2023 11:23:29 +0000 (16:53 +0530)] 
GH-89091: raise `RuntimeWarning` for unawaited async generator methods (#104611)

2 years agogh-104943: Remove mentions of old Python versions (#104945)
Tomas R [Fri, 26 May 2023 06:34:17 +0000 (08:34 +0200)] 
gh-104943: Remove mentions of old Python versions (#104945)

2 years agogh-104479: Update outdated tutorial floating-point reference (#104681)
Mark Dickinson [Fri, 26 May 2023 06:26:16 +0000 (07:26 +0100)] 
gh-104479: Update outdated tutorial floating-point reference (#104681)

2 years agogh-104886: Remove deprecated configparser.LegacyInterpolation (#104887)
Hugo van Kemenade [Fri, 26 May 2023 06:06:32 +0000 (09:06 +0300)] 
gh-104886: Remove deprecated configparser.LegacyInterpolation (#104887)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-102024: Reduced _idle_semaphore.release calls (#102025)
Andrii Kuzmin [Fri, 26 May 2023 05:48:40 +0000 (08:48 +0300)] 
gh-102024: Reduced _idle_semaphore.release calls (#102025)

Reduced _idle_semaphore.release calls in concurrent.futures.thread._worker
_idle_semaphore.release() is now only called if only work_queue is empty.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>