<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/102374>102374</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[llvm-lit] TypeError in lit’s built-in cat -v implementation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
connieyzhu
</td>
</tr>
</table>
<pre>
lit’s built-in cat -v implementation gives a TypeError when converting text input
```
FAIL: LLVM :: Object/archive-format.test (8 of 54309)
******************** TEST 'LLVM :: Object/archive-format.test' FAILED ********************
Exit Code: 2
Command Output (stdout):
--
# RUN: at line 88
cat -v /usr/local/google/home/harinidonthula/llvm-project/build/test/Object/Output/archive-format.test.tmp/foo.a | /usr/local/google/home/harinidonthula/llvm-project/build/bin/FileCheck -strict-whitespace --check-prefix=SOLARIS /usr/local/google/home/harinidonthula/llvm-project/llvm/test/Object/archive-format.test
# executed command: cat -v /usr/local/google/home/harinidonthula/llvm-project/build/test/Object/Output/archive-format.test.tmp/foo.a
# .---command stderr------------
# | Traceback (most recent call last):
# | File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/builtin_commands/cat.py", line 85, in <module>
# | main(sys.argv)
# | File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/builtin_commands/cat.py", line 73, in main
# | contents = convertToCaretAndMNotation(contents)
# | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# | File "/usr/local/google/home/harinidonthula/llvm-project/llvm/utils/lit/lit/builtin_commands/cat.py", line 13, in convertToCaretAndMNotation
# | data = bytearray(data)
# | ^^^^^^^^^^^^^^^
# | TypeError: string argument without an encoding
# `-----------------------------
# error: command failed with exit status: 1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVlFvozgQ_jXOywhETBLIAw-5JEgrdbfStnevJ2Mm4FtjI3tIm_v1JxPS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