about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/ext/open23.py2
-rwxr-xr-xtests/manpage_completion_test.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/ranger/ext/open23.py b/ranger/ext/open23.py
index de60d516..14faf32b 100644
--- a/ranger/ext/open23.py
+++ b/ranger/ext/open23.py
@@ -20,7 +20,7 @@ def open23(
     file,
     mode="r",
     buffering=-1,
-    encoding=None,
+    encoding="UTF-8",
     errors=None,
     newline=None,
     closefd=True,
diff --git a/tests/manpage_completion_test.py b/tests/manpage_completion_test.py
index f5e5c335..f6ce87de 100755
--- a/tests/manpage_completion_test.py
+++ b/tests/manpage_completion_test.py
@@ -6,6 +6,8 @@ import os.path
 import re
 import sys
 
+from ranger.ext.open23 import open23
+
 
 # Add relevant ranger module to PATH... there surely is a better way to do this...
 sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
@@ -26,14 +28,14 @@ def get_path_of_man_page():
 
 def read_manpage():
     path = get_path_of_man_page()
-    with open(path, 'r') as man_page:
+    with open23(path, 'r') as man_page:
         return man_page.read()
 
 
 def get_sections():
     manpage = read_manpage()
     parts = manpage.split('=head1 ')
-    sections = dict()
+    sections = {}
     for part in parts:
         if '\n' in part:
             section_name, section_content = part.split('\n', 1)