mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 02:05:55 +08: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
@ -298,8 +298,7 @@ class MaterialManagementModel(QObject):
|
|||||||
def exportAll(self, file_path: QUrl) -> None:
|
def exportAll(self, file_path: QUrl) -> None:
|
||||||
registry = CuraContainerRegistry.getInstance()
|
registry = CuraContainerRegistry.getInstance()
|
||||||
|
|
||||||
with open(file_path.toLocalFile(), "w") as stream:
|
archive = zipfile.ZipFile(file_path.toLocalFile(), "w")
|
||||||
archive = zipfile.ZipFile(stream, "w", compression = zipfile.ZIP_DEFLATED)
|
|
||||||
for metadata in registry.findInstanceContainersMetadata(type = "material"):
|
for metadata in registry.findInstanceContainersMetadata(type = "material"):
|
||||||
if metadata["base_file"] != metadata["id"]: # Only process base files.
|
if metadata["base_file"] != metadata["id"]: # Only process base files.
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user