Skip to content

Commit fe52eb6

Browse files
authored
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().
1 parent 32c5a17 commit fe52eb6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/test/test_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5219,7 +5219,7 @@ def namer(self, name):
52195219

52205220
def rotator(self, source, dest):
52215221
if os.path.exists(source):
5222-
os.rename(source, dest + ".rotated")
5222+
os.replace(source, dest + ".rotated")
52235223

52245224
rh = HandlerWithNamerAndRotator(
52255225
self.fn, encoding="utf-8", backupCount=2, maxBytes=1)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix test_logging.test_namer_rotator_inheritance() on Windows: use
2+
:func:`os.replace` rather than :func:`os.rename`. Patch by Victor Stinner.

0 commit comments

Comments
 (0)