Fix bug 9717, XML import with env language other than utf8, has bad progress meter

This commit is contained in:
prculley 2016-09-24 15:47:03 -05:00
parent 68bd1e9038
commit ffa5b6db61

View File

@ -361,9 +361,10 @@ class LineParser:
# will not work properly, going immediately to
# 100%.
# It should work correctly from version 3.3.
ofile = io.TextIOWrapper(gzip.open(filename, "rb"))
ofile = io.TextIOWrapper(gzip.open(filename, "rb"),
encoding='utf8', errors='replace')
else:
ofile = open(filename, "r")
ofile = open(filename, "r", encoding='utf8', errors='replace')
for line in ofile:
self.count += 1