Skip to content

"Unusual" characters in project names cause JSON decode error #22

@gsteinLTU

Description

@gsteinLTU

To replicate:

Name a project file "test — dash.json" (there's an em-dash)

Open the project, and then try to run it (contents of project can be default)

The following error should appear:

Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
  File "/Users/gordon/.pyenv/versions/3.12.10/l
ib/python3.12/site-packages/netsblox/editor.py"
, line 87, in __init__
    res = _json.loads(_requests.post(f'{self._b
ase_url}/projects/',
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^
  File "/Users/gordon/.pyenv/versions/3.12.10/l
ib/python3.12/json/__init__.py", line 346, in l
oads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/gordon/.pyenv/versions/3.12.10/l
ib/python3.12/json/decoder.py", line 338, in de
code
    obj, end = self.raw_decode(s, idx=_w(s, 0).
end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^
  File "/Users/gordon/.pyenv/versions/3.12.10/l
ib/python3.12/json/decoder.py", line 356, in ra
w_decode
    raise JSONDecodeError("Expecting value", s,
 err.value) from None
json.decoder.JSONDecodeError: Expecting value: 
line 1 column 1 (char 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions