about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/loader.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index 99e60abf..5c9e28a5 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -178,7 +178,9 @@ class CommandLoader(  # pylint: disable=too-many-instance-attributes
         # pylint: disable=consider-using-with
         popenargs = {} if self.popenArgs is None else self.popenArgs
         popenargs['stdout'] = popenargs['stderr'] = PIPE
-        popenargs['stdin'] = PIPE if self.input else open(os.devnull, 'r')
+        popenargs['stdin'] = (
+            PIPE if self.input else open(os.devnull, 'r', encoding="utf-8")
+        )
         self.process = process = Popen(self.args, **popenargs)
         self.signal_emit('before', process=process, loader=self)
         if self.input: