Fix directory creation not working with absolute paths
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Thu, 24 Jul 2008 08:07:46 +0000 (10:07 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:23:31 +0000 (11:23 +0100)
youtube-dl

index 4dea34376bba4b87dfcf4ff7a47fd570ec906549..fe64819c75a7c481ee75c243c02b80d881b624f8 100755 (executable)
@@ -94,6 +94,7 @@ class FileDownloader(object):
                """Create directory components in filename. Similar to Unix "mkdir -p"."""
                components = filename.split(os.sep)
                aggregate = [os.sep.join(components[0:x]) for x in xrange(1, len(components))]
+               aggregate = ['%s%s' % (x, os.sep) for x in aggregate] # Finish names with separator
                for dir in aggregate:
                        if not os.path.exists(dir):
                                os.mkdir(dir)