Skip to content

Graphical output does not work when filename supplied in version 2.1.1 #164

@Benjamin2107

Description

@Benjamin2107

When trying to plot any file with prov version 2.1.1, the plot() function of ProvBundle parses the filename incorrectly:

if filename:
    format = str(os.path.splitext(filename))[-1].lower().strip(os.path.extsep)
else:
    format = "png"

The string casting at the wrong place results in every format only beeing ) when a filename is supplied. This is due to the return value of splitext (a tuple) being casted into a string like this: "("path/to/file/prov", ".svg")".

A solution would look like this:

if filename:
    format = str(os.path.splitext(filename)[-1]).lower().strip(os.path.extsep)
else:
    format = "png"

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