about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-09-01 17:53:15 +0200
committertoonn <toonn@toonn.io>2021-09-01 17:57:15 +0200
commit08ab6b9fd3c2beada39951576ebf017d5a65f3f7 (patch)
treec66bf57d15eaecfe4a021478a570bc6aa16d05b1 /ranger
parent903f352beea83cc3ee9a6b62ccb735cf6b0ad02c (diff)
downloadranger-08ab6b9fd3c2beada39951576ebf017d5a65f3f7.tar.gz
loader: Force UTF-8 encoding
Diffstat (limited to 'ranger')
-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: