Description
Bugzilla Link | 43776 |
Version | trunk |
OS | Windows NT |
CC | @gregbedwell,@jmorse,@pogo59 |
Extended Description
With python 3.6.8, lit hangs if producing output with non-ascii characters and redirecting to a file on Windows. This can happen if a test fails and has non-ascii in the Script: output. Below I'm using the -a option to show all output to elicit this so it doesn't need to fail.
To reproduce (with revision 689ce81)
python --version
Python 3.6.8
python build/bin/llvm-lit.py llvm/test/Other -a > afile.txt
llvm-lit.py: F:/git/llvm-project/llvm\utils\lit\lit\run.py:170: warning: Failed to raise process limit: No module named 'resource'
Exception in thread Thread-5:
Traceback (most recent call last):
File "C:\Python36\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\Python36\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "C:\Python36\lib\multiprocessing\pool.py", line 479, in _handle_results
cache[job]._set(i, obj)
File "C:\Python36\lib\multiprocessing\pool.py", line 649, in _set
self._callback(self._value)
File "F:/git/llvm-project/llvm\utils\lit\lit\run.py", line 134, in
callback=lambda r, t=test: self._process_result(t, r))
File "F:/git/llvm-project/llvm\utils\lit\lit\run.py", line 80, in _process_result
self.progress_callback(test)
File "F:/git/llvm-project/llvm\utils\lit\lit\main.py", line 189, in progress_callback
display.update(test)
File "F:/git/llvm-project/llvm\utils\lit\lit\display.py", line 52, in update
self.print_result(test)
File "F:/git/llvm-project/llvm\utils\lit\lit\display.py", line 73, in print_result
print(test.result.output)
File "C:\Python36\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 304-305: character maps to
This should complete in a second or two but hangs instead.
This works fine with python 2.7.15, or with one thread (-j 1), or not outputting the script with non-ascii, or not redirecting to a file.