Merge pull request #241 from prculley/9717

Fix bug 9717, XML import with env language other than utf8, has bad progress meter
This commit is contained in:
Sam Manzi 2016-09-28 09:01:32 +10:00 committed by GitHub
commit d6e33b36bd

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