mirror of
https://github.com/python/cpython.git
synced 2025-09-28 03:13:48 +00:00
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:
parent
2dc6b1789e
commit
629ef0fb9c
2 changed files with 3 additions and 1 deletions
|
@ -5102,7 +5102,7 @@ class RotatingFileHandlerTest(BaseFileTest):
|
||||||
|
|
||||||
def rotator(self, source, dest):
|
def rotator(self, source, dest):
|
||||||
if os.path.exists(source):
|
if os.path.exists(source):
|
||||||
os.rename(source, dest + ".rotated")
|
os.replace(source, dest + ".rotated")
|
||||||
|
|
||||||
rh = HandlerWithNamerAndRotator(
|
rh = HandlerWithNamerAndRotator(
|
||||||
self.fn, backupCount=2, maxBytes=1)
|
self.fn, backupCount=2, maxBytes=1)
|
||||||
|
|
|
@ -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.
|
Loading…
Add table
Add a link
Reference in a new issue