Skip to content

Commit

Permalink
Only unquote once in getMaterialFilePackageId
Browse files Browse the repository at this point in the history
  • Loading branch information
casperlamboo committed Jul 19, 2022
1 parent a6b15d2 commit 3dad5d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cura/CuraPackageManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def isMaterialBundled(self, file_name: str, guid: str):

def getMaterialFilePackageId(self, file_name: str, guid: str) -> str:
"""Get the id of the installed material package that contains file_name"""
file_name = unquote_plus(file_name)
for material_package in [f for f in os.scandir(self._installation_dirs_dict["materials"]) if f.is_dir()]:
package_id = material_package.name

for root, _, file_names in os.walk(material_package.path):
file_name = unquote_plus(file_name)
if file_name not in file_names:
# File with the name we are looking for is not in this directory
continue
Expand Down

0 comments on commit 3dad5d5

Please sign in to comment.