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

Allow spaces in jobname #71

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

the-nick-of-time
Copy link

The call to latexrun inserts the job name, but doesn't do any shell escaping while passing it. Wrapping this input in single quotes keeps it from being split or otherwise processed by the next shell pass.

@@ -66,7 +66,7 @@
return_code = subprocess.call(
args=[
latexrun_file,
"--latex-args=-shell-escape -jobname=" + job_name,
"--latex-args=-shell-escape -jobname='" + job_name.replace("'", "'\\''") + "'",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use something a bit more robust here, like shlex.quote() or pipes.quote() if we have to support Python 2 (I'm really not familiar with Python and don't know how to tell from a quick glance whether this is Python 2 or 3...)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm missing something, we're using Python 3 (https://bazel.build/reference/be/python#py_binary.python_version). shlex.quote() would likely be the best way forward here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants