about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-09-01 16:52:54 +0200
committertoonn <toonn@toonn.io>2021-09-01 17:00:53 +0200
commit5279ac8b9101f0778cc6f4859249685191c4923c (patch)
tree1e02d39446bd342862e2f7da4bbf79505fcceb74 /ranger
parent05b024b726ff79c46d0309c2f6f8bdd69c85f08d (diff)
downloadranger-5279ac8b9101f0778cc6f4859249685191c4923c.tar.gz
actions: Fix source to encode lines to ASCII
The machinery behind `:source` expects "str"s everywhere so this is the
easiest way to allow switching to `io.open()` without causing problems.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 83810385..784a6c09 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -379,6 +379,8 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
                 if line.startswith("#") or not line.strip():
                     continue
                 try:
+                    if not isinstance(line, str):
+                        line = line.encode("ascii")
                     self.execute_console(line)
                 except Exception as ex:  # pylint: disable=broad-except
                     if ranger.args.debug: