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
Python polls unnecessarily every 0.1 second when interactive #43941
Comments
When python is running an interactive session, and is To reproduce:
This isn't a significant problem, since it only affects The attached patch (against Python-2.5c1) modifies the |
Logged In: YES Original report: This is tied to the version of readline being used; the |
Logged In: YES Recent versions of readline can still support callbacks if Applied as rev. 51815 to the trunk, so the fix will be in |
Logged In: YES I'd be cautious about applying this to 2.5: we could end up with the same HAVE_READLINE_CALLBACK is defined when readline is 2.1 *or newer* I think... |
Logged In: YES HAVE_READLINE_CALLBACK was not defined with readline 5.1 on I didn't think of a possible interaction with signals, and |
Logged In: YES On looking at the readline code, I think this patch makes no The code in readline.c for the callbacks looks like this: has_input = 0;
while (!has_input) {
...
has_input = select.select(rl_input);
}
if (has_input > 0) {read character}
elif (errno == EINTR) {check signals} So I think that, if a signal is delivered to a thread and I'm not sure what to do at this point. I think the new code |
Logged In: YES HAVE_READLINE_CALLBACK is defined by configure.in whenever I agree that the code looks buggy on platforms in which |
Logged In: YES That's exactly my setup. I don't think there is a -dev I do note that READLINE_CALLBACKS is defined in |
Logged In: YES I'm finding the function because it's defined in the In any case, this isn't desperately important, since you've |
I'm fine if this patch is applied. Since it was applied to trunk, it seems like it might as well go into 2.5.1 as well. I agree it's not that high priority, but don't see much reason to wait either. OTOH, I won't lose sleep if it's not applied, so do what you think is best. |
Applied to 2.5.1 in rev. 53516. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: