[issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error

2021-04-28 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error

2021-04-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 629ef0fb9cad6ac340d3be884af7b47fb393ae99 by Miss Islington (bot) 
in branch '3.9':
bpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684) 
(GH-25688)
https://github.com/python/cpython/commit/629ef0fb9cad6ac340d3be884af7b47fb393ae99


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error

2021-04-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fe52eb62191e640e720d184a9a1a04e965b8a062 by Victor Stinner in 
branch 'master':
bpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684)
https://github.com/python/cpython/commit/fe52eb62191e640e720d184a9a1a04e965b8a062


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error

2021-04-28 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +24378
pull_request: https://github.com/python/cpython/pull/25688

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error

2021-04-28 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 25684 to fix this issue.

> What does os.rename do on Linux? Does it just overwrite existing files by 
> default?

os.rename() calls rename():
https://man7.org/linux/man-pages/man2/rename.2.html

   rename() renames a file, moving it between directories if
   required.  Any other hard links to the file (as created using
   link(2)) are unaffected.  Open file descriptors for oldpath are
   also unaffected.

   If newpath already exists, it will be atomically replaced, so
   that there is no point at which another process attempting to
   access newpath will find it missing.  However, there will
   probably be a window in which both oldpath and newpath refer to
   the file being renamed.

On Windows, os.rename() is implemented with MoveFileExW(src, dst, 0).

Maybe the test should use os.replace() instead of os.rename()? On Windows, 
os.replace() is implemented with with MoveFileExW(src, dst, 
MOVEFILE_REPLACE_EXISTING).

HandlerWithNamerAndRotator.rotator() of test_logging calls os.rename() when the 
file already exists:

if os.path.exists(source):
os.rename(source, dest + ".rotated")

And the test fails with "Cannot create a file when that file already exists"... 
well yes, we just tested that it exists.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error

2021-04-28 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +24374
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25684

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error

2021-04-27 Thread Steve Dower


Steve Dower  added the comment:

What does os.rename do on Linux? Does it just overwrite existing files by 
default?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error

2021-04-27 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
title: test_logging.test_namer_rotator_inheritance() logs a logging error -> 
[Windows] test_logging.test_namer_rotator_inheritance() logs a logging error

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com