From 3361edbee2b8e985bb3770a150b109c86d0fc797 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 14 Apr 2010 21:44:09 +0000 Subject: [PATCH] * morituri/common/encode.py: Before moving the newly tagged file to overwrite the original one, copy over mode. --- ChangeLog | 6 ++++++ morituri/common/encode.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index d9d4b34..33b4bf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-04-14 Thomas Vander Stichele + + * morituri/common/encode.py: + Before moving the newly tagged file to overwrite the original + one, copy over mode. + 2010-04-14 Thomas Vander Stichele * morituri/common/program.py: diff --git a/morituri/common/encode.py b/morituri/common/encode.py index 7ec53f2..15a492e 100644 --- a/morituri/common/encode.py +++ b/morituri/common/encode.py @@ -22,6 +22,7 @@ import math import os +import shutil import tempfile from morituri.common import common, task, checksum @@ -487,6 +488,8 @@ class SafeRetagTask(task.MultiSeparateTask): self.debug('comparing checksums %08x and %08x' % (c1, c2)) if c1 == c2: # data is fine, so we can now move + # but first, copy original mode to our temporary file + shutil.copymode(self._path, self._tmppath) self.debug('moving temporary file to %r' % self._path) os.rename(self._tmppath, self._path) else: