validate_file does not support argument type unicode on my system.

encoding filename in ascii fixes this problem.