Skip to content

Commit

Permalink
Use utf-8 debug file
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Jun 20, 2023
1 parent b0b20d2 commit 8841734
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/7781.bugfix.rst
@@ -0,0 +1 @@
Fix writing non-encodable text to log file when using ``--debug``.
2 changes: 1 addition & 1 deletion src/_pytest/helpconfig.py
Expand Up @@ -105,7 +105,7 @@ def pytest_cmdline_parse():
if config.option.debug:
# --debug | --debug <file.log> was provided.
path = config.option.debug
debugfile = open(path, "w")
debugfile = open(path, "w", encoding="utf-8")
debugfile.write(
"versions pytest-%s, "
"python-%s\ncwd=%s\nargs=%s\n\n"
Expand Down

0 comments on commit 8841734

Please sign in to comment.