From 74561500b5cb19ac84ffbed00825f26e35c7cfe1 Mon Sep 17 00:00:00 2001 From: mano3m Date: Sat, 14 Dec 2013 21:12:10 +0100 Subject: [PATCH] Convert windows path to *nix path in sp Fixes #2594 Note that os.path.normath converts '/' to '\\' on windows machines, but unfortunately not the other way around... --- couchpotato/core/helpers/encoding.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/couchpotato/core/helpers/encoding.py b/couchpotato/core/helpers/encoding.py index e88c6ca3..bcc698d7 100644 --- a/couchpotato/core/helpers/encoding.py +++ b/couchpotato/core/helpers/encoding.py @@ -54,6 +54,10 @@ def sp(path, *args): if not path or len(path) == 0: return path + # convert windows path (from remote box) to *nix path + if os.path.sep == '/' and '\\' in path: + path = '/' + path.replace(':', '').replace('\\', '/') + path = os.path.normcase(os.path.normpath(ss(path, *args))) if path != os.path.sep: