Skip to content

Commit 6fbaa2a

Browse files
committed
fix: convert non str/bytes to str.
1 parent 12f8b5b commit 6fbaa2a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sasctl/pzmm/zip_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def zip_files(
7575

7676
with zipfile.ZipFile(buffer, "w", zipfile.ZIP_DEFLATED, False) as archive:
7777
for file_name, data in model_files.items():
78+
if not isinstance(data, (str, bytes)):
79+
data = str(data)
7880
archive.writestr(file_name, data)
7981

8082
# NOTE: bytes are added to the buffer when zip file is closed

0 commit comments

Comments
 (0)