Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
bpo-26806: add 30 to the recursion limit in IDLE's shell (GH-13944)
This is done to compensate for the extra stack frames added by
IDLE itself, which cause problems when setting the recursion limit
to low values.

This wraps sys.setrecursionlimit() and sys.getrecursionlimit()
as invisibly as possible.
(cherry picked from commit fcf1d00)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
  • Loading branch information
taleinat authored and miss-islington committed Jul 6, 2019
commit dcbf6f40e4e91647f65d36f21b0d263ae7cec008
4 changes: 4 additions & 0 deletions Doc/library/idle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,10 @@ or ``print`` or ``write`` to sys.stdout or sys.stderr,
IDLE should be started in a command line window. The secondary subprocess
will then be attached to that window for input and output.

The IDLE code running in the execution process adds frames to the call stack
that would not be there otherwise. IDLE wraps ``sys.getrecursionlimit`` and
``sys.setrecursionlimit`` to reduce the effect of the additional stack frames.

If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``,
IDLE's changes are lost and input from the keyboard and output to the screen
will not work correctly.
Expand Down
5 changes: 5 additions & 0 deletions Lib/idlelib/NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Released on 2019-06-24?
======================================


bpo-26806: To compensate for stack frames added by IDLE and avoid
possible problems with low recursion limits, add 30 to limits in the
user code execution process. Subtract 30 when reporting recursion
limits to make this addition mostly transparent.

bpo-37325: Fix tab focus traversal order for help source and custom
run dialogs.

Expand Down
Loading