Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Revert 19108 remove c element tree #20116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
8dc3917
Update docs.
serhiy-storchaka May 5, 2020
4e01946
bpo-40513: Per-interpreter signals pending (GH-19924)
vstinner May 5, 2020
0b1e330
bpo-40513: Per-interpreter gil_drop_request (GH-19927)
vstinner May 5, 2020
c5fa364
bpo-40514: Add --with-experimental-isolated-subinterpreters (GH-19926)
vstinner May 5, 2020
627f701
bpo-32117: Updated Simpsons names in docs (GH-19737)
kingbuzzman May 5, 2020
4e30ed3
bpo-40513: Per-interpreter recursion_limit (GH-19929)
vstinner May 5, 2020
b0be6b3
bpo-29587: _PyErr_ChainExceptions() checks exception (GH-19902)
vstinner May 5, 2020
6351d9e
bpo-40520: Remove redundant comment in pydebug.h (GH-19931)
shihai1991 May 5, 2020
299b8c6
Revert "bpo-40513: Per-interpreter signals pending (GH-19924)" (GH-19…
vstinner May 5, 2020
607b102
bpo-40521: Disable Unicode caches in isolated subinterpreters (GH-19933)
vstinner May 5, 2020
ac4bf42
bpo-40458: Increase reserved stack space to prevent overflow crash on…
zooba May 5, 2020
b4b5386
bpo-40521: Disable free lists in subinterpreters (GH-19937)
vstinner May 5, 2020
e838a93
bpo-40522: _PyThreadState_Swap() sets autoTSSkey (GH-19939)
vstinner May 5, 2020
0dd5e7a
bpo-40513: new_interpreter() init GIL earlier (GH-19942)
vstinner May 5, 2020
7be4e35
bpo-40513: Per-interpreter GIL (GH-19943)
vstinner May 5, 2020
fb2c7c4
bpo-40513: _xxsubinterpreters.run_string() releases the GIL (GH-19944)
vstinner May 5, 2020
c21c512
bpo-40355: Improve error messages in ast.literal_eval with malformed …
curtisbucher May 5, 2020
1253c3e
bpo-40504: Allow weakrefs to lru_cache objects (GH-19938)
sweeneyde May 5, 2020
96074de
bpo-40523: Add pass-throughs for hash() and reversed() to weakref.pro…
pablogsal May 5, 2020
b9c46a2
bpo-40480 "fnmatch" exponential execution time (GH-19908)
tim-one May 6, 2020
d60040b
bpo-40517: Implement syntax highlighting support for ASDL (#19928)
isidentical May 6, 2020
eff870b
Revert "bpo-40517: Implement syntax highlighting support for ASDL (#1…
rhettinger May 6, 2020
2668a9a
bpo-40527: Fix command line argument parsing (GH-19955)
vstinner May 6, 2020
091951a
bpo-40528: Improve and clear several aspects of the ASDL definition c…
isidentical May 6, 2020
89fc4a3
bpo-40521: Disable method cache in subinterpreters (GH-19960)
vstinner May 6, 2020
d8135e9
bpo-40533: Disable GC in subinterpreters (GH-19961)
vstinner May 6, 2020
b7aa23d
bpo-40521: Disable list free list in subinterpreters (GH-19959)
vstinner May 6, 2020
999ec9a
bpo-40334: Add type to the assignment rule in the grammar file (GH-19…
lysnikolaou May 6, 2020
441416c
Fix typo in sqlite3 documentation (GH-19965)
naglis May 6, 2020
99db2a1
bpo-40334: Allow trailing comma in parenthesised context managers (GH…
pablogsal May 6, 2020
470aac4
bpo-40334: Generate comments in the parser code to improve debugging …
pablogsal May 6, 2020
c1c7d8e
bpo-40397: Refactor typing._GenericAlias (GH-19719)
serhiy-storchaka May 7, 2020
3466922
bpo-1635741: Port errno module to multiphase initialization (GH-19923)
corona10 May 7, 2020
2f37c35
bpo-40334: Fix error location upon parsing an invalid string literal …
lysnikolaou May 7, 2020
4638c64
bpo-40334: Error message for invalid default args in function call (G…
lysnikolaou May 7, 2020
e1becf4
bpo-38787: C API for module state access from extension methods (PEP …
encukou May 7, 2020
8963a7f
bpo-40545: Export _PyErr_GetTopmostException() function (GH-19978)
vstinner May 7, 2020
a1d9e0a
bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-19768)
ericsnowcurrently May 7, 2020
c068b53
bpo-38787: Update structures.rst docs (PEP 573) (GH-19980)
shihai1991 May 7, 2020
4e36376
bpo-40548: Always run GitHub action, even on doc PRs (GH-19981)
vstinner May 7, 2020
b7a78ca
bpo-40517: Implement syntax highlighting support for ASDL (GH-19967)
isidentical May 7, 2020
db9163c
bpo-40555: Check for p->error_indicator in loop rules after the main …
pablogsal May 8, 2020
02fa0ea
bpo-40273: Reversible mappingproxy (FH-19513)
ZackerySpytz May 8, 2020
d2c349b
bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
cjerdonek May 8, 2020
2effef7
Make the first dataclass example more useful (GH-19994)
nedbat May 8, 2020
81a5fc3
bpo-40541: Add optional *counts* parameter to random.sample() (GH-19970)
rhettinger May 8, 2020
d10091a
bpo-40502: Initialize n->n_col_offset (GH-19988)
nanjekyejoannah May 8, 2020
7f7e706
bpo-39791: Add files() to importlib.resources (GH-19722)
jaraco May 8, 2020
77c6146
bpo-40566: Apply PEP 573 to abc module (GH-20005)
corona10 May 9, 2020
2c3d508
bpo-40570: Improve compatibility of uname_result with late-bound .pla…
jaraco May 9, 2020
ac7a92c
bpo-40334: Avoid collisions between parser variables and grammar vari…
pablogsal May 10, 2020
85bdec1
Add link to Enum class (GH-19884)
andresdelfino May 10, 2020
fcb2856
bpo-40397: Remove __args__ and __parameters__ from _SpecialGenericAli…
serhiy-storchaka May 10, 2020
1c2fa78
bpo-40549: Convert posixmodule.c to multiphase init (GH-19982)
vstinner May 10, 2020
86a93fd
bpo-37986: Improve perfomance of PyLong_FromDouble() (GH-15611)
sir-sigurd May 10, 2020
0122d48
bpo-40397: Fix subscription of nested generic alias without parameter…
serhiy-storchaka May 10, 2020
2fbc57a
bpo-40257: Tweak docstrings for special generic aliases. (GH-20022)
serhiy-storchaka May 10, 2020
2cc9b84
Improve code clarity for the set lookup logic (GH-20028)
rhettinger May 10, 2020
5b956ca
bpo-40585: Normalize errors messages in codeop when comparing them (G…
pablogsal May 11, 2020
6067d4b
bpo-40575: Avoid unnecessary overhead in _PyDict_GetItemIdWithError()…
scoder May 11, 2020
d5d9a71
bpo-36346: array: Don't use deprecated APIs (GH-19653)
methane May 11, 2020
ef7973a
bpo-40561: Add docstrings for webbrowser open functions (GH-19999)
bsolomon1124 May 11, 2020
86d6944
bpo-40584: Update PyType_FromModuleAndSpec() to process tp_vectorcall…
shihai1991 May 11, 2020
27c0d9b
bpo-40334: produce specialized errors for invalid del targets (GH-19911)
hauntsaninja May 11, 2020
4804b5b
bpo-39465: Don't access directly _Py_Identifier members (GH-20043)
vstinner May 11, 2020
21cdb71
bpo-40571: Make lru_cache(maxsize=None) more discoverable (GH-20019)
rhettinger May 12, 2020
b617993
bpo-40602: Rename hashtable.h to pycore_hashtable.h (GH-20044)
vstinner May 12, 2020
d0919f0
bpo-40602: _Py_hashtable_new() uses PyMem_Malloc() (GH-20046)
vstinner May 12, 2020
b1b4c79
bpo-40480: restore ability to join fnmatch.translate() results (GH-20…
tim-one May 12, 2020
f3a5b7a
bpo-39481: remove generic classes from ipaddress/mmap (GH-20045)
isidentical May 12, 2020
74ea6b5
bpo-40593: Improve syntax errors for invalid characters in source cod…
serhiy-storchaka May 12, 2020
7c6e970
bpo-40602: Optimize _Py_hashtable for pointer keys (GH-20051)
vstinner May 12, 2020
5650e76
bpo-40596: Fix str.isidentifier() for non-canonicalized strings conta…
serhiy-storchaka May 12, 2020
4c9ea09
bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks (…
scoder May 12, 2020
f453221
bpo-40602: Add _Py_HashPointerRaw() function (GH-20056)
vstinner May 12, 2020
d6b727e
bpo-40501: Replace ctypes code in uuid with native module (GH-19948)
zooba May 12, 2020
3d54211
Fix Wikipedia link (GH-20031)
guoguo12 May 12, 2020
9e2ca17
bpo-40609: Rewrite how _tracemalloc handles domains (GH-20059)
vstinner May 12, 2020
f9b3b58
bpo-40609: Remove _Py_hashtable_t.key_size (GH-20060)
vstinner May 13, 2020
2d0a3d6
bpo-40609: Add destroy functions to _Py_hashtable (GH-20062)
vstinner May 13, 2020
d95bd42
bpo-40609: _tracemalloc allocates traces (GH-20064)
vstinner May 13, 2020
5b0a303
bpo-40609: _Py_hashtable_t values become void* (GH-20065)
vstinner May 13, 2020
42bae3a
bpo-40602: Optimize _Py_hashtable_get_ptr() (GH-20066)
vstinner May 13, 2020
b809717
bpo-40331: Increase test coverage for the statistics module (GH-19608)
tzabal May 13, 2020
fa0a66e
bpo-40613: Remove compiler warning from _xxsubinterpretersmodule (GH-…
corona10 May 13, 2020
de92769
bpo-34790: add version of removal of explicit passing of coros to `as…
Jackenmen May 13, 2020
a15c9b3
bpo-40334: Always show the caret on SyntaxErrors (GH-20050)
lysnikolaou May 13, 2020
97e1568
bpo-38787: Fix Argument Clinic defining_class_converter (GH-20074)
vstinner May 13, 2020
d72ea60
issue-25872: Fix KeyError using linecache from multiple threads (GH-1…
mgraczyk May 13, 2020
d6fb53f
bpo-39465: Remove _PyUnicode_ClearStaticStrings() from C API (GH-20078)
vstinner May 13, 2020
75cd8e4
bpo-29587: Make gen.throw() chain exceptions with yield from (GH-19858)
cjerdonek May 13, 2020
3d17c04
bpo-40521: Add PyInterpreterState.unicode (GH-20081)
vstinner May 13, 2020
6f2f475
bpo-40597: email: Use CTE if lines are longer than max_line_length co…
ivyl May 14, 2020
7443d42
bpo-40275: Import locale module lazily in gettext (GH-19905)
shihai1991 May 14, 2020
e77d428
bpo-40495: compileall option to hardlink duplicate pyc files (GH-19901)
frenzymadness May 14, 2020
97f33c3
bpo-40549: posixmodule.c uses defining_class (GH-20075)
vstinner May 14, 2020
f2c3b68
Revert "bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-197…
vstinner May 14, 2020
a482dc5
bpo-40602: Write unit tests for _Py_hashtable_t (GH-20091)
vstinner May 14, 2020
bcc3036
bpo-40619: Correctly handle error lines in programs without file mode…
pablogsal May 14, 2020
ce21cfc
bpo-40618: Disallow invalid targets in augassign and except clauses (…
lysnikolaou May 14, 2020
d2dc827
bpo-40602: _Py_hashtable_set() reports rehash failure (GH-20077)
vstinner May 14, 2020
75d7257
bpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-19983)
FFY00 May 14, 2020
edf2643
bpo-40460: Fix typo in idlelib/zzdummy.py (GH-20093)
vstinner May 14, 2020
4b972fa
bpo-40462: Fix typo in test_json (GH-20094)
vstinner May 14, 2020
7ba1f75
bpo-38872: Document exec symbol for codeop.compile_command (GH-20047)
nanjekyejoannah May 15, 2020
16ab070
bpo-40334: Correctly identify invalid target in assignment errors (GH…
pablogsal May 15, 2020
6a78589
bpo-40548: github actions: pass the changes check on no source change…
FFY00 May 15, 2020
1aa8767
Update code comment re: location of struct _is. (GH-20067)
cjerdonek May 15, 2020
15bc9ab
bpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072)
gvanrossum May 15, 2020
4a12d12
Fix typo in code comment in main_loop label. (GH-20068)
cjerdonek May 15, 2020
003708b
Trivial typo fix in _tkinter.c (GH-19622)
AndrewGYork May 15, 2020
6e57237
bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
vstinner May 15, 2020
16d4e6f
bpo-40479: Fix hashlib issue with OpenSSL 3.0.0 (GH-20107)
tiran May 15, 2020
62d618c
bpo-40479: Test with latest OpenSSL versions (GH-20108)
tiran May 15, 2020
60e8085
Merge branch 'revert-19108-remove-cElementTree' of https://github.com…
serhiy-storchaka May 15, 2020
d577e9b
Merge branch 'master' into revert-19108-remove-cElementTree
serhiy-storchaka May 15, 2020
8d39d0a
Update NEWS.
serhiy-storchaka May 15, 2020
55e413a
Merge branch 'revert-19108-remove-cElementTree' of https://github.com…
serhiy-storchaka May 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-40513: Per-interpreter recursion_limit (GH-19929)
Move recursion_limit member from _PyRuntimeState.ceval to
PyInterpreterState.ceval.

* Py_SetRecursionLimit() now only sets _Py_CheckRecursionLimit
  of ceval.c if the current Python thread is part of the main
  interpreter.
* Inline _Py_MakeEndRecCheck() into _Py_LeaveRecursiveCall().
* Convert _Py_RecursionLimitLowerWaterMark() macro into a static
  inline function.
  • Loading branch information
vstinner authored May 5, 2020
commit 4e30ed3af06ae655f4cb8aad8cba21f341384250
24 changes: 13 additions & 11 deletions 24 Include/internal/pycore_ceval.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ PyAPI_DATA(int) _Py_CheckRecursionLimit;
/* With USE_STACKCHECK macro defined, trigger stack checks in
_Py_CheckRecursiveCall() on every 64th call to Py_EnterRecursiveCall. */
static inline int _Py_MakeRecCheck(PyThreadState *tstate) {
return (++tstate->recursion_depth > _Py_CheckRecursionLimit
return (++tstate->recursion_depth > tstate->interp->ceval.recursion_limit
|| ++tstate->stackcheck_counter > 64);
}
#else
static inline int _Py_MakeRecCheck(PyThreadState *tstate) {
return (++tstate->recursion_depth > _Py_CheckRecursionLimit);
return (++tstate->recursion_depth > tstate->interp->ceval.recursion_limit);
}
#endif

Expand All @@ -90,20 +90,22 @@ static inline int _Py_EnterRecursiveCall_inline(const char *where) {

#define Py_EnterRecursiveCall(where) _Py_EnterRecursiveCall_inline(where)


/* Compute the "lower-water mark" for a recursion limit. When
* Py_LeaveRecursiveCall() is called with a recursion depth below this mark,
* the overflowed flag is reset to 0. */
#define _Py_RecursionLimitLowerWaterMark(limit) \
(((limit) > 200) \
? ((limit) - 50) \
: (3 * ((limit) >> 2)))

#define _Py_MakeEndRecCheck(x) \
(--(x) < _Py_RecursionLimitLowerWaterMark(_Py_CheckRecursionLimit))
static inline int _Py_RecursionLimitLowerWaterMark(int limit) {
if (limit > 200) {
return (limit - 50);
}
else {
return (3 * (limit >> 2));
}
}

static inline void _Py_LeaveRecursiveCall(PyThreadState *tstate) {
if (_Py_MakeEndRecCheck(tstate->recursion_depth)) {
tstate->recursion_depth--;
int limit = tstate->interp->ceval.recursion_limit;
if (tstate->recursion_depth < _Py_RecursionLimitLowerWaterMark(limit)) {
tstate->overflowed = 0;
}
}
Expand Down
1 change: 1 addition & 0 deletions 1 Include/internal/pycore_interp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct _pending_calls {
};

struct _ceval_state {
int recursion_limit;
/* Records whether tracing is on for any thread. Counts the number
of threads for which tstate->c_tracefunc is non-NULL, so if the
value is 0, we know we don't have to check this thread's
Expand Down
1 change: 0 additions & 1 deletion 1 Include/internal/pycore_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ extern "C" {
/* ceval state */

struct _ceval_runtime_state {
int recursion_limit;
struct _gil_runtime_state gil;
};

Expand Down
24 changes: 14 additions & 10 deletions 24 Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,14 +699,15 @@ int _Py_CheckRecursionLimit = Py_DEFAULT_RECURSION_LIMIT;
void
_PyEval_InitRuntimeState(struct _ceval_runtime_state *ceval)
{
ceval->recursion_limit = Py_DEFAULT_RECURSION_LIMIT;
_Py_CheckRecursionLimit = Py_DEFAULT_RECURSION_LIMIT;
_gil_initialize(&ceval->gil);
}

int
_PyEval_InitState(struct _ceval_state *ceval)
{
ceval->recursion_limit = Py_DEFAULT_RECURSION_LIMIT;

struct _pending_calls *pending = &ceval->pending;
assert(pending->lock == NULL);

Expand All @@ -730,16 +731,18 @@ _PyEval_FiniState(struct _ceval_state *ceval)
int
Py_GetRecursionLimit(void)
{
struct _ceval_runtime_state *ceval = &_PyRuntime.ceval;
return ceval->recursion_limit;
PyThreadState *tstate = _PyThreadState_GET();
return tstate->interp->ceval.recursion_limit;
}

void
Py_SetRecursionLimit(int new_limit)
{
struct _ceval_runtime_state *ceval = &_PyRuntime.ceval;
ceval->recursion_limit = new_limit;
_Py_CheckRecursionLimit = new_limit;
PyThreadState *tstate = _PyThreadState_GET();
tstate->interp->ceval.recursion_limit = new_limit;
if (_Py_IsMainInterpreter(tstate)) {
_Py_CheckRecursionLimit = new_limit;
}
}

/* The function _Py_EnterRecursiveCall() only calls _Py_CheckRecursiveCall()
Expand All @@ -750,8 +753,7 @@ Py_SetRecursionLimit(int new_limit)
int
_Py_CheckRecursiveCall(PyThreadState *tstate, const char *where)
{
_PyRuntimeState *runtime = tstate->interp->runtime;
int recursion_limit = runtime->ceval.recursion_limit;
int recursion_limit = tstate->interp->ceval.recursion_limit;

#ifdef USE_STACKCHECK
tstate->stackcheck_counter = 0;
Expand All @@ -760,8 +762,10 @@ _Py_CheckRecursiveCall(PyThreadState *tstate, const char *where)
_PyErr_SetString(tstate, PyExc_MemoryError, "Stack overflow");
return -1;
}
/* Needed for ABI backwards-compatibility (see bpo-31857) */
_Py_CheckRecursionLimit = recursion_limit;
if (_Py_IsMainInterpreter(tstate)) {
/* Needed for ABI backwards-compatibility (see bpo-31857) */
_Py_CheckRecursionLimit = recursion_limit;
}
#endif
if (tstate->recursion_critical)
/* Somebody asked that we don't check for recursion. */
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.