Commit graph

114651 commits

Author SHA1 Message Date
Miss Islington (bot)
9dda9020ab
gh-99578: Fix refleak in _imp.create_builtin() (GH-99642)
Fix a reference bug in _imp.create_builtin() after the creation of
the first sub-interpreter for modules "builtins" and "sys".
(cherry picked from commit cb2ef8b2ac)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-11-21 03:43:23 -08:00
Miss Islington (bot)
bb4c091583
[3.11] GH-95815: Document less specific error for os.remove (GH-99571) (#99641)
GH-95815: Document less specific error for os.remove (GH-99571)

os.remove can raise PermissionError instead of IsADirectoryError,
when the object to be removed is a directory (in particular on
macOS).

This reverts a change done in GH-14262.
(cherry picked from commit 1cae31d26b)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-21 12:04:55 +01:00
Miss Islington (bot)
aa067868ec
[3.11] gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470) (#99638)
gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470)

Fix a number of compile errors with GCC-12 on macOS:

1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS
(cherry picked from commit cdde29dde9)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-21 11:22:10 +01:00
Miss Islington (bot)
f381644819
gh-99581: Fix a buffer overflow in the tokenizer when copying lines that fill the available buffer (GH-99605)
(cherry picked from commit e13d1d9dda)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-11-20 12:53:02 -08:00
Lysandros Nikolaou
152a437b8d
[3.11] gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215) (GH-99622)
gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215)

(cherry picked from commit 9c4232ae89)
2022-11-20 19:29:05 +01:00
Serhiy Storchaka
56a517e9e8
[3.11] gh-78453: Move Unicode C API tests from test_unicode to test_capi.test_unicode (GH-99431). (GH-99614)
(cherry picked from commit 06d4e02c3b)
2022-11-20 11:24:45 +02:00
Miss Islington (bot)
a15ab1ec65
Doc: Make functions.html readable again. (GH-99476)
(cherry picked from commit 858cb79486)

Co-authored-by: Julien Palard <julien@palard.fr>
2022-11-19 02:58:32 -08:00
Miss Islington (bot)
7e742379af
[3.11] gh-98086: Now `patch.dict` can decorate async functions (GH-98095) (#99365)
gh-98086: Now ``patch.dict`` can decorate async functions (GH-98095)
(cherry picked from commit 67b4d2772c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-19 10:10:42 +00:00
Miss Islington (bot)
369cb3e66a
Doc: Replace question mark with fullstop (GH-99558)
The sentence "Set the LC_CTYPE locale to the user preferred locale." should end with a period
instead of a question mark.
(cherry picked from commit 0e09d2cc59)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2022-11-18 11:34:10 -08:00
Miss Islington (bot)
d5e6f9b0ab
gh-99442: Fix handling in py.exe launcher when argv[0] does not include a file extension (GH-99542)
(cherry picked from commit a220c6d1ee)
2022-11-18 17:49:14 +00:00
Miss Islington (bot)
82ab9e6b79
gh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException (GH-99572)
(cherry picked from commit c8c6113398)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-11-18 08:10:55 -08:00
Miss Islington (bot)
bbac9a8bcc
gh-99443: descr_set_trampoline_call return type should be int not PyObject* (GH-99444)
(cherry picked from commit bc390dd935)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2022-11-16 15:50:50 -08:00
Miss Islington (bot)
0014ce7d0d
gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)
(cherry picked from commit 7c57857340)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-16 15:41:18 -08:00
Hood Chatham
a06fb519af
[3.11] GH-99460: Emscripten trampolines on optimized METH_O and METH_NOARGS code paths (gh-99461) (#99514)
Manual backport of GH-99461.
2022-11-16 08:09:34 -08:00
Miss Islington (bot)
0a208d5e24
gh-98940: Fix Mac/Extras.install.py File filter bug (GH-98943)
Slightly simplify the script and fix a case issue in the name of ``.DS_Store`` files.

(cherry picked from commit ea88d34de2)

Co-authored-by: zhangbo <zhangbo2012@outlook.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-16 01:45:31 -08:00
Miss Islington (bot)
f4cb8285ba
gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373)
(cherry picked from commit 4e4b13e8f6)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-15 13:10:27 -08:00
Miss Islington (bot)
e1e8a15abf
GH-98219: reduce sleep time in asyncio subprocess test (GH-99464)
(cherry picked from commit 619cadcda6)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-15 07:52:38 -08:00
Miss Islington (bot)
b189f429b2
gh-99370: fix test_zippath_from_non_installed_posix (GH-99483)
When build with shared enabled, we need to set `LD_LIBRARY_PATH`
for the non-installed python environment in
test_zippath_from_non_installed_posix so that the python binary
and find and link the libpython.so.
(cherry picked from commit 1df0752b4d)

Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
2022-11-14 17:27:42 -08:00
Miss Islington (bot)
90de4b76b9
[3.11] gh-99357: Close the event loop when it is no longer used in test_uncancel_structured_blocks (GH-99414) (#99424)
(cherry picked from commit 99972dc745)

Co-authored-by: Xiao Chen <chenxiao_7@163.com>
2022-11-14 10:52:10 -08:00
Miss Islington (bot)
5971a65d07
gh-99370: Calculate zip path from prefix when in a venv (GH-99371)
Before python3.11, when in a venv the zip path is calculated
from prefix on POSIX platforms. In python3.11 the behavior is
accidentally changed to calculating from default prefix. This
change will break venv created from a non-installed python
with a stdlib zip file. This commit restores the behavior back
to before python3.11.
(cherry picked from commit e3d4fed074)

Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
2022-11-14 07:31:46 -08:00
Miss Islington (bot)
3b8bcfc789
[Enum] update version TODO comment (GH-99458)
(cherry picked from commit db115682bd)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-11-13 21:18:13 -08:00
Gregory P. Smith
51c68cf466
[3.11] gh-98930: improve the docstring of signal.strsignal (GH-99290) (#99449)
Improves the docstring on signal.strsignal to make it explain when it returns a message, None, or when it raises ValueError.

Closes GH-98930

Co-authored-by: Gregory P. Smith <greg@krypto.org>.
(cherry picked from commit 88385b8564)

Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
2022-11-13 12:21:19 -08:00
Miss Islington (bot)
bf76d9bd4d
gh-99275: Fix SystemError in ctypes during __initsubclass__ (GH-99283)
(cherry picked from commit 343eb0f94b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-13 11:51:26 -08:00
Miss Islington (bot)
72d356e358
gh-99418: Make urllib.parse.urlparse enforce that a scheme must begin with an alphabetical ASCII character. (GH-99421)
Prevent urllib.parse.urlparse from accepting schemes that don't begin with an alphabetical ASCII character.

RFC 3986 defines a scheme like this: `scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )`
RFC 2234 defines an ALPHA like this: `ALPHA = %x41-5A / %x61-7A`

The WHATWG URL spec defines a scheme like this:
`"A URL-scheme string must be one ASCII alpha, followed by zero or more of ASCII alphanumeric, U+002B (+), U+002D (-), and U+002E (.)."`
(cherry picked from commit 439b9cfaf4)

Co-authored-by: Ben Kallus <49924171+kenballus@users.noreply.github.com>
2022-11-13 11:00:25 -08:00
Erlend E. Aasland
eac1a63cdb
[3.11] gh-98707: configure --with-system-libmpdec and --with-system-expat no longer include vendored headers (GH-98711) (#99391)
(cherry picked from commit 6abec1caff)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2022-11-13 19:47:31 +01:00
Miss Islington (bot)
edf744990e
gh-99392: Fix sqlite3 converter recipes (GH-99393)
(cherry picked from commit dfc1b17a23)

Co-authored-by: naglis <827324+naglis@users.noreply.github.com>
2022-11-12 11:48:52 -08:00
Miss Islington (bot)
944ac46b88
[3.11] gh-99304: [Enum] clarify what constitutes a flag alias (GH-99395) (GH-99415)
gh-99304: [Enum] clarify what constitutes a flag alias (GH-99395)
(cherry picked from commit 73a921b070)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-11-12 10:43:32 -08:00
Miss Islington (bot)
ecc164f350
bpo-34272: Reorganize C API tests. (GH-8551)
Move some C API tests into Lib/test/test_capi/.
(cherry picked from commit f883b7f8ee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-12 09:36:42 -08:00
Miss Islington (bot)
92b531b858
gh-80448: argparse: Fix IndexError on store_true action (GH-15656)
(cherry picked from commit e02cc6d42a)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-11 18:30:38 -08:00
Miss Islington (bot)
d75b2e2fc8
gh-87604: Clarify in docs that sys.addaudithook is not for sandboxes (GH-99372)
(cherry picked from commit c3c3871415)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-11 05:42:44 -08:00
Brandt Bucher
1119ee4f7e
[3.11] GH-99298: Don't perform jumps before error handling (GH-99343) 2022-11-11 11:30:21 +00:00
Miss Islington (bot)
b31b64570a
gh-84522: Add for-loop to apply-method-to-sequence FAQ (GH-94660)
(cherry picked from commit 97c493dd35)

Co-authored-by: Samuel Sloniker <sam@kj7rrv.com>
2022-11-10 20:26:31 -08:00
Miss Islington (bot)
edd92a11ab
gh-98366: use sphinx.locale._ as gettext() in pyspecific.py (GH-98437)
fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py

[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
(cherry picked from commit d26ee8a0a5)

Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
2022-11-10 17:30:50 -08:00
Miss Islington (bot)
17f1c0ab06
GH-99183: Document behavior of count() for empty substrings (GH-99339)
(cherry picked from commit 2f4af2d99c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2022-11-10 13:29:16 -08:00
Miss Islington (bot)
0dfbb769df
[3.11] gh-99277: remove older version of get_write_buffer_limits (GH-99280) (#99338)
(cherry picked from commit f1680c3fbf)

Co-authored-by: Carlo <34414634+csuriano23@users.noreply.github.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-10 09:01:14 -08:00
Miss Islington (bot)
c9f2177d13
gh-99204: Calculate base_executable by alternate names in POSIX venvs (GH-99206)
Check to see if `base_executable` exists. If it does not, attempt
to use known alternative names of the python binary to find an
executable in the path specified by `home`.

If no alternative is found, previous behavior is preserved.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>

(cherry picked from commit c41b13d39c)

Co-authored-by: Vincent Fazio <vfazio@gmail.com>
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
2022-11-10 08:53:51 -08:00
Miss Islington (bot)
f9a68be673
[3.11] GH-99257: Check the owner's type when specializing slots (GH-99324)
(cherry picked from commit 9d69284169)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-11-10 08:44:49 -08:00
Miss Islington (bot)
1de088ca95
gh-74044: inspect.signature for wrappers around decorated bound methods (GH-736)
(cherry picked from commit dbf2faf579)

Co-authored-by: Anton Ryzhov <anton@ryzhov.me>
2022-11-10 04:58:06 -08:00
Miss Islington (bot)
921f235367
gh-99320: remove tests for old-style class from test_complex (GH-99321)
(cherry picked from commit 26726c7649)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-10 03:22:00 -08:00
Miss Islington (bot)
7c9c993945
GH-99205: Mark new interpreters and threads as non-static (GH-99268)
(cherry picked from commit 283ab0e1c0)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-11-09 14:19:15 -08:00
Miss Islington (bot)
014940ac70
Update reference to the size of PyPI (GH-99076)
Update reference to the size of PyPI

Last changed in 2008 (528576031d).
(cherry picked from commit 58ee5d8677)

Co-authored-by: jmcb <joelsgp@protonmail.com>
2022-11-09 11:36:10 -08:00
Victor Stinner
1082890857
gh-98724: Fix Py_CLEAR() macro side effects (#99100) (#99288)
The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate
their argument once. If an argument has side effects, these side
effects are no longer duplicated.

Add test_py_clear() and test_py_setref() unit tests to _testcapi.

(cherry picked from commit c03e05c2e7)
2022-11-09 16:29:23 +01:00
Miss Islington (bot)
cf5dbb47a2
[Enum] Typo: fix DuplicateFreeEnum example docs (GH-99265)
(cherry picked from commit b3bd69c1bf)

Co-authored-by: Bruno Neyra <112962296+blv-brunoneyra@users.noreply.github.com>
2022-11-08 16:51:04 -08:00
Miss Islington (bot)
1565db7020
gh-94445: add compiler test for another case of excessive stack use (GH-99237)
(cherry picked from commit 027bc7e6bb)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2022-11-08 13:16:28 -08:00
Miss Islington (bot)
00147a84fc
gh-99238: clarify the type of the env dict. (GH-99253)
(cherry picked from commit 2eee9d9cd7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-11-08 13:09:04 -08:00
Miss Islington (bot)
4f31171e3f
gh-99248: [Enum] fix negative number infinite loop (GH-99256)
[Enum] fix negative number infinite loop

- _iter_bits_lsb() now raises a ValueError if a negative number
  is passed in

- verify() now skips checking negative numbers for named flags
(cherry picked from commit 0b4ffb08cc)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-11-08 12:33:21 -08:00
Miss Islington (bot)
ca944628ac
Fix broken link in asyncio-subprocesses doc (GH-99214)
GH- Fix broken link in Doc/library/asyncio-subprocess.rst

This is a trivial fix in documentation to fix a broken link.

There is a broken link in [Doc/library/asyncio-subprocess.rst](https://docs.python.org/3/library/asyncio-subprocess.htmlGH-asyncio.subprocess.Process) for the function ``wait_for``:

![image](https://user-images.githubusercontent.com/37690409/200388894-fb6b7c42-b2cc-49ec-a239-e3472890db1f.png)

I suppose this refers to the function ``asyncio.wait_for`` which is not clear in the docs.

This PR fixes the link and the result looks like the following:

![image](https://user-images.githubusercontent.com/37690409/200389483-b4a92105-7d2c-4285-b0fc-78a6dc0be39c.png)
(cherry picked from commit acf4d5d5bd)

Co-authored-by: Mikael Koli <koli.mikael@gmail.com>
Automerge-Triggered-By: GH:AlexWaygood
2022-11-08 08:33:51 -08:00
Miss Islington (bot)
47f4a18be0
gh-99181: fix except* on unhashable exceptions (GH-99192)
(cherry picked from commit c43714fbcd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-11-08 01:58:45 -08:00
Miss Islington (bot)
2d00190591
gh-92119: ctypes: Print exception class name instead of its representation (GH-98302)
(cherry picked from commit b9dedfe61d)

Co-authored-by: Kamil Turek <kamil.turek@hotmail.com>
2022-11-07 21:20:06 -08:00
Miss Islington (bot)
a6f6c3a3d6
[3.11] gh-98433: Fix quadratic time idna decoding. (GH-99092) (#99222)
There was an unnecessary quadratic loop in idna decoding. This restores
the behavior to linear.

(cherry picked from commit d315722564)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-11-07 18:57:10 -08:00