New submission from mori-b <moribi...@gmail.com>:
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. ---------- assignee: docs@python components: Documentation messages: 395658 nosy: docs@python, mori-b priority: normal severity: normal status: open title: log rotator cookbook example might waste disk space type: resource usage _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44399> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com