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

ExecutionResult uses __qualname__, breaks PY2 #9756

vbraun opened this issue Jul 13, 2016 · 1 comment


None yet
3 participants
Copy link

commented Jul 13, 2016

Sage uses run_cell() a lot to test the desired command line behavior. But with IPython 5 I get:

IPython 5.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: ip = get_ipython()

In [2]: ip.run_cell('1+1')
Out[2]: 2
Out[2]: ---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/home/vbraun/Sage/git-develop/local/lib/python2.7/site-packages/IPython/core/formatters.pyc in __call__(self, obj)
    668                 type_pprinters=self.type_printers,
    669                 deferred_pprinters=self.deferred_printers)
--> 670             printer.pretty(obj)
    671             printer.flush()
    672             return stream.getvalue()

/home/vbraun/Sage/git-develop/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)
    381                             if callable(meth):
    382                                 return meth(obj, self, cycle)
--> 383             return _default_pprint(obj, self, cycle)
    384         finally:
    385             self.end_group()

/home/vbraun/Sage/git-develop/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _default_pprint(obj, p, cycle)
    501     if _safe_getattr(klass, '__repr__', None) not in _baseclass_reprs:
    502         # A user-provided repr. Find newlines and replace them with p.break_()
--> 503         _repr_pprint(obj, p, cycle)
    504         return
    505     p.begin_group(1, '<')

/home/vbraun/Sage/git-develop/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)
    692     """A pprint that just redirects to the normal repr function."""
    693     # Find newlines and replace them with p.break_()
--> 694     output = repr(obj)
    695     for idx,output_line in enumerate(output.splitlines()):
    696         if idx:

/home/vbraun/Sage/git-develop/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in __repr__(self)
    185     def __repr__(self):
    186         return '<%s object at %x, execution_count=%s error_before_exec=%s error_in_exec=%s result=%s>' %\
--> 187                 (self.__class__.__qualname__, id(self), self.execution_count, self.error_before_exec, self.error_in_exec, repr(self.result))

AttributeError: type object 'ExecutionResult' has no attribute '__qualname__'

@takluyver takluyver added this to the 5.1 milestone Jul 13, 2016

Carreau added a commit to Carreau/ipython that referenced this issue Jul 25, 2016


This comment has been minimized.

Copy link

commented Jul 25, 2016

#9804 should fix that, and sorry for breaking things. We'll try to push for a 5.0.1, or a 5.1.0 soon with most of these bugfixes.

Thanks !

Carreau added a commit to Carreau/ipython that referenced this issue Jul 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.