#15271: pretty_print_default fails in a terminal session
------------------------------+-----------------------------
Reporter: iandrus | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-5.13
Component: user interface | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
------------------------------+-----------------------------
Calling pretty_print_default in a terminal fails:
{{{
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 5.12, Release Date: 2013-10-07 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: pretty_print_default(True)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
<ipython-input-1-b70acc55a8d2> in <module>()
----> 1 pretty_print_default(True)
/Users/ivanandres/SageStuff/sage-5.12/local/lib/python2.7/site-
packages/sage/misc/latex.pyc in pretty_print_default(enable)
2463 """
2464 import sys
-> 2465 sys.displayhook.set_display('typeset' if enable else 'simple')
2466
2467
AttributeError: 'DisplayHook' object has no attribute 'set_display'
sage:
}}}
Perhaps calling pretty_print_default doesn't make much sense in the
terminal, but it's used in the emacs interface to be able to display
typeset output.
I think doctests pass because the doctesting framework sets
sys.displayhook to something else, namely
`sage.misc.displayhook.DisplayHook(sys.displayhook)`. I think the
regression was introduced in #15168, and so I have cc'ed the people
involved there in case they want to weigh in on how this should be fixed.
--
Ticket URL: <http://trac.sagemath.org/ticket/15271>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.