From: Jason Ish Date: Wed, 11 Dec 2019 21:26:58 +0000 (-0600) Subject: update-sources: python 3 fixup X-Git-Tag: 1.2.0rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F216%2Fhead;p=thirdparty%2Fsuricata-update.git update-sources: python 3 fixup Open index in binary mode to fix encoding issue on Python 3.6 on CentOS 7. --- diff --git a/suricata/update/commands/updatesources.py b/suricata/update/commands/updatesources.py index 25f6e3e..a47c24c 100644 --- a/suricata/update/commands/updatesources.py +++ b/suricata/update/commands/updatesources.py @@ -73,7 +73,7 @@ def compare_sources(initial_content, final_content): def write_and_compare(initial_content, fileobj): with open(local_index_filename, "wb") as outobj: outobj.write(fileobj.getvalue()) - with open(local_index_filename) as stream: + with open(local_index_filename, "rb") as stream: final_content = yaml.safe_load(stream) compare_sources(initial_content, final_content) logger.info("Saved %s", local_index_filename)