mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 03:37:48 -06:00
Fix writing bytes to string-stream
Don't open the file first. We can let the zipfile module handle that. Contributes to issue CURA-8055.
This commit is contained in:
parent
ec727e1068
commit
66b2825a66
1 changed files with 10 additions and 11 deletions
|
@ -298,8 +298,7 @@ class MaterialManagementModel(QObject):
|
|||
def exportAll(self, file_path: QUrl) -> None:
|
||||
registry = CuraContainerRegistry.getInstance()
|
||||
|
||||
with open(file_path.toLocalFile(), "w") as stream:
|
||||
archive = zipfile.ZipFile(stream, "w", compression = zipfile.ZIP_DEFLATED)
|
||||
archive = zipfile.ZipFile(file_path.toLocalFile(), "w")
|
||||
for metadata in registry.findInstanceContainersMetadata(type = "material"):
|
||||
if metadata["base_file"] != metadata["id"]: # Only process base files.
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue