Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#19789 closed Bug (invalid)

With IPython `./manage.py shell` gives back a DeprecationWarning regarding the with statement

Reported by: Rohan Jain Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: int_ua Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I came across this issue while debugging #19738. This happens in a fresh django project.

The traceback:

└─> ./manage.py shell                                                                                                                          Python 2.7.3rc2 (default, Mar 21 2012, 06:59:11) 
Type "copyright", "credits" or "license" for more information.

IPython 0.13.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
('VIRTUAL_ENV ->', '/home/rohan/.virtualenvs/django/lib/python2.7/site-packages')
/home/rohan/workspace/src/ipython/IPython/frontend/terminal/interactiveshell.py:463: DeprecationWarning: With-statements now directly support multiple context managers
  with nested(self.builtin_trap, self.display_trap):

It doesn't seem like an issue in IPython because I was able to similarly invoke it from a python script without any warning.

Change History (6)

comment:1 by Aymeric Augustin, 11 years ago

Deprecation warnings are silent in Python by default, but Django makes them loud since #18985 was fixed.

comment:2 by Rohan Jain, 11 years ago

Alright, thanks. This is an IPython issue then. Should I close this as invalid? Also, if #19737 goes along, all the similar issue will become irrelevant.

comment:3 by Rohan Jain, 11 years ago

Resolution: invalid
Status: newclosed

comment:4 by anonymous, 11 years ago

Any work around this thing, the warning is pretty irritating and I am finicky about these things

comment:5 by int_ua, 10 years ago

Cc: int_ua added

The workaround/fix is to remove the nested() function:

with self.builtin_trap, self.display_trap:

https://github.com/ipython/ipython/issues/4455

comment:6 by Claude Paroz, 10 years ago

Note that this should be fixed by [0c6a3399523d850cfbd20de54cd089419a47383d]

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