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

write_xml method doesn't accept pathlib.Path input #227

Open
suedunham opened this issue May 6, 2023 · 1 comment
Open

write_xml method doesn't accept pathlib.Path input #227

suedunham opened this issue May 6, 2023 · 1 comment

Comments

@suedunham
Copy link

When using the SVG.write_xml() method, I cannot simply hand it a pathlib.Path() object for the new filename. Instead, an exception is raised.

File "C:\Python311\Lib\site-packages\svgelements\svgelements.py", line 3429, in write_xml
    write(self, f)
  File "C:\Python311\Lib\site-packages\svgelements\svgelements.py", line 9362, in write
    if f.lower().endswith("svgz"):
       ^^^^^^^
AttributeError: 'WindowsPath' object has no attribute 'lower'. Did you mean: 'owner'?

This isn't a huge issue, since I can just do something like svg.write_xml(str(file_path)). However, the SVG.parse() method does work with Path() objects as input, and it would be nice if the other did as well for uniformity's sake.

tatarize added a commit that referenced this issue May 14, 2023
@tatarize
Copy link
Member

Should be fixed in the 1.9.4

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

2 participants