#17419: Make sure that IPython 3.0 will warn about exceptions in formatting
-------------------------------------------------+-------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.5
Component: doctest framework | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: Reported upstream. No | Work issues:
feedback yet. | Commit:
Branch: | Stopgaps:
Dependencies: |
-------------------------------------------------+-------------------------
Changes (by jdemeyer):
* upstream: N/A => Reported upstream. No feedback yet.
Old description:
> With IPython 3.0.0-dev, there is a doctest failure
> {{{
> sage -t --long src/sage/plot/graphics.py
> **********************************************************************
> File "src/sage/plot/graphics.py", line 2412, in
> sage.plot.graphics.Graphics.?
> Failed example:
> plot(x, typeset='garbage')
> Expected:
> doctest:...: FormatterWarning: Exception in text/plain formatter:
> typeset must be set to one of 'default', 'latex', or 'type1'; got
> 'garbage'.
> None
> Got:
> Traceback (most recent call last):
> File "/usr/local/src/sage-git/local/lib/python2.7/site-
> packages/IPython/core/formatters.py", line 232, in warn_format_error
> r = method(self, *args, **kwargs)
> File "/usr/local/src/sage-git/local/lib/python2.7/site-
> packages/sage/repl/display/formatter.py", line 281, in __call__
> obj._graphics_() # ignore whether there actually is graphics
> File "/usr/local/src/sage-git/local/lib/python2.7/site-
> packages/sage/plot/graphics.py", line 872, in _graphics_
> figsize=figsize, dpi=dpi)
> File "/usr/local/src/sage-git/local/lib/python2.7/site-
> packages/sage/structure/graphics_file.py", line 268, in
> graphics_from_save
> save_function(filename, **kwds)
> File "/usr/local/src/sage-git/local/lib/python2.7/site-
> packages/sage/misc/decorators.py", line 471, in wrapper
> return func(*args, **kwds)
> File "/usr/local/src/sage-git/local/lib/python2.7/site-
> packages/sage/plot/graphics.py", line 3048, in save
> figure = self.matplotlib(**options)
> File "/usr/local/src/sage-git/local/lib/python2.7/site-
> packages/sage/plot/graphics.py", line 2453, in matplotlib
> " or 'type1'; got '{}'.".format(typeset))
> ValueError: typeset must be set to one of 'default', 'latex', or
> 'type1'; got 'garbage'.
> None
> **********************************************************************
> }}}
>
> I propose to remove the `@warn_format_error` from
> `SageDoctestTextFormatter.__call__`
New description:
With IPython 3.0.0-dev, there is a doctest failure
{{{
sage -t --long src/sage/plot/graphics.py
**********************************************************************
File "src/sage/plot/graphics.py", line 2412, in
sage.plot.graphics.Graphics.?
Failed example:
plot(x, typeset='garbage')
Expected:
doctest:...: FormatterWarning: Exception in text/plain formatter:
typeset must be set to one of 'default', 'latex', or 'type1'; got
'garbage'.
None
Got:
Traceback (most recent call last):
File "/usr/local/src/sage-git/local/lib/python2.7/site-
packages/IPython/core/formatters.py", line 232, in warn_format_error
r = method(self, *args, **kwargs)
File "/usr/local/src/sage-git/local/lib/python2.7/site-
packages/sage/repl/display/formatter.py", line 281, in __call__
obj._graphics_() # ignore whether there actually is graphics
File "/usr/local/src/sage-git/local/lib/python2.7/site-
packages/sage/plot/graphics.py", line 872, in _graphics_
figsize=figsize, dpi=dpi)
File "/usr/local/src/sage-git/local/lib/python2.7/site-
packages/sage/structure/graphics_file.py", line 268, in graphics_from_save
save_function(filename, **kwds)
File "/usr/local/src/sage-git/local/lib/python2.7/site-
packages/sage/misc/decorators.py", line 471, in wrapper
return func(*args, **kwds)
File "/usr/local/src/sage-git/local/lib/python2.7/site-
packages/sage/plot/graphics.py", line 3048, in save
figure = self.matplotlib(**options)
File "/usr/local/src/sage-git/local/lib/python2.7/site-
packages/sage/plot/graphics.py", line 2453, in matplotlib
" or 'type1'; got '{}'.".format(typeset))
ValueError: typeset must be set to one of 'default', 'latex', or
'type1'; got 'garbage'.
None
**********************************************************************
}}}
'''Upstream bug''': [https://github.com/ipython/ipython/issues/7072]
--
--
Ticket URL: <http://trac.sagemath.org/ticket/17419#comment:16>
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/d/optout.