Special characters in OSX filename ? (Python os.rename)
问题 I am trying to rename some files automatically on OSX with a python script. But I fail to work with special characters like forward slash etc.: oldname = "/test" newname = "/test(1\/10)" os.rename(oldname, newname) I think I do have an encoding problem. But different tries with re.escape or using UTF-8 unicode encodings havent been successful for me. Would you have a hint? Thanks! Marco 回答1: What most of the file systems have in common is that they do not allow directory separators (slashes)