RuntimeError in completer #543

jstenar opened this Issue Jun 28, 2011 · 2 comments


None yet
2 participants

jstenar commented Jun 28, 2011

Using master f0437d2 I get "RuntimeError: can't re-enter readline" when completing on properties of some objects. I have gotten it on proxy objects in Pyro (python remote objects) and some other objects I don't recall right now. This problem does not appear on 0.10.2.

I get a crashreport ( ) but ipython does not go down completely. There are two files in the gist, the first one is the crash report and the second one is the output that I got at the terminal that was not part of the crash report.



jstenar commented Jun 28, 2011

By catching both ValueError and AttributeError in utils/dir2 as shown below, the error disappears:

if hasattr(obj, 'trait_names'):
        may_have_dupes = True
    except (TypeError, AttributeError):
        # This will happen if `obj` is a class and not an instance.

# Support for PyCrust-style _getAttributeNames magic method.
if hasattr(obj, '_getAttributeNames'):
        may_have_dupes = True
    except (TypeError, AttributeError):
        # `obj` is a class and not an instance.  Ignore
        # this error.

minrk commented Jun 28, 2011

Thanks for tracking it down! It's pretty terrible when remote object libraries lie to hasattr. I'll go ahead and make the change.

minrk closed this in b9b8f44 Jun 28, 2011

@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

@minrk Jörgen Stenarson + minrk don't rely on hasattr in utils.dir2
Some remote object libraries (e.g. Pyro) will lie to hasattr, not raising AttributeError until the attr is actually requested.
This prevents these AttributeErrors from crashing IPython.

closes gh-543

Signed-off-by: MinRK <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment