From 6cf05503120e8e5041327f25911e0f451c040390 Mon Sep 17 00:00:00 2001 From: Renha Date: Tue, 13 Jan 2015 22:24:35 +0000 Subject: [PATCH] Bugfix for Invalid cross-device link on Linux when /tmp is on another fs --- src/octoprint/util/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py index b07fa6e0..239cd8c9 100644 --- a/src/octoprint/util/__init__.py +++ b/src/octoprint/util/__init__.py @@ -9,6 +9,7 @@ import time import re import tempfile import logging +import shutil from flask import make_response from octoprint.settings import settings, default_settings @@ -182,7 +183,8 @@ def safeRename(old, new, throw_error=False): raise e else: # on anything else than windows it's ooooh so much easier... - os.rename(old, new) + # because of shutil's high level, maybe win32-specific code isn't needed anymore + shutil.move(old, new) def silentRemove(file):