def encode_filename(filename):
    'Encode unicode filename\n    '
    if isinstance(filename, str):
        return filename.encode(sys.getfilesystemencoding())
    else:
        return filename
Encode unicode filename
def encode_filename(filename):
    '\n    '
    if isinstance(filename, str):
        return filename.encode(sys.getfilesystemencoding())
    else:
        return filename