Skip to content

Commit 278c227

Browse files
committed
Fix re.sub positional argument in nt_compatible_path
The flags argument (re.IGNORECASE | re.MULTILINE | re.DOTALL = 26) was passed as the 4th positional parameter to re.sub, which is `count`, not `flags`. Use keyword arguments instead.
1 parent 6075040 commit 278c227

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎cairosvg/url.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def nt_compatible_path(path):
6969
"""
7070
if os.name == 'nt' and re.match(
7171
'^/[a-z]:/', path, re.IGNORECASE | re.MULTILINE | re.DOTALL):
72-
return re.sub('^/', '', path, re.IGNORECASE | re.MULTILINE | re.DOTALL)
72+
return re.sub('^/', '', path, count=1, flags=re.IGNORECASE | re.MULTILINE | re.DOTALL)
7373
else:
7474
return path
7575

0 commit comments

Comments
 (0)