GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up|
The patch fixes the issue on master on Windows. I can't tell if this is the best fix or if there could be an issue not caught in the tests. |
|
I'm not sure that this is the right approach yet. While you prevent the prompt from changing to "...", the code still keeps accumulating input, which means the line count will be off. Example:
I suspect you may have to doctor the caller of |
…espace
|
Thanks for suggestions @gvanrossum, current version fixed accumulation bug. |
| if (tok->nextprompt != NULL) | ||
| tok->prompt = tok->nextprompt; | ||
| if (tok->nextprompt != NULL) { | ||
| if (newtok != NULL && (*newtok == '#' || *newtok == ' ' || *newtok == '\t')) |
| if (tok->nextprompt != NULL) { | ||
| if (newtok != NULL && (*newtok == '#' || *newtok == ' ' || *newtok == '\t')) | ||
| tok->nextprompt = NULL; | ||
| else |
| if (tok->nextprompt != NULL) | ||
| tok->prompt = tok->nextprompt; | ||
| if (tok->nextprompt != NULL) { | ||
| if (newtok != NULL && (*newtok == '#' || *newtok == ' ' || *newtok == '\t')) |
Suggestion: You may be able to simplify this with strchr (check that is not slower....maybe is faster if inlined).
|
Left some comment regarding the code itself, I didn't check the solution itself yet. |
|
(I am working through a backlog, I should pay attention to reviews and other tasks that have been waiting longer first.) |
|
Better, but there's still a regression. Look here:
Previously this would just give a
|
|
I think it works now but i am not sure if it is an ideal solution or not. |
|
I have to think about this more. It seems to work but the changes look ad-hoc (and not at all what I had expected they would be when I wrote up the bug description). I need to do some deep thinking about whether this is the right place in the code to implement this behavior. Ping me if I haven't replied in a week -- I don't want to keep you hanging forever! |
|
I have a different suggestion:
|
|
Thanks for your suggestions Guido. |
|
LGTM. Can one of the other reviewers double-check there's nothing amiss? |
|
The 2 error cases on the issue and 2 above and otherw work for me. I presume
is correct. |
|
Thanks @isidentical for the PR |
…espace (pythonGH-17421) https://bugs.python.org/issue38673 (cherry picked from commit 109fc27) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
|
GH-17516 is a backport of this pull request to the 3.8 branch. |
…espace (GH-17421) https://bugs.python.org/issue38673 (cherry picked from commit 109fc27) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
…espace (pythonGH-17421) https://bugs.python.org/issue38673 (cherry picked from commit 109fc27) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com> (cherry picked from commit 184a381) Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
…espace (GH-17421) (GH-17522) https://bugs.python.org/issue38673 (cherry picked from commit 109fc27) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
isidentical commentedNov 30, 2019
•
edited by miss-islington
https://bugs.python.org/issue38673
Automerge-Triggered-By: @gvanrossum