mathandy / svgpathtools

A collection of tools for manipulating and analyzing SVG Path objects and Bezier curves.
MIT License
532 stars 134 forks source link

could not convert string to float: 'c' #175

Closed eggplants closed 1 year ago

eggplants commented 2 years ago

Target: https://github.com/primer/octicons/blob/main/icons/mark-github-16.svg

$ python -V
Python 3.9.10
$ pip show svgpathtools
Name: svgpathtools
Version: 1.4.4
Summary: A collection of tools for manipulating and analyzing SVG Path objects and Bezier curves.
Home-page: https://github.com/mathandy/svgpathtools
Author: Andy Port
Author-email: AndyAPort@gmail.com
License: MIT
Location: /home/eggplants/.pyenv/versions/3.9.10/lib/python3.9/site-packages
Requires: numpy, scipy, svgwrite
Required-by:
from svgpathtools import svg2paths
p, a=svg2paths("mark-github.svg")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/eggplants/.pyenv/versions/3.9.10/lib/python3.9/site-packages/svgpathtools/svg_to_paths.py", line 202, in svg2paths
    path_list = [parse_path(d) for d in d_strings]
  File "/home/eggplants/.pyenv/versions/3.9.10/lib/python3.9/site-packages/svgpathtools/svg_to_paths.py", line 202, in <listcomp>
    path_list = [parse_path(d) for d in d_strings]
  File "/home/eggplants/.pyenv/versions/3.9.10/lib/python3.9/site-packages/svgpathtools/parser.py", line 15, in parse_path
    return Path(pathdef, current_pos=current_pos, tree_element=tree_element)
  File "/home/eggplants/.pyenv/versions/3.9.10/lib/python3.9/site-packages/svgpathtools/path.py", line 2436, in __init__
    self._parse_path(segments[0], current_pos)
  File "/home/eggplants/.pyenv/versions/3.9.10/lib/python3.9/site-packages/svgpathtools/path.py", line 3303, in _parse_path
    end = float(elements.pop()) + float(elements.pop()) * 1j
ValueError: could not convert string to float: 'c'

could not convert string to float: 'c'