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

Fix test_logging.test_namer_rotator_inheritance() on Windows: use
os.replace() rather than os.rename().
This commit is contained in:
Victor Stinner 2021-04-28 15:47:10 +02:00 committed by GitHub
parent 32c5a17444
commit fe52eb6219
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -5219,7 +5219,7 @@ class RotatingFileHandlerTest(BaseFileTest):
def rotator(self, source, dest):
if os.path.exists(source):
os.rename(source, dest + ".rotated")
os.replace(source, dest + ".rotated")
rh = HandlerWithNamerAndRotator(
self.fn, encoding="utf-8", 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.