Set encoding correctly when opening files everywhere

Otherwise the encoding is interpreted differently on Windows and Mac.
This commit is contained in:
Ghostkeeper 2018-06-11 11:08:47 +02:00
parent c779795618
commit 54a03723ab
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
8 changed files with 13 additions and 13 deletions

View file

@ -1018,7 +1018,7 @@ class XmlMaterialProfile(InstanceContainer):
@classmethod
def getProductIdMap(cls) -> Dict[str, List[str]]:
product_to_id_file = os.path.join(os.path.dirname(sys.modules[cls.__module__].__file__), "product_to_id.json")
with open(product_to_id_file) as f:
with open(product_to_id_file, encoding = "utf-8") as f:
product_to_id_map = json.load(f)
product_to_id_map = {key: [value] for key, value in product_to_id_map.items()}
return product_to_id_map