diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -583,9 +583,9 @@ class buildhgextindex(Command): if err or returncode != 0: raise DistutilsExecError(err) - with open(self._indexfilename, 'w') as f: - f.write('# this file is autogenerated by setup.py\n') - f.write('docs = ') + with open(self._indexfilename, 'wb') as f: + f.write(b'# this file is autogenerated by setup.py\n') + f.write(b'docs = ') f.write(out) class buildhgexe(build_ext):