[Libosinfo] [osinfo-db PATCH] test: conftest: Set LC_ALL
Cole Robinson
crobinso at redhat.com
Fri Mar 29 15:51:01 UTC 2019
On 3/29/19 6:56 AM, Fabiano Fidêncio wrote:
> Based on Dan's comment: "This doesn't actually do the same as the
> makefile code. This still uses the user's own locale for everything that
> isn't LC_CTYPE. The make code explicitly forced C locale to ensure
> reproducable environment that does not vary per user locale.", let's
> force the C locale.
>
> Also based on Dan's comment: "This isn't a freebsd problem. It will hit
> any user who is not using a UTF-8 locale.", let's adjust the comment
> explaining why we need to have LC_ALL and LC_CTYPE set.
>
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
> ---
> tests/conftest.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/conftest.py b/tests/conftest.py
> index ade36c5..a6cb20a 100644
> --- a/tests/conftest.py
> +++ b/tests/conftest.py
> @@ -17,7 +17,8 @@ def pytest_configure(config):
> os.environ[key] = os.path.realpath(os.path.join(
> os.path.dirname(__file__), "..", "data"))
>
> - # Needed for test reproducibility on freebsd
> + # Needed for test reproducibility on any system not using a UTF-8 locale
> + locale.setlocale(locale.LC_ALL, 'C')
> locale.setlocale(locale.LC_CTYPE, 'en_US.UTF-8')
>
> # Default to --log-level=info if not otherwise specified
>
Yeah that's what I came up with too. But I don't understand all the
issues at play so I'll let Dan give the review, CCd
Thanks,
Cole
More information about the Libosinfo
mailing list