From: Kefu Chai Date: Thu, 8 Dec 2022 06:42:42 +0000 (+0800) Subject: qa: set locale to C.UTF-8 in tox.ini X-Git-Tag: v16.2.11~54^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=000c3a2270b79b6b18b6828bd71db3d7789f2e1b;p=ceph.git 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) --- diff --git a/qa/tox.ini b/qa/tox.ini index d7c6d555482a..582397efc079 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=