summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* gh-91051: allow setting a callback hook on PyType_Modified (GH-97875)Carl Meyer2022-10-212-0/+12
|
* gh-95023: Added os.setns and os.unshare functions (#95046)Noam Cohen2022-10-202-0/+8
| | | | | | | | Added os.setns and os.unshare to easily switch between namespaces on Linux. Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-98417: Store int_max_str_digits on the Interpreter State (GH-98418)Eric Snow2022-10-191-0/+6
|
* gh-97669: Create Tools/build/ directory (#97963)Victor Stinner2022-10-175-6/+6
| | | | | | | | | | | | | | | | | | | | | | | Create Tools/build/ directory. Move the following scripts from Tools/scripts/ to Tools/build/: * check_extension_modules.py * deepfreeze.py * freeze_modules.py * generate_global_objects.py * generate_levenshtein_examples.py * generate_opcode_h.py * generate_re_casefix.py * generate_sre_constants.py * generate_stdlib_module_names.py * generate_token.py * parse_html5_entities.py * smelly.py * stable_abi.py * umarshal.py * update_file.py * verify_ensurepip_wheels.py Update references to these scripts.
* gh-95756: Lazily created cached co_* attrs (GH-97791)Ken Jin2022-10-111-1/+8
|
* gh-95011: Migrate syslog module to Argument Clinic (GH-95012)Noam Cohen2022-10-082-0/+24
|
* gh-97922: Run the GC only on eval breaker (#97920)Pablo Galindo Salgado2022-10-082-0/+4
|
* gh-91052: Add PyDict_Unwatch for unwatching a dictionary (#98055)Carl Meyer2022-10-081-0/+1
|
* gh-97955: Migrate `zoneinfo` to Argument Clinic (#97958)Nikita Sobolev2022-10-072-0/+8
|
* Make _symtable_entry.ste_type's comment consistent wit _Py_block_ty (#92414)zikcheng2022-10-071-1/+1
| | | | _Py_block_ty defines four types of block, FunctionBlock, ClassBlock, ModuleBlock and AnnotationBlock. But _symtable_entry.ste_type only comments three of them, I think it's better both sides are consistent.
* gh-64373: Convert `_functools` to Argument Clinic (#96640)Nikita Sobolev2022-10-072-0/+8
|
* GH-91052: Add C API for watching dictionaries (GH-31787)Carl Meyer2022-10-073-1/+51
|
* GH-91079: Decouple C stack overflow checks from Python recursion checks. ↵Mark Shannon2022-10-053-15/+24
| | | | (GH-96510)
* gh-96512: Move int_max_str_digits setting to PyConfig (#96944)Gregory P. Smith2022-10-033-4/+1
| | | | | | | | | | | It had to live as a global outside of PyConfig for stable ABI reasons in the pre-3.12 backports. This removes the `_Py_global_config_int_max_str_digits` and gets rid of the equivalent field in the internal `struct _is PyInterpreterState` as code can just use the existing nested config struct within that. Adds tests to verify unique settings and configs in subinterpreters.
* gh-96670: Raise SyntaxError when parsing NULL bytes (#97594)Pablo Galindo Salgado2022-09-271-0/+1
|
* gh-96959: Update HTTP links which are redirected to HTTPS (GH-96961)Serhiy Storchaka2022-09-241-2/+2
|
* gh-96947: Fix comment on `pyruntimestate->pyinterpreters` struct for ↵Виталий Дмитриев2022-09-201-2/+2
| | | | | | | `next_id` (GH-96949) `_next_interp_id` appeared on [this commit](https://github.com/python/cpython/commit/e377416c10eb0bf055b0728cdcdc4488fdfd3b5f#diff-7ac11e526f79b42d6ea9d3592cb99da46775640c69fa5510f4a6de87cced7141R68) renamed to `next_id` ([by this commit](https://github.com/python/cpython/commit/2ebc5ce42a8a9e047e790aefbf9a94811569b2b6#diff-bccfc01bd96b58c022dde77486b8a896cbb31d7581bd4a4156b32c3654afe468R59)). Also, now, `next_id` gets initialized in` _PyInterpreterState_Enable()` https://github.com/python/cpython/blob/12c5f328d2479ac3432df5e266adc4e59adeabfe/Python/pystate.c#L241-L244 because `_PyInterpreterState_Init()` function doesn't exist at all.
* GH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)adphrost2022-09-151-1/+3
| | | | Co-authored-by: Andrew Frost <adfrost@fb.com> Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
* GH-90997: Improve inline cache performance for MSVC (GH-96781)Brandt Bucher2022-09-151-74/+19
|
* gh-90110: Fix the c-analyzer Tool (gh-96731)Eric Snow2022-09-121-1/+0
| | | | | | | This includes: * update the whitelists * fixes so we can stop ignoring some of the files * ensure Include/cpython/*.h get analyzed
* GH-90699: use statically allocated interned strings in typeobject's slotdefs ↵Kumar Aditya2022-09-071-3/+0
| | | | (GH-94706)
* gh-89545: Updates platform module to use new internal _wmi module on Windows ↵Steve Dower2022-09-072-0/+8
| | | | to directly query OS properties (GH-96289)
* GH-96569: Add two NULL checks to avoid undefined behavior. (GH-96585)Mark Shannon2022-09-061-2/+7
|
* gh-95778: Correctly pre-check for int-to-str conversion (#96537)Mark Dickinson2022-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Converting a large enough `int` to a decimal string raises `ValueError` as expected. However, the raise comes _after_ the quadratic-time base-conversion algorithm has run to completion. For effective DOS prevention, we need some kind of check before entering the quadratic-time loop. Oops! =) The quick fix: essentially we catch _most_ values that exceed the threshold up front. Those that slip through will still be on the small side (read: sufficiently fast), and will get caught by the existing check so that the limit remains exact. The justification for the current check. The C code check is: ```c max_str_digits / (3 * PyLong_SHIFT) <= (size_a - 11) / 10 ``` In GitHub markdown math-speak, writing $M$ for `max_str_digits`, $L$ for `PyLong_SHIFT` and $s$ for `size_a`, that check is: $$\left\lfloor\frac{M}{3L}\right\rfloor \le \left\lfloor\frac{s - 11}{10}\right\rfloor$$ From this it follows that $$\frac{M}{3L} < \frac{s-1}{10}$$ hence that $$\frac{L(s-1)}{M} > \frac{10}{3} > \log_2(10).$$ So $$2^{L(s-1)} > 10^M.$$ But our input integer $a$ satisfies $|a| \ge 2^{L(s-1)}$, so $|a|$ is larger than $10^M$. This shows that we don't accidentally capture anything _below_ the intended limit in the check. <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
* GH-96458: Statically initialize utf8 representation of static strings (#96481)Kumar Aditya2022-09-033-130/+131
|
* gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96499)Gregory P. Smith2022-09-025-0/+47
| | | | | | | | | | | | | | | | Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds. This PR comes fresh from a pile of work done in our private PSRT security response team repo. Signed-off-by: Christian Heimes [Red Hat] <christian@python.org> Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org> Reviews via the private PSRT repo via many others (see the NEWS entry in the PR). <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#). Much of that text wound up in the Issue. Backports PRs already exist. See the issue for links.
* gh-93554: Conditional jump opcodes only jump forward (GH-96318)Irit Katriel2022-09-012-51/+35
|
* gh-96143: Allow Linux perf profiler to see Python calls (GH-96123)Pablo Galindo Salgado2022-08-302-0/+22
| | | | | | | :warning: :warning: Note for reviewers, hackers and fellow systems/low-level/compiler engineers :warning: :warning: If you have a lot of experience with this kind of shenanigans and want to improve the **first** version, **please make a PR against my branch** or **reach out by email** or **suggest code changes directly on GitHub**. If you have any **refinements or optimizations** please, wait until the first version is merged before starting hacking or proposing those so we can keep this PR productive.
* gh-46845: clean up unused DK_IXSIZE (GH-96405)Matthias Görgens2022-08-301-9/+0
|
* Fix Py_INCREF() statistics in limited C API 3.10 (#96120)Victor Stinner2022-08-291-1/+1
| | | | | In the limited C API with a debug build, Py_INCREF() is implemented by calling _Py_IncRef() which calls Py_INCREF(). Only call _Py_INCREF_STAT_INC() once.
* GH-96237: Allow non-functions as reference-holder in frames. (GH-96238)Mark Shannon2022-08-251-2/+2
|
* GH-93503: Add thread-specific APIs to set profiling and tracing functions in ↵Pablo Galindo Salgado2022-08-241-0/+2
| | | | | | | | | | | | | | | | | the C-API (#93504) * gh-93503: Add APIs to set profiling and tracing functions in all threads in the C-API * Use a separate API * Fix NEWS entry * Add locks around the loop * Document ignoring exceptions * Use the new APIs in the sys module * Update docs
* GH-96177: Move GIL and eval breaker code out of ceval.c into ceval_gil.c. ↵Mark Shannon2022-08-242-3/+7
| | | | (GH-96204)
* gh-93678: add _testinternalcapi.optimize_cfg() and test utils for compiler ↵Irit Katriel2022-08-243-0/+21
| | | | optimization unit tests (GH-96007)
* GH-96075: move interned dict under runtime state (GH-96077)Kumar Aditya2022-08-221-0/+2
|
* GH-90997: Wrap yield from/await in a virtual try/except StopIteration (GH-96010)Brandt Bucher2022-08-192-56/+57
|
* Remove dead code in _PyDict_GetItemHint and rename to _PyDict_LookupIndex ↵Matthias Görgens2022-08-181-1/+1
| | | | (GH-95948)
* GH-93911: Specialize `LOAD_ATTR` for custom `__getattribute__` (GH-93988)Ken Jin2022-08-174-41/+46
|
* GH-95909: Make `_PyArg_Parser` initialization thread safe (GH-95958)Kumar Aditya2022-08-161-0/+4
|
* GH-95245: Move weakreflist into the pre-header. (GH-95996)Mark Shannon2022-08-162-5/+11
|
* Fix typo in internal/pycore_atomic.h (GH-95939)fluesvamp2022-08-131-1/+1
|
* gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code ↵Eric Snow2022-08-113-0/+2313
| | | | | | | | | | | | | | | | (gh-95860) We only statically initialize for core code and builtin modules. Extension modules still create the tuple at runtime. We'll solve that part of interpreter isolation separately. This change includes generated code. The non-generated changes are in: * Tools/clinic/clinic.py * Python/getargs.c * Include/cpython/modsupport.h * Makefile.pre.in (re-generate global strings after running clinic) * very minor tweaks to Modules/_codecsmodule.c and Python/Python-tokenize.c All other changes are generated code (clinic, global strings).
* gh-93274: Expose receiving vectorcall in the Limited API (GH-95717)Petr Viktorin2022-08-084-9/+23
|
* gh-94673: Add Per-Interpreter tp_subclasses for Static Builtin Types (gh-95301)Eric Snow2022-08-053-3/+4
|
* gh-94673: Recover Weaklist Lookup Performance (gh-95544)Eric Snow2022-08-041-0/+33
| | | gh-95302 seems to have introduced a small performance regression. Here we make some minor changes to recover that lost performance.
* gh-94936: C getters: co_varnames, co_cellvars, co_freevars (#95008)Ken Jin2022-08-041-0/+6
|
* GH-95245: Store object values and dict pointers in single tagged pointer. ↵Mark Shannon2022-08-013-12/+38
| | | | (GH-95278)
* gh-94673: Add Per-Interpreter tp_weaklist for Static Builtin Types (#95302)Eric Snow2022-07-293-1/+20
| | | | | | | | | | | | | | | * Store tp_weaklist on the interpreter state for static builtin types. * Factor out _PyStaticType_GET_WEAKREFS_LISTPTR(). * Add _PyStaticType_ClearWeakRefs(). * Add a comment about how _PyStaticType_ClearWeakRefs() loops. * Document the change. * Update Doc/whatsnew/3.12.rst * Fix a typo.
* GH-90081: Run python tracers at full speed (GH-95328)Mark Shannon2022-07-281-2/+3
|
* gh-95174: Add pthread stubs for WASI (GH-95234)Christian Heimes2022-07-272-0/+91
| | | Co-authored-by: Brett Cannon <brett@python.org>