From 25b5f5dfa1ac2527bf1346aaca8eefd6634885b8 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 16 Jun 2020 11:00:19 -0700 Subject: [PATCH] python,util: Fixed string decoding in include verifier The Python2 <-> Python3 port included a decode on a string as part of the include statement git-hook verifier. This results in a failure. To fix this issue, the file to be checked is opened in binary mode. This issue was highlighted by Gabe Black here: https://gem5-review.googlesource.com/c/public/gem5/+/28588 Change-Id: I9a30ecc24d4741853ed1c2d0c03addf57c3e5b6c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30336 Reviewed-by: Gabe Black Reviewed-by: Jason Lowe-Power Maintainer: Gabe Black Tested-by: kokoro --- util/style/verifiers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/style/verifiers.py b/util/style/verifiers.py index 00cf0705c..85f31cee1 100644 --- a/util/style/verifiers.py +++ b/util/style/verifiers.py @@ -347,7 +347,7 @@ class SortedIncludes(Verifier): def check(self, filename, regions=all_regions, fobj=None, silent=False): close = False if fobj is None: - fobj = self.open(filename, 'r') + fobj = self.open(filename, 'rb') close = True norm_fname = self.normalize_filename(filename) -- 2.30.2