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
6d5cde6a
Commit
6d5cde6a
authored
Mar 20, 2014
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Plain Diff
Closes #20558: Improved implementation of error handling.
parents
9f9f0e23
71dcb28d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
Lib/logging/config.py
Lib/logging/config.py
+11
-12
No files found.
Lib/logging/config.py
View file @
6d5cde6a
# Copyright 2001-201
3
by Vinay Sajip. All Rights Reserved.
# Copyright 2001-201
4
by Vinay Sajip. All Rights Reserved.
#
#
# Permission to use, copy, modify, and distribute this software and its
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# documentation for any purpose and without fee is hereby granted,
...
@@ -19,13 +19,19 @@ Configuration functions for the logging package for Python. The core package
...
@@ -19,13 +19,19 @@ Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.
by Apache's log4j system.
Copyright (C) 2001-201
3
Vinay Sajip. All Rights Reserved.
Copyright (C) 2001-201
4
Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
To use, simply 'import logging' and log away!
"""
"""
import
sys
,
logging
,
logging
.
handlers
,
struct
,
traceback
,
re
import
errno
import
io
import
io
import
logging
import
logging.handlers
import
re
import
struct
import
sys
import
traceback
try
:
try
:
import
_thread
as
thread
import
_thread
as
thread
...
@@ -38,10 +44,7 @@ from socketserver import ThreadingTCPServer, StreamRequestHandler
...
@@ -38,10 +44,7 @@ from socketserver import ThreadingTCPServer, StreamRequestHandler
DEFAULT_LOGGING_CONFIG_PORT
=
9030
DEFAULT_LOGGING_CONFIG_PORT
=
9030
if
sys
.
platform
==
"win32"
:
RESET_ERROR
=
errno
.
ECONNRESET
RESET_ERROR
=
10054
#WSAECONNRESET
else
:
RESET_ERROR
=
104
#ECONNRESET
#
#
# The following code implements a socket listener for on-the-fly
# The following code implements a socket listener for on-the-fly
...
@@ -867,12 +870,8 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None):
...
@@ -867,12 +870,8 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None):
if self.server.ready:
if self.server.ready:
self.server.ready.set()
self.server.ready.set()
except OSError as e:
except OSError as e:
if
not isinstance(e.args, tuple)
:
if
e.errno != RESET_ERROR
:
raise
raise
else:
errcode = e.args[0]
if errcode != RESET_ERROR:
raise
class ConfigSocketReceiver(ThreadingTCPServer):
class ConfigSocketReceiver(ThreadingTCPServer):
"""
"""
...
...
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