Py3 codecs.open doesn't like mode='t'

This commit is contained in:
Matthias Urlichs committed 2019-02-03 19:01:07 +01:00
1 parent f82ec61463
commit 5edeecdc8c
1 file changed
+2
+2
View File
@@ -1056,6 +1056,8 @@ def bom_aware_open(filename, encoding="ascii", mode="r", **kwargs):
if header.startswith(bom):
encoding += "-sig"
# Py3 doesn't like 't'
mode = mode.replace('t','')
return codecs.open(filename, encoding=encoding, mode=mode, **kwargs)