summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2010-08-22 18:11:02 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2010-08-22 18:11:02 (GMT)
commit89994b279f8dfe8512293c6b6432129b94871a40 (patch)
treeadef504c1f5ecfc67f3c309a1e1306e96aacb457 /Lib
parent7224d073d24851c02fa53b0f126f696e57f583ee (diff)
downloadcpython-89994b279f8dfe8512293c6b6432129b94871a40.zip
cpython-89994b279f8dfe8512293c6b6432129b94871a40.tar.gz
cpython-89994b279f8dfe8512293c6b6432129b94871a40.tar.bz2
Issue #9512: Made comment more informative.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/logging/handlers.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index 5f838e5..906df16 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -103,8 +103,13 @@ class RotatingFileHandler(BaseRotatingHandler):
If maxBytes is zero, rollover never occurs.
"""
+ # If rotation/rollover is wanted, it doesn't make sense to use another
+ # mode. If for example 'w' were specified, then if there were multiple
+ # runs of the calling application, the logs from previous runs would be
+ # lost if the 'w' is respected, because the log file would be truncated
+ # on each run.
if maxBytes > 0:
- mode = 'a' # doesn't make sense otherwise!
+ mode = 'a'
BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
self.maxBytes = maxBytes
self.backupCount = backupCount