Skip to content

Commit

Permalink
Improve path normalization to cover more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
pineapplemachine committed Aug 21, 2018
1 parent 4ae3140 commit 31be499
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/normalize_path.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
def normalize_path(path):
if not path:
return path
path = path.replace("\\ ", " ")
path = path.replace("\\'", "'")
path = path.replace("\\\"", "\"")
if path[0] == '"' and path[-1] == '"':
path = path[1:-1]
elif path[0] == "'" and path[-1] == "'":
path = path[1:-1]
path = path.replace("\\ ", " ")
return path

0 comments on commit 31be499

Please sign in to comment.