python pillow (better PIL) encoding check bug -


i've installed pillow package virtualenv. doing this:

from pil import image, imagefont, imagedraw imagefont.load_path('some_path') 

i'm getting error:

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 class, type, or tuple of classes , types 

and indeed, if check official gihub repository (https://github.com/python-imaging/pillow/blob/master/pil/imagefont.py#l264), can see construct:

if not isinstance(filename, "utf-8"):     ... 

my question is: how replace works?

someone overlooked testing method; correct incantation is:

if not isinstance(filename, str):     # ... 

because rest of code proceeds turn into str, both python 2 , python 3.

i've issued pull request, after talking maintainer on irc.

update: patch has been merged.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -