Procházet zdrojové kódy

Fix os.makedirs in Windows

Philipp Hagemeister před 14 roky
rodič
revize
e5e74ffb97
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      youtube-dl

+ 3 - 1
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