mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
explicitly specify encoding=utf-8 in apidoc
This commit is contained in:
parent
3ea1ec84cc
commit
cdc45669a2
@ -222,14 +222,14 @@ class FileAvoidWrite:
|
||||
self._io.close()
|
||||
|
||||
try:
|
||||
with open(self._path) as old_f:
|
||||
with open(self._path, encoding='utf-8') as old_f:
|
||||
old_content = old_f.read()
|
||||
if old_content == buf:
|
||||
return
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
with open(self._path, 'w') as f:
|
||||
with open(self._path, 'w', encoding='utf-8') as f:
|
||||
f.write(buf)
|
||||
|
||||
def __enter__(self) -> "FileAvoidWrite":
|
||||
|
Loading…
Reference in New Issue
Block a user