From 39179f6c00ef3f888a677d9a10c61aff273507d3 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mon, 8 Jun 2020 20:59:15 +0200 Subject: [PATCH] repo2json: Open the out file as binary to avoid any encoding question Signed-off-by: Pierre-Yves Chibon --- roles/repo2json/files/rhel_to_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/repo2json/files/rhel_to_json.py b/roles/repo2json/files/rhel_to_json.py index e47ca23fb4..a484b434e5 100644 --- a/roles/repo2json/files/rhel_to_json.py +++ b/roles/repo2json/files/rhel_to_json.py @@ -162,7 +162,7 @@ def decompress_primary_db(archive, location): tar.extractall(path=location) elif archive.endswith('.bz2'): import bz2 - with open(location, 'w') as out: + with open(location, 'wb') as out: bzar = bz2.BZ2File(archive) out.write(bzar.read()) bzar.close()