From: Torsten Werner Date: Sat, 26 Mar 2011 17:08:21 +0000 (+0000) Subject: Add missing directories in filewriter.py. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=a49270fc5890c9c4386176404a4b700c9cbde083;p=dak.git Add missing directories in filewriter.py. Signed-off-by: Torsten Werner --- diff --git a/daklib/filewriter.py b/daklib/filewriter.py index a3c16ea8..8907fa6d 100755 --- a/daklib/filewriter.py +++ b/daklib/filewriter.py @@ -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