diff mbox

[ovs-dev,v3,4/7] checkpatch: correct a parsing issue

Message ID 20170501194443.10029-5-aconole@redhat.com
State Superseded
Headers show

Commit Message

Aaron Conole May 1, 2017, 7:44 p.m. UTC
Occasionally, characters will be sent which violate the
ascii decoder's sense of propriety.  In fact, in-tree there are
a few such files (ex: tests/atlocal.in), and they cause an
exception to be raised when they are encountered.

Set the policy to ignore these cases.  This means these bytes are
omitted from the text stream during processing.

Signed-off-by: Aaron Conole <aconole@redhat.com>
---
 utilities/checkpatch.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 68c4156..2088865 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -252,7 +252,7 @@  def ovs_checkpatch_parse(text):
     is_co_author = re.compile(r'(\s*(Co-authored-by: )(.*))$',
                               re.I | re.M | re.S)
 
-    for line in text.decode().split('\n'):
+    for line in text.decode(errors='ignore').split('\n'):
         if current_file != previous_file:
             previous_file = current_file