This is an archive of the discontinued LLVM Phabricator instance.

Enable unicode output on terminals.
AbandonedPublic

Authored by v.g.vassilev on May 23 2017, 3:01 PM.

Details

Reviewers
chapuni
modocache
Summary

Patch by Axel Naumann!

Diff Detail

Repository
rL LLVM

Event Timeline

v.g.vassilev created this revision.May 23 2017, 3:01 PM
MatzeB added a subscriber: MatzeB.Jun 8 2017, 2:15 PM

What problem does this solve exactly? I thought this switch is a hack that works around places where we didn't correctly encode/decode bytestreams and it seems we should better fix the root cause.

Adding the author in the loop.

Apologies for the slow response.

This is about a test file using a unicode (or non-ASCII?) character, for instance ächo.C. If you put this into a lit test suite and run lit without this patch it will complain:

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 405, in _handle_results
    cache[job]._set(i, obj)
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 572, in _set
    self._callback(self._value)
  File "/mnt/a/build/cling/cling-all-in-one/cling-all-in-one/src/utils/lit/lit/run.py", line 443, in consume_test_result
    self.display.update(test_with_result)
  File "/mnt/a/build/cling/cling-all-in-one/cling-all-in-one/src/utils/lit/lit/main.py", line 50, in update
    test.getFullName())
  File "/mnt/a/build/cling/cling-all-in-one/cling-all-in-one/src/utils/lit/lit/ProgressBar.py", line 271, in update
    self.term.CLEAR_EOL + message)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 20: ordinal not in range(128)

This patch prevents that exception. (Which btw brings lit into a terrible state...)

D34464 fixes this in a less hacky way.

D34464 fixes this in a less hacky way.

Excellent, thanks! Feel free to close this one.

v.g.vassilev abandoned this revision.May 28 2022, 11:37 PM

This is not an issue anymore for us.

Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2022, 11:37 PM
Herald added a subscriber: delcypher. · View Herald Transcript