urllib.error.URLError when running svg2png on SVGs containing internal xlink:hrefs
Hello, I've found other references (https://github.com/Kozea/CairoSVG/issues/134) to this issue, but I'm still having trouble processing SVGs containing internal xlink:hrefs with CairoSVG 2.4.0.
Here's a general idea of my SVG structure:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="inline" height="90" viewBox="0 0 320 90" width="320">
<title>Title</title>
<desc>
<p>Description</p>
</desc>
<defs>
<path d="M0 0 l 0 25" id="arrows" marker-end="url(#arrowhead)"/>
<marker id="arrowhead" markerHeight="7.5" markerWidth="7.5" orient="auto" refX="5" refY="5" viewBox="0 0 10 10">
<path d="M0,0 L10,5 L0,10z"/>
</marker>
</defs>
<g>
<g>
<use marker-end="url(#arrowhead)" x="38.5" xlink:href="#arrows" y="25"/>
<use marker-end="url(#arrowhead)" x="99" xlink:href="#arrows" y="25"/>
<use marker-end="url(#arrowhead)" x="150" xlink:href="#arrows" y="25"/>
</g>
</g>
</svg>
I'm calling CairoSVG from a python script with this code:
cairosvg.svg2png(url='svgs/' + svgName, write_to='svgs/png.png', scale=2)
When I run my code on SVGs that don't contain internal hrefs everything processes as expected, but when I try to run my code on an SVG with internal hrefs I receive the following error:
urllib.error.URLError: <urlopen error [WinError 2] The system cannot find the file specified: 'C:\\Users\\khanson\\Desktop\\%23arrows'>
How can I fix this behavior so CairoSVG will properly parse internal hrefs?