repo2json: Open the out file as binary to avoid any encoding question

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2020-06-08 20:59:15 +02:00
parent 89afed8844
commit 39179f6c00

View file

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