aboutsummaryrefslogtreecommitdiffhomepage
path: root/share
diff options
context:
space:
mode:
authorGravatar Adam <adis@blad.is>2012-06-05 13:22:29 +0200
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-06-05 15:26:11 -0700
commit4e3acdcbdc86cc8d63a3646d6ba93e91bfaac75d (patch)
treed18f5b7a13be9a8a110a8b6af579ca1757f23449 /share
parent85f808130d4ecca2a79052d3a101a1a650dba5c5 (diff)
Unicode error fix in manpage completion with python3
Diffstat (limited to 'share')
-rwxr-xr-xshare/tools/create_manpage_completions.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py
index aca89249..c27b6cf8 100755
--- a/share/tools/create_manpage_completions.py
+++ b/share/tools/create_manpage_completions.py
@@ -661,11 +661,14 @@ def parse_manpage_at_path(manpage_path, output_directory):
fd = gzip.open(manpage_path, 'r')
else:
fd = open(manpage_path, 'r')
- try:
+
+ try: #Utf-8 python3
+ manpage = fd.read()
+ except: #Latin-1 python3
+ fd = open(manpage_path, 'r', encoding='latin-1')
manpage = fd.read()
- except UnicodeDecodeError:
- return
fd.close()
+
manpage = str(manpage)
# Get the "base" command, e.g. gcc.1.gz -> gcc