From 5d0e4238d595056f4f7f51af0a736d17afa94611 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 15 Jun 2022 13:26:29 +0200 Subject: [PATCH] Use os.path.join instead of appending a "/" since this is os specific. Remove possible bad conversion to str for path. --- cura/CuraPackageManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/CuraPackageManager.py b/cura/CuraPackageManager.py index 87a2935d96..12a77fd234 100644 --- a/cura/CuraPackageManager.py +++ b/cura/CuraPackageManager.py @@ -65,7 +65,7 @@ class CuraPackageManager(PackageManager): paths = [Path(p) for p in glob.glob(path + '/**/*.xml.fdm_material')] for material in paths: if material.name == file_name: - with open(str(material), encoding="utf-8") as f: + with open(material, encoding="utf-8") as f: # Make sure the file we found has the same guid as our material # Parsing this xml would be better but the namespace is needed to search it. parsed_guid = PluginRegistry.getInstance().getPluginObject( @@ -87,7 +87,7 @@ class CuraPackageManager(PackageManager): # File with the name we are looking for is not in this directory continue - with open(root + "/" + file_name, encoding="utf-8") as f: + with open(os.path.join(root, file_name), encoding="utf-8") as f: # Make sure the file we found has the same guid as our material # Parsing this xml would be better but the namespace is needed to search it. parsed_guid = PluginRegistry.getInstance().getPluginObject("XmlMaterialProfile").getMetadataFromSerialized(