mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
Unicode error fix in manpage completion with python3
This commit is contained in:
parent
85f808130d
commit
4e3acdcbdc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user