From 546d89852e3b59b61c9dc9faec85f3f542bcbc3c Mon Sep 17 00:00:00 2001 From: Vadim Lebedev Date: Sat, 23 Jul 2022 13:25:14 +0200 Subject: [PATCH] open archive in binary mode --- libarchive/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libarchive/__init__.py b/libarchive/__init__.py index ec8c2d8..ed8010f 100644 --- a/libarchive/__init__.py +++ b/libarchive/__init__.py @@ -160,7 +160,7 @@ def is_archive(f, formats=(None, ), filters=(None, )): format(s)/filter(s).''' need_close : bool = False if isinstance(f, str): - f = open(f, 'r') + f = open(f, 'rb') need_close = True a = _libarchive.archive_read_new() for format in formats: