aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2017-09-12 18:59:21 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2017-09-12 18:59:21 +0000
commit5a9a60cc08f2fe1492844a6d270467326228e886 (patch)
tree3ecfe423fe2b5fba6540c20f0c65b44d3d0aa6c0 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent44ee6e41795d79a1763954d12e1035e950bab74f (diff)
downloadllvm-5a9a60cc08f2fe1492844a6d270467326228e886.zip
llvm-5a9a60cc08f2fe1492844a6d270467326228e886.tar.gz
llvm-5a9a60cc08f2fe1492844a6d270467326228e886.tar.bz2
[sancov] coverage-report-server.py: ServerHandler(): open file as UTF8
Summary: This is nessesary in Python3. Everywhere else we assume that encoding is UTF8. If we don't specify it here, the defaults from the environment will be used, which may result in ASCII decoder being used. And if the file is non-ASCII, then it will crash: ``` File "/usr/local/bin/coverage-report-server.py", line 168, in do_GET for line_no, line in enumerate(f, start=1)]) File "/usr/local/bin/coverage-report-server.py", line 165, in <listcomp> ["<span class='{cls}'>{line}&nbsp;</span>".format( File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 106: ordinal not in range(128) ``` Fixes https://bugs.llvm.org/show_bug.cgi?id=33548 Now, how would i add a testcase here? Reviewers: m.ostapenko, kcc Reviewed By: kcc Subscribers: kcc, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D37661 llvm-svn: 313063
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions