-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
PyREPL exits the interpreter on specific input #125666
Labels
Comments
|
Maybe #88575 has a clue about when Is it possible that instead of eating the space some invisible character got inserted? Edit: oh, it says right on the error that the issue was a null byte. |
|
Aha, I can reproduce on Linux by pressing >>>
SyntaxError: source code string cannot contain null bytes (<python-input-5>)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/ubuntu/projects/cpython/Lib/_pyrepl/__main__.py", line 6, in <module>
__pyrepl_interactive_console()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ubuntu/projects/cpython/Lib/_pyrepl/main.py", line 59, in interactive_console
run_multiline_interactive_console(console)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/home/ubuntu/projects/cpython/Lib/_pyrepl/simple_interact.py", line 160, in run_multiline_interactive_console
more = console.push(_strip_final_indent(statement), filename=input_name, _symbol="single") # type: ignore[call-arg]
File "/home/ubuntu/projects/cpython/Lib/code.py", line 312, in push
more = self.runsource(source, filename, symbol=_symbol)
File "/home/ubuntu/projects/cpython/Lib/_pyrepl/console.py", line 179, in runsource
self.showsyntaxerror(filename, source=source)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/projects/cpython/Lib/_pyrepl/console.py", line 165, in showsyntaxerror
super().showsyntaxerror(filename=filename, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/projects/cpython/Lib/code.py", line 114, in showsyntaxerror
self._showtraceback(typ, value, None, source)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/projects/cpython/Lib/code.py", line 139, in _showtraceback
and not value.text and len(lines) >= value.lineno): ^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>=' not supported between instances of 'int' and 'NoneType'Edit |
pablogsal
pushed a commit
that referenced
this issue
Oct 27, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 27, 2024
…ythonGH-125732) (cherry picked from commit 44becb8) Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
Yhg1s
pushed a commit
that referenced
this issue
Dec 2, 2024
ebonnal
pushed a commit
to ebonnal/cpython
that referenced
this issue
Jan 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug report
Bug description:
Playing with the Python 3.13.0 interpreter installed from brew on macOS 14.7 in a Terminal window.
I entered the repl and typed
Then I hit ctrl-P to get the last line and hit SPC,
/,2. Oddly, the SPC got eaten and the slash ended up right next to theu. I didn't notice that until I hit Enter, at which point the exception occurred and exited the interpreter.Unfortunately, I cannot reproduce it again.
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: