Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
28ff49c5
Commit
28ff49c5
authored
Sep 06, 2013
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Plain Diff
Closes #18941: Merged fix from 3.3.
parents
4c02491f
0f2eb140
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
Lib/logging/__init__.py
Lib/logging/__init__.py
+3
-2
Lib/logging/handlers.py
Lib/logging/handlers.py
+4
-2
No files found.
Lib/logging/__init__.py
View file @
28ff49c5
# Copyright 2001-201
2
by Vinay Sajip. All Rights Reserved.
# Copyright 2001-201
3
by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
...
...
@@ -18,7 +18,7 @@
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python.
Copyright (C) 2001-201
2
Vinay Sajip. All Rights Reserved.
Copyright (C) 2001-201
3
Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
...
...
@@ -971,6 +971,7 @@ class FileHandler(StreamHandler):
self
.
baseFilename
=
os
.
path
.
abspath
(
filename
)
self
.
mode
=
mode
self
.
encoding
=
encoding
self
.
delay
=
delay
if
delay
:
#We don't open the stream, but we still need to call the
#Handler constructor to set level, formatter, lock etc.
...
...
Lib/logging/handlers.py
View file @
28ff49c5
...
...
@@ -172,6 +172,7 @@ class RotatingFileHandler(BaseRotatingHandler):
if
os
.
path
.
exists
(
dfn
):
os
.
remove
(
dfn
)
self
.
rotate
(
self
.
baseFilename
,
dfn
)
if
not
self
.
delay
:
self
.
stream
=
self
.
_open
()
def
shouldRollover
(
self
,
record
):
...
...
@@ -394,6 +395,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
if
self
.
backupCount
>
0
:
for
s
in
self
.
getFilesToDelete
():
os
.
remove
(
s
)
if
not
self
.
delay
:
self
.
stream
=
self
.
_open
()
newRolloverAt
=
self
.
computeRollover
(
currentTime
)
while
newRolloverAt
<=
currentTime
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment