iPython behaves strangely only with Django shell

146 views
Skip to first unread message

Yo-Yo Ma

unread,
Aug 29, 2012, 10:58:03 AM8/29/12
to django-d...@googlegroups.com
The following gist demonstrates a strange phenomenon, which occurs when I use ``python manage.py shell``, but not when I use ``ipython`` alone.

https://gist.github.com/f8c2fd97647de90d915a

I'm not certain whether this is a known issue, or whether it's even a Django bug, but certainly nothing of the sort occurs in iPython when used alone. This occurs with ANY name. I first noticed it when I tried to create a form, and there was a name error on ``forms`` on the line of my first field declaration.

IPython 0.12.1
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)

Jacob Kaplan-Moss

unread,
Aug 29, 2012, 12:37:13 PM8/29/12
to django-d...@googlegroups.com
This looks like some sort of error in your environment; I can't reproduce it::

$ ./manage.py shell
In [1]: import decimal

In [2]: class F(object):
...: d = decimal.Decimal('0')
...:

In [3]:

$ ipython

In [1]: import decimal

In [2] >>> class F(object):
...: d = decimal.Decimal('0')
...:

In [3]:

Jacob
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-developers/-/0IjXTJb6WFYJ.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-develop...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.

Alex Gaynor

unread,
Aug 29, 2012, 12:40:12 PM8/29/12
to django-d...@googlegroups.com
I was able to reproduce this, no idea what the cause is though: http://bpaste.net/show/Fyi0eK1ILaLKRPqnMc8M/

Alex

--
"I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero

Alex Ogier

unread,
Aug 29, 2012, 6:26:04 PM8/29/12
to django-d...@googlegroups.com
This is almost certainly related to https://code.djangoproject.com/ticket/18204

I can repro just as Alex Gaynor did, and the patch from the above
ticket fixes it.

Best,
Alex Ogier
Reply all
Reply to author
Forward
0 new messages