Opened 7 years ago

Closed 7 years ago

#27721 closed Cleanup/optimization (fixed)

Unhelpful error message when trying to run shell that can't be imported

Reported by: Peter Inglesby Owned by: nobody
Component: Core (Management commands) Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When you try to run a specific shell, and that shell can't be imported, you get a traceback with an unhelpful error message:

$ ./ shell -i bpython
Traceback (most recent call last):
  File "./", line 22, in <module>
  File "/Users/inglesp/.pyenv/versions/inglesham-gallery/lib/python3.6/site-packages/django/core/management/", line 367, in execute_from_command_line
  File "/Users/inglesp/.pyenv/versions/inglesham-gallery/lib/python3.6/site-packages/django/core/management/", line 359, in execute
  File "/Users/inglesp/.pyenv/versions/inglesham-gallery/lib/python3.6/site-packages/django/core/management/", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/inglesp/.pyenv/versions/inglesham-gallery/lib/python3.6/site-packages/django/core/management/", line 345, in execute
    output = self.handle(*args, **options)
  File "/Users/inglesp/.pyenv/versions/inglesham-gallery/lib/python3.6/site-packages/django/core/management/commands/", line 124, in handle
    raise ImportError("Couldn't load any of the specified interfaces.")
ImportError: Couldn't load any of the specified interfaces.

Instead you should get CommandError explaining what's gone wrong.

I have a PR which comes from my first attempt at fixing #27670.

Change History (3)

comment:1 by Tim Graham, 7 years ago

Component: UncategorizedCore (Management commands)
Patch needs improvement: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by Tim Graham, 7 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:3 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: newclosed

In 0b2e5da6:

Fixed #27721 -- Added interface name to shell's IPython/bython import error.

Note: See TracTickets for help on using tickets.
Back to Top