bpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684) (GH-25688)

Fix test_logging.test_namer_rotator_inheritance() on Windows: use
os.replace() rather than os.rename().
(cherry picked from commit fe52eb6219)

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2021-04-28 08:28:15 -07:00 committed by GitHub
parent 2dc6b1789e
commit 629ef0fb9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -5102,7 +5102,7 @@ def namer(self, name):
def rotator(self, source, dest):
if os.path.exists(source):
os.rename(source, dest + ".rotated")
os.replace(source, dest + ".rotated")
rh = HandlerWithNamerAndRotator(
self.fn, backupCount=2, maxBytes=1)

View File

@ -0,0 +1,2 @@
Fix test_logging.test_namer_rotator_inheritance() on Windows: use
:func:`os.replace` rather than :func:`os.rename`. Patch by Victor Stinner.