1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-25 00:08:11 +00:00

Fix handling of UTF-8 in large SVG files

Fix #854
This commit is contained in:
Julien Duponchelle 2017-01-06 09:42:56 +01:00
parent 6778b29fc0
commit 51aef2b9c7
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -126,7 +126,7 @@ class Drawing:
filename = hashlib.md5(value.encode()).hexdigest() + ".svg" filename = hashlib.md5(value.encode()).hexdigest() + ".svg"
file_path = os.path.join(self._project.pictures_directory, filename) file_path = os.path.join(self._project.pictures_directory, filename)
if not os.path.exists(file_path): if not os.path.exists(file_path):
with open(file_path, "w+") as f: with open(file_path, "w+", encoding="utf-8") as f:
f.write(value) f.write(value)
self._svg = filename self._svg = filename
else: else: