You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/afm.py", line 101, in _sanity_check
if not line.startswith(b'StartFontMetrics'):
TypeError: startswith first arg must be str or a tuple of str, not bytes
I think that it should be solved editing the file afm.py and forcing the variable line to be of type bytes (because sometimes -I don't know why- it could be str), for instance, writing these 2 lines of code before the statements similar to: if not line.startswith(b'....Some string....') (lines 101, 155 and 198 of afm.py --- maybe also in 233, 244 and 277...)
if isinstance(line, str):
line = line.encode()
The text was updated successfully, but these errors were encountered:
This code raises a unexpected TypeError in Python 3.
...
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/afm.py", line 101, in _sanity_check
if not line.startswith(b'StartFontMetrics'):
TypeError: startswith first arg must be str or a tuple of str, not bytes
I think that it should be solved editing the file
afm.py
and forcing the variableline
to be of typebytes
(because sometimes -I don't know why- it could bestr
), for instance, writing these 2 lines of code before the statements similar to:if not line.startswith(b'....Some string....')
(lines 101, 155 and 198 ofafm.py
--- maybe also in 233, 244 and 277...)The text was updated successfully, but these errors were encountered: