From 31be499eee6d2d0826f5133c99f64ab8f79ebc39 Mon Sep 17 00:00:00 2001 From: Sophie Kirschner Date: Tue, 21 Aug 2018 09:35:38 +0300 Subject: [PATCH] Improve path normalization to cover more cases --- src/normalize_path.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/normalize_path.py b/src/normalize_path.py index 6c3ddfb..c8f554c 100644 --- a/src/normalize_path.py +++ b/src/normalize_path.py @@ -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 \ No newline at end of file