-color settings ignored whitin ipdb #1

Closed
brickZA opened this Issue Feb 22, 2011 · 4 comments

Comments

Projects
None yet
2 participants
@brickZA

brickZA commented Feb 22, 2011

I originally reported this issue as an ipython bug, but it looks like may be possible to fix it by making changes to ipdb. See ipython/ipython#279

@gotcha

This comment has been minimized.

Show comment
Hide comment
@gotcha

gotcha Mar 2, 2011

Owner

I'll take care of this asap.

Owner

gotcha commented Mar 2, 2011

I'll take care of this asap.

@gotcha

This comment has been minimized.

Show comment
Hide comment
@gotcha

gotcha Jun 11, 2011

Owner

In ipython/ipython#279, you state :

OK. So if I do ipape.get().options.colors in a straight ipython shell, it gives the right answers. Then I instrumented ipdb to print the
same info, and it always gave Linux. Then I saw the following lines in ipdb/init.py:

from IPython.Shell import IPShell
...
shell = IPShell(argv=[''])

By commenting out the the last line, the correct info is obtained by ipdb. Presumably a new ipython shell with default options is
created by the IPShell() statement. Why would ipdb do this? A quick smoke test seems to indicate that ipdb works OK without it.

P.S. the ipdb file I have matches this one:
https://github.com/gotcha/ipdb/blob/master/ipdb/__init__.py

Owner

gotcha commented Jun 11, 2011

In ipython/ipython#279, you state :

OK. So if I do ipape.get().options.colors in a straight ipython shell, it gives the right answers. Then I instrumented ipdb to print the
same info, and it always gave Linux. Then I saw the following lines in ipdb/init.py:

from IPython.Shell import IPShell
...
shell = IPShell(argv=[''])

By commenting out the the last line, the correct info is obtained by ipdb. Presumably a new ipython shell with default options is
created by the IPShell() statement. Why would ipdb do this? A quick smoke test seems to indicate that ipdb works OK without it.

P.S. the ipdb file I have matches this one:
https://github.com/gotcha/ipdb/blob/master/ipdb/__init__.py

@gotcha

This comment has been minimized.

Show comment
Hide comment
@gotcha

gotcha Jun 11, 2011

Owner

As soon as I commented the line you mention,

I got

Traceback (most recent call last):
  File "manual_test.py", line 11, in <module>
    main()
  File "manual_test.py", line 7, in main
    import ipdb; ipdb.set_trace()
  File "/Users/gotcha/tmp/ipdbrel/lib/python2.6/site-packages/ipdb/__init__.py", line 11, in set_trace
    def_colors = ip.options.colors
AttributeError: 'NoneType' object has no attribute 'options'

This made me think that I do not use ipdb the same way as you do.

I guess that you are actually using ipdb from inside IPython.

If this is correct, my last commit should fix the issue.

Can you confirm ?

Owner

gotcha commented Jun 11, 2011

As soon as I commented the line you mention,

I got

Traceback (most recent call last):
  File "manual_test.py", line 11, in <module>
    main()
  File "manual_test.py", line 7, in main
    import ipdb; ipdb.set_trace()
  File "/Users/gotcha/tmp/ipdbrel/lib/python2.6/site-packages/ipdb/__init__.py", line 11, in set_trace
    def_colors = ip.options.colors
AttributeError: 'NoneType' object has no attribute 'options'

This made me think that I do not use ipdb the same way as you do.

I guess that you are actually using ipdb from inside IPython.

If this is correct, my last commit should fix the issue.

Can you confirm ?

@brickZA

This comment has been minimized.

Show comment
Hide comment
@brickZA

brickZA Jun 13, 2011

Indeed, I run it from within IPython. It also seems to work correctly with your latest revision.

brickZA commented Jun 13, 2011

Indeed, I run it from within IPython. It also seems to work correctly with your latest revision.

@gotcha gotcha closed this in 5644ea9 Jun 13, 2011

@pyup-bot pyup-bot referenced this issue in illagrenan/django-cookiecutter-template Sep 5, 2016

Merged

Initial Update #6

@pyup-bot pyup-bot referenced this issue in uktrade/data-hub-leeloo Jan 19, 2017

Merged

Pin ipdb to latest version 0.10.1 #53

@pyup-bot pyup-bot referenced this issue in nicfit/MishMash Feb 26, 2017

Merged

Pin ipdb to latest version 0.10.2 #22

@pyup-bot pyup-bot referenced this issue in oii/ogre Mar 5, 2017

Closed

Pin ipdb to latest version 0.10.2 #7

@pyup-bot pyup-bot referenced this issue in kobinpy/kobin Mar 21, 2017

Closed

Initial Update #70

@pyup-bot pyup-bot referenced this issue in aio-libs/aiologstash Oct 9, 2017

Closed

Scheduled weekly dependency update for week 41 #9

@pyup-bot pyup-bot referenced this issue in aio-libs/aiologstash Oct 16, 2017

Merged

Scheduled weekly dependency update for week 42 #10

@pyup-bot pyup-bot referenced this issue in theflyingturtle/BIGSdb-attributor Jan 8, 2018

Merged

Pin ipdb to latest version 0.10.3 #2

@pyup-bot pyup-bot referenced this issue in rochacbruno/quokka Feb 6, 2018

Closed

Pin ipdb to latest version 0.10.3 #526

@pyup-bot pyup-bot referenced this issue in JavierLopezMunoz/cookiecutter-flask Feb 15, 2018

Open

Pin ipdb to latest version 0.11 #179

@pyup-bot pyup-bot referenced this issue in JavierLopezMunoz/cookiecutter-flask-api Feb 15, 2018

Open

Pin ipdb to latest version 0.11 #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment