GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
812 stars 263 forks source link

UnicodeEncodeError: 'ascii' codec can't encode characters in position 58-59: ordinal not in range(128) #1058

Closed julien-duponchelle closed 7 years ago

julien-duponchelle commented 7 years ago

https://sentry.io/gns3/gns3-server/issues/287793450/

UnicodeEncodeError: 'ascii' codec can't encode characters in position 58-59: ordinal not in range(128)
  File "gns3server/web/route.py", line 195, in control_schema
    yield from func(request, response)
  File "gns3server/handlers/api/compute/qemu_handler.py", line 404, in create_img
    yield from Qemu.instance().create_disk(qemu_img, path, request.json)
  File "gns3server/compute/qemu/__init__.py", line 250, in create_disk
    if os.path.exists(path):
  File "python3.4/genericpath.py", line 19, in exists
    os.stat(path)

UnicodeEncodeError: 'ascii' codec can't encode characters in position 58-59: ordinal not in range(128)
julien-duponchelle commented 7 years ago

We need to catch the unicode error and raise a QemuError. This when user pass something not supported by the local filesystem