From 93c956ebdfc1eb252c68f6dce782c37939904fa3 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Thu, 7 Feb 2019 13:53:23 -0600 Subject: [PATCH] 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 --- rust/gen-c-headers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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( -- 2.47.2