]> err.no Git - dak/commitdiff
Add missing directories in filewriter.py.
authorTorsten Werner <twerner@debian.org>
Sat, 26 Mar 2011 17:08:21 +0000 (17:08 +0000)
committerTorsten Werner <twerner@debian.org>
Sat, 26 Mar 2011 17:08:21 +0000 (17:08 +0000)
Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/filewriter.py

index a3c16ea828c9f7b10b6881fec336fa9b294542a1..8907fa6d96fa39f7c8e2d7163f3c20e4f361bd2e 100755 (executable)
@@ -54,6 +54,11 @@ class BaseFileWriter(object):
         '''
         Returns a file object for writing.
         '''
+        # create missing directories
+        try:
+            os.makedirs(os.path.dirname(self.path))
+        except:
+            pass
         self.file = open(self.path + '.new', 'w')
         return self.file