1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-24 07:41:54 -07:00

Oops, python 2.7 doesn't have open(..., encoding=).

Copied from Perforce
 Change: 184034
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2014-01-16 18:08:24 +00:00
parent c03eb1419f
commit 0ab15d7930

View file

@ -91,7 +91,7 @@ def index_sub(m):
return s
def convert_file(name, source, dest):
s = open(source, encoding='utf-8').read()
s = open(source, 'rb').read().decode('utf-8')
# We want the index directive to go right at the start, so that it leads
# to the whole document.
m = index.search(s)
@ -115,8 +115,8 @@ def convert_file(name, source, dest):
os.makedirs(os.path.dirname(dest))
except:
pass
with open(dest, mode='w', encoding='utf-8') as out:
out.write(s)
with open(dest, 'wb') as out:
out.write(s.encode('utf-8'))
# Mini-make
def convert_updated(app):