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()