From 3c4b7b1de3e8332d9085823c8b2798555fa521c5 Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 20 Jun 2022 14:38:48 +0200 Subject: fix zip export --- gerbonara/layers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gerbonara') diff --git a/gerbonara/layers.py b/gerbonara/layers.py index 552ac8b..41c5bfe 100644 --- a/gerbonara/layers.py +++ b/gerbonara/layers.py @@ -409,9 +409,9 @@ class LayerStack: else: raise ValueError('output zip file already exists and overwrite_existing is False') - with ZipFile(path) as le_zip: + with ZipFile(path, 'w') as le_zip: for path, layer in self._save_files_iter(naming_scheme=naming_scheme): - with le_zip.open(prefix + str(path), 'wb') as out: + with le_zip.open(prefix + str(path), 'w') as out: out.write(layer.write_to_bytes()) def save_to_directory(self, path, naming_scheme={}, overwrite_existing=True): -- cgit