-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-26806: add 30 to the recursion limit in IDLE's shell #13944
bpo-26806: add 30 to the recursion limit in IDLE's shell #13944
Conversation
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.
c7e1a04
to
7d7b622
Compare
@terryjreedy, I couldn't figure out where you'd like this mentioned in which docs. I'm happy to add appropriate wording if you point me in the right direction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also see new comment on the issue, which includes some manual tests.
When you're done making the requested changes, leave the comment: |
Our messages crossed. I worry about the docstring and doc and blurb when we agree on everything else. I considered the PRs you and Cheryl worked on last week a higher priority. |
1. define wrapping code at the module level 2. increase recursion limit delta from 25 to 30 3. add a note to the wrapped functions' doc-strings 4. extract the recursion limit delta to a variable 5. rework test and add another one
@terryjreedy, I have made the requested changes; please review again. |
Thanks for making the requested changes! @terryjreedy: please review the changes made to this pull request. |
6554218
to
38bab8d
Compare
Ping, @terryjreedy. I'd like to get this into 3.8.0. BTW, should we backport this to 3.7.4? |
Doc/library/idle.rst
Outdated
@@ -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 their visibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"their" is ambiguous here; I suggest "to reduce the visibility of the additional stack frames."
Also, perhaps we should mention that this is not just about visibility? E.g. "to reduce the effect of the additional stack frames".
@terryjreedy, see my two comments on your recent changes. |
I have made changes (improvements) in response to both comments. I'd like to merge this and move on to other issues. |
Looks good to me, just one minor typo. I'll fix it and merge later today
even I'm at a computer.
…On Sat, Jul 6, 2019, 10:31 Terry Jan Reedy ***@***.***> wrote:
I have made changes (improvements) in response to both comments. I'd like
to merge this and move on to other issues.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#13944?email_source=notifications&email_token=AAEB6OO5UUE4J3JX2UPNVOLP6BC65A5CNFSM4HWYA6G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZKUI7A#issuecomment-508904572>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEB6OLBEVI7FF47OEYJGTLP6BC65ANCNFSM4HWYA6GQ>
.
|
Thanks @taleinat for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
GH-14621 is a backport of this pull request to the 3.8 branch. |
) 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>
GH-14622 is a backport of this pull request to the 3.7 branch. |
) 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>
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>
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>
|
No, I did really mean to ask about 3.7.4, but we've already backported to 3.7, so I'll take that as a yes :)
I agree. |
@taleinat @terryjreedy It seems that IDLE fails to start after fcf1d00 when CPython is configured without docstrings (
|
Having read the IDLE part of #14592 a couple of days before merging, it should have occurred to me that we were adding a bug. The possibility of such an oversight is why I don't try to squeeze in substantial code patched after, or even immediately before a .rc. Fortunately, beginner users of IDLE are unlikely to recompile this way. I just tested the effect of -OO and it also sets doc to None, although only for functions in the code being run, not builtins. I am working on a patch now: #14657. |
This is done to compensate for the extra stack frames added by IDLE's shell, which can cause problems when setting the recursion limit to low values.
This wraps
sys.setrecursionlimit()
andsys.getrecursionlimit()
, adding a note about this to their doc-strings.https://bugs.python.org/issue26806