diff --git a/PIL/ImageQt.py b/PIL/ImageQt.py index 1723e3226..6b7d4d66e 100644 --- a/PIL/ImageQt.py +++ b/PIL/ImageQt.py @@ -59,7 +59,10 @@ class ImageQt(QImage): # handle filename, if given instead of image name if hasattr(im, "toUtf8"): # FIXME - is this really the best way to do this? - im = unicode(im.toUtf8(), "utf-8") + if str is bytes: + im = unicode(im.toUtf8(), "utf-8") + else: + im = str(im.toUtf8(), "utf-8") if isPath(im): im = Image.open(im)