From e69421226b7c6297a24c6043a907da628e5a0f38 Mon Sep 17 00:00:00 2001 From: mano3m Date: Sun, 29 Dec 2013 23:42:55 +0100 Subject: [PATCH] Remove leading '//' from *NIX paths Fixes #2506, #2021 --- couchpotato/core/helpers/encoding.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/helpers/encoding.py b/couchpotato/core/helpers/encoding.py index 9f361a10..a6f15119 100644 --- a/couchpotato/core/helpers/encoding.py +++ b/couchpotato/core/helpers/encoding.py @@ -64,10 +64,13 @@ def sp(path, *args): if path != os.path.sep: path = path.rstrip(os.path.sep) - # Add a trailing separator in case it is a root folder on windows + # Add a trailing separator in case it is a root folder on windows (crashes guessit) if len(path) == 2 and path[1] == ':': path = path + os.path.sep + # Replace *NIX ambiguous '//' at the beginning of a path with '/' (crashes guessit) + path = re.sub('^//', '/', path) + return path def ek(original, *args):