Skip to content

Potential Error in _page_generator.py #251

Open
@CommitThis

Description

Hello,

I was trying to get the write image function working and may have come across an error in _page_generator.py. Unfortunately I don't have a specific error for you as I couldn't get it working end-to-end and have since moved on (now awaiting the next proper release), but I noticed that there are some strange things occurring in the aforementioned page.

With respect to the following code:

plotly = (
(
Path(plotly.__file__).parent / "package_data" / "plotly.min.js",
"utf-8",
).as_uri(),
"utf-8",
)
if not plotly.is_file():
plotly = (DEFAULT_PLOTLY, "utf-8")

I'm not quite sure what is supposed to be happening here. It looks like you're trying to call both as_uri() and is_file() on a tuple. I may have missed something but it feels like you wanted to do something like this:

plotly_path = Path(plotly.__file__).parent / "package_data" / "plotly.min.js"
if not plotly_path.is_file():
    plotly = (DEFAULT_PLOTLY, "utf-8")
else:
    plotly = (plotly_path.as_uri(), "utf-8")

In any case, apologies in advance if I've missed something and this is a non-issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions