aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2011-09-06 17:56:05 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2011-09-06 17:56:05 +0200
commite5e74ffb97106949c64000e3d4266d0bbf08cc7c (patch)
treee1323e76505ad8adf35b485630e06cd0b22bd3b3
parenteb99a7ee5f7bd36fa9dfcbaf0590ecc2854e3e30 (diff)
Fix os.makedirs in Windows
-rwxr-xr-xyoutube-dl4
1 files changed, 3 insertions, 1 deletions
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