Skip to content
New issue

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

tr_rootdir being a Path obj causes esbonio v0.92.1 (pre-release) to crash #74

Open
iaavo opened this issue Mar 27, 2024 · 2 comments
Open

Comments

@iaavo
Copy link

iaavo commented Mar 27, 2024

tr_rootdir being a Path obj causes esbonio v0.92.1 (pre-release) to crash

test_reports.py#L47:

app.add_config_value("tr_rootdir", app.confdir, "html")

since app.confdir is a Path, it causes esbonio to raise an exception as it cant convert the configuration to a json

util.py#L27:

def as_json(data: Any) -> str:
    if dataclasses.is_dataclass(data):
        data = dataclasses.asdict(data)

    return json.dumps(data, default=_serialize_message)

one way to fix this issue would be:

app.add_config_value("tr_rootdir", str(app.confdir), "html")
@chrisjsewell
Copy link
Member

since app.confdir is a Path

Thanks for the report, just to note, this is a change in Sphinx core, since 7.2.6 if I recall correctly

@danwos
Copy link
Member

danwos commented Apr 2, 2024

I'm afraid this needs to be fixed by Esbonio, as Sphinx-Test-Reports is using the official Sphinx API correctly: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_config_value

There may be also a workaround on project/user side, as the default value app.confdir is just the default, meaning settingtr_rootdir in conf.py should fix it.
Can you try this and and give a short feedback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants