From 000c3a2270b79b6b18b6828bd71db3d7789f2e1b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 8 Dec 2022 14:42:42 +0800 Subject: [PATCH] qa: set locale to C.UTF-8 in tox.ini as ansible is using UTF-8 encoded characters in the file names, so, to avoid failures like: File "/home/jenkins-build/build/workspace/ceph-pull-requests/qa/.tox/py3/lib/python3.10/site-packages/pip/_internal/utils/unpacking.py", line 217, in untar_file with open(path, "wb") as destfp: UnicodeEncodeError: 'latin-1' codec can't encode characters in position 137-140: ordinal not in range(256) we have to set a locale which is able to handle UTF-8. see also https://github.com/ceph/teuthology/pull/1671 Signed-off-by: Kefu Chai (cherry picked from commit bc2b551e9fc94697aee42de34de03d0a2a819850) --- qa/tox.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qa/tox.ini b/qa/tox.ini index d7c6d555482ae..582397efc0794 100644 --- a/qa/tox.ini +++ b/qa/tox.ini @@ -2,6 +2,11 @@ envlist = flake8, mypy, pytest skipsdist = True +[testenv] +setenv = + LC_ALL = C.UTF-8 + LANG = C + [testenv:flake8] basepython = python3 deps= -- 2.39.5