Fix os.makedirs in Windows
authorPhilipp Hagemeister <phihag@phihag.de>
Tue, 6 Sep 2011 15:56:05 +0000 (17:56 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Tue, 6 Sep 2011 15:56:05 +0000 (17:56 +0200)
youtube-dl

index cc6462cc004b1756ac945e13753a6080f0271318..153d4132fae31b7dc0f6e242eae30c65e6b99d14 100755 (executable)
@@ -711,7 +711,9 @@ class FileDownloader(object):
                        return
 
                try:
-                       os.makedirs(os.path.dirname(filename))
+                       dn = os.path.dirname(filename)
+                       if dn != '' and not os.path.exists(dn):
+                               os.makedirs(dn)
                except (OSError, IOError), err:
                        self.trouble(u'ERROR: unable to create directories: %s' % str(err))
                        return