File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 17
17
from string import Formatter
18
18
19
19
from ..logger import create_logger
20
+ from ..platformflags import is_windows
20
21
21
22
logger = create_logger ()
22
23
@@ -436,8 +437,9 @@ class Location:
436
437
(?P<path>.+)
437
438
"""
438
439
439
- # abs_path must start with a slash.
440
- abs_path_re = r"(?P<path>/.+)"
440
+ abs_path_re_posix = r"(?P<path>/.+)" # abs path must start with a slash.
441
+ abs_path_re_win = r"(?P<path>[a-zA-Z]:/.+)" # abs path must start with drive : slash.
442
+ abs_path_re = abs_path_re_win if is_windows else abs_path_re_posix
441
443
442
444
# path may or may not start with a slash.
443
445
abs_or_rel_path_re = r"(?P<path>.+)"
@@ -455,7 +457,8 @@ class Location:
455
457
456
458
rclone_re = re .compile (r"(?P<proto>rclone):(?P<path>(.*))" , re .VERBOSE )
457
459
458
- file_or_socket_re = re .compile (r"(?P<proto>(file|socket))://" + abs_path_re , re .VERBOSE )
460
+ sep = r"/" if is_windows else r"" # on windows, an addtl. slash is needed
461
+ file_or_socket_re = re .compile (r"(?P<proto>(file|socket))://" + sep + abs_path_re , re .VERBOSE )
459
462
460
463
local_re = re .compile (local_path_re , re .VERBOSE )
461
464
Original file line number Diff line number Diff line change 8
8
9
9
is_win32 = sys .platform .startswith ("win32" )
10
10
is_cygwin = sys .platform .startswith ("cygwin" )
11
+ is_msys = sys .platform .startswith ("msys" )
12
+ is_windows = is_win32 or is_cygwin or is_msys
11
13
12
14
is_linux = sys .platform .startswith ("linux" )
13
15
is_freebsd = sys .platform .startswith ("freebsd" )
You can’t perform that action at this time.
0 commit comments