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-4.0.7~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08f9d31a8228c4df9344c0d2f95bcdaf699b7e7b;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 ba7ce7defd..f0c6e32e48 100755 --- a/rust/gen-c-headers.py +++ b/rust/gen-c-headers.py @@ -156,7 +156,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(