Skip to content

Commit

Permalink
Fix bug when working with network drives in windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
skuroda committed Apr 13, 2014
1 parent b2d2a51 commit 450aaca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion advanced_new_file/anf_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@
def generate_creation_path(settings, base, path, append_extension=False):
if PLATFORM == "windows":
if not re.match(WIN_ROOT_REGEX, base):
return base + TOP_LEVEL_SPLIT_CHAR + path
if IS_ST3:
drive, _ = os.path.splitdrive(base)
else:
drive, _ = os.path.splitunc(base)
if len(drive) == 0:
return base + TOP_LEVEL_SPLIT_CHAR + path
else:
return os.path.join(base, path)
else:
if not re.match(NIX_ROOT_REGEX, base):
return base + TOP_LEVEL_SPLIT_CHAR + path
Expand Down

0 comments on commit 450aaca

Please sign in to comment.