-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-42378: fixed log truncation on logging shutdown #27310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-42378: fixed log truncation on logging shutdown #27310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks OK, but I would suggest the following changes:
_closed = True
is done inHandler.close()
, and so there is a reliance thatFileHandler.close()
will call the superclass'close()
. Of course it does, and there is a comment there about bpo-19523 and avoiding a handler leak, but I would add under that something like# See also bpo-42378: we also rely on # self._closed being set to True there
- As you've added
next_rec()
toBaseFileTest
, it can be removed fromRotatingFileHandlerTest
, which inherits fromBaseFileTest
. - And, of course, add the documentation update and NEWS entry, as you've mentioned on the issue,
Thanks!
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
@vsajip Thanks for the review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor changes suggested to the documentation part. Thanks!
Doc/library/logging.handlers.rst
Outdated
@@ -117,6 +117,9 @@ sends logging output to a disk file. It inherits the output functionality from | |||
|
|||
Outputs the record to the file. | |||
|
|||
Note that if the file was closed due to logging shutdown at exit and file | |||
mode is 'w', record will not be emitted (see :issue:`42378`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change "file mode" to "the file mode" and "record" to "the record".
@vsajip fixed the docs per comment.. |
@akulakov: Status check is done, and it's a success ✅ . |
thanks @vsajip ! |
Thanks @akulakov for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Automerge-Triggered-By: GH:vsajip (cherry picked from commit 96cf5a6) Co-authored-by: andrei kulakov <[email protected]>
GH-30468 is a backport of this pull request to the 3.10 branch. |
…GH-30468) Co-authored-by: andrei kulakov <[email protected]>
https://bugs.python.org/issue42378
Automerge-Triggered-By: GH:vsajip