[PATCH] D84901: [Sanitizers] Fix lint failure with Python 3.6

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 17:42:12 PDT 2020


nemanjai created this revision.
nemanjai added reviewers: kcc, samsonov.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.
nemanjai requested review of this revision.

There are some files in compiler-rt that use UTF-8 characters in some of the comments. This causes lint failures with some versions of Python. This patch just makes the encoding implicit in the call to `open`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84901

Files:
  compiler-rt/lib/sanitizer_common/scripts/litlint.py


Index: compiler-rt/lib/sanitizer_common/scripts/litlint.py
===================================================================
--- compiler-rt/lib/sanitizer_common/scripts/litlint.py
+++ compiler-rt/lib/sanitizer_common/scripts/litlint.py
@@ -45,7 +45,7 @@
     The number of errors detected.
   """
   errs = 0
-  with open(p, 'r') as f:
+  with open(p, 'r', encoding='utf-8') as f:
     for i, s in enumerate(f.readlines(), start=1):
       msg, col = LintLine(s)
       if msg != None:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84901.281773.patch
Type: text/x-patch
Size: 489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200730/89ecef23/attachment.bin>


More information about the llvm-commits mailing list