Re: [Python-Dev] Tests failing on Windows with TESTFN

2018年7月29日 07:58:01 -0700

On Sun, Jul 29, 2018 at 2:21 PM, Jeremy Kloth <[email protected]> wrote:
>
> try:
> os.rename(new_file.name, self._path)
> except FileExistsError:
> - os.remove(self._path)
> + temp_name = _create_temporary_name(self._path)
> + os.rename(self._path, temp_name)
> os.rename(new_file.name, self._path)
> + os.remove(temp_name)
This should call os.replace to allow the file system to replace the
existing file.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to