Skip to content

Commit 9080cfc

Browse files
authored
Use utf-8 encoding when writing to file (#36)
1 parent df9a03e commit 9080cfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytest_accept/doctest_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ def pytest_sessionfinish(session, exitstatus):
184184
# sort by line number
185185
failures = sorted(failures, key=lambda x: x.test.lineno or 0)
186186

187-
original = list(path.read_text().splitlines())
187+
original = list(path.read_text(encoding="utf-8").splitlines())
188188
path = path.with_suffix(".py.new") if passed_accept_copy else path
189-
with path.open("w+") as file:
189+
with path.open("w+", encoding="utf-8") as file:
190190

191191
# TODO: is there cleaner way of doing this interleaving?
192192

0 commit comments

Comments
 (0)