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
dcb30cf9
Commit
dcb30cf9
authored
Feb 23, 2012
by
Brett Cannon
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
f500778f
0a786221
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
32 deletions
+62
-32
.hgtags
.hgtags
+1
-0
Doc/library/subprocess.rst
Doc/library/subprocess.rst
+1
-1
Doc/library/sys.rst
Doc/library/sys.rst
+3
-2
Doc/library/time.rst
Doc/library/time.rst
+3
-2
Lib/logging/__init__.py
Lib/logging/__init__.py
+18
-10
Lib/logging/handlers.py
Lib/logging/handlers.py
+36
-17
No files found.
.hgtags
View file @
dcb30cf9
...
...
@@ -77,6 +77,7 @@ d18e9d71f369d8211f6ac87252c6d3211f9bd09f v3.1.3rc1
a4f75773c0060cee38b0bb651a7aba6f56b0e996 v3.1.3
32fcb9e94985cb19ce37ba9543f091c0dbe9d7dd v3.1.4rc1
c918ec9f3a76d6afedfbb5d455004de880443a3d v3.1.4
ee26aca3219cf4bb0b93352e83edcc9cb28c7802 v3.1.5rc1
b37b7834757492d009b99cf0ca4d42d2153d7fac v3.2a1
56d4373cecb73c8b45126ba7b045b3c7b3f94b0b v3.2a2
da012d9a2c23d144e399d2e01a55b8a83ad94573 v3.2a3
...
...
Doc/library/subprocess.rst
View file @
dcb30cf9
...
...
@@ -240,7 +240,7 @@ default values. The arguments that are most commonly needed are:
When *stdout* or *stderr* are pipes and *universal_newlines* is
:const:`True` then the output data is assumed to be encoded as UTF-8 and
will automatically be decoded to text. All line endings will be converted
to ``'\n'`` as described for the universal newlines `'U'`` mode argument
to ``'\n'`` as described for the universal newlines `
`
'U'`` mode argument
to :func:`open`.
If *shell* is :const:`True`, the specified command will be executed through
...
...
Doc/library/sys.rst
View file @
dcb30cf9
...
...
@@ -195,7 +195,7 @@ always available.
be set at build time with the ``--exec-prefix`` argument to the
:program:`configure` script. Specifically, all configuration files (e.g. the
:file:`pyconfig.h` header file) are installed in the directory
:file:`{exec_prefix}/lib/python{X.Y}/config
'
, and shared library modules are
:file:`{exec_prefix}/lib/python{X.Y}/config
`
, and shared library modules are
installed in :file:`{exec_prefix}/lib/python{X.Y}/lib-dynload`, where *X.Y*
is the version number of Python, for example ``3.2``.
...
...
@@ -756,6 +756,7 @@ always available.
always use the ``startswith`` idiom presented above.
.. seealso::
:attr:`os.name` has a coarser granularity. :func:`os.uname` gives
system-dependent version information.
...
...
@@ -771,7 +772,7 @@ always available.
argument to the :program:`configure` script. The main collection of Python
library modules is installed in the directory :file:`{prefix}/lib/python{X.Y}``
while the platform independent header files (all except :file:`pyconfig.h`) are
stored in :file:`{prefix}/include/python{X.Y}`
`
, where *X.Y* is the version
stored in :file:`{prefix}/include/python{X.Y}`, where *X.Y* is the version
number of Python, for example ``3.2``.
...
...
Doc/library/time.rst
View file @
dcb30cf9
...
...
@@ -228,8 +228,9 @@ The module defines the following functions and data items:
.. function:: monotonic()
Monotonic clock. The reference point of the returned value is undefined so
only the difference of consecutive calls is valid.
Monotonic non-decreasing clock. The clock is not related to the system clock
and cannot go backward. The reference point of the returned
value is undefined so only the difference of consecutive calls is valid.
.. versionadded:: 3.3
...
...
Lib/logging/__init__.py
View file @
dcb30cf9
...
...
@@ -16,9 +16,9 @@
"""
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python
, and influenced by Apache's log4j system
.
comp.lang.python.
Copyright (C) 2001-201
1
Vinay Sajip. All Rights Reserved.
Copyright (C) 2001-201
2
Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
...
...
@@ -914,8 +914,12 @@ class StreamHandler(Handler):
"""
Flushes the stream.
"""
if
self
.
stream
and
hasattr
(
self
.
stream
,
"flush"
):
self
.
stream
.
flush
()
self
.
acquire
()
try
:
if
self
.
stream
and
hasattr
(
self
.
stream
,
"flush"
):
self
.
stream
.
flush
()
finally
:
self
.
release
()
def
emit
(
self
,
record
):
"""
...
...
@@ -964,12 +968,16 @@ class FileHandler(StreamHandler):
"""
Closes the stream.
"""
if
self
.
stream
:
self
.
flush
()
if
hasattr
(
self
.
stream
,
"close"
):
self
.
stream
.
close
()
StreamHandler
.
close
(
self
)
self
.
stream
=
None
self
.
acquire
()
try
:
if
self
.
stream
:
self
.
flush
()
if
hasattr
(
self
.
stream
,
"close"
):
self
.
stream
.
close
()
StreamHandler
.
close
(
self
)
self
.
stream
=
None
finally
:
self
.
release
()
def
_open
(
self
):
"""
...
...
Lib/logging/handlers.py
View file @
dcb30cf9
# Copyright 2001-201
0
by Vinay Sajip. All Rights Reserved.
# Copyright 2001-201
2
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,
...
...
@@ -16,10 +16,9 @@
"""
Additional handlers for the logging package for Python. The core package is
based on PEP 282 and comments thereto in comp.lang.python, and influenced by
Apache's log4j system.
based on PEP 282 and comments thereto in comp.lang.python.
Copyright (C) 2001-201
0
Vinay Sajip. All Rights Reserved.
Copyright (C) 2001-201
2
Vinay Sajip. All Rights Reserved.
To use, simply 'import logging.handlers' and log away!
"""
...
...
@@ -594,10 +593,14 @@ class SocketHandler(logging.Handler):
"""
Closes the socket.
"""
if
self
.
sock
:
self
.
sock
.
close
()
self
.
sock
=
None
logging
.
Handler
.
close
(
self
)
self
.
acquire
()
try
:
if
self
.
sock
:
self
.
sock
.
close
()
self
.
sock
=
None
logging
.
Handler
.
close
(
self
)
finally
:
self
.
release
()
class
DatagramHandler
(
SocketHandler
):
"""
...
...
@@ -792,8 +795,12 @@ class SysLogHandler(logging.Handler):
"""
Closes the socket.
"""
self
.
socket
.
close
()
logging
.
Handler
.
close
(
self
)
self
.
acquire
()
try
:
self
.
socket
.
close
()
logging
.
Handler
.
close
(
self
)
finally
:
self
.
release
()
def
mapPriority
(
self
,
levelName
):
"""
...
...
@@ -1137,7 +1144,11 @@ class BufferingHandler(logging.Handler):
This version just zaps the buffer to empty.
"""
self
.
buffer
=
[]
self
.
acquire
()
try
:
self
.
buffer
=
[]
finally
:
self
.
release
()
def
close
(
self
):
"""
...
...
@@ -1187,18 +1198,26 @@ class MemoryHandler(BufferingHandler):
The record buffer is also cleared by this operation.
"""
if
self
.
target
:
for
record
in
self
.
buffer
:
self
.
target
.
handle
(
record
)
self
.
buffer
=
[]
self
.
acquire
()
try
:
if
self
.
target
:
for
record
in
self
.
buffer
:
self
.
target
.
handle
(
record
)
self
.
buffer
=
[]
finally
:
self
.
release
()
def
close
(
self
):
"""
Flush, set the target to None and lose the buffer.
"""
self
.
flush
()
self
.
target
=
None
BufferingHandler
.
close
(
self
)
self
.
acquire
()
try
:
self
.
target
=
None
BufferingHandler
.
close
(
self
)
finally
:
self
.
release
()
class
QueueHandler
(
logging
.
Handler
):
...
...
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