This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ECONNRESET value in logging.config is valid with Linux [distros]; not valid with *BSD
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: ngie, python-dev, r.david.murray, vinay.sajip
Priority: normal Keywords:

Created on 2014-02-08 00:55 by ngie, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch ngie, 2014-02-10 23:23 Patch to standardize RESET_ERROR on errno.ECONNRESET
Messages (9)
msg210580 - (view) Author: Enji Cooper (ngie) * Date: 2014-02-08 00:55
The logging module checks for ECONNRESET if it's equal to 104. This is valid on Linux, but not [some] other OSes. On FreeBSD and OpenBSD [*] it's 54, not 104.

The attached patch fixes the logging code to check for errno.ECONNRESET in !win32 environments.

http://www.openbsd.org/cgi-bin/man.cgi?query=errno&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=htmlvim
msg210584 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-02-08 02:42
On windows, errno.ECONNRESET is set equal to errno.WSAECONNRESET.
msg210585 - (view) Author: Enji Cooper (ngie) * Date: 2014-02-08 02:56
Good to know!

I updated the patch to remove the errno abstraction, grab the errno attribute from the OSError, and sort the imports.
msg210610 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2014-02-08 10:18
There's a small possibility that someone could be relying on logging.config.RESET_ERROR being present, so I think it makes more sense to:

1. Leave RESET_ERROR as a module attribute, but set it unconditionally to
   errno.ECONNRESET.

2. Use e.errno rather than e.args[0], and compare it against RESET_ERROR
   since that's available, in the exception suite.
msg210890 - (view) Author: Enji Cooper (ngie) * Date: 2014-02-10 23:23
Updated patch to incorporate Vinay's comments. Thanks :)!
msg210922 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-02-11 11:33
New changeset 41e49f1c5bd8 by Vinay Sajip in branch '2.7':
Issue #20558: Improved implementation of error handling.
http://hg.python.org/cpython/rev/41e49f1c5bd8
msg210923 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2014-02-11 11:35
3.3, 3.4 and default branches will be updated in due course.
msg214220 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-03-20 13:05
New changeset 46fe23e000a1 by Vinay Sajip in branch '3.4':
Issue #20558: Improved implementation of error handling.
http://hg.python.org/cpython/rev/46fe23e000a1
msg214221 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-03-20 13:06
New changeset 9c27c9844be2 by Vinay Sajip in branch 'default':
Closes #20558: Improved implementation of error handling.
http://hg.python.org/cpython/rev/9c27c9844be2
History
Date User Action Args
2022-04-11 14:57:58adminsetgithub: 64757
2014-03-20 13:06:18python-devsetstatus: open -> closed
resolution: fixed
messages: + msg214221

stage: resolved
2014-03-20 13:05:38python-devsetmessages: + msg214220
2014-02-22 22:46:52vinay.sajipsetassignee: vinay.sajip
2014-02-11 11:35:05vinay.sajipsetmessages: + msg210923
versions: - Python 2.7
2014-02-11 11:33:22python-devsetnosy: + python-dev
messages: + msg210922
2014-02-10 23:23:44ngiesetfiles: - patch
2014-02-10 23:23:29ngiesetfiles: + patch

messages: + msg210890
2014-02-08 10:18:43vinay.sajipsetmessages: + msg210610
2014-02-08 02:57:26ngiesetfiles: - patch
2014-02-08 02:56:54ngiesetfiles: + patch

messages: + msg210585
2014-02-08 02:42:33r.david.murraysetnosy: + r.david.murray
messages: + msg210584
2014-02-08 01:00:37ned.deilysetnosy: + vinay.sajip
2014-02-08 00:56:14ngiesettype: behavior
components: + Library (Lib)
versions: + Python 2.7, Python 3.5
2014-02-08 00:55:43ngiecreate