Allow testing from a unicode path

As reported in #2564, this fixes the non-Cython part of the problem.