Commit graph

12884 commits

Author SHA1 Message Date
Max Bachmann
b28f919007
[3.11] gh-102281: Fix potential nullptr dereference + use of uninitia… (#103040)
[3.11] gh-102281: Fix potential nullptr dereference + use of uninitialized memory (gh-102282)
(cherry picked from commit afa6092ee4)
2023-03-25 16:35:00 -07:00
Miss Islington (bot)
67161396de
[3.11] gh-102027: Fix macro name (GH-102124) (#102916)
gh-102027: Fix macro name (GH-102124)

This fixes the ssse3 / sse2 detection when sse4 is available.

(cherry picked from commit ea93bde4ec)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-03-24 13:40:22 +01:00
Miss Islington (bot)
e075631f67
[3.11] gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (GH-96932) (#102918)
gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (GH-96932)
(cherry picked from commit af9c34f6ef)

Co-authored-by: Benjamin Fogle <benfogle@gmail.com>
2023-03-24 13:33:24 +01:00
Miss Islington (bot)
fd43fb6996
GH-100989: remove annotation from docstring (GH-102991)
(cherry picked from commit d49409196e)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-03-23 23:04:06 -07:00
Miss Islington (bot)
a4a039c546
GH-100989: Revert Improve the accuracy of collections.deque docstrings (GH-102979)
(cherry picked from commit 7f01a11199)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-03-23 18:17:43 -07:00
Miss Islington (bot)
f7dea0cb32
gh-100989: Improve the accuracy of collections.deque docstrings (GH-100990)
(cherry picked from commit c74073657e)

Co-authored-by: Timo Ludwig <ti.ludwig@web.de>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-22 05:25:03 -07:00
Irit Katriel
fcafc37411
[3.11] gh-102493: backport unit test for PyErr_SetObject (#102602)
gh-102493: backport unit test for PyErr_SetObject
2023-03-11 15:01:01 +00:00
Miss Islington (bot)
7905ae7b1a
GH-102397: Fix segfault from race condition in signal handling (GH-102399)
(cherry picked from commit 1a84cc007e)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-03-08 00:26:20 -08:00
Miss Islington (bot)
cc6ce90206
gh-102179: Fix os.dup2 error reporting for negative fds (GH-102180)
(cherry picked from commit c2bd55d26f)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2023-03-04 06:55:02 -08:00
Mark Dickinson
eb5565918a
[3.11] Add missing 'is' to cmath.log() docstring (GH-102049) (#102279)
Fix missing 'is' in cmath.log() docstring.
(cherry picked from commit 71f614ef2a)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2023-02-26 14:55:44 +00:00
Nikita Sobolev
d0ff3d996f
[3.11] gh-101656: Fix "conversion from Py_ssize_t to int" warning in _testcapimodule (#101680)
(cherry picked from commit acc2f3b19d)
2023-02-08 11:02:07 +01:00
Łukasz Langa
955ba2839b
[3.11] gh-101072: support default and kw default in PyEval_EvalCodeEx for 3.11+ (GH-101127) (#101636)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Matthieu Dartiailh <m.dartiailh@gmail.com>
2023-02-07 13:36:35 +00:00
Miss Islington (bot)
d003bcc91a
gh-101543: Ensure Windows registry path is only used when stdlib can't be found (GH-101544)
(cherry picked from commit 7a253103d4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2023-02-06 09:34:05 -08:00
Miss Islington (bot)
9bd000c7b8
gh-101372: Fix unicodedata.is_normalized to properly handle the UCD 3… (gh-101388)
(cherry picked from commit 9ef7e75434)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2023-02-06 02:32:30 -08:00
Gregory P. Smith
fa7c37af49
[3.11] gh-99952: fix refcount issues in ctypes.Structure from_param() result (#101339)
[3.11] gh-99952: [ctypes] fix refcount issues in from_param() result. (GH-100169)

Fixes a reference counting issue with `ctypes.Structure` when a `from_param()` method call is used and the structure size is larger than a C pointer `sizeof(void*)`.

This problem existed for a very long time, but became more apparent in 3.8+ by change likely due to garbage collection cleanup timing changes..
(cherry picked from commit dfad678d70)

Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
2023-01-26 01:02:37 -08:00
Shantanu
cd0fe5ba09
[3.11] gh-101326: Fix regression when passing None to FutureIter.throw (GH-101327) (#101328)
(cherry picked from commit a178ba82bf)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-01-25 13:01:13 -08:00
Miss Islington (bot)
5964b12829
gh-100795: Don't call freeaddrinfo on failure. (GH-101252)
When getaddrinfo returns an error, the output pointer is in an unknown state
Don't call freeaddrinfo on it.  See the issue for discussion and details with
links to reasoning.  _Most_ libc getaddrinfo implementations never modify the
output pointer unless they are returning success.

(cherry picked from commit b724ac2fe7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Sergey G. Brester <github@sebres.de>
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2023-01-23 15:30:19 -08:00
Miss Islington (bot)
3ef9f6b508
gh-82052: Don't send partial UTF-8 sequences to the Windows API (GH-101103)
Don't send partial UTF-8 sequences to the Windows API
(cherry picked from commit f34176b77f)

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2023-01-17 11:52:50 -08:00
Steve Dower
87ade7ebda
gh-100320: Fix path calculations on Windows when python.exe is moved outside of the normal location (GH-100947) 2023-01-16 17:00:34 +00:00
Kumar Aditya
e707671684
[3.11] GH-100892: Fix race in clearing threading.local (GH-100922). (#100937)
(cherry picked from commit 762745a124)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-01-11 21:01:48 +05:30
Miss Islington (bot)
2d1128e9eb
GH-81061: Fix refcount issue when returning None from a ctypes.py_object callback (GH-13364)
(cherry picked from commit 837ba05267)

Co-authored-by: dgelessus <dgelessus@users.noreply.github.com>
2023-01-09 08:06:17 -08:00
Miss Islington (bot)
6c7e32f6a8
gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)" (GH-100745)
* gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)"

This reverts commit 7c83eaa536.
(cherry picked from commit b034fd3e59)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-01-08 05:19:37 -08:00
Miss Islington (bot)
d0a9bc5a89
gh-100649: Update native_thread_id after fork (gh-100650)
Update native_thread_id after fork
(cherry picked from commit d52d4942cf)

Co-authored-by: Gabriele N. Tornetta <P403n1x87@users.noreply.github.com>
2023-01-01 06:50:56 -08:00
Kumar Aditya
ebe428824d
[3.11] GH-100342: check for allocation failure in AC *args parsing (GH-100343). (#100568)
(cherry picked from commit 7cf164ad5e)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-12-28 10:11:27 +05:30
colorfulappl
a3dbd4c70e
[3.11] gh-64490: Fix bugs in argument clinic varargs processing (GH-32092) (#100368)
(cherry picked from commit 0da728387c)
2022-12-28 02:10:06 +01:00
Bill Fisher
57e727af3f
[3.11] gh-99110: Initialize frame->previous in init_frame to fix segmentation fault (GH-100182) (#100478)
(cherry picked from commit 88d565f32a)

Co-authored-by: Bill Fisher <william.w.fisher@gmail.com>
2022-12-24 11:17:10 +05:30
Miss Islington (bot)
f6fe4bb75c
[3.11] gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576) (GH-100452)
gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576)

The itemsize returned in a memoryview of a ctypes array is now computed from the item type, instead of dividing the total size by the length and assuming that the length is not zero.
(cherry picked from commit 84bc6a4f25)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
2022-12-23 08:56:20 +00:00
Miss Islington (bot)
3e715e0cc8
gh-78878: Fix crash when creating an instance of _ctypes.CField (GH-14837)
(cherry picked from commit d713c54ac8)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2022-12-21 10:02:05 -08:00
colorfulappl
bed1d141a9
[3.11] gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing (GH-99890) (#100385)
(cherry picked from commit efbb1eb9f5)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-21 15:32:29 +05:30
colorfulappl
ba8e30c56b
[3.11] gh-99240: Fix double-free bug in Argument Clinic str_converter generated code (GH-99241) (#100352)
(cherry picked from commit 8dbe08eb7c)

Fix double-free bug mentioned at GH-99240, by moving memory clean up out of "exit" label.
2022-12-20 15:49:53 +05:30
colorfulappl
c42a4ad587
[3.11] gh-64490: Fix refcount error when arguments are packed to tuple in argument clinic (GH-99233) (#100338)
(cherry picked from commit 69f6cc77d0)
2022-12-19 15:18:49 +05:30
colorfulappl
dd323afea8
[3.11] gh-96002: Add functional test for Argument Clinic (GH-96178) (#100230)
(cherry picked from commit c450c8c9ed)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-17 12:04:54 +05:30
Serhiy Storchaka
3fae04b10e
[3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created (#99949)
It no longer emits a deprecation warning if the current event loop was set.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-12-06 16:15:44 +01:00
Łukasz Langa
32a2193f67
[3.11] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#100016)
In case if only True/False be supported as boolean arguments in future,
we should continue to support 1/0 here.
(cherry picked from commit 922a6cf6c2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-12-05 17:58:40 +01:00
Luke Garland
374b0a2ace
[3.11] bpo-40882: Fix a memory leak in SharedMemory on Windows (GH-20684) (#99973)
bpo-40882: Fix a memory leak in SharedMemory on Windows (GH-20684)

In multiprocessing.shared_memory.SharedMemory(), the temporary view
returned by MapViewOfFile() should be unmapped when it is no longer
needed.

(cherry picked from commit 85c128e34d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-12-05 13:38:25 +01:00
Kumar Aditya
6f658dd60d
[3.11] bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and segfaults (GH-18640) (#99841)
Co-authored-by: Oren Milman <orenmn@gmail.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>

(cherry picked from commit 53eef27133)
2022-11-28 16:47:33 +05:30
Miss Islington (bot)
3e3980b49e
GH-95896: posixmodule.c: fix osdefs.h inclusion to not depend on compiler (GH-95897)
(cherry picked from commit ec2b76aa8b)

Co-authored-by: TheShermanTanker <32636402+TheShermanTanker@users.noreply.github.com>
Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-26 01:57:49 -08:00
Miss Islington (bot)
c06f74f1d6
bpo-38031: Fix a possible assertion failure in _io.FileIO() (GH-GH-5688)
(cherry picked from commit d386115039)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-11-25 05:20:00 -08:00
Miss Islington (bot)
f38eebb88b
GH-97001: Release GIL in termios extension (GH-99503)
Without releasing the GIL calls to termios APIs might block the entire interpreter.
(cherry picked from commit 959ba45d75)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-22 03:28:06 -08:00
Victor Stinner
0c6b3a2d8e
[3.11] Revert "[3.11] gh-98724: Fix Py_CLEAR() macro side effects (#99100)" (#99573)
Revert "gh-98724: Fix Py_CLEAR() macro side effects (#99100) (#99288)"

This reverts commit 1082890857.
2022-11-21 18:01:10 +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)
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
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)
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
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)
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)
58c8c1dee7
gh-96055: Update faulthandler to emit proper unexpect signal number (gh-99162)
(cherry picked from commit f626b7b504)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-11-06 18:45:54 -08:00
Miss Islington (bot)
57077928ec
gh-83004: Clean up refleak in _pickle initialisation (GH-98841)
(cherry picked from commit d3b82b4463)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-06 06:41:24 -08:00
Miss Islington (bot)
4b1e45e78b
gh-83004: Clean up refleak in _zoneinfo initialisation (GH-98842)
(cherry picked from commit 31f2f6568d)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-06 06:30:41 -08:00