def make_str(value):
if isinstance(value, bytes):<EOL><INDENT>try:<EOL><INDENT>return value.decode(get_filesystem_encoding())<EOL><DEDENT>except UnicodeError:<EOL><INDENT>return value.decode('<STR_LIT:utf-8>', '<STR_LIT:replace>')<EOL><DEDENT><DEDENT>return text_type(value)<EOL>
Converts a value into a valid string.