From 22889976979967e991b43a0f7bf2989ca12fa712 Mon Sep 17 00:00:00 2001 From: "A.Sasin" Date: Fri, 6 Oct 2017 18:56:17 +0200 Subject: [PATCH] Fixed: while project loading pass call upgrade plugin for preferences CURA-4344 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 7e185c8d9f..ad52b55163 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -304,7 +304,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader): num_visible_settings = 0 try: temp_preferences = Preferences() - temp_preferences.readFromFile(io.TextIOWrapper(archive.open("Cura/preferences.cfg"))) # We need to wrap it, else the archive parser breaks. + serialized = archive.open("Cura/preferences.cfg").read().decode("utf-8") + temp_preferences.deserialize(serialized) visible_settings_string = temp_preferences.getValue("general/visible_settings") if visible_settings_string is not None: @@ -407,7 +408,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # Create a shadow copy of the preferences (we don't want all of the preferences, but we do want to re-use its # parsing code. temp_preferences = Preferences() - temp_preferences.readFromFile(io.TextIOWrapper(archive.open("Cura/preferences.cfg"))) # We need to wrap it, else the archive parser breaks. + serialized = archive.open("Cura/preferences.cfg").read().decode("utf-8") + temp_preferences.deserialize(serialized) # Copy a number of settings from the temp preferences to the global global_preferences = Preferences.getInstance()