This is an archive of the discontinued LLVM Phabricator instance.

scan-build-py: Force the opening in utf-8
ClosedPublic

Authored by sylvestre.ledru on Aug 11 2021, 2:53 AM.

Details

Summary

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

Diff Detail

Event Timeline

sylvestre.ledru requested review of this revision.Aug 11 2021, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2021, 2:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
isthismyaccount accepted this revision.Aug 17 2021, 10:06 AM

Seems reasonable to me.

This revision is now accepted and ready to land.Aug 17 2021, 10:06 AM
phosek accepted this revision.Aug 17 2021, 10:08 AM

LGTM

clang/tools/scan-build-py/lib/libscanbuild/report.py
420

The rest of this file uses ' rather than " for strings, can we keep it consistent?

sylvestre.ledru marked an inline comment as done.Aug 17 2021, 10:18 AM
This revision was landed with ongoing or failed builds.Aug 17 2021, 10:20 AM
This revision was automatically updated to reflect the committed changes.