[all-commits] [llvm/llvm-project] 70b06f: scan-build-py: Force the opening in utf-8

Sylvestre Ledru via All-commits all-commits at lists.llvm.org
Tue Aug 17 10:20:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 70b06fe8a1862f5b9a0ef4e5e9098c1e457cf275
      https://github.com/llvm/llvm-project/commit/70b06fe8a1862f5b9a0ef4e5e9098c1e457cf275
  Author: Sylvestre Ledru <sylvestre at debian.org>
  Date:   2021-08-17 (Tue, 17 Aug 2021)

  Changed paths:
    M clang/tools/scan-build-py/lib/libscanbuild/report.py

  Log Message:
  -----------
  scan-build-py: Force the opening in utf-8

It fails on ubuntu bionic otherwise with:
```
scan-build-py-14: Run 'scan-view /tmp/scan-build-2021-08-09-09-14-36-765350-nx9s888s' to examine bug reports.
scan-build-py-14: Internal error.
Traceback (most recent call last):
  File "/usr/lib/llvm-14/lib/libscanbuild/__init__.py", line 125, in wrapper
    return function(*args, **kwargs)
  File "/usr/lib/llvm-14/lib/libscanbuild/analyze.py", line 72, in scan_build
    number_of_bugs = document(args)
  File "/usr/lib/llvm-14/lib/libscanbuild/report.py", line 35, in document
    for bug in read_bugs(args.output, html_reports_available):
  File "/usr/lib/llvm-14/lib/libscanbuild/report.py", line 282, in read_bugs
    for bug in parser(bug_file):
  File "/usr/lib/llvm-14/lib/libscanbuild/report.py", line 421, in parse_bug_html
    for line in handler.readlines():
  File "/usr/lib/python3.6/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 3360: ordinal not in range(128)
scan-build-py-14: Please run this command again and turn on verbose mode (add '-vvvv' as argument).
```

I guess it is caused by a problem in Python 3.6

Reviewed By: phosek, isthismyaccount

Differential Revision: https://reviews.llvm.org/D107887




More information about the All-commits mailing list