Skip to content

Interpreter crashes when given non-existent file in interactive mode #919

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

Closed
arian-deimling opened this issue Sep 27, 2021 · 0 comments
Closed
Labels
Milestone

Comments

@arian-deimling
Copy link
Contributor

See below. Running the same command with python3 versus bpython and py3 prints a short error message and then opens the interpreter, but bpy just crashes.

bpython % python3 -i file_that_does_not_exist.py
/Library/Developer/CommandLineTools/usr/bin/python3: can't open file 'file_that_does_not_exist.py': [Errno 2] No such file or directory
>>> ^D


bpython % bpython -i file_that_does_not_exist.py
Traceback (most recent call last):
  File "/Users/arian/Library/Python/3.8/bin/bpython", line 8, in <module>
    sys.exit(main())
  File "/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/curtsies.py", line 181, in main
    bpargs.exec_code(interp, exec_args)
  File "/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/args.py", line 161, in exec_code
    with open(args[0]) as sourcefile:
FileNotFoundError: [Errno 2] No such file or directory: 'file_that_does_not_exist.py'
bpython % 

@sebastinas sebastinas added the bug label Oct 1, 2021
@sebastinas sebastinas added this to the release-0.22 milestone Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants