From 2c7d36041103b4b282261edd0fd17ef5d4b722e1 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 2 Nov 2014 17:40:00 +0100 Subject: core.actions: Avoid UnicodeDecodeError, fixes #172 Thanks to cym13 and GermainZ for looking into this --- ranger/core/actions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 92d626c0..ba6b3658 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -819,7 +819,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): if version_info[0] == 3: def sha1_encode(self, path): return os.path.join(ranger.CACHEDIR, - sha1(path.encode('utf-8')).hexdigest()) + '.jpg' + sha1(path.encode('utf-8', 'backslashreplace')) \ + .hexdigest()) + '.jpg' else: def sha1_encode(self, path): return os.path.join(ranger.CACHEDIR, -- cgit 1.4.1-2-gfad0