summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--texgen.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/texgen.py b/texgen.py
index 3a2964d..73277fc 100644
--- a/texgen.py
+++ b/texgen.py
@@ -3,6 +3,7 @@ import asyncio.subprocess as subprocess
import contextlib
import hashlib
import os
+import shlex
import shutil
from aiofile import async_open
@@ -61,5 +62,9 @@ class TexGenerator:
raise TexGenerationError('xelatex timed out')
if proc.returncode != 0:
raise TexGenerationError(f'xelatex process exited with non-zero code {proc.returncode}')
- os.rename(os.path.join(workdir, f'{job_name}.pdf'), cache_file_path)
+ os.system(' '.join([
+ 'mv',
+ shlex.quote(os.path.join(workdir, f'{job_name}.pdf')),
+ shlex.quote(cache_file_path),
+ ]))
return cache_file_path