Closed k4ml closed 11 years ago
I'm having the same issue. According to sys.exc_info(), the complaint is that Rpdb has no attribute "do_sys".
I tried using a modified version of rpdb to add a do_sys attribute, but by assigning it to do_continue and by writing my own no-op do_sys, and this only led to more issues.
Can you give me some context, what version of Python are you using, what environment?
I am on Ubuntu 10.04 with Python 2.6.5 running under uWSGI 1.2.6.
Note that it works fine under the Django runserver on Ubuntu 12.04 with Python 2.7.3. I don't know if the OS/Python versions have anything to do with it vs. uWSGI itself.
Notice that this well-meaning blogger has the same issue, but probably doesn't realize it (see his console output): http://blog.krajniak.info/2012/05/remote-pdb-and-django.html
Same for me under Python 2.7.3, Ubuntu. rpdb==0.1.2
ed@corsa:/tmp$ cat b.py
from future import unicode_literals
def pi(): print 1 import rpdb; rpdb.set_trace() print 2 pi()
ed@corsa:/tmp$ python2.7 b.py 1 pdb is running on corsa:4444
ed@corsa:/tmp$ telnet localhost 4444 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. --Call--
/usr/local/lib/python2.7/dist-packages/rpdb/init.py(37)shutdown() -> def shutdown(self): (Pdb)
Can you get back to set_trace using the "up" pdb command?
Yes:
ed@krab ~ $ telnet krab 4444
Trying 127.0.1.1...
Connected to krab.
Escape character is '^]'.
--Call--
> /usr/local/lib/python2.7/dist-packages/rpdb/__init__.py(37)shutdown()
-> def shutdown(self):
(Pdb) up
> /usr/local/lib/python2.7/dist-packages/rpdb/__init__.py(62)set_trace()
-> debugger.shutdown()
(Pdb) up
> <ipython-input-1-6aa2ac9c9437>(3)pi()
-> import rpdb; rpdb.set_trace()
(Pdb)
I merged the fix from k4ml because I can't remember why I had this finally. Let me know if that works for you (also published on pypi as 0.1.3: https://pypi.python.org/pypi/rpdb/0.1.3)
Confirming - under current master issue is fixed. Thanks for your kind support :)
Btw 0.1.3 in not installable from pypi using pip. pip install rpdb
installs 0.1.2.
Oops, forgot to do sdist upload. That's fixed now.
It work fine if I used the following:-
import rpdb debugger = rpdb.Rpdb('127.0.0.1', 4444) debugger.set_trace()
but when using the shortcut
import rpdb;rpdb.set_trace()
it always end up in the Rpdb.shutdown(). So I removed the call to shutdown() in the finally block and it seem to work now.