Browse Source

Fix os.makedirs in Windows

Philipp Hagemeister 14 years ago
parent
commit
e5e74ffb97
1 changed files with 3 additions and 1 deletions
  1. 3 1
      youtube-dl

+ 3 - 1
youtube-dl

@@ -711,7 +711,9 @@ class FileDownloader(object):
 			return
 			return
 
 
 		try:
 		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:
 		except (OSError, IOError), err:
 			self.trouble(u'ERROR: unable to create directories: %s' % str(err))
 			self.trouble(u'ERROR: unable to create directories: %s' % str(err))
 			return
 			return