Skip to content
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

Command not found will no longer traceback #218

Merged
merged 1 commit into from
Mar 7, 2021

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Mar 5, 2021

Previously, when a command was not found, Jupyter printed a traceback on the user:

$ jupyter foobar
Traceback (most recent call last):
  File "/usr/bin/jupyter", line 33, in <module>
    sys.exit(load_entry_point('jupyter-core==4.6.3', 'console_scripts', 'jupyter')())
  File "/usr/lib/python3.9/site-packages/jupyter_core/command.py", line 247, in main
    command = _jupyter_abspath(subcommand)
  File "/usr/lib/python3.9/site-packages/jupyter_core/command.py", line 133, in _jupyter_abspath
    raise Exception(
Exception: Jupyter command `jupyter-foobar` not found.

Generally, I believe users should only see tracebacks when they are debugging
stuff or when there is an unexpected "crash".

In Fedora, such traceback is detected as crash by the automatic bug reporting tool.

Now, an error message is printed to stderr instead to provide a better UX.

Fixes #211

Previously, when a command was not found, Jupyter printed a traceback on the user:

    $ jupyter foobar
    Traceback (most recent call last):
      File "/usr/bin/jupyter", line 33, in <module>
        sys.exit(load_entry_point('jupyter-core==4.6.3', 'console_scripts', 'jupyter')())
      File "/usr/lib/python3.9/site-packages/jupyter_core/command.py", line 247, in main
        command = _jupyter_abspath(subcommand)
      File "/usr/lib/python3.9/site-packages/jupyter_core/command.py", line 133, in _jupyter_abspath
        raise Exception(
    Exception: Jupyter command `jupyter-foobar` not found.

Generally, I believe users should only see tracebacks when they are debugging
stuff or when there is an unexpected "crash".

In Fedora, such traceback is detected as crash by the automatic bug reporting tool.

Now, an error message is printed to stderr instead to provide a better UX.

Fixes jupyter#211
Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice - thank you.

Copy link
Member

@rgbkrk rgbkrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you for this fix.

@kevin-bates kevin-bates merged commit e69a436 into jupyter:master Mar 7, 2021
@hroncok hroncok deleted the issue211 branch March 8, 2021 12:13
@jasongrout jasongrout added this to the 4.8 milestone Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE: Don't traceback on command not found
4 participants