diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-12-14 02:02:29 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-12-14 02:02:29 +0900 |
commit | 2c98e909bf1a6de5f689aeca908e8ccc73f181ac (patch) | |
tree | 43752eff923aac12cd786424c1f5bb7725080143 /sphinx/util/osutil.py | |
parent | 0b074c9e48dbc00137c2e94769bbe6e4685199c6 (diff) | |
parent | 5b28d77b376cad5d93942743ea1d18098b459948 (diff) | |
download | sphinx-git-2c98e909bf1a6de5f689aeca908e8ccc73f181ac.tar.gz |
Merge branch '3.x'
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r-- | sphinx/util/osutil.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py index bd774cdad..153808186 100644 --- a/sphinx/util/osutil.py +++ b/sphinx/util/osutil.py @@ -195,14 +195,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": |