def filesys_decode(path):
fs_enc = sys.getfilesystemencoding()<EOL>if isinstance(path, decoded_string):<EOL><INDENT>return path<EOL><DEDENT>for enc in (fs_enc, "<STR_LIT:utf-8>"):<EOL><INDENT>try:<EOL><INDENT>return path.decode(enc)<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>
Ensure that the given path is decoded,
NONE when no expected encoding works