[Python-Dev] Tests failing on Windows with TESTFN (original) (raw)

eryk sun eryksun at gmail.com
Sun Jul 29 10:54:39 EDT 2018


On Sun, Jul 29, 2018 at 2:21 PM, Jeremy Kloth <jeremy.kloth at gmail.com> wrote:

try: os.rename(newfile.name, self.path) except FileExistsError: - os.remove(self.path) + tempname = createtemporaryname(self.path) + os.rename(self.path, tempname) os.rename(newfile.name, self.path) + os.remove(tempname)

This should call os.replace to allow the file system to replace the existing file.



More information about the Python-Dev mailing list