]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: set locale to C.UTF-8 in tox.ini
authorKefu Chai <tchaikov@gmail.com>
Thu, 8 Dec 2022 06:42:42 +0000 (14:42 +0800)
committerAdam King <adking@redhat.com>
Fri, 9 Dec 2022 18:47:03 +0000 (13:47 -0500)
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 <tchaikov@gmail.com>
(cherry picked from commit bc2b551e9fc94697aee42de34de03d0a2a819850)

qa/tox.ini

index d7c6d555482aebd175d981c83a68b655b934f49d..582397efc07942423cf9811c11ea548188595af2 100644 (file)
@@ -2,6 +2,11 @@
 envlist = flake8, mypy, pytest
 skipsdist = True
 
+[testenv]
+setenv =
+  LC_ALL = C.UTF-8
+  LANG = C
+
 [testenv:flake8]
 basepython = python3
 deps=