We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37952cd commit abdb8f9Copy full SHA for abdb8f9
cairosvg/parser.py
@@ -357,6 +357,8 @@ def __init__(self, **kwargs):
357
self.url = url
358
elif file_obj is not None:
359
bytestring = file_obj.read()
360
+ if isinstance(bytestring, str):
361
+ bytestring = bytestring.encode()
362
self.url = getattr(file_obj, 'name', None)
363
if self.url == '<stdin>':
364
self.url = None
0 commit comments