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

plotting (with custom PNG viewer as per trac 11795) can silently fail #13842

Open
greg-minshall opened this issue Dec 19, 2012 · 2 comments
Open

Comments

@greg-minshall
Copy link

hi. with #11795 installed, misconfiguring the, e.g., PNG viewer causes a plot to fail silently.

import sage.misc.viewer
viewer.png_viewer('/x/y/display')
circle((0,0), 1, rgbcolor=(1,1,0))

note the "e.g." above. the same thing happens for PDF and DVI files. browser, on the other hand, reports an error:

sage: viewer.browser('/x/y/w3m')
sage: tutorial()
/Users/buildsage/src/import/sage/sage-5.4.1/local/bin/sage-native-execute: line 8: /x/y/w3m: No such file or directory

on the mailing list, Ivan Andrus commented thus:

That's true. The function specifically sends all output to /dev/null, so there's probably some reason for doing that. But we could at least use the exit status to print a warning that it might not work.

(ps -- let me know about formatting, tagging, etc., mistakes i may have made.)

CC: @nathanncohen @gvol

Component: user interface

Issue created by migration from https://trac.sagemath.org/ticket/13842

@ppurka
Copy link
Member

ppurka commented May 26, 2013

comment:2

The file sage/misc/viewer.py passes all the doctests precisely because it does not care whether the commands that are being doctested are actually present in the system. I tried adding a check and then almost everything fails.

How should I go about adding the test for a command then? Introduce a new keyword to the Viewer._set() method called check_command=True?

@jhpalmieri
Copy link
Member

comment:3

To add a test use sage.doctest.DOCTEST_MODE in the code to avoid user settings, as in for example sage/misc/hg.py or sage/plot/animate.py.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants