summaryrefslogtreecommitdiff
path: root/src/tox
diff options
context:
space:
mode:
authorJames Williams <james@kananlabs.org>2022-12-29 17:33:56 -0600
committerGitHub <noreply@github.com>2022-12-29 15:33:56 -0800
commitb49d11867ab6bd7219c5b2c50f610e7829395975 (patch)
treea674bb40db2862aeafdc3abb929c72b1ed16c450 /src/tox
parentc83819262b4b739899af8a0bd7b6f32442344e4a (diff)
downloadtox-git-b49d11867ab6bd7219c5b2c50f610e7829395975.tar.gz
Fix logging error with emoji in git branch name. (#2790)
Resolves https://github.com/tox-dev/tox/issues/2768
Diffstat (limited to 'src/tox')
-rw-r--r--src/tox/pytest.py2
-rw-r--r--src/tox/tox_env/api.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/tox/pytest.py b/src/tox/pytest.py
index 21cd816a..ae211252 100644
--- a/src/tox/pytest.py
+++ b/src/tox/pytest.py
@@ -161,7 +161,7 @@ class ToxProject:
at_path.mkdir(exist_ok=True)
ToxProject._setup_files(at_path, None, value)
elif isinstance(value, str):
- at_path.write_text(textwrap.dedent(value))
+ at_path.write_text(textwrap.dedent(value), encoding="utf-8")
elif value is None:
at_path.mkdir()
else:
diff --git a/src/tox/tox_env/api.py b/src/tox/tox_env/api.py
index 98c4501a..3ce15b99 100644
--- a/src/tox/tox_env/api.py
+++ b/src/tox/tox_env/api.py
@@ -444,7 +444,7 @@ class ToxEnv(ABC):
@staticmethod
def _write_execute_log(env_name: str, log_file: Path, request: ExecuteRequest, status: ExecuteStatus) -> None:
- with log_file.open("wt") as file:
+ with log_file.open("wt", encoding="utf-8") as file:
file.write(f"name: {env_name}\n")
file.write(f"run_id: {request.run_id}\n")
for env_key, env_value in request.env.items():