#12735 closed (fixed)
django shell is broken with IPython 0.11.x (bzr.r1219)
Reported by: | alperkanat | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
[15:33] (tunix@penguix raptiye)$ ./manage.py shell Traceback (most recent call last): File "./manage.py", line 14, in <module> execute_manager(settings) File "/Users/tunix/Projects/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/Users/tunix/Projects/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Users/tunix/Projects/django/core/management/base.py", line 195, in run_from_argv self.execute(*args, **options.__dict__) File "/Users/tunix/Projects/django/core/management/base.py", line 222, in execute output = self.handle(*args, **options) File "/Users/tunix/Projects/django/core/management/base.py", line 351, in handle return self.handle_noargs(**options) File "/Users/tunix/Projects/django/core/management/commands/shell.py", line 29, in handle_noargs shell = IPython.Shell.IPShell(argv=[]) AttributeError: 'module' object has no attribute 'Shell'
It seems that Shell module is deprecated:
In [1]: from IPython import Shell /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/IPython/Shell.py:31: DeprecationWarning: This module (IPython.Shell) is deprecated. The classes that were in this module have been replaced by: IPShell->IPython.core.iplib.InteractiveShell IPShellEmbed->IPython.core.embed.InteractiveShellEmbed Please migrate your code to use these classes instead. warn(msg, category=DeprecationWarning, stacklevel=1)
Attachments (1)
Change History (8)
comment:1 by , 15 years ago
Component: | Core framework → django-admin.py |
---|---|
Description: | modified (diff) |
by , 15 years ago
Attachment: | django_shell.patch added |
---|
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
follow-up: 4 comment:3 by , 15 years ago
#13554 reported the same issue against the now stable 0.11 IPython release and contains a similar patch.
comment:4 by , 14 years ago
Replying to ramiro:
... against the now stable 0.11 IPython release.
Wrong. IPython 0.1 hasn't been released yet.
comment:5 by , 14 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
Most of the time we try the "new way" to do things first and fall back to the old way if it didn't work out.
Plus, a comment explaining why we need this try...except clause is in order too.
try: shell = IPython.InteractiveShell() except AttributeError: # IPython < 0.11 # Explicitly pass an empty list as arguments, because otherwise IPython # would use sys.argv from this script. shell = IPython.Shell.IPShell(argv=[]) shell.mainloop()
comment:6 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [14895]) Fixed #12735, #14892 and #11542 -- Fixed support for the latest IPython (development) version in the shell management command and added a hook to implement additional shell runners (by subclassing django.core.management.commands.shell.Command, extending the shells
attribute and implement a method with the same name).
(reformatted description)
no 0.11 version of ipython has been released yet, should we wait for a stable release before thinking about adding compatibility code to Django?