[PATCH] D69207: [lit] Don't fail when printing test output with special chars

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 27 23:41:56 PDT 2019


mehdi_amini added a comment.

I have a failure on my bot for tools/llvm-ar/mri-utf8.test ; and this patch is making it worse.

Without this patch I have:

  : 'RUN: at line 23';   env LANG=en_US.UTF-8 "/usr/bin/python" -c "assert open(u'\U000000A3.txt', 'rb').read() == b'contents\n'"
  --
  Exit Code: 1
   
  Command Output (stderr):
  --
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 0: ordinal not in range(128)
   
  --

I suspect en_US.UTF-8 is just not available on the system.

After this patch however the error becomes:

  [3110/3111] Running the LLVM regression tests
  -- Testing: 34143 tests, 64 workers --
  FAIL: LLVM :: tools/llvm-ar/mri-utf8.test (32130 of 34143)
  ******************** TEST 'LLVM :: tools/llvm-ar/mri-utf8.test' FAILED ********************
  Exception in thread Thread-3:
  Traceback (most recent call last):
    File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
      self.run()
    File "/usr/lib/python2.7/threading.py", line 754, in run
      self.__target(*self.__args, **self.__kwargs)
    File "/usr/lib/python2.7/multiprocessing/pool.py", line 408, in _handle_results
      cache[job]._set(i, obj)
    File "/usr/lib/python2.7/multiprocessing/pool.py", line 577, in _set
      self._callback(self._value)
    File "/var/lib/buildkite-agent/builds/buildkite-6dd7db7bf5-rcq8r-1/mlir/llvm-coverage/llvm/utils/lit/lit/run.py", line 136, in <lambda>
      callback=lambda r, t=test: self._process_result(t, r))
    File "/var/lib/buildkite-agent/builds/buildkite-6dd7db7bf5-rcq8r-1/mlir/llvm-coverage/llvm/utils/lit/lit/run.py", line 82, in _process_result
      self.progress_callback(test)
    File "/var/lib/buildkite-agent/builds/buildkite-6dd7db7bf5-rcq8r-1/mlir/llvm-coverage/llvm/utils/lit/lit/main.py", line 194, in progress_callback
      display.update(test)
    File "/var/lib/buildkite-agent/builds/buildkite-6dd7db7bf5-rcq8r-1/mlir/llvm-coverage/llvm/utils/lit/lit/display.py", line 52, in update
      self.print_result(test)
    File "/var/lib/buildkite-agent/builds/buildkite-6dd7db7bf5-rcq8r-1/mlir/llvm-coverage/llvm/utils/lit/lit/display.py", line 85, in print_result
      out = out.decode(encoding=sys.stdout.encoding)
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 492: ordinal not in range(128)
   

And lit will just hang there forever.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69207





More information about the llvm-commits mailing list