[Python-Dev] Tests failing on Windows with TESTFN (original) (raw)
eryk sun eryksun at gmail.com
Sun Jul 29 10:54:39 EDT 2018
- Previous message (by thread): [Python-Dev] Tests failing on Windows with TESTFN
- Next message (by thread): [Python-Dev] Tests failing on Windows with TESTFN
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message (by thread): [Python-Dev] Tests failing on Windows with TESTFN
- Next message (by thread): [Python-Dev] Tests failing on Windows with TESTFN
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]