-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix error generation for missing pgf.texsystem. #26689
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
Conversation
) from err | ||
except OSError as err: | ||
raise RuntimeError( | ||
f"Error starting process {self.latex.args[0]!r}") from err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? AFAICS, if the try block raises self.latex is not set in this method, i.e. it will be whatever it was before, possibly None?!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, there was the same bug there as with the FileNotFoundError case; fixed it too.
If pgf.texsystem isn't installed, then self.latex will not be created *at all* by _setup_latex_process, and we thus cannot access self.latex.args[0], but must instead read the rc value again. To make this clearer, move the error handling into _setup_latex_process, instead of having it outside. No test because that'd require setting up a test env where pgf.texsystem is explicitly *missing* (or go through lots of mocks), which seems not worth it.
…689-on-v3.8.x Backport PR #26689 on branch v3.8.x (Fix error generation for missing pgf.texsystem.)
Fix error generation for missing pgf.texsystem. (cherry picked from commit 5f785e3)
If pgf.texsystem isn't installed, then self.latex will not be created at all by _setup_latex_process, and we thus cannot access self.latex.args[0], but must instead read the rc value again. To make this clearer, move the error handling into _setup_latex_process, instead of having it outside.
No test because that'd require setting up a test env where pgf.texsystem is explicitly missing (or go through lots of mocks), which seems not worth it.
This is (I think) the origin of the AttributeError in #26551.
PR summary
PR checklist