diff options
author | Olivier Tilloy <osomon@sanctuary> | 2008-01-18 22:49:30 +0100 |
---|---|---|
committer | Olivier Tilloy <osomon@sanctuary> | 2008-01-18 22:49:30 +0100 |
commit | b6b0a404a44acc5227ed10104d2d028843026d6b (patch) | |
tree | ac651bb2722e6f34d7e492f134542c09b392df85 | |
parent | 766426fa74e5c267d23e4ae5f20e32654f30554a (diff) | |
download | pyexiv2-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.py | 4 |
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 = {} |