Test: use codecs.open in TestMetadata.test_file_path

This commit is contained in:
wmayer
2022-06-29 15:51:42 +02:00
parent 7b377a216b
commit 898b1007b9

View File

@@ -25,6 +25,7 @@
import FreeCAD
import unittest
import os
import codecs
import tempfile
class TestMetadata(unittest.TestCase):
@@ -111,7 +112,7 @@ class TestMetadata(unittest.TestCase):
def test_file_path(self):
# Issue 7112
filename = os.path.join(tempfile.gettempdir(), b'H\xc3\xa5vard.xml'.decode("utf-8"))
xmlfile = open(file=filename, mode="w", encoding="utf-8")
xmlfile = codecs.open(filename, mode="w", encoding="utf-8")
xmlfile.write(r"""<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<package format="1" xmlns="https://wiki.freecad.org/Package_Metadata">
<name>test</name>