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

[Bug] KeyError: 'd' #26

Open
chepo92 opened this issue Nov 15, 2020 · 3 comments
Open

[Bug] KeyError: 'd' #26

chepo92 opened this issue Nov 15, 2020 · 3 comments

Comments

@chepo92
Copy link

chepo92 commented Nov 15, 2020

 File "svg2cookiecutter.py", line 232, in svgToCookieCutter
    for superpath in parser.getPathsFromSVGFile(filename)[0]:
  File "C:\Users\Axel\AppData\Roaming\inkscape\extensions\svgpath\parser.py", line 699, in getPathsFromSVGFile
    return getPathsFromSVG(ET.parse(filename).getroot())
  File "C:\Users\Axel\AppData\Roaming\inkscape\extensions\svgpath\parser.py", line 693, in getPathsFromSVG
    getPaths(paths, matrix, svg, path.SVGState(), {})
  File "C:\Users\Axel\AppData\Roaming\inkscape\extensions\svgpath\parser.py", line 587, in getPaths
    getPaths(paths, matrix, child, state, savedElements)
  File "C:\Users\Axel\AppData\Roaming\inkscape\extensions\svgpath\parser.py", line 587, in getPaths
    getPaths(paths, matrix, child, state, savedElements)
  File "C:\Users\Axel\AppData\Roaming\inkscape\extensions\svgpath\parser.py", line 549, in getPaths
    path = parse_path(tree.attrib['d'], matrix=matrix, svgState=state)
KeyError: 'd'

I Attach file to reproduce error
camion.zip

@arpruss
Copy link
Owner

arpruss commented Nov 16, 2020

I think the cause of the error is:
<path style="fill:#000000;stroke:none;stroke-width:0.264583" id="path57" cx="51.671551" cy="96.268814" r="1.4382441" />
in your svg.

This doesn't look like a valid path. I think it's meant to be a circle instead.

@chepo92
Copy link
Author

chepo92 commented Nov 16, 2020

Thanks I'll review the file, at first I couldn't find which path was having trouble, i erased one by one and randomly appearing the error.
I added a try/except block to parser.py and it passed with no errors, may PR later, but first I'll identify the path

@arpruss
Copy link
Owner

arpruss commented Nov 16, 2020

It's the one without d=.

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