[PATCH] D64129: [clang-scan-view] Force utf-8 when handling report (python2 only)
Phabricator via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 16 01:57:05 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366194: [clang-scan-view] Force utf-8 when handling report (python2 only) (authored by serge_sans_paille, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D64129?vs=207752&id=210046#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64129/new/
https://reviews.llvm.org/D64129
Files:
cfe/trunk/tools/scan-view/share/ScanView.py
Index: cfe/trunk/tools/scan-view/share/ScanView.py
===================================================================
--- cfe/trunk/tools/scan-view/share/ScanView.py
+++ cfe/trunk/tools/scan-view/share/ScanView.py
@@ -764,11 +764,11 @@
variables['report'] = m.group(2)
try:
- f = open(path,'r')
+ f = open(path,'rb')
except IOError:
return self.send_404()
fs = os.fstat(f.fileno())
- data = f.read()
+ data = f.read().decode('utf-8')
for a,b in kReportReplacements:
data = a.sub(b % variables, data)
return self.send_string(data, ctype, mtime=fs.st_mtime)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64129.210046.patch
Type: text/x-patch
Size: 679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190716/eafcece8/attachment.bin>
More information about the cfe-commits
mailing list