Requester icon indicating copy to clipboard operation
Requester copied to clipboard

fix rename backup history file #30

Open mercurykd opened this issue 4 years ago • 3 comments

mercurykd avatar Feb 23 '21 14:02 mercurykd

Coverage Status

Coverage increased (+0.2%) to 70.608% when pulling 6c2ec64660def187d35c31efee386159a233458f on mercurykd:issue-30 into 93fd2673cf69a97b0e0d49a2411abe6148326f41 on kylebebak:master.

coveralls avatar Feb 23 '21 14:02 coveralls

What issue does this fix?

I can create files a.txt and b.txt in the same directory, and calling os.rename("a.txt", "b.txt") overwrites the content of b.txt with that of a.txt.

In other words, this code works as expected. Your PR tries to remove the backup file before renaming the main file to the backup file. I don't see what that could achieve.

kylebebak avatar Apr 13 '21 13:04 kylebebak

What issue does this fix?

I can create files a.txt and b.txt in the same directory, and calling os.rename("a.txt", "b.txt") overwrites the content of b.txt with that of a.txt.

Then why does the error occur? FileExistsError: [WinError 183] The file cannot be created because it already exists: 'C:\Users\User\AppData\Roaming\Sublime Text 3\Packages\User\Requester.history.json.bkp'

mercurykd avatar Apr 13 '21 13:04 mercurykd