aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Tilloy <osomon@sanctuary>2008-01-18 22:49:30 +0100
committerOlivier Tilloy <osomon@sanctuary>2008-01-18 22:49:30 +0100
commitb6b0a404a44acc5227ed10104d2d028843026d6b (patch)
treeac651bb2722e6f34d7e492f134542c09b392df85
parent766426fa74e5c267d23e4ae5f20e32654f30554a (diff)
downloadpyexiv2-b6b0a404a44acc5227ed10104d2d028843026d6b.tar.gz
*Really* fixed bug #146313 (passing the filename to the Image constructor as unicode fails): if filename is passed as unicode, it is converted to a regular string.
-rw-r--r--src/pyexiv2.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pyexiv2.py b/src/pyexiv2.py
index 6a1b46a..5a03213 100644
--- a/src/pyexiv2.py
+++ b/src/pyexiv2.py
@@ -281,7 +281,9 @@ class Image(libpyexiv2.Image):
"""
def __init__(self, filename):
- libpyexiv2.Image.__init__(self, str(filename))
+ if filename.__class__ is unicode:
+ filename = filename.encode('utf-8')
+ libpyexiv2.Image.__init__(self, filename)
self.__exifTagsDict = {}
self.__iptcTagsDict = {}