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

1 imagemagick failing doctest in misc/latex.py #28867

Closed
seblabbe opened this issue Dec 10, 2019 · 9 comments
Closed

1 imagemagick failing doctest in misc/latex.py #28867

seblabbe opened this issue Dec 10, 2019 · 9 comments

Comments

@seblabbe
Copy link
Contributor

sage -t --optional=sage,imagemagick src/sage/misc/latex.py

gives

Using --optional=imagemagick,memlimit,sage
Doctesting 1 file.
sage -t src/sage/misc/latex.py
**********************************************************************
File "src/sage/misc/latex.py", line 1086, in sage.misc.latex.Latex.?
Failed example:
    latex.eval("\ThisIsAnInvalidCommand", {}) # optional -- ImageMagick
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.misc.latex.Latex.?[1]>", line 1, in <module>
        latex.eval("\ThisIsAnInvalidCommand", {}) # optional -- ImageMagick
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/misc/latex.py", line 1115, in eval
        O.write(str_to_bytes(x, encoding='utf-8'))
    TypeError: write() argument must be str, not bytes
**********************************************************************
1 item had failures:
   1 of   3 in sage.misc.latex.Latex.?
    [303 tests, 1 failure, 0.93 s]
----------------------------------------------------------------------
sage -t src/sage/misc/latex.py  # 1 doctest failed
----------------------------------------------------------------------

CC: @fchapoton

Component: misc

Author: Frédéric Chapoton

Branch/Commit: c2c24c4

Reviewer: Sébastien Labbé

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

@seblabbe seblabbe added this to the sage-9.0 milestone Dec 10, 2019
@embray
Copy link
Contributor

embray commented Jan 6, 2020

comment:1

Ticket retargeted after milestone closed

@embray embray modified the milestones: sage-9.0, sage-9.1 Jan 6, 2020
@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 1, 2020

comment:2

Fredéric, I think you solved something similar in the past. Do you see easily a fix?

@fchapoton
Copy link
Contributor

comment:3

Voilà. Y a de grandes chances que ca casse les doctests sous python2. A mon avis, y a pas moyen d'avoir les deux. Et c'est un doctest optionnel..


New commits:

c2c24c4trac 28867 py3 fix for latex

@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@fchapoton
Copy link
Contributor

Commit: c2c24c4

@fchapoton
Copy link
Contributor

Branch: u/chapoton/28867

@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 2, 2020

Reviewer: Sébastien Labbé

@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 2, 2020

comment:4

I confirm it fixes the issue for that optional doctest (9.1.beta2 running Python 3).

@vbraun
Copy link
Member

vbraun commented Feb 10, 2020

Changed branch from u/chapoton/28867 to c2c24c4

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

4 participants