Skip to content

Commit bce053a

Browse files
Fixed social plugin crashing for CairoSVG >= 2.8
Co-authored-by: kamilkrzyskow <34622465+kamilkrzyskow@users.noreply.github.com>
1 parent ca65624 commit bce053a

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

material/plugins/social/plugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ def _load_logo_svg(self, path, fill = None):
443443
# Fill with color, if given
444444
if fill:
445445
data = data.replace("<svg", f"<svg fill=\"{fill}\"")
446+
data = data.encode("utf-8")
446447

447448
# Convert to PNG and return image
448449
svg2png(bytestring = data, write_to = file, scale = 10)

src/plugins/social/plugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ def _load_logo_svg(self, path, fill = None):
443443
# Fill with color, if given
444444
if fill:
445445
data = data.replace("<svg", f"<svg fill=\"{fill}\"")
446+
data = data.encode("utf-8")
446447

447448
# Convert to PNG and return image
448449
svg2png(bytestring = data, write_to = file, scale = 10)

0 commit comments

Comments
 (0)