Commit graph

7008 commits

Author SHA1 Message Date
Miss Islington (bot)
1079b3e3cb
bpo-42540: reallocation of id_mutex should not force default allocator (GH-29564)
Unlike the other locks reinitialized by _PyRuntimeState_ReInitThreads,
the "interpreters.main->id_mutex" is not freed by _PyRuntimeState_Fini
and should not force the default raw allocator.
(cherry picked from commit 736684b1bb)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2021-11-17 13:16:01 -08:00
Brandt Bucher
a89bbde83f
[3.10] bpo-45773: Stop "optimizing" certain jump patterns (GH-29526) 2021-11-11 13:52:43 -08:00
Miss Islington (bot)
b2ae631619
[3.10] bpo-45688: Add _scproxy to sys.stdlib_module_names (GH-29358) (GH-29361)
Co-authored-by: Christian Heimes <christian@python.org>
2021-11-02 12:32:36 +01:00
Miss Islington (bot)
854db7e821
Fix format string in _PyImport_LoadDynamicModuleWithSpec() (GH-28863)
(cherry picked from commit f79f3b41c8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-12 10:10:59 -07:00
Miss Islington (bot)
56825b697e
Handle error when PyUnicode_GetLength returns a negative value. (GH-28859)
(cherry picked from commit 560a79f94e)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2021-10-11 04:40:43 -07:00
Miss Islington (bot)
3a58d60620
Fix a leak in _PyImport_LoadDynamicModuleWithSpec() after failing PySys_Audit() (GH-28862)
(cherry picked from commit 9883ca498d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-11 02:22:29 -07:00
Christian Clauss
ccd82a0800
[3.10] Fix typos in the Python directory (GH-28767) (GH-28799)
(cherry picked from commit db693df3e1)
2021-10-07 17:30:08 +02:00
Miss Islington (bot)
d0d29655ff
bpo-44050: Extension modules can share state when they don't support sub-interpreters. (GH-27794) (GH-28738)
Automerge-Triggered-By: GH:encukou
(cherry picked from commit b9bb74871b)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2021-10-05 18:34:59 +02:00
Serhiy Storchaka
1670d590fa
[3.10] bpo-45355: More use of sizeof(_Py_CODEUNIT) (GH-28720). (GH-28721)
(cherry picked from commit 252b7bcb23)
2021-10-04 17:07:21 +03:00
Serhiy Storchaka
b5499784ec
[3.10] bpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code unit (GH-28711). (GH-28718)
(cherry picked from commit 60b9e040c9)
2021-10-04 15:01:11 +03:00
Serhiy Storchaka
93242d7a2a
[3.10] Remove trailing spaces (GH-28709) 2021-10-03 20:03:49 +03:00
Victor Stinner
6df8c32753
bpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait() (GH-28671)
On Unix, if the sem_clockwait() function is available in the C
library (glibc 2.30 and newer), the threading.Lock.acquire() method
now uses the monotonic clock (time.CLOCK_MONOTONIC) for the timeout,
rather than using the system clock (time.CLOCK_REALTIME), to not be
affected by system clock changes.

configure now checks if the sem_clockwait() function is available.
2021-10-01 18:22:49 +02:00
Mark Shannon
2be4c370c6
Move predispatch logic from DISPATCH macro to juts before switch. Reduces size of each opocde in interpreter. (GH-28475) 2021-09-29 13:16:13 +01:00
Serhiy Storchaka
ec4e2ec241
[3.10] bpo-45307: Restore private C API function _PyImport_FindExtensionObject() (GH-28594)
py2exe and PyOxidizer rely on this API.
It will be removed in Python 3.11.

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-09-28 23:12:50 +02:00
Brett Cannon
e1bdecb6dc
[3.10] bpo-45183: don't raise an exception when calling zipimport.zipimporter.find_spec() when the zip file is missing and the internal cache has been reset (GH-28435) (#28438)
This can occur when the zip file gets deleted, you call zipimport.zipimporter.invalidate_cache(), and then try to use zipimport.zipimporter.find_spec() (i.e. you left the zip file path on sys.path).
(cherry picked from commit 209b7035f7)

Co-authored-by: Brett Cannon <brett@python.org>
2021-09-17 17:46:22 -07:00
Łukasz Langa
2563dd2d0a
[3.10] bpo-34602: Quadruple stack size on macOS when compiling with UBSAN (GH-27309) (GH-28280)
(cherry picked from commit be9de8721d)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-15 20:34:57 +02:00
Miss Islington (bot)
23c46778d6
bpo-44219: Release the GIL during isatty syscalls (GH-28250) (GH-28255)
Release the GIL while performing isatty() system calls on arbitrary
file descriptors. In particular, this affects os.isatty(),
os.device_encoding() and io.TextIOWrapper. By extension,
io.open() in text mode is also affected.
(cherry picked from commit 06148b1870)

Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
2021-09-09 18:35:43 +02:00
Miss Islington (bot)
6b996d61c9
[3.10] bpo-45083: Include the exception class qualname when formatting an exception (GH-28119) (GH-28134)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
(cherry picked from commit b4b6342848)

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

* Use a private version of _PyType_GetQualName

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-08 18:32:19 +02:00
Łukasz Langa
d41abe8970
[3.10] bpo-45056: Remove trailing unused constants from co_consts (GH-28109) (GH-28125)
(cherry picked from commit 55c4a92fc1)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-09-08 18:25:09 +02:00
Miss Islington (bot)
53257cf19f
bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194) (GH-28199)
Fix PyAiter_Check to only check for the `__anext__` presense (not for
`__aiter__`). Rename `PyAiter_Check()` to `PyAIter_Check()`,
`PyObject_GetAiter()` -> `PyObject_GetAIter()`.
2021-09-07 12:43:33 +01:00
Miss Islington (bot)
ebbd0ac5d8
bpo-45039: Consistently use ADDOP_LOAD_CONST in compiler rather than ADDOP_O(c, LOAD_CONST,...) (GH-28015)
(cherry picked from commit 70ccee418d)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-08-31 11:08:32 -07:00
Miss Islington (bot)
c4c57e5c0e
bpo-45061: Enhance faulthandler traceback wit no Python frame (GH-28090)
Fix indentation of <no Python frame> message in a faulthandler
traceback or a Fatal Python error traceback. Example:

Current thread 0x00007f03896fb740 (most recent call first):
  Garbage-collecting
  <no Python frame>
(cherry picked from commit 888d4cc06b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-08-31 08:53:17 -07:00
Victor Stinner
fe997e1a67
bpo-44449: faulthandler don't modify frame refcnt (GH-27850)
Fix a crash in the signal handler of the faulthandler module: no
longer modify the reference count of frame objects.
2021-08-30 15:24:39 +02:00
Dong-hee Na
32c1caa87f
bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947) (GH-27957)
(cherry picked from commit 551da597a0)
2021-08-26 10:52:21 +01:00
Miss Islington (bot)
d86bbe3cff
bpo-25782: avoid hang in PyErr_SetObject when current exception has a cycle in its context chain (GH-27626)
Co-authored-by: Dennis Sweeney 36520290+sweeneyde@users.noreply.github.com
(cherry picked from commit d5c217475c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-08-10 06:47:23 -07:00
Mark Shannon
0f02993b2c
Remove unused variable. (GH-27677) (#27680) 2021-08-09 15:25:40 +01:00
Mark Shannon
762ef85f44
bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656) (#27673)
(cherry picked from commit b854557b49)
2021-08-09 10:54:48 +01:00
Miss Islington (bot)
ac8f72cd3f
bpo-44856: Possible reference leak in error paths of update_bases() and __build_class__ (GH-27647)
(cherry picked from commit a40675c659)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-08-07 07:03:17 -07:00
Miss Islington (bot)
2ae2235c7a
bpo-44849: Fix os.set_inheritable() on FreeBSD 14 with O_PATH (GH-27623)
Fix the os.set_inheritable() function on FreeBSD 14 for file
descriptor opened with the O_PATH flag: ignore the EBADF error on
ioctl(), fallback on the fcntl() implementation.
(cherry picked from commit c24896c0e3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-08-06 06:40:44 -07:00
Miss Islington (bot)
a11158ecef
bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065)
The threading debug (PYTHONTHREADDEBUG environment variable) is
deprecated in Python 3.10 and will be removed in Python 3.12. This
feature requires a debug build of Python.
(cherry picked from commit 4d77691172)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-08-06 04:32:37 -07:00
Miss Islington (bot)
8ce7f2f4ef
bpo-39091: Fix segfault when Exception constructor returns non-exception for gen.throw. (GH-17658) (GH-27572)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
(cherry picked from commit 83ca46b778)

Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-08-03 12:10:38 +02:00
Miss Islington (bot)
ebba286709
bpo-32280: Store _PyRuntime in a named section (GH-4802) (#27448)
This commit stores the _PyRuntime structure in a section of the same name. This allows a debugging or crash reporting tool to quickly locate this structure at runtime without requiring the symbol table.

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit 35002aa8f6)

Co-authored-by: Max Bélanger <aeromax@gmail.com>

Co-authored-by: Max Bélanger <aeromax@gmail.com>
2021-07-29 16:20:58 +01:00
Miss Islington (bot)
405f5c5491
[3.10] bpo-43897: Reject "_" captures and top-level MatchStar in the AST validator (GH-27432) (GH-27435)
(cherry picked from commit 8d0647485d)


Co-authored-by: Brandt Bucher <brandt@python.org>

Automerge-Triggered-By: GH:brandtbucher
2021-07-28 18:02:14 -07:00
Miss Islington (bot)
6fc1efa454
bpo-44740: Lowercase "internet" and "web" where appropriate. (GH-27378) (GH-27380)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 11749e2dc2)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-27 00:34:32 +02:00
Miss Islington (bot)
01601aa736
[3.10] bpo-44600: Fix line numbers for pattern matching cleanup code (GH-27346) (GH-27356)
(cherry picked from commit 4214f470f0)


Co-authored-by: Charles Burkland <charles.aburkland@gmail.com>

Automerge-Triggered-By: GH:brandtbucher
2021-07-25 17:04:06 -07:00
Miss Islington (bot)
37bdd2221c
bpo-44645: Check for interrupts on any potentially backwards edge (GH-27216) (GH-27235)
(cherry picked from commit d09c134178)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2021-07-19 12:15:58 +01:00
Miss Islington (bot)
efda9054b9
bpo-44655: Include the name of the type in unset __slots__ attribute errors (GH-27199) (GH-27201)
(cherry picked from commit f783428a23)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-17 01:01:53 +01:00
Miss Islington (bot)
a0b1d401db
bpo-44655: Don't include suggestions for attributes that are the same as the missing one (GH-27197) (GH-27198)
(cherry picked from commit 6714dec5e1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-16 22:16:08 +01:00
Miss Islington (bot)
42a5514cca
Revert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)" (GH-27194) (#27195)
This reverts commit 000e70ad52.
(cherry picked from commit c90c591e51)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-16 19:29:32 +02:00
Mark Shannon
37686f78cc
bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138) (GH-27182)
(cherry picked from commit a86f7dae0a)
2021-07-16 11:49:10 +01:00
Mark Shannon
0e349ea554
[3.10] bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167) (GH-27183)
(cherry picked from commit 000e70ad52)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2021-07-16 11:48:46 +01:00
Mark Shannon
47695e3c88
bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. (GH-27160) (GH-27163)
(cherry picked from commit f333ab0f2e)
2021-07-15 16:54:38 +02:00
Miss Islington (bot)
016af14d93
[3.10] bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal keys (GH-27131) (GH-27157)
(cherry picked from commit 2693132292)


Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>

Automerge-Triggered-By: GH:brandtbucher
2021-07-14 18:00:35 -07:00
Mark Shannon
794ff7d505
bpo-44616: Mark all clean up instructions at end of named exception block as artificial (GH-27109) (GH-27135)
(cherry picked from commit e5862f79c1)
2021-07-14 11:43:56 +01:00
Miss Islington (bot)
4a0f1df952
bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822) (GH-26830)
(cherry picked from commit 06cda808f1)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-07-13 09:43:26 +01:00
Batuhan Taskaya
2f7636887e
[3.10] bpo-43897: ast validation for pattern matching nodes (GH-27074)
(cherry picked from commit 8dcb7d9808)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
2021-07-10 01:16:15 +01:00
Mark Shannon
9f2c63b258
bpo-44570: Fix line tracing for forward jumps to duplicated tails (GH-27067) 2021-07-08 19:21:22 +01:00
Steve Dower
a5764d3d96
bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal.dumps (GH-26970) 2021-06-30 18:52:25 +01:00
Victor Stinner
ece3841d3d
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26877)
Py_RunMain() now resets PyImport_Inittab to its initial value at
exit. It must be possible to call PyImport_AppendInittab() or
PyImport_ExtendInittab() at each Python initialization.

(cherry picked from commit 489699ca05)
2021-06-23 17:47:38 +02:00
Victor Stinner
9b0bbb9143
bpo-44466: Faulthandler now detects the GC (GH-26823) (GH-26826)
The faulthandler module now detects if a fatal error occurs during a
garbage collector collection (only if all_threads is true).

(cherry picked from commit d19163912b)
2021-06-21 14:23:13 +02:00