Now, I’m pretty sure that scons won’t run with python3, but it shouldn’t be a problem in itself, we can modify src/SConscript to hardcode the compilation flags to point to python3 instead of the current version in use by scons.

In src/SConscript, there are references to get_python_inc and get_python_lib, you will need to replace those code by hardcoded values that you will obtain from executing them in a python3 shell.

Please let me know if this helps, or the problems you encounter, I’ll gladly help. Having pyexiv2 work with py3k would be awesome!

Note that as far as I can tell the default version of Python in Ubuntu Oneiric is still 2.7.

The first line '<class 'str'>' is a print I've inserted in 'def _instantiate_image()'
Here the error appears with 'os.path.exist(filename)' but is the same with 'os.path.isfile(filename)' or 'os.path.exist(str(filename))' and 'os.path.isfile(str(filename))'

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())