]> git.decadent.org.uk Git - dak.git/commitdiff
Ignore 'Operation not permitted' error.
authorTorsten Werner <twerner@debian.org>
Mon, 19 Mar 2012 20:11:38 +0000 (21:11 +0100)
committerTorsten Werner <twerner@debian.org>
Mon, 19 Mar 2012 20:11:38 +0000 (21:11 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/queue.py

index 8acfb4e7f198803d3f914c97c1e22df8a3f48b2f..e2ab8467b66ec7901e967e68e0ce513dd24dd8fa 100755 (executable)
@@ -2432,7 +2432,12 @@ distribution."""
         self.force_reject(reject_files)
 
         # Change permissions of the .changes file to be world readable
-        os.chmod(changesfile, os.stat(changesfile).st_mode | stat.S_IROTH)
+        try:
+            os.chmod(changesfile, os.stat(changesfile).st_mode | stat.S_IROTH)
+        except OSError as (errno, strerror):
+            # Ignore 'Operation not permitted' error.
+            if errno != 1:
+                raise
 
         # If we fail here someone is probably trying to exploit the race
         # so let's just raise an exception ...