Skip to content

uv, ipython3 and django shell is not working #15221

@Jharanza

Description

@Jharanza

Besides the error, when I run the Django shell with:
$ uv run ipython3 manage.py shell
I get the following error: :
/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py:915: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
warn(
12 objects imported automatically (use -v 2 for details).

Type 'manage.py help ' for help on a specific subcommand.

Available subcommands:

[auth]
changepassword
createsuperuser

[contenttypes]
remove_stale_contenttypes

[django]
check
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
makemigrations
migrate
optimizemigration
sendtestemail
shell
showmigrations
sqlflush
sqlmigrate
sqlsequencereset
squashmigrations
startapp
startproject
test
testserver

[sessions]
clearsessions

[staticfiles]
collectstatic
findstatic
runserver
Traceback (most recent call last):
File "/usr/bin/ipython3", line 8, in
sys.exit(start_ipython())
^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/IPython/init.py", line 130, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 982, in launch_instance
app.start()
File "/usr/lib/python3/dist-packages/IPython/terminal/ipapp.py", line 320, in start
self.shell.restore_term_title()
File "/usr/lib/python3/dist-packages/IPython/terminal/interactiveshell.py", line 626, in restore_term_title
restore_term_title()
File "/usr/lib/python3/dist-packages/IPython/utils/terminal.py", line 115, in restore_term_title
_restore_term_title()
File "/usr/lib/python3/dist-packages/IPython/utils/terminal.py", line 83, in _restore_term_title_xterm
assert _xterm_term_title_saved
^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

If you suspect this is an IPython 8.20.0 bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True

I'm not sure whether this issue is related to Django or IPython3, but it seems that IPython is not working properly with the Django shell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions