Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No output with ipdb debugger #5247

Closed
jhamrick opened this issue Mar 1, 2014 · 3 comments
Closed

No output with ipdb debugger #5247

jhamrick opened this issue Mar 1, 2014 · 3 comments
Milestone

Comments

@jhamrick
Copy link
Contributor

jhamrick commented Mar 1, 2014

If I create a cell in the notebook that contains a function which calls the ipdb debugger, e.g.:

def f(x):
    import ipdb; ipdb.set_trace()
    return x

Then calling f will drop into ipdb, but running anything in the interactive prompt fails to print the relevant output, for example:

mass-inference-copy0

I'm not sure if this is an IPython bug or an ipdb bug, or possibly an interaction of the two.

@takluyver
Copy link
Member

It turns out ipdb explicitly resets sys.stdout = sys.__stdout__, which breaks redirecting output. I've reported this as gotcha/ipdb#52.

@cclamb
Copy link

cclamb commented Jun 30, 2015

Guys, I can see the fix in ipdb, but it tests against nose having been loaded and when I'm running ipython notebooks nose modules are in fact loaded, so the output still redirects to the console in which the notebook is running rather than the notebook itself. I've commented out the fix locally (where the code runs the test 'if 'nose' in sys.modules.keys():' prior to defining io.stdout so that io.stdout is not redefined:

if 'nose' in sys.modules.keys():
        def update_stdout():
            # setup stdout to ensure output is available with nose
            # io.stdout = sys.stdout = sys.__stdout__
            pass

This does work in my local installation, but likely causes issues with nose tests, which was the initial source of this particular bug. I could very well be doing something wrong with ipython on my end, it's a stock installation via brew on yosemite, using the latest ipython and ipdb code installed via pip.

@takluyver
Copy link
Member

As in #5306, I believe this is an ipdb issue, not anything we can fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants