ipdb

ipython ipdb, when invoked via ipdb.set_trace(), does not remember the command history while debugging

不打扰是莪最后的温柔 提交于 2019-12-12 08:21:38
问题 iPython does remember the command history if I run ipython normally, e.g. to mess around testing basic things in the repl, but I would like to be able to pull up the debugging commands from the previous debug session, and I am doing my debugging by simply running my program as normal, where the program contains import ipdb def info(type, value, info): import traceback traceback.print_exception(type, value, info) ipdb.pm() import sys sys.excepthook = info trace = ipdb.set_trace Which is to set

“Name Error: name 'get_ipython' is not defined” while preparing a debugging session via “import ipdb”

自作多情 提交于 2019-12-12 02:21:00
问题 I'm trying to install and use ipdb (IPython-enabled pdb) on Python 3.3.5 32 bit on Win10 using PIP 8.1.2. I've installed via PIP (had to install it seprately) in windows cmd with no errors: pip install ipdb I wrote a simple test script expecting to stop in debugger before printing 'test' string, ipdb_test.py : import ipdb ipdb.set_trace() print('test') When running it from IDLE editor the following exceptions show up: Traceback (most recent call last): File "C:\Python33.5-32\lib\site-packages

Start pdb on exception in Tornado's ioloop

烂漫一生 提交于 2019-12-11 13:22:23
问题 It's often useful to do this in standalone Python programs: def excepthook(typ, value, tb): traceback.print_exception(typ, value, tb) pdb.pm() ... if log.getEffectiveLevel() == logging.DEBUG: sys.excepthook = excepthook (i.e. if uncatched exception happens, program is dropped into pdb post-mortem mode) But that doesn't work with Tornado ioloop bc it seems that ioloop catches uncatched exceptions and prints or logs them. If I install above hook, the program enters post-mortem mode only on

Rerun code while debugging and while reloading all modules

﹥>﹥吖頭↗ 提交于 2019-12-11 03:33:58
问题 When debugging my Python code, I run a script through ipdb from the command line, and set a number of breakpoints. Then I make some changes in one or more modules, and rerun. However, if I simply use run modules do not get reloaded. To make sure they do, I can exit and restart Python completely, but then I need to reset all breakpoints, which is tedious if I have many and if done over and over again. Is there a way to restart a run in (i)pdb, and make sure all modules get recursively reloaded

ipdb, multiple threads and autoreloading programs causing ProgrammingError

ぃ、小莉子 提交于 2019-12-10 13:18:51
问题 I am using ipdb debugger to debug multithreaded web applications locally (Django, Plone). Often ipdb seems to get confused because of the autoreload which happens when I am on the debug prompt. The resulting stack trace comes up /Users/mikko/code/xxxx/venv/lib/python2.7/site-packages/IPython/core/history.pyc in writeout_cache(self, conn) 605 with self.db_input_cache_lock: 606 try: --> 607 self._writeout_input_cache(conn) 608 except sqlite3.IntegrityError: 609 self.new_session(conn) /Users

How to install ipdb with Anaconda on Windows?

我与影子孤独终老i 提交于 2019-12-07 07:37:10
问题 I already have Python 2.7 installed but I wanted to try IPython so I installed IPython via Anaconda as recommended on the ipython website (although not sure what the pros/cons of doing this are). Now I would like to use ipdb debugger. I guess I need to make sure it installs underneath the Anaconda version of python rather than the normal python. How do I install this? In general if I want to install some arbitrary python module under Anaconda how do I do this? 回答1: Actually I think in the

ipython debugger: full traceback on interactive pdb?

人走茶凉 提交于 2019-12-07 01:59:19
问题 I recently switched from ipython0.10 to ipython0.11. In ipython0.11, I only see a small snippet of the full traceback when the python debugger engages (i.e. using %pdb ), whereas in ipython0.10 I'd see the full traceback. As far as I can tell, the full traceback is not directly accessible from the pdb command line - you can navigate through it with 'u' but can't see it directly. So, is there any way to show the full traceback? Such as a configuration parameter? Or, even more usefully, is

History across ipdb sessions

落爺英雄遲暮 提交于 2019-12-06 00:38:57
问题 This question has been asked before, but I couldn't find a good answer. So, I am trying to ask again. I would like my ipdb to remember commands across sessions. Right now, it can pull up commands executed in Ipython sessions but not from old ipdb sessions. It would be a huge time saver, if I could have this feature. Does anyone have a solution to this problem? 回答1: I had your same problem, so I forked the project and add a patch for persistent history. You can install the forked version of

using ipdb for debugging python inside emacs

荒凉一梦 提交于 2019-12-05 16:34:35
import pdb; pdb.set_trace() works fine when I run M-x pdb python manage.py runserver However import ipdb would cause the above statement to hang indefinately.. I hear great things about ipdb, how do I use it under emacs? Edit Just found out django has nothing to do with it, simple python file hangs as well. 来源: https://stackoverflow.com/questions/29425325/using-ipdb-for-debugging-python-inside-emacs

ipython debugger: full traceback on interactive pdb?

ε祈祈猫儿з 提交于 2019-12-05 07:12:14
I recently switched from ipython0.10 to ipython0.11. In ipython0.11, I only see a small snippet of the full traceback when the python debugger engages (i.e. using %pdb ), whereas in ipython0.10 I'd see the full traceback. As far as I can tell, the full traceback is not directly accessible from the pdb command line - you can navigate through it with 'u' but can't see it directly. So, is there any way to show the full traceback? Such as a configuration parameter? Or, even more usefully, is there any way to have ipython just show the Exception that was caught, rather than showing where in the