From: Bobby R. Bruce Date: Tue, 16 Jun 2020 18:00:19 +0000 (-0700) Subject: python,util: Fixed string decoding in include verifier X-Git-Tag: v20.1.0.0~534 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=25b5f5dfa1ac2527bf1346aaca8eefd6634885b8;p=gem5.git 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 --- 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)