diff options
Diffstat (limited to 'pbr/hooks/files.py')
-rw-r--r-- | pbr/hooks/files.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pbr/hooks/files.py b/pbr/hooks/files.py index 0fe0df5..c44af7c 100644 --- a/pbr/hooks/files.py +++ b/pbr/hooks/files.py @@ -41,6 +41,13 @@ def unquote_path(path): # strip the quotes off individual path components because os.walk cannot # handle paths like: "'i like spaces'/'another dir'", so we will pass it # "i like spaces/another dir" instead. + + if os.name == 'nt': + # shlex cannot handle paths that contain backslashes, treating those + # as escape characters. + path = path.replace("\\", "/") + return "".join(shlex.split(path)).replace("/", "\\") + return "".join(shlex.split(path)) |