From 22a1a919680fe59792d0033101efefb0844ed9c4 Mon Sep 17 00:00:00 2001 From: user27182 <89109579+user27182@users.noreply.github.com> Date: Sat, 26 Sep 2026 11:51:58 -0600 Subject: [PATCH 1/2] fix(exporter): write zip directory entries without ZipFile.mkdir ZipFile.mkdir was added in Python 3.11, so to_wazex and to_html raised AttributeError on Python 3.10, which requires-python still allows. Co-Authored-By: Claude Opus 5.5 --- src/trame_vtklocal/utils/exporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trame_vtklocal/utils/exporter.py b/src/trame_vtklocal/utils/exporter.py index 5397e2f..67a36a3 100644 --- a/src/trame_vtklocal/utils/exporter.py +++ b/src/trame_vtklocal/utils/exporter.py @@ -330,7 +330,7 @@ def to_wazex( ), ) # Write states - zipf.mkdir("states") + zipf.writestr("states/", "") for vtk_id in ids_to_export: zipf.writestr( f"states/{vtk_id}", @@ -338,7 +338,7 @@ def to_wazex( ) # Write blobs - zipf.mkdir("blobs") + zipf.writestr("blobs/", "") for hash in hashes: zipf.writestr( f"blobs/{hash}", From a098518ded4d85429e5b15daf801a25ff2f562e3 Mon Sep 17 00:00:00 2001 From: user27182 <89109579+user27182@users.noreply.github.com> Date: Sat, 26 Sep 2026 11:51:58 -0600 Subject: [PATCH 2/2] fix(wasm): extract the wasm bundle with the data filter Calling tarfile.extractall without a filter emits a DeprecationWarning on Python 3.12 and 3.13 and trusts member paths on older versions. Co-Authored-By: Claude Opus 5.5 --- src/trame_vtklocal/module/wasm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/trame_vtklocal/module/wasm.py b/src/trame_vtklocal/module/wasm.py index bc94cc2..7be90f7 100644 --- a/src/trame_vtklocal/module/wasm.py +++ b/src/trame_vtklocal/module/wasm.py @@ -59,7 +59,10 @@ async def setup_wasm_directory(target_directory, wasm_url): # unpack with tarfile.open(dest_file) as tgz: - tgz.extractall(dest_folder) + if hasattr(tarfile, "data_filter"): + tgz.extractall(dest_folder, filter="data") + else: + tgz.extractall(dest_folder) print(f"Downloaded WASM:\n - from: {wasm_url}\n - to: {dest_folder}")