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

TypeError: float() argument must be a string or a number #6

Open
stuaxo opened this issue Jul 13, 2015 · 2 comments
Open

TypeError: float() argument must be a string or a number #6

stuaxo opened this issue Jul 13, 2015 · 2 comments

Comments

@stuaxo
Copy link
Contributor

stuaxo commented Jul 13, 2015

This smiley svg on wikipedia causes an error

https://upload.wikimedia.org/wikipedia/commons/8/85/Smiley.svg

Exception while parsing element <Element '{http://www.w3.org/2000/svg}circle' at 0x7f6fda20f390>
Traceback (most recent call last):
  File "go2.py", line 9, in <module>
    svg_doc = glsvg.SVGDoc(filename)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/glsvg/svg.py", line 146, in __init__
    self.parse_root(self.root)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/glsvg/svg.py", line 177, in parse_root
    self._parse_element(e)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/glsvg/svg.py", line 192, in _parse_element
    renderable = SVGPath(self, e, parent)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/glsvg/svg_path.py", line 237, in __init__
    self.config)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/glsvg/svg_path_builder.py", line 111, in read_xml_svg_element
    cx = float(e.get('cx'))
TypeError: float() argument must be a string or a number
@stuaxo
Copy link
Contributor Author

stuaxo commented Jul 13, 2015

Maybe the code should be e.get('cx', 0) ?

Don't know anything about the internals to know if this is right though.

@stuaxo
Copy link
Contributor Author

stuaxo commented Jul 16, 2015

Got this parsing here ..
#7

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

1 participant