From: Jason Ish Date: Thu, 7 Feb 2019 19:53:23 +0000 (-0600) Subject: issue 2795: python 3 fix in Rust C header gen X-Git-Tag: suricata-5.0.0-beta1~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93c956ebdfc1eb252c68f6dce782c37939904fa3;p=thirdparty%2Fsuricata.git issue 2795: python 3 fix in Rust C header gen The C header generation script was failing with a unicode error in Python 3 on FreeBSD. Fix the reading of files to properly handle unicode in all Python 3 environments. Redmine issue: https://redmine.openinfosecfoundation.org/issues/2794 --- diff --git a/rust/gen-c-headers.py b/rust/gen-c-headers.py index 2d678549ad..cfe303671b 100755 --- a/rust/gen-c-headers.py +++ b/rust/gen-c-headers.py @@ -169,7 +169,7 @@ def gen_headers(filename): if not should_regen(filename, output_filename): return - buf = open(filename).read() + buf = open(filename, "rb").read().decode("utf-8") writer = StringIO() for fn in re.findall(