Antoine Pitrou writes: > But those funny characters only appear for invalid > filenames. What makes you think the filenames are invalid? The file*names* are probably perfectly valid in the intended encoding; they are simply invalid in the encoding that Python wants to apply.