Commit 80d93a6
committed
Suppress traceback chaining for tex subprocess failures.
For tex failures (e.g., `figtext(.5, .5, "\N{snowman}", usetex=True)`),
instead of
```
Traceback (most recent call last):
File ".../matplotlib/texmanager.py", line 253, in _run_checked_subprocess
report = subprocess.check_output(
File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['latex', '-interaction=nonstopmode', '--halt-on-error', '../71cab2b5aca12ed5cad4a481b3b00e42.tex']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
<a long traceback>
raise RuntimeError(
RuntimeError: latex was not able to process the following string:
b'\\u2603'
Here is the full report generated by latex:
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=latex)
<the tex output>
```
instead report the failure in a single block, as
```
Traceback (most recent call last):
<a long traceback>
raise RuntimeError(
RuntimeError: latex was not able to process the following string:
b'\\u2603'
Here is the full command invocation and its output:
latex -interaction=nonstopmode --halt-on-error ../71cab2b5aca12ed5cad4a481b3b00e42.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=latex)
<the tex output>
```
(the exception chaining is not particularly informative, and we can move
the only relevant info -- the command we tried to run -- to the second
exception).1 parent 63e9ea3 commit 80d93a6
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
| 265 | + | |
265 | 266 | | |
266 | 267 | | |
| 268 | + | |
267 | 269 | | |
268 | | - | |
| 270 | + | |
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
| |||
0 commit comments