[Django] #27721: Unhelpful error message when trying to run shell that can't be imported

9 views
Skip to first unread message

Django

unread,
Jan 10, 2017, 4:47:31 PM1/10/17
to django-...@googlegroups.com
#27721: Unhelpful error message when trying to run shell that can't be imported
------------------------------------------+------------------------
Reporter: Peter Inglesby | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
When you try to run a specific shell, and that shell can't be imported,
you get a traceback with an unhelpful error message:

{{{
$ ./manage.py shell -i bpython
Traceback (most recent call last):
File "./manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/inglesp/.pyenv/versions/inglesham-gallery/lib/python3.6
/site-packages/django/core/management/__init__.py", line 367, in
execute_from_command_line
utility.execute()
File "/Users/inglesp/.pyenv/versions/inglesham-gallery/lib/python3.6
/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/inglesp/.pyenv/versions/inglesham-gallery/lib/python3.6
/site-packages/django/core/management/base.py", 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/base.py", 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/shell.py", 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/27721>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 11, 2017, 7:53:48 AM1/11/17
to django-...@googlegroups.com
#27721: Unhelpful error message when trying to run shell that can't be imported
-------------------------------------+-------------------------------------

Reporter: Peter Inglesby | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Management | Version: 1.10
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1
* type: Uncategorized => Cleanup/optimization
* component: Uncategorized => Core (Management commands)
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/27721#comment:1>

Django

unread,
Jan 11, 2017, 5:17:04 PM1/11/17
to django-...@googlegroups.com
#27721: Unhelpful error message when trying to run shell that can't be imported
-------------------------------------+-------------------------------------

Reporter: Peter Inglesby | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Management | Version: 1.10
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/27721#comment:2>

Django

unread,
Jan 12, 2017, 1:12:40 PM1/12/17
to django-...@googlegroups.com
#27721: Unhelpful error message when trying to run shell that can't be imported
-------------------------------------+-------------------------------------

Reporter: Peter Inglesby | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Core (Management | Version: 1.10
commands) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"0b2e5da6ed946f10b4e0c1959f19d98449815715" 0b2e5da6]:
{{{
#!CommitTicketReference repository=""
revision="0b2e5da6ed946f10b4e0c1959f19d98449815715"
Fixed #27721 -- Added interface name to shell's IPython/bython import
error.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27721#comment:3>

Reply all
Reply to author
Forward
0 new messages