[PATCH] D68418: [test] Remove locale dependency for mri-utf8.test

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 06:45:24 PDT 2019


thopre added a comment.

In D68418#1694611 <https://reviews.llvm.org/D68418#1694611>, @thopre wrote:

> In D68418#1694539 <https://reviews.llvm.org/D68418#1694539>, @thopre wrote:
>
> > In D68418#1694439 <https://reviews.llvm.org/D68418#1694439>, @gbreynoo wrote:
> >
> > > You are correct that the locale is required to pass on linux. I had some trouble with this test as the behaviour of python in this area differs between linux / windows and python 2 / python 3. For example this fix appears to be fine for linux, however Windows with python 2 fails:
> > >
> > >   Traceback (most recent call last):
> > >     File "<string>", line 1, in <module>
> > >   IOError: [Errno 2] No such file or directory: '\xc2\xa3.txt'
> > >
> > >
> > > I do not like the reliance on the locale however the upstream buildbots all appear to have it installed. Maybe the test should be split into a windows test and a linux test?
> >
> >
> > Mmmh, I need a Windows system to try more then. I guess the current code will output the pound sign into whatever encoding Windows use (which I guess is not UTF-8 but then how does the echo few lines above creates the file correct). Thanks for reverting the commit and sorry for the breakage.
>
>
> So it's lit that processes the redirection and I guess the file will be read as a UTF-8, decoded into unicode and then on Windows this will output a filename in UTF-16.
>
> Does llvm-ar espects UTF-8 specifically in archive members or can it be anything (e.g. UTF-16)?


Could you try this change on Windows instead:

RUN: env LANG=C.UTF-8 %python -c "assert open(u'\xA3.txt', 'rb').read() == b'contents\n'"


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68418/new/

https://reviews.llvm.org/D68418





More information about the llvm-commits mailing list