I'm not sure if this answers your question, but...
In python3 the __file__
holds the current running script and path as a str
. *nix systems use binary for filenames and have no preference for a particular encoding. When you use __file__
the system will attempt to take the binary string and encode it into a string using the default encoding system. I'm wondering if maybe your filenames are in cp1252 and python is trying to interpret it as utf8.
Python may follow the convention outlined here when encoding __file__
: http://docs.python.org/2/library/sys.html#sys.getfilesystemencoding
You didn't state what OS you're using, though...