mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-19 12:57:56 +00:00
Do not crash if dynamips config contain non ascii chars
But I don't know why user can want to do that. Fix #123
This commit is contained in:
parent
49f36a83bd
commit
990f243f15
@ -560,8 +560,8 @@ class Dynamips(BaseManager):
|
|||||||
raise DynamipsError("Could not create Dynamips configs directory: {}".format(e))
|
raise DynamipsError("Could not create Dynamips configs directory: {}".format(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(path, "w") as f:
|
with open(path, "wb") as f:
|
||||||
f.write(content)
|
f.write(content.encode("utf-8"))
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise DynamipsError("Could not create config file {}: {}".format(path, e))
|
raise DynamipsError("Could not create config file {}: {}".format(path, e))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user