1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/tools
Roman Lebedev 9ced3ef674 [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
2017-09-12 18:59:21 +00:00
..
bugpoint
bugpoint-passes
dsymutil
gold
llc
lli
llvm-ar
llvm-as
llvm-as-fuzzer
llvm-bcanalyzer
llvm-c-test
llvm-cat
llvm-config
llvm-cov [llvm-cov] Allow hiding instantiation/region coverage from summary tables 2017-09-11 22:56:20 +00:00
llvm-cvtres
llvm-cxxdump
llvm-cxxfilt
llvm-diff
llvm-dis
llvm-dwarfdump llvm-dwarfdump: Make -brief the default and add a -verbose option instead. 2017-09-11 23:05:20 +00:00
llvm-dwp
llvm-extract
llvm-go
llvm-isel-fuzzer
llvm-jitlistener
llvm-link
llvm-lto
llvm-lto2
llvm-mc
llvm-mc-assemble-fuzzer
llvm-mc-disassemble-fuzzer
llvm-mcmarkup
llvm-modextract
llvm-mt
llvm-nm
llvm-objcopy
llvm-objdump Remove unneccessary string copies from method invocations. 2017-09-12 02:27:39 +00:00
llvm-opt-report
llvm-pdbutil
llvm-profdata
llvm-rc
llvm-readobj
llvm-rtdyld
llvm-shlib
llvm-size
llvm-split
llvm-stress
llvm-strings
llvm-symbolizer
llvm-xray
lto
msbuild
obj2yaml
opt
opt-viewer
sancov [sancov] coverage-report-server.py: ServerHandler(): open file as UTF8 2017-09-12 18:59:21 +00:00
sanstats Fix broken links to the Itanium CXX ABI 2017-09-12 00:19:11 +00:00
verify-uselistorder
xcode-toolchain
yaml2obj
CMakeLists.txt
LLVMBuild.txt