8000 gh-94360: Fix a tokenizer crash when reading encoded files with syntax errors from stdin by pablogsal · Pull Request #94386 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-94360: Fix a tokenizer crash when reading encoded files with syntax errors from stdin #94386

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
merged 2 commits into from
Jul 5, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
nitty nit
  • Loading branch information
ambv authored Jul 5, 2022
commit a22ae03afeaeafa7a37ac226e7bd666eb62708da
2 changes: 1 addition & 1 deletion Parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ tok_concatenate_interactive_new_line(struct tok_state *tok, const char *line) {

Py_ssize_t current_size = tok->interactive_src_end - tok->interactive_src_start;
Py_ssize_t line_size = strlen(line);
char last_char = line[line_size > 0 ? line_size - 1: line_size];
char last_char = line[line_size > 0 ? line_size - 1 : line_size];
if (last_char != '\n') {
line_size += 1;
}
Expand Down
0