Commit Graph

113414 Commits

Author SHA1 Message Date
Miss Islington (bot) aa55985aa8
gh-87901: Remove the encoding argument from os.popen (GH-92836)
(cherry picked from commit 96f65835f8)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2022-05-18 20:12:47 -07:00
Miss Islington (bot) 849963598f
gh-92812: Align ArgumentParser.add_subparsers() docs with argument spec (GH-92814)
(cherry picked from commit f2d994da10)

Co-authored-by: 180909 <734461790@qq.com>
2022-05-18 14:25:25 -07:00
Miss Islington (bot) 65ebd923b3
gh-92780: Improve sqlite3.Connection.create_collation docs (GH-92790)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 7ee19e2715)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-05-18 04:58:57 -07:00
Miss Islington (bot) fad72d0e36
gh-91755: Document Py_IncRef and Py_DecRef as C functions (GH-91805)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 58a3d28039)

Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com>
2022-05-18 02:00:22 -07:00
Miss Islington (bot) 9a61afec20
bpo-40838: document `getdoc`, `getmodule`, `getsourcefile` in `inspect` returns `None` (GH-30575)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit b86d783a4e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-05-17 18:41:55 -07:00
Miss Islington (bot) 36da1a77c6
gh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842)
(cherry picked from commit 33880b4b1c)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-05-17 15:59:29 -07:00
Miss Islington (bot) 58088a544c
gh-89898: Fix test_threading.test_args_argument() (GH-92885)
Join the thread to not leak threads running in the background to the
next test.

Fix the following warning on the "AMD64 FreeBSD Shared 3.11"
buildbot:

test_args_argument (test.test_threading.ThreadTests.test_args_argument) ...
Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)
Warning -- Dangling thread: <_MainThread(MainThread, started 35026161664)>
Warning -- Dangling thread: <Thread(Thread-134 (<lambda>), started 35314998016)>
ok
(cherry picked from commit 970efae274)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-17 15:45:56 -07:00
Miss Islington (bot) 1df455042d
gh-89653: PEP 670: Fix PyUnicode_READ() cast (GH-92872)
_Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST()
instead.
(cherry picked from commit e6fd7992a9)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-17 10:45:55 -07:00
Miss Islington (bot) 38d95b5500
[3.11] gh-92530: Fix an issue that occurred after interrupting threading.Condition.notify (GH-92534) (GH-92829)
If Condition.notify() was interrupted just after it released the waiter lock,
but before removing it from the queue, the following calls of notify() failed
with RuntimeError: cannot release un-acquired lock.
(cherry picked from commit 70af994fee)


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

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-17 09:45:40 -07:00
Miss Islington (bot) 76b81be413
gh-81548: Clarify the deprecation of octal sequences affect byte strings (GH-92643)
Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 0d8500c739)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-05-17 09:44:23 -07:00
Miss Islington (bot) 5c826ef0a5
Fix NULL check in test_type_from_ephemeral_spec in_testcapimodule.c (GH-92863)
(cherry picked from commit 524f03c08c)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2022-05-17 08:47:50 -07:00
Miss Islington (bot) 386583040d
Fix NULL test in _testinternalcapi (GH-92861)
(cherry picked from commit 702e0da000)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2022-05-16 18:57:42 -07:00
Miss Islington (bot) da2f0c755d
re docs: fix source code link (GH-92819)
(cherry picked from commit bd30461298)

Co-authored-by: 谭九鼎 <109224573@qq.com>
2022-05-16 17:21:50 -07:00
Christian Heimes 8f937976bc
[3.11] gh-90473: Skip tests that don't apply to Emscripten and WASI (GH-92846) (GH-92851)
Co-authored-by: Christian Heimes <christian@python.org>
2022-05-16 20:15:56 +02:00
Miss Islington (bot) 52e6596fb5
gh-92671: Don't omit parentheses when unparsing empty tuples (GH-92673)
(cherry picked from commit f6fd8aac13)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-05-16 06:01:34 -07:00
Miss Islington (bot) 2ef6a986ee
Speedup: build docs in parallel (GH-92733)
(cherry picked from commit a487623c6b)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-05-16 05:17:20 -07:00
Victor Stinner a3d2ce95d1
gh-92781: Avoid mixing declarations and code in C API (#92783) (#92813)
Avoid mixing declarations and code in the C API to fix the compiler
warning: "ISO C90 forbids mixed declarations and code"
[-Werror=declaration-after-statement].

(cherry picked from commit 90e7230073)
2022-05-16 13:19:52 +02:00
Miss Islington (bot) 5f24acdca0
gh-90473: WASI: Mark tests that require os.pipe() (GH-92837)
(cherry picked from commit 730902c0ad)

Co-authored-by: Christian Heimes <christian@python.org>
2022-05-16 01:04:01 -07:00
Miss Islington (bot) fdfc7eb410
gh-87670: Add web.archive redirects from effbot (GH-92816)
(cherry picked from commit 3ed1cae9ed)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-05-15 23:26:31 -07:00
Ezio Melotti 5b2c5ae756
[3.11] Restore default role check in `make check`. (GH-92290) (#92821)
* Restore default role check in `make check`.

* Options first, then files.

* Update `make.bat` too.

* Add a comment explaining the extra options.

* No reason to ignore the README.rst.

* Enable default-role check in sphinx-lint.

Co-authored-by: Julien Palard <julien@palard.fr>

* Update sphinx-lint default-role check.

* Fix use of the default role in the docs.

* Update make.bat to check for the default role too.

* Fix comment in make.bat.

Co-authored-by: Julien Palard <julien@palard.fr>
(cherry picked from commit 953ab07952)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-05-15 17:55:12 +02:00
Miss Islington (bot) 2bcae11302
gh-90473: Fail subprocess early on Emscripten/WASI (GH-92802)
(cherry picked from commit db0b455ff4)

Co-authored-by: Christian Heimes <christian@python.org>
2022-05-14 11:47:17 -07:00
Miss Islington (bot) dae3e2fea3
Check result of utc_to_seconds and skip fold probe in pure Python (GH-91582)
The `utc_to_seconds` call can fail, here's a minimal reproducer on
Linux:

TZ=UTC python -c "from datetime import *; datetime.fromtimestamp(253402300799 + 1)"

The old behavior still raised an error in a similar way, but only
because subsequent calculations happened to fail as well. Better to fail
fast.

This also refactors the tests to split out the `fromtimestamp` and
`utcfromtimestamp` tests, and to get us closer to the actual desired
limits of the functions. As part of this, we also changed the way we
detect platforms where the same limits don't necessarily apply (e.g.
Windows).

As part of refactoring the tests to hit this condition explicitly (even
though the user-facing behvior doesn't change in any way we plan to
guarantee), I noticed that there was a difference in the places that
`datetime.utcfromtimestamp` fails in the C and pure Python versions, which
was fixed by skipping the "probe for fold" logic for UTC specifically —
since UTC doesn't have any folds or gaps, we were never going to find a
fold value anyway. This should prevent some failures in the pure python
`utcfromtimestamp` method on timestamps close to 0001-01-01.

There are two separate news entries for this because one is a
potentially user-facing change, the other is an internal code
correctness change that, if anything, changes some error messages. The
two happen to be coupled because of the test refactoring, but they are
probably best thought of as independent changes.

Fixes GH-91581
(cherry picked from commit 83c0247d47)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2022-05-14 07:59:52 -07:00
Miss Islington (bot) d9089c0e8b
GH-92804: Fix memory leak in memoryview iterator (gh-92805)
(cherry picked from commit d923fdf54b)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-05-14 07:55:03 -07:00
Miss Islington (bot) 9640676356
gh-92311: Add tests for frame_setlineno jumping over listcomps (GH-92741)
(cherry picked from commit 8cf2906828)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2022-05-13 23:19:00 -07:00
Miss Islington (bot) 9a97a89b3d
gh-92611: Link to PEP 594 sections & add key detail in doc deprecation notices (GH-92612)
(cherry picked from commit 9f68dab3d3)

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-05-13 13:09:53 -07:00
Miss Islington (bot) 60c4bca013
Fix typo in argparse docs. (GH-92691) (#92709) 2022-05-13 09:03:03 -05:00
Miss Islington (bot) 0c1795bd33
Document Py_ssize_t. (GH-92512)
It fixes 252 errors from a Sphinx nitpicky run (sphinx-build -n). But
there's 8182 errors left.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit 664aa94b57)

Co-authored-by: Julien Palard <julien@palard.fr>
2022-05-13 06:32:05 -07:00
Miss Islington (bot) 2e8b2d0ee2
GH-92236: Remove spurious "line" event when starting coroutine or generator. (GH-92722) (GH-92772)
(cherry picked from commit 22a1db378c)
2022-05-13 11:52:54 +01:00
Miss Islington (bot) c41667e71b
gh-90473: Increase stack size, disable obmalloc on WASI (GH-92732)
(cherry picked from commit d81d57e959)

Co-authored-by: Christian Heimes <christian@python.org>
2022-05-13 00:00:33 -07:00
Miss Islington (bot) 715b070dcc
gh-92436: __future__ docs: add note on expectations for "from __future__ import annotations" (GH-92568)
(cherry picked from commit 6582c96454)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-12 07:37:59 -07:00
Miss Islington (bot) 3d1ad42591
Update outdated `LOAD_METHOD` comments in `Python/ceval.c` (GH-92641)
(cherry picked from commit bdf9969197)

Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>
2022-05-12 05:59:36 -07:00
Miss Islington (bot) 6e1a214426
gh-89653: PEP 670: unicodeobject.h uses _Py_CAST() (GH-92696) (GH-92703)
Use _Py_CAST() and _Py_STATIC_CAST() in macros wrapping static inline
functions of unicodeobject.h.

Change also the kind type from unsigned int to int: same parameter
type than PyUnicode_FromKindAndData().

The limited API version 3.11 no longer casts arguments to expected
types.
(cherry picked from commit d0c9353a79)

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-12 02:01:35 +02:00
Miss Islington (bot) a1bef8c2e3
gh-89653: PEP 670: Use PyObject* type for parameters (GH-92694)
Use the PyObject* type for parameters of static inline functions:

* Py_SIZE(): same parameter type than PyObject_Size()
* PyList_GET_SIZE(), PyList_SET_ITEM(): same parameter type than
  PyList_Size() and PyList_SetItem()
* PyTuple_GET_SIZE(), PyTuple_SET_ITEM(): same parameter type than
  PyTuple_Size() and PyTuple_SetItem().
(cherry picked from commit 6de78ef96a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-11 16:23:29 -07:00
Miss Islington (bot) c7b9da5204
gh-92031, test_embed: Improve test for unquickening static code (GH-92440)
(cherry picked from commit 27185f98ff)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2022-05-11 16:22:45 -07:00
Miss Islington (bot) bf86901dc1
Fix minor documentation error in bisect docs (GH-92697)
(cherry picked from commit b3f99b69d0)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-05-11 16:13:13 -07:00
Miss Islington (bot) 6f9287205f
gh-89653: PEP 670: Limited API doesn't cast arguments (GH-92654)
The limited API version 3.11 no longer casts arguments to expected
types of functions of functions:

* PyList_GET_SIZE(), PyList_SET_ITEM()
* PyTuple_GET_SIZE(), PyTuple_SET_ITEM()
* PyWeakref_GET_OBJECT()
(cherry picked from commit 7d3b469e47)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-11 15:32:04 -07:00
Miss Islington (bot) 64593f2fed
gh-90978: asyncio TestSSL uses SHORT_TIMEOUT (GH-92642)
TestSSL of asyncio now uses support.SHORT_TIMEOUT rather than
hardcoded timeouts like 5, 10 or 40 seconds.
(cherry picked from commit 1d1929fcb5)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-11 14:56:07 -07:00
Miss Islington (bot) 5a33643dce
bpo-42627: Fix incorrect parsing of Windows registry proxy settings (GH-26307)
(cherry picked from commit b69297ea23)

Co-authored-by: 狂男风 <CrazyBoyFeng@Live.com>
2022-05-11 11:41:53 -07:00
Miss Islington (bot) a2c8180a9a
[3.11] gh-89336: Fix configparser.RawConfigParser.readfp typo (GH-92636) (GH-92662)
(cherry picked from commit 75e463430e)


Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-11 10:38:30 -07:00
Miss Islington (bot) 20fec2c265
[3.11] gh-91810: ElementTree: Use text file's encoding by default in XML declaration (GH-91903) (GH-92663)
ElementTree method write() and function tostring() now use the text file's
encoding ("UTF-8" if not available) instead of locale encoding in XML
declaration when encoding="unicode" is specified.
(cherry picked from commit 707839b0fe)


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

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-11 10:36:52 -07:00
Miss Islington (bot) 5ea8a93e1a
[3.11] Fix typo in unittest.rst: addCleanupModule -> addModuleCleanup (GH-92631) (GH-92659)
(cherry picked from commit 38486ca212)


Co-authored-by: Mikhail Terekhov <termim@gmail.com>

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-11 03:49:59 -07:00
Miss Islington (bot) a9b5bc3274
Update numbers.rst (GH-31995)
(cherry picked from commit dde8a1668e)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2022-05-11 00:36:24 -07:00
Miss Islington (bot) b162f0875d
gh-91966 Document where key functions are applied in the bisect module (GH-92602) (#92667) 2022-05-11 02:06:10 -05:00
Miss Islington (bot) 5135b6ed73
gh-92550: Fix pathlib.Path.rglob() for empty pattern (GH-92604)
(cherry picked from commit 87f849c775)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-10 22:13:11 -07:00
Miss Islington (bot) 951cfc8e54
Fix inconsistent return type for statistics median_grouped() gh-92531 (GH-92533) (#92656) 2022-05-10 23:45:17 -05:00
Serhiy Storchaka 5197134c1c
Revert "gh-92550 - Fix regression in `pathlib.Path.rglob()` (GH-92583)" (GH-92599)
This reverts commit a51baec9ce.
2022-05-11 07:14:40 +03:00
Miss Islington (bot) 6a17cdebe9
gh-92619: Fix bug where the compiler duplicates exit blocks unnecessarily (GH-92620) (GH-92621)
(cherry picked from commit 7c6b7ade8d)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-05-10 22:01:17 +01:00
Miss Islington (bot) 6546af31ee
gh-91731: Fix typo in pymacro.h (GH-92618)
* Fix typo in pymacro.h

* Update Include/pymacro.h

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 4e6da502f4)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-05-10 06:24:11 -07:00
Miss Islington (bot) 635b62a376
[3.11] gh-76773: Update docs mentioning no-longer-supported Windows versions & features (GH-92529) (GH-92608)
(cherry picked from commit f1bbcba74f)


Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-10 02:55:36 -07:00
Miss Islington (bot) 8a2b3edcdc
Add `__slots__` to `typing._NotIterable` (GH-92570)
(cherry picked from commit eef47d5bc7)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-10 02:45:17 -07:00