This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mori-b
Recipients docs@python, mori-b
Date 2021-06-11.19:50:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org>
In-reply-to
Content
In https://docs.python.org/3/howto/logging-cookbook.html#using-a-rotator-and-namer-to-customize-log-rotation-processing, the log rotator example deletes the original log file after compressing it. However, running on Linux the command "lsof +S1" shows that the deleted original log file might still hold the same disk space, and keep growing.
Replacing the command "os.remove(source)" with "os.truncate(source,0)" seems to solve the issue by freeing the original log file disk space at each rotation.
History
Date User Action Args
2021-06-11 19:50:16mori-bsetrecipients: + mori-b, docs@python
2021-06-11 19:50:16mori-bsetmessageid: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org>
2021-06-11 19:50:16mori-blinkissue44399 messages
2021-06-11 19:50:16mori-bcreate