fix for Python3: Python3 open() use 'rt' mode by default, and decoding by locale.getpreferredencoding(). In sphinx test, html output encoded by 'utf-8' but reading with syste-locale-setting-encode that cause UnicodeDecodeError.

This commit is contained in:
Takayuki Shimizukawa
2012-05-02 15:55:11 +09:00
parent 733854e121
commit b948dfc7e0

View File

@@ -329,7 +329,7 @@ def test_html(app):
for fname, paths in HTML_XPATH.iteritems():
parser = NslessParser()
parser.entity.update(htmlentitydefs.entitydefs)
fp = open(os.path.join(app.outdir, fname))
fp = open(os.path.join(app.outdir, fname), 'rb')
try:
etree = ET.parse(fp, parser)
finally: