The HTML number conversion regex operating against a byte string will only
convert individual bytes, so therefore incorrectly converts utf-8 encoded characters. Decoding byte strings to unicode objects results in correct HTML number encodings.
This commit is contained in:
parent
d76c923623
commit
cc0ee3dc29
@ -27,6 +27,7 @@
|
|||||||
import itertools
|
import itertools
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
|
import codecs
|
||||||
|
|
||||||
import llnl.util.tty as tty
|
import llnl.util.tty as tty
|
||||||
from llnl.util.filesystem import *
|
from llnl.util.filesystem import *
|
||||||
@ -107,7 +108,7 @@ def __eq__(self, other):
|
|||||||
def fetch_log(path):
|
def fetch_log(path):
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
return list()
|
return list()
|
||||||
with open(path, 'rb') as F:
|
with codecs.open(path, 'rb', 'utf-8') as F:
|
||||||
return list(line.strip() for line in F.readlines())
|
return list(line.strip() for line in F.readlines())
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user