Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitae6e943

Browse files
committed
Improve error arising from fully commented-out TeX strings.
Currently, `figtext(.5, .5, "%foo", usetex=True)` results in an obscureexception (`FileNotFoundError: No such file or directory: blah.dvi`).Best would be to force TeX to always generate a page even if the stringis "empty" (from TeX's PoV), but in the meantime, at least log a warningto make the situation slightly less confusing.
1 parent7b6eb77 commitae6e943

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎lib/matplotlib/dviread.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,15 @@ def __init__(self, filename, dpi):
196196
Use None to return TeX's internal units.
197197
"""
198198
_log.debug('Dvi: %s',filename)
199-
self.file=open(filename,'rb')
199+
try:
200+
self.file=open(filename,'rb')
201+
exceptFileNotFoundError:
202+
# This warning should go away once we fix texmanager to always
203+
# create a dvi file, even if it is empty.
204+
_log.warning(
205+
'%s does not exist; this may arise from processing an empty '
206+
'or fully commented-out TeX string.',filename)
207+
raise
200208
self.dpi=dpi
201209
self.fonts= {}
202210
self.state=_dvistate.pre

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp