4

Use import ipdb; ipdb.set_trace() to insert breakpoint. Color is fine when first hit the breakpoint, but it shows color code instead of true color when hit the BP the second time (by press c) and so on.

    ←[1;32m     72 ←[1;33m        ←[1;32mimport←[0m ←[0mipdb←[0m←[1;33m;←[0m ←[0mipdb←[0m←[1;33m.←[0m←[0mset_trace←[0m←[1;33m(←[0m←[1;33m)←[0m  ←[1;31m# XXX BREAKPO
    INT←[0m←[1;33m←[0m←[0m

It is in windows 7, python 2.7 and 2.6 have the same issue. I think one work around method is using nocolor scheme (how to get nocolor scheme?) And how to fix this issue with color scheme available? Thanks!

Tmx
  • 579
  • 2
  • 6
  • 17

1 Answers1

3

It is a known issue when using ipdb for Windows: https://github.com/gotcha/ipdb/issues/31

Apparently, this ticket is still open.

There is a quickfix from a guy that solves the problem:

OK ... I commented out line ipdb/main.py:43 which sets io.stdout and sys.stdout. Then I added a "pass" statement.

This now seems to work for me on windows.

Gustavo Barbosa
  • 1,340
  • 1
  • 17
  • 27
  • 1
    Thanks! Do you mean the line `# io.stdout = sys.stdout = sys.__stdout__`? In my case, it is at line 60 in `ipdb/__main__.py`. It works for me as well. – Tmx Oct 04 '13 at 21:16
  • Probably you are using a new version of ipdb. But that is it! – Gustavo Barbosa Oct 05 '13 at 16:14
  • I installed `ipdb` via `easy_install`, in order to apply this fix do I have to install from source? – User Oct 23 '13 at 23:47
  • Ok I uninstalled via `pip uninstall ipdb`, then downloaded from https://pypi.python.org/pypi/ipdb, unzipped, edited the file on line 60 as mentioned here, then ran `setup.py install`. Now it's working – User Oct 23 '13 at 23:58
  • This issue has hopefully being fixed in [ipdb 0.8.1](https://pypi.python.org/pypi/ipdb/0.8.1). – Godefroid Chapelle Jun 04 '15 at 12:38