我剛剛爲我的virtualenv安裝了一個Pillow包。這樣做:python枕頭(更好的PIL)編碼檢查bug
from PIL import Image, ImageFont, ImageDraw
ImageFont.load_path('some_path')
我得到一個錯誤:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/net/isilonP/public/rw/homes/cbl_adm/.virtualenvs/chembl_webservices/lib/python2.7/site-packages/PIL/ImageFont.py", line 264, in load_path
if not isinstance(filename, "utf-8"):
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types
事實上,如果你檢查的官方gihub庫(https://github.com/python-imaging/Pillow/blob/master/PIL/ImageFont.py#L264),你可以看到這個結構:
if not isinstance(filename, "utf-8"):
...
我的問題是:如何將其替換爲實際有效的內容?
使用該項目提交錯誤報告?枕頭正處於非常活躍的發展階段。 –
完成! https://github.com/python-imaging/Pillow/issues/304 – mnowotka