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

Daniel P. Berrangé berrange at redhat.com
Fri Mar 29 16:00:41 UTC 2019


On Fri, Mar 29, 2019 at 11:51:01AM -0400, Cole Robinson wrote:
> 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

Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the Libosinfo mailing list