From 9be4e7b576dc7272df6afcc05e239de24a214a29 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 31 Mar 2022 19:14:13 -0400 Subject: [PATCH] Fix Bison 3.8.2 error (#3366). --- Changes | 1 + src/bisonpre | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 16539baa6..25b7d3b41 100644 --- a/Changes +++ b/Changes @@ -16,6 +16,7 @@ Verilator 4.221 devel * Split --prof-threads into --prof-exec and --prof-pgo (#3365). [Geza Lore, Shunyao CAD] * Deprecate 'vluint64_t' and similar types (#3255). * Fix MSVC localtime_s (#3124). +* Fix Bison 3.8.2 error (#3366). [elike-ypq] Verilator 4.220 2022-03-12 diff --git a/src/bisonpre b/src/bisonpre index efebd9744..05b213d93 100755 --- a/src/bisonpre +++ b/src/bisonpre @@ -101,7 +101,7 @@ def bison_version_check(): def clean_output(filename, outname, is_output, is_c): print(" edit " + filename + " " + outname) - with open(filename) as fh: + with open(filename, "r", encoding="utf-8") as fh: lines = fh.readlines() basename = re.sub(r'.*/', '', tmp_prefix() + ".") @@ -165,7 +165,7 @@ def clean_output(filename, outname, is_output, is_c): def warning_check(filename): - with open(filename) as fh: + with open(filename, "r", encoding="utf-8") as fh: linenum = 0 for line in fh: linenum += 1 @@ -185,7 +185,7 @@ def clean_input(filename, outname): global Filename # pylint: disable=global-variable-undefined Filename = filename - with open(filename) as fh: + with open(filename, "r", encoding="utf-8") as fh: lines = fh.readlines() # Find "%tokens:"