enthought / enthought/enable

Code path for SVG clip-path seems unreachable

Open
#496 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
C
Stars
97
Forks
45
PR merge metrics
No merged PRs in 30d

Description

This if-clause in `enable.savage.svg.document.SVGDocument` seems to be always false:
https://github.com/enthought/enable/blob/6b41a429f5cfddc70fa67c3a1025cdd426a98988/enable/savage/svg/document.py#L646

The `node` object is understood to be an instance of `xml.etree.ElementTree.Element`. Before enable 4.7.0, (e.g. 4.6.2), it was looping over `node.keys()`:
https://github.com/enthought/enable/blob/248cf7adee2cfc4cdf07646a6f47ce5f13a358df/enable/savage/svg/document.py#L655

`node.keys()` returns the element attribute names. https://docs.python.org/3.8/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.keys

Upon changing to just `node`, the if-clause will be checking for containment in the subelements, which will likely be always false.

Discovered through attempt to write a test in #492 that requires the code path.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.