From 780f1fe1506216e22f954114fc094a96c786d870 Mon Sep 17 00:00:00 2001 From: Per Austrin Date: Tue, 4 Dec 2018 21:33:44 +0100 Subject: [PATCH] problem2pdf: replace os.rename by shutil.move so that cross-filesystem moves work Fixes #107 --- problemtools/problem2pdf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/problemtools/problem2pdf.py b/problemtools/problem2pdf.py index f27c3168..96f0560b 100644 --- a/problemtools/problem2pdf.py +++ b/problemtools/problem2pdf.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import re import os.path +import shutil import sys import string from string import Template @@ -43,7 +44,7 @@ def convert(problem, options=None): os.chdir(origcwd) if not options.nopdf: - os.rename(os.path.splitext(texfile)[0] + '.pdf', destfile) + shutil.move(os.path.splitext(texfile)[0] + '.pdf', destfile) if templ != None: templ.cleanup()