[SCM] morituri/master: * morituri/common/accurip.py: The AccuRip cache dir could exist without the file; handle that case.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:09:14 UTC 2014


The following commit has been merged in the master branch:
commit ee186a0d301cc677675f1b50d8cbcaca9e14e5d6
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sun Jan 31 15:54:12 2010 +0000

    	* morituri/common/accurip.py:
    	  The AccuRip cache dir could exist without the file; handle that
    	  case.

diff --git a/ChangeLog b/ChangeLog
index 7711202..7c3ef82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-31  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* morituri/common/accurip.py:
+	  The AccuRip cache dir could exist without the file; handle that
+	  case.
+
 2009-12-28  Thomas Vander Stichele  <thomas at apestaart dot org>
 
 	* morituri/common/program.py:
diff --git a/morituri/common/accurip.py b/morituri/common/accurip.py
index 7e6e7c1..babd452 100644
--- a/morituri/common/accurip.py
+++ b/morituri/common/accurip.py
@@ -20,6 +20,7 @@
 # You should have received a copy of the GNU General Public License
 # along with morituri.  If not, see <http://www.gnu.org/licenses/>.
 
+import errno
 import os
 import struct
 import urlparse
@@ -75,7 +76,14 @@ class AccuCache(log.Loggable):
 
     def _cache(self, url, data):
         path = self._getPath(url)
-        os.makedirs(os.path.dirname(path))
+        try:
+            os.makedirs(os.path.dirname(path))
+        except OSError, e:
+            self.debug('Could not make dir %s: %r' % (
+                path, log.getExceptionMessage(e)))
+            if e.errno != errno.EEXIST:
+                raise
+
         handle = open(path, 'wb')
         handle.write(data)
         handle.close()

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list