Re: [osinfo-db PATCH] test: conftest: Set LC_ALL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux