We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exporting the JSON (using --export-json) for some projects (e.g. examples/vhdl/run) throws the following exception:
--export-json
examples/vhdl/run
Traceback (most recent call last): File "/home/tom/git/vunit/vunit/ui/__init__.py", line 726, in main all_ok = self._main(post_run) File "/home/tom/git/vunit/vunit/ui/__init__.py", line 761, in _main return self._main_export_json(self._args.export_json) File "/home/tom/git/vunit/vunit/ui/__init__.py", line 892, in _main_export_json json.dump(json_data, fptr, sort_keys=True, indent=4, separators=(",", ": ")) File "/usr/lib64/python3.8/json/__init__.py", line 179, in dump for chunk in iterable: File "/usr/lib64/python3.8/json/encoder.py", line 431, in _iterencode yield from _iterencode_dict(o, _current_indent_level) File "/usr/lib64/python3.8/json/encoder.py", line 405, in _iterencode_dict yield from chunks File "/usr/lib64/python3.8/json/encoder.py", line 325, in _iterencode_list yield from chunks File "/usr/lib64/python3.8/json/encoder.py", line 405, in _iterencode_dict yield from chunks File "/usr/lib64/python3.8/json/encoder.py", line 405, in _iterencode_dict yield from chunks File "/usr/lib64/python3.8/json/encoder.py", line 438, in _iterencode o = _default(o) File "/usr/lib64/python3.8/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type PosixPath is not JSON serializable
This is when running on Linux, but it seems to be a problem on Windows as well.
The text was updated successfully, but these errors were encountered:
Hi @tomvdbussche! Please, can you try replacing https://github.com/VUnit/vunit/blob/master/vunit/ui/__init__.py#L874 with file_name=str(info.location.file_name),? It worked for me on Windows (MSYS2).
file_name=str(info.location.file_name),
However, I'm not sure about pushing that to master or using the absolute path as in https://github.com/VUnit/vunit/blob/master/vunit/ui/__init__.py#L851. Currently, it feels inconsistent that some test paths are absolute and others are relative in the exported JSON. @kraigher, any guess?
master
Sorry, something went wrong.
@eine Can confirm that this does seem to fix the issue on Linux as well!
ui: fix not serializable path when exporting JSON (VUnit#657)
ff997a4
I pushed that fix. We'll revisit the absolute/relative issue if we need it in the future...
No branches or pull requests
Exporting the JSON (using
--export-json
) for some projects (e.g.examples/vhdl/run
) throws the following exception:This is when running on Linux, but it seems to be a problem on Windows as well.
The text was updated successfully, but these errors were encountered: