Python: Opening a file without creating a lock
问题 I'm trying to create a script in Python to back up some files. But, these files could be renamed or deleted at any time. I don't want my script to prevent that by locking the file; the file should be able to still be deleted at any time during the backup. How can I do this in Python? And, what happens? Do my objects just become null if the stream cannot be read? Thank you! I'm somewhat new to Python. 回答1: As mentioned by kindall, this is a Windows-specific issue. Unix OSes allow deleting. To