From: Philipp Hagemeister Date: Tue, 6 Sep 2011 15:56:05 +0000 (+0200) Subject: Fix os.makedirs in Windows X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=e5e74ffb97106949c64000e3d4266d0bbf08cc7c;p=youtube-dl Fix os.makedirs in Windows --- diff --git a/youtube-dl b/youtube-dl index cc6462cc0..153d4132f 100755 --- a/youtube-dl +++ b/youtube-dl @@ -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