summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-45211: Remember the stdlib dir during startup. (gh-28586)Eric Snow2021-09-283-1/+43
| | | | | During runtime startup we figure out the stdlib dir but currently throw that information away. This change preserves it and exposes it via PyConfig.stdlib_dir, _Py_GetStdlibDir(), and sys._stdlib_dir. https://bugs.python.org/issue45211
* Do not check isabs() on Windows. (gh-28584)Eric Snow2021-09-271-0/+2
| | | | | I missed this in gh-28550. https://bugs.python.org/issue45211
* bpo-45211: Move helpers from getpath.c to internal API. (gh-28550)Eric Snow2021-09-273-17/+100
| | | | | | | | | | | | This accomplishes 2 things: * consolidates some common code between getpath.c and getpathp.c * makes the helpers available to code in other files FWIW, the signature of the join_relfile() function (in fileutils.c) intentionally mirrors that of Windows' PathCchCombineEx(). Note that this change is mostly moving code around. No behavior is meant to change. https://bugs.python.org/issue45211
* bpo-41299: Mark private thread_nt.h functions as static (GH-28553)Victor Stinner2021-09-241-10/+10
| | | | | | | | Mark the following thread_nt.h functions as static: * AllocNonRecursiveMutex() * FreeNonRecursiveMutex() * EnterNonRecursiveMutex() * LeaveNonRecursiveMutex()
* bpo-41299: Fix EnterNonRecursiveMutex() (GH-28548)Victor Stinner2021-09-241-3/+0
| | | Remove Py_FatalError() call: the code works even if now is negative.
* bpo-41299: QueryPerformanceFrequency() cannot fail (GH-28552)Victor Stinner2021-09-241-21/+7
| | | | | | py_win_perf_counter_frequency() no longer checks for QueryPerformanceFrequency() failure. According to the QueryPerformanceFrequency() documentation, the function can no longer fails since Windows XP.
* bpo-45020: Fix some corner cases for frozen module generation. (gh-28538)Eric Snow2021-09-241-2/+2
| | | | | This also includes some cleanup in preparation for a PR to make the "make all" output less noisy. https://bugs.python.org/issue45020
* bpo-20524: adds better error message for `.format()` (GH-28310)Nikita Sobolev2021-09-241-7/+19
| | | It now lists the bad format_spec and the type of the object.
* bpo-21302: time.sleep() uses waitable timer on Windows (GH-28483)Victor Stinner2021-09-221-0/+11
| | | | | | | | | | | | On Windows, time.sleep() now uses a waitable timer which has a resolution of 100 ns (10^-7 sec). Previously, it had a solution of 1 ms (10^-3 sec). * On Windows, time.sleep() now calls PyErr_CheckSignals() before resetting the SIGINT event. * Add _PyTime_As100Nanoseconds() function. * Complete and update time.sleep() documentation. Co-authored-by: Livius <egyszeregy@freemail.hu>
* bpo-45061: Detect refcount bug on empty tuple singleton (GH-28503)Victor Stinner2021-09-211-0/+10
| | | | | | Detect refcount bugs in C extensions when the empty tuple singleton is destroyed by mistake. Add the _Py_FatalRefcountErrorFunc() function.
* bpo-24076: Fix reference in sum() introduced by GH-28469 (GH-28493)Pablo Galindo Salgado2021-09-211-1/+2
|
* bpo-24076: Inline single digit unpacking in the integer fastpath of sum() ↵scoder2021-09-211-1/+9
| | | | (GH-28469)
* bpo-1514420: Do not attempt to open files with names in <>s when formatting ↵Irit Katriel2021-09-201-0/+9
| | | | | | an exception (GH-28143) Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* Clean up initialization __class_getitem__ with Py_GenericAlias. (GH-28450)Serhiy Storchaka2021-09-191-2/+2
| | | | | The cast to PyCFunction is redundant. Overuse of redundant casts can hide actual bugs.
* bpo-45020: Freeze os, site, and codecs. (gh-28398)Eric Snow2021-09-171-1/+10
| | | https://bugs.python.org/issue45020
* bpo-45219: Factor dictkey indexing (GH-28389)Mark Shannon2021-09-171-20/+19
|
* bpo-45107: Make LOAD_METHOD_CLASS safer and faster, clean up comments (GH-28177)Ken Jin2021-09-172-15/+9
| | | | | * Improve comments * Check cls is a type, remove dict calculation
* bpo-45203: fix compiler warnings (GH-28357)Ken Jin2021-09-171-0/+1
| | | Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-45020: Drop the frozen .h files from the repo. (gh-28392)Eric Snow2021-09-1612-14430/+0
| | | | | The main advantage is that the files will no longer show up in diffs and PRs. That means, for a PR, the number of files / lines changed will more clearly reflect the actual change. (This is essentially an un-revert of gh-28375.) https://bugs.python.org/issue45020
* bpo-45020: Revert "Drop the frozen .h files from the repo." (gh-28380)Eric Snow2021-09-1611-0/+14405
| | | | | gh-28375 broke one of the buildbots. Until I figure out why, I'm rolling the change back. https://bugs.python.org/issue45020
* bpo-45020: Drop the frozen .h files from the repo. (gh-28375)Eric Snow2021-09-1612-14425/+0
| | | | | The main advantage is that the files will no longer show up in diffs and PRs. That means, for a PR, the number of files / lines changed will more clearly reflect the actual change. https://bugs.python.org/issue45020
* bpo-45019: Clean up the frozen __hello__ module. (gh-28374)Eric Snow2021-09-154-21/+32
| | | | | Here's one more small cleanup that should have been in PR gh-28319. We eliminate stdout side-effects from importing the frozen __hello__ module, and update tests accordingly. We also move the module's source file into Lib/ from Toos/freeze/flag.py. https://bugs.python.org/issue45019
* bpo-45020: Freeze some of the modules imported during startup. (gh-28335)Eric Snow2021-09-1510-0/+6787
| | | | | | | Doing this provides significant performance gains for runtime startup (~15% with all the imported modules frozen). We don't yet freeze all the imported modules because there are a few hiccups in the build systems we need to sort out first. (See bpo-45186 and bpo-45188.) Note that in PR GH-28320 we added a command-line flag (-X frozen_modules=[on|off]) that allows users to opt out of (or into) using frozen modules. The default is still "off" but we will change it to "on" as soon as we can do it in a way that does not cause contributors pain. https://bugs.python.org/issue45020
* bpo-45203: Cleanup stats gathering code for LOAD_METHOD (GH-28352)Mark Shannon2021-09-151-41/+39
|
* bpo-21302: Add _PyTime_AsNanoseconds() (GH-28350)Victor Stinner2021-09-151-123/+188
| | | | | | | | | | | | | | | | | Refactor pytime.c: * Add pytime_from_nanoseconds() and pytime_as_nanoseconds(), and use explicitly these functions * Add two empty lines between functions * PEP 7: add braces { ... } * C99: declare variables where they are set * Rename private functions to lowercase * Rename error_time_t_overflow() to pytime_time_t_overflow() * Rename win_perf_counter_frequency() to py_win_perf_counter_frequency() * py_get_monotonic_clock(): add an assertion to detect overflow when mach_absolute_time() unsigned uint64_t is casted to _PyTime_t (signed int64_t). _testcapi: use _PyTime_FromNanoseconds().
* bpo-45020: Add -X frozen_modules=[on|off] to explicitly control use of ↵Eric Snow2021-09-144-13/+174
| | | | | | | frozen modules. (gh-28320) Currently we freeze several modules into the runtime. For each of these modules it is essential to bootstrapping the runtime that they be frozen. Any other stdlib module that we later freeze into the runtime is not essential. We can just as well import from the .py file. This PR lets users explicitly choose which should be used, with the new "-X frozen_modules=[on|off]" CLI flag. The default is "off" for now. https://bugs.python.org/issue45020
* bpo-45152: Add HAS_CONST macro and get_const_value() function and use… ↵Irit Katriel2021-09-141-7/+39
| | | | (#28262)
* bpo-45019: Do some cleanup related to frozen modules. (gh-28319)Eric Snow2021-09-135-2/+80
| | | | | There are a few things I missed in gh-27980. This is a follow-up that will make subsequent PRs cleaner. It includes fixes to tests and tools that reference the frozen modules. https://bugs.python.org/issue45019
* bpo-43413: Fix handling keyword arguments in subclasses of some buitin ↵Serhiy Storchaka2021-09-121-2/+4
| | | | | | | | classes (GH-26456) * Constructors of subclasses of some buitin classes (e.g. tuple, list, frozenset) no longer accept arbitrary keyword arguments. * Subclass of set can now define a __new__() method with additional keyword parameters without overriding also __init__().
* bpo-44219: Release the GIL during isatty syscalls (GH-28250)Vincent Michel2021-09-091-2/+14
| | | | | | 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.
* bpo-44959: Add fallback to extension modules with '.sl' suffix on HP-UX ↵Florin Spătar2021-09-081-1/+1
| | | | (GH-27857)
* bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194)Yury Selivanov2021-09-071-1/+1
| | | | | | | | Fix PyAiter_Check to only check for the `__anext__` presense (not for `__aiter__`). Rename `PyAiter_Check()` to `PyAIter_Check()`, `PyObject_GetAiter()` -> `PyObject_GetAIter()`. Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-41031: Match C and Python code formatting of unprintable exceptions and ↵Irit Katriel2021-09-052-2/+6
| | | | exceptions in the __main__ module. (GH-28139)
* bpo-45094: Add Py_NO_INLINE macro (GH-28140)Victor Stinner2021-09-031-1/+1
| | | | | * Rename _Py_NO_INLINE macro to Py_NO_INLINE: make it public and document it. * Sort macros in the C API documentation.
* bpo-34602: Quadruple stack size on macOS when compiling with UBSAN (GH-27309)Łukasz Langa2021-09-031-7/+6
|
* bpo-45083: Include the exception class qualname when formatting an exception ↵Irit Katriel2021-09-032-35/+35
| | | | | (GH-28119) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-45056: Remove trailing unused constants from co_consts (GH-28109)Inada Naoki2021-09-024-6318/+6348
|
* bpo-45085: Remove the binhex module (GH-28117)Victor Stinner2021-09-021-1/+0
| | | | | | | | | | The binhex module, deprecated in Python 3.9, is now removed. The following binascii functions, deprecated in Python 3.9, are now also removed: * a2b_hqx(), b2a_hqx(); * rlecode_hqx(), rledecode_hqx(). The binascii.crc_hqx() function remains available.
* bpo-45039: Consistently use ADDOP_LOAD_CONST in compiler rather than ↵Irit Katriel2021-08-311-2/+4
| | | | ADDOP_O(c, LOAD_CONST,...) (GH-28015)
* bpo-37596: Clean up the set/frozenset marshalling code (GH-28068)Brandt Bucher2021-08-311-8/+11
|
* bpo-45061: Enhance faulthandler traceback wit no Python frame (GH-28090)Victor Stinner2021-08-311-1/+1
| | | | | | | | 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>
* bpo-45019: Add a tool to generate list of modules to include for frozen ↵Eric Snow2021-08-305-29/+57
| | | | | | | modules (gh-27980) Frozen modules must be added to several files in order to work properly. Before this change this had to be done manually. Here we add a tool to generate the relevant lines in those files instead. This helps us avoid mistakes and omissions. https://bugs.python.org/issue45019
* bpo-45045: Optimize mapping patterns of structural pattern matching (GH-28043)Dong-hee Na2021-08-301-6/+17
|
* Refine specialization stats (GH-27992)Mark Shannon2021-08-271-17/+89
|
* bpo-44945: Specialize BINARY_ADD (GH-27967)Mark Shannon2021-08-273-46/+195
|
* bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947)Dong-hee Na2021-08-251-0/+4
| | | Automerge-Triggered-By: GH:pablogsal
* bpo-44990: Change layout of evaluation frames. "Layout B" (GH-27933)Mark Shannon2021-08-253-66/+62
| | | Places the locals between the specials and stack. This is the more "natural" layout for a C struct, makes the code simpler and gives a slight speedup (~1%)
* Format the Python-tokenize module and fix exit path (GH-27935)Pablo Galindo Salgado2021-08-251-47/+46
|
* bpo-37596: Make `set` and `frozenset` marshalling deterministic (GH-27926)Brandt Bucher2021-08-251-0/+32
|
* Add tests for the C tokenizer and expose it as a private module (GH-27924)Pablo Galindo Salgado2021-08-243-0/+237
|