mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 03:08:14 +00:00
Catch unicode error when you try to duplicate a project with invalid characters
Fix #934
This commit is contained in:
parent
886329a978
commit
d60597ca0d
@ -75,7 +75,10 @@ def import_project(controller, project_id, stream, location=None, name=None, kee
|
||||
else:
|
||||
projects_path = controller.projects_directory()
|
||||
path = os.path.join(projects_path, project_name)
|
||||
try:
|
||||
os.makedirs(path, exist_ok=True)
|
||||
except UnicodeEncodeError as e:
|
||||
raise aiohttp.web.HTTPConflict(text="The project name contain non supported or invalid characters")
|
||||
myzip.extractall(path)
|
||||
|
||||
topology = load_topology(os.path.join(path, "project.gns3"))
|
||||
|
Loading…
Reference in New Issue
Block a user