Skip to content

Commit

Permalink
avoid double path-separators
Browse files Browse the repository at this point in the history
(#74)
  • Loading branch information
mikf committed Mar 22, 2018
1 parent b25ae30 commit 3f2dd6b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gallery_dl/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,12 @@ def set_directory(self, keywords):
self.basedirectory,
*segments
)

# remove trailing path separator;
# occurs if the last argument to os.path.join() is an empty string
if self.directory[-1] == os.sep:
self.directory = self.directory[:-1]

self.realdirectory = self.adjust_path(self.directory)
os.makedirs(self.realdirectory, exist_ok=True)

Expand Down

0 comments on commit 3f2dd6b

Please sign in to comment.