Skip to content

Fix AttributeError: 'SVGCanvas' object has no attribute 'beginPath'. - #498

Merged
deeplook merged 1 commit into
deeplook:mainfrom
CZ-NIC:fix-svg-canvas
Jul 31, 2026
Merged

Fix AttributeError: 'SVGCanvas' object has no attribute 'beginPath'.#498
deeplook merged 1 commit into
deeplook:mainfrom
CZ-NIC:fix-svg-canvas

Conversation

@zbohm

@zbohm zbohm commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Class renderSVG.SVGCanvas does not have a beginPath function, which will throw an AttributeError exception. It is used in easy-thumbnails[svg]==2.10.1.

https://github.com/SmileyChris/easy-thumbnails/blob/2.10.1/easy_thumbnails/VIL/Image.py#L21

Comment thread src/svglib/svglib.py
Handles Path, Rect, Circle, Ellipse, and Polygon; falls back to the
shape's bounding box for other types.
"""
if isinstance(canvas, SVGCanvas) and not hasattr(canvas, "beginPath"):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanatory comments are just here, between if and return None.

@deeplook

Copy link
Copy Markdown
Owner

Thanks for tracking this down and adding the guard — merging.

@deeplook
deeplook merged commit d4a8708 into deeplook:main Jul 31, 2026
16 checks passed
@deeplook deeplook mentioned this pull request Aug 1, 2026
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

Successfully merging this pull request may close these issues.

3 participants