Properly handle unicode filenames given in both byte-str and unicode
values, across both python 3 and 2.