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

Better handling of pdflatex compilation failure #36

Closed
jgiret opened this issue Jan 8, 2021 · 2 comments · Fixed by #37
Closed

Better handling of pdflatex compilation failure #36

jgiret opened this issue Jan 8, 2021 · 2 comments · Fixed by #37

Comments

@jgiret
Copy link

jgiret commented Jan 8, 2021

Description of feature

Currently, the call to pdflatex is done by using a os.system call. However, this is not recommended (https://docs.python.org/3/library/subprocess.html#replacing-os-system), and in this case it is not possible to retrieve the return code at the end of the execution. It would allow to raise an exception when an error is encountered during the compilation of the .tex file. We have experienced silent errors of the .tex compilation (either because the latex distribution was not recent enough, or because special characters were not escaped), and we are currently checking the existence of the pdf output file at the end, which is not optimal.

Potential solution

I would replace the os.system call by a subprocess.call, and raise an exception if the return code is different from 0. I think this is a very small and easy development, and I can submit you a PR if you wish. Tell me what is the best option for you.

@JustinSGray
Copy link
Contributor

though Im not currently the lead maintainer of this repo, I would personally approve of a PR for this. It sounds like a good change.

@eirikurj
Copy link
Contributor

eirikurj commented Jan 8, 2021

@jgiret we welcome PRs, so I encourage you to submit a PR for this.

@ewu63 ewu63 mentioned this issue Feb 13, 2021
12 tasks
@ewu63 ewu63 closed this as completed in #37 Feb 13, 2021
ewu63 added a commit that referenced this issue Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants