-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve path normalization to cover more cases
- Loading branch information
1 parent
4ae3140
commit 31be499
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|