summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* gh-93243: Make smtpd private before porting its users (GH-93246)Oleg Iarygin2022-08-061-1/+0
| | | | | | | gh-93243 This PR is required to reduce diffs of the following porting (no need to either maintain documentation and tests consistent with each porting step, or try to port everything and remove smtpd in a single PR). Automerge-Triggered-By: GH:warsaw
* gh-87092: create a 'jump target label' abstraction so that the compiler's ↵Irit Katriel2022-08-041-354/+385
| | | | codegen stage does not work directly with basic blocks (GH-95398)
* GH-95245: Store object values and dict pointers in single tagged pointer. ↵Mark Shannon2022-08-012-15/+20
| | | | (GH-95278)
* bpo-45445: Revert "bpo-45445: Fail if an invalid X-option is provided in the ↵Pablo Galindo Salgado2022-07-311-48/+0
| | | | command line (GH-28823)" (#94745)
* GH-90081: Run python tracers at full speed (GH-95328)Mark Shannon2022-07-281-4/+7
|
* gh-94938: Fix errror detection of unexpected keyword arguments (GH-94999)Serhiy Storchaka2022-07-281-85/+57
| | | | | | | | | | When keyword argument name is an instance of a str subclass with overloaded methods __eq__ and __hash__, the former code could not find the name of an extraneous keyword argument to report an error, and _PyArg_UnpackKeywords() returned success without setting the corresponding cell in the linearized arguments array. But since the number of expected initialized cells is determined as the total number of passed arguments, this lead to reading NULL as a keyword parameter value, that caused SystemError or crash or other undesired behavior.
* gh-95174: Add pthread stubs for WASI (GH-95234)Christian Heimes2022-07-273-6/+201
| | | Co-authored-by: Brett Cannon <brett@python.org>
* gh-93678: extract 'struct cfg_builder' from the compiler so that the CFG can ↵Irit Katriel2022-07-261-120/+113
| | | | be manipulated directly (GH-95107)
* gh-95174: Handle missing dup() and constants in WASI (GH-95229)Christian Heimes2022-07-262-1/+11
| | | | | | | - check for ``dup()`` libc function - handle missing ``F_DUPFD`` in ``dup2()`` replacement function - add workaround for WASI libc bug in MSG_TRUNC - ESHUTDOWN is missing, use EPIPE instead - POLLPRI is missing, define as 0 (no-op)
* gh-94673: Always Finalize Static Builtin Types (#95153)Eric Snow2022-07-251-1/+2
| | | | | | | | | | | | | Static builtin types are finalized by calling _PyStaticType_Dealloc(). Before this change, we were skipping finalizing such a type if it still had subtypes (i.e. its tp_subclasses hadn't been cleared yet). The problem is that types hold several heap objects, which leak if we skip the type's finalization. This change addresses that. For context, there's an old comment (from e9e3eab0b86) that says the following: // If a type still has subtypes, it cannot be deallocated. // A subtype can inherit attributes and methods of its parent type, // and a type must no longer be used once it's deallocated. However, it isn't clear that is actually still true. Clearing tp_dict should mean it isn't a problem. Furthermore, the only subtypes that might still be around come from extension modules that didn't clean them up when unloaded (i.e. extensions that do not implement multi-phase initialization, AKA PEP 489). Those objects are already leaking, so this change doesn't change anything in that regard. Instead, this change means more objects gets cleaned up that before.
* gh-94673: Add _PyStaticType_InitBuiltin() (#95152)Eric Snow2022-07-253-26/+22
| | | | | | | | | | | | This is the first of several precursors to storing tp_subclasses (and tp_weaklist) on the interpreter state for static builtin types. We do the following: * add `_PyStaticType_InitBuiltin()` * add `_Py_TPFLAGS_STATIC_BUILTIN` * set it on all static builtin types in `_PyStaticType_InitBuiltin()` * shuffle some code around to be able to use _PyStaticType_InitBuiltin() * rename `_PyStructSequence_InitType()` to `_PyStructSequence_InitBuiltinWithFlags()` * add `_PyStructSequence_InitBuiltin()`.
* GH-94851: check refcnt of immortal objects after finalization (GH-95001)Kumar Aditya2022-07-251-0/+3
|
* gh-95185: Check recursion depth in the AST constructor (#95186)Pablo Galindo Salgado2022-07-241-1/+106
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* GH-94036: Fix more attribute location quirks (GH-95028)Brandt Bucher2022-07-221-20/+23
|
* GH-95113: Don't use EXTENDED_ARG_QUICK in unquickened code (GH-95121)Brandt Bucher2022-07-223-3/+14
|
* GH-91409: Don't overwrite valid locations with NOP locations (GH-95067)Brandt Bucher2022-07-201-1/+4
|
* gh-91102: Port 8-argument _warnings.warn_explicit to Argument Clinic (#92891)Oleg Iarygin2022-07-202-25/+105
| | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* GH-94851: fix immortal objects refcounting in compiler (gh-95040)Kumar Aditya2022-07-201-1/+1
|
* gh-91256: Ensure help text has the program name even before getpath is ↵Steve Dower2022-07-191-0/+3
| | | | called (GH-94929)
* gh-93678: move normalize_basic_block and extend_block call into optimize_cfg ↵Irit Katriel2022-07-191-31/+26
| | | | (GH-95002)
* GH-94822: Don't specialize when metaclasses are involved (GH-94892)Brandt Bucher2022-07-181-6/+5
|
* gh-94930: skipitem() in getargs.c should return non-NULL on error (GH-94931)Serhiy Storchaka2022-07-181-3/+1
|
* GH-94739: Mark stacks of exception handling blocks for setting ↵Mark Shannon2022-07-181-14/+0
| | | | frame.f_lineno in the debugger. (GH-94958)
* gh-91348: Restore frame argument to sys._getframe audit event (GH-94928)Steve Dower2022-07-171-5/+7
|
* gh-93939: Build C extensions without setup.py (GH-94474)Christian Heimes2022-07-141-1/+0
| | | Combines GH-93940, GH-94452, and GH-94433
* gh-93883: elide traceback indicators when possible (#93994)John Belmonte2022-07-111-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gh-93883: elide traceback indicators when possible Elide traceback column indicators when the entire line of the frame is implicated. This reduces traceback length and draws even more attention to the remaining (very relevant) indicators. Example: ``` Traceback (most recent call last): File "query.py", line 99, in <module> bar() File "query.py", line 66, in bar foo() File "query.py", line 37, in foo magic_arithmetic('foo') File "query.py", line 18, in magic_arithmetic return add_counts(x) / 25 ^^^^^^^^^^^^^ File "query.py", line 24, in add_counts return 25 + query_user(user1) + query_user(user2) ^^^^^^^^^^^^^^^^^ File "query.py", line 32, in query_user return 1 + query_count(db, response['a']['b']['c']['user'], retry=True) ~~~~~~~~~~~~~~~~~~^^^^^ TypeError: 'NoneType' object is not subscriptable ``` Rather than going out of our way to provide indicator coverage in every traceback test suite, the indicator test suite should be responible for sufficient coverage (e.g. by adding a basic exception group test to ensure that margin strings are covered).
* GH-94694: Fix column offsets for multi-line method lookups (GH-94697)Brandt Bucher2022-07-101-2/+9
|
* GH-93252: Fix error handling for failed Python calls (GH-94693)Brandt Bucher2022-07-091-1/+5
|
* gh-94215: Fix error handling for line-tracing events (GH-94681)Brandt Bucher2022-07-081-5/+14
| | | | | * Re-enable crasher * Fix error handling for line-tracing events * blurb add
* gh-92228: disable the compiler's 'small exit block inlining' optimization ↵Irit Katriel2022-07-071-0/+14
| | | | | | | for blocks that have a line number (GH-94592) Inlining of code that corresponds to source code lines, can make it hard to distinguish later between code which is only reachable from except handlers, and that which is reachable in normal control flow. This caused problems with the debugger's jump feature. This PR turns off the inlining optimisation for code which has line numbers. We still inline things like the implicit "return None".
* gh-94510: Raise on re-entrant calls to sys.setprofile and sys.settrace ↵Pablo Galindo Salgado2022-07-051-2/+24
| | | | | (GH-94511) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-94485: Set line number of module's RESUME instruction to 0, as specified ↵Irit Katriel2022-07-051-1/+4
| | | | | by PEP 626 (GH-94552) Co-authored-by: Mark Shannon <mark@hotpy.org>
* gh-94216: add pseudo instructions to the dis/opcodes modules (GH-94241)Irit Katriel2022-07-012-39/+12
|
* GH-94262: Don't create frame objects for frames that aren't yet complete. ↵Mark Shannon2022-07-012-5/+17
| | | | (GH-94371)
* gh-91719: Reload opcode on unknown error so that C can optimize the ↵neonene2022-06-301-0/+3
| | | | dispatching in ceval.c (#94364)
* GH-94329: Don't raise on excessive stack consumption (GH-94421)Mark Shannon2022-06-301-6/+1
|
* gh-94332: make it safe to call assemble_free when assemble_init has not been ↵Irit Katriel2022-06-301-1/+2
| | | | called (GH-94389)
* GH-94163: Add BINARY_SLICE and STORE_SLICE instructions. (GH-94168)Mark Shannon2022-06-274-45/+139
|
* gh-77560: Report possible errors in restoring builtins at finalization ↵Serhiy Storchaka2022-06-251-1/+1
| | | | | | | (GH-94255) Seems in the past the copy of builtins was not made in some scenarios, and the error was silenced. Write it now to stderr, so we have a chance to see it.
* GH-93841: Allow stats to be turned on and off, cleared and dumped at ↵Mark Shannon2022-06-214-9/+193
| | | | runtime. (GH-93843)
* gh-74953: _PyThread_cond_after() uses _PyTime_t (#94056)Victor Stinner2022-06-212-29/+16
| | | | | | pthread _PyThread_cond_after() implementation now uses the _PyTime_t type to handle properly overflow: clamp to the maximum value. Remove MICROSECONDS_TO_TIMESPEC() function.
* GH-91432: Specialize FOR_ITER (GH-91713)Dennis Sweeney2022-06-213-37/+118
| | | | | * Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations. * Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
* GH-93678: refactor compiler so that optimizer does not need the assembler ↵Irit Katriel2022-06-211-160/+169
| | | | and compiler structs (GH-93842)
* gh-94021: Address unreachable code warning in specialize code (GH-94022)Christian Heimes2022-06-211-1/+2
|
* gh-93937: PyOS_StdioReadline() uses PyConfig.legacy_windows_stdio (#94024)Victor Stinner2022-06-201-0/+3
| | | | | | | On Windows, PyOS_StdioReadline() now gets PyConfig.legacy_windows_stdio from _PyOS_ReadlineTState, rather than using the deprecated global Py_LegacyWindowsStdioFlag variable. Fix also a compiler warning in Py_SetStandardStreamEncoding().
* GH-93516: Speedup line number checks when tracing. (GH-93763)Mark Shannon2022-06-201-7/+9
| | | | * Use a lookup table to reduce overhead of getting line numbers during tracing.
* GH-93897: Store frame size in code object and de-opt if insufficient space ↵Mark Shannon2022-06-203-41/+15
| | | | on thread frame stack. (GH-93908)
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938)Victor Stinner2022-06-196-6/+4
| | | | | | | | | | | | | | | | Move the follow functions and type from frameobject.h to pyframe.h, so the standard <Python.h> provide frame getter functions: * PyFrame_Check() * PyFrame_GetBack() * PyFrame_GetBuiltins() * PyFrame_GetGenerator() * PyFrame_GetGlobals() * PyFrame_GetLasti() * PyFrame_GetLocals() * PyFrame_Type Remove #include "frameobject.h" from many C files. It's no longer needed.
* gh-74953: Reformat PyThread_acquire_lock_timed() (#93947)Victor Stinner2022-06-191-46/+62
| | | | | | | | Reformat the pthread implementation of PyThread_acquire_lock_timed() using a mutex and a conditioinal variable. * Add goto to avoid multiple indentation levels and exit quickly * Use "while(1)" and make the control flow more obvious. * PEP 7: Add braces around if blocks.
* gh-93911: Specialize `LOAD_ATTR_PROPERTY` (GH-93912)Ken Jin2022-06-173-22/+97
|