From 0b924d905048be8d047fe90deafedc0153f19ee0 Mon Sep 17 00:00:00 2001 From: Vadim Lebedev Date: Tue, 9 Aug 2022 23:06:58 +0200 Subject: [PATCH] Fix writing unicod data in python2 --- libarchive/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libarchive/__init__.py b/libarchive/__init__.py index 79f520a..b95890f 100644 --- a/libarchive/__init__.py +++ b/libarchive/__init__.py @@ -283,7 +283,7 @@ class EntryWriteStream(object): if self.buffer: if PY3: self.buffer.write(data) - else: + elif isinstance(data, str): self.buffer.write(unicode(data, ENCODING)) else: _libarchive.archive_write_data_from_str(self.archive._a, data.encode(ENCODING))