From ad135f70f10b44ee42465e564609ad4a3c0148a4 Mon Sep 17 00:00:00 2001 From: ArturTomczak Date: Mon, 24 Jan 2022 16:24:15 +0100 Subject: [PATCH] encoding clean up the use of binary access to file was not intentional, switched to @aothms proposal. --- src/ifcopenshell-python/ifcopenshell/ids.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/ids.py b/src/ifcopenshell-python/ifcopenshell/ids.py index 5c3856a3c4..5e05fc001a 100644 --- a/src/ifcopenshell-python/ifcopenshell/ids.py +++ b/src/ifcopenshell-python/ifcopenshell/ids.py @@ -156,13 +156,12 @@ class ids: }, ) - with open(filepath, "wb") as f: - f.write('\n'.encode("utf-8")) - f.write("\n".encode("utf-8")) - f.write(ids_str.encode("utf-8")) + with open(filepath, "w", encoding="utf-8") as f: + f.write('\n') + f.write("\n") + f.write(ids_str) f.close() - # ids_schema.validate(filepath) return ids_schema.is_valid(filepath) @staticmethod