Comment 12 for bug 824440

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the investigation Vincent.

So there are issues with non-ascii characters in filenames when commenting out the code that handles them, which doesn’t surprise me much.

But does it work with a filename that doesn’t have non-ascii characters?

Also, it looks like the 'unicode' type doesn’t exist in python3 any longer: strings (of type 'str') are unicode by default. Non-unicode strings have the type 'bytes'. This means that the test in ImageMetadata.__init__(…) should become:

    if filename is not None and isinstance(filename, str):
        self.filename = filename.encode(sys.getfilesystemencoding())

And in ImageMetadata._instantiate_image(…), since we are bitten by https://svn.boost.org/trac/boost/ticket/4609, we probably want to do the following:

    return libexiv2python._Image(filename.decode('utf-8'))

Vincent, can you test if the above works for you?