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: SyslogHandler: should not raise exception in constructor if connection fails
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Mariatta, socketpair, vinay.sajip
Priority: normal Keywords:

Created on 2017-03-14 09:36 by socketpair, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 663 merged python-dev, 2017-03-14 10:12
PR 695 merged vinay.sajip, 2017-03-17 16:31
PR 696 merged vinay.sajip, 2017-03-17 16:34
Messages (13)
msg289573 - (view) Author: Марк Коренберг (socketpair) * Date: 2017-03-14 09:36
Syslog handler already able to ignore temporary errors while seding logs. So he knows that syslog server may be not reachable at the moment. But when we say about constructor, it fails with error. I have fixed that -- now it will ignore such errors, and try to re-connect on every logging as it was before. C's version does the same.
msg289609 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2017-03-14 17:09
Can you provide a short script which demonstrates exactly the problem you're trying to solve?
msg289611 - (view) Author: Марк Коренберг (socketpair) * Date: 2017-03-14 17:20
Nothing special. Just try to create SysLogHandler when syslog server is down. Exception will be raised.
msg289627 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2017-03-14 23:02
> Nothing special. Just try to create SysLogHandler when syslog server is down.

Which specific syslog configuration? UDP listener, Unix socket listener, or both?
msg289635 - (view) Author: Марк Коренберг (socketpair) * Date: 2017-03-15 03:35
Syslog, listening on local machine via UNIX socket.
msg289762 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-03-17 15:36
Does this need backport into 3.5 and 3.6?
msg289765 - (view) Author: Марк Коренберг (socketpair) * Date: 2017-03-17 15:45
Yes, I want this simple patch to be back-ported. We use Python 3.5 in our projects.
msg289768 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2017-03-17 16:21
Sorry, I was a bit too hasty closing the issue.
msg290168 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2017-03-24 22:12
New changeset e59af55c28b657cdf57c71a7b0837c9e9f4b2a31 by Vinay Sajip in branch '3.5':
bpo-29808: Do not fail in SysLogHandler constructor if syslog isn't available. (#695)
https://github.com/python/cpython/commit/e59af55c28b657cdf57c71a7b0837c9e9f4b2a31
msg290169 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2017-03-24 22:12
New changeset 46e81d3345b979f835740a228857906dca0f59c0 by Vinay Sajip in branch '3.6':
bpo-29808: Do not fail in SysLogHandler constructor if syslog isn't available. (#696)
https://github.com/python/cpython/commit/46e81d3345b979f835740a228857906dca0f59c0
msg290171 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2017-03-24 22:13
New changeset 1b038e073807ecb6fd176edaf3386a8e3205416e by Vinay Sajip (Коренберг Марк) in branch 'master':
bpo-29808: SysLogHandler: Do not fail if initial connect to syslog failed (#663) (#663)
https://github.com/python/cpython/commit/1b038e073807ecb6fd176edaf3386a8e3205416e
msg293391 - (view) Author: Марк Коренберг (socketpair) * Date: 2017-05-10 08:56
@vinay.sajip

I don't see this change in Python 3.5.3:

https://github.com/python/cpython/blob/v3.5.3/Lib/logging/handlers.py#L806

How can this be true?
msg293401 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2017-05-10 11:12
> How can this be true?

Perhaps it didn't make the cut for that specific release? Seems to be in the 3.5 branch OK.
History
Date User Action Args
2022-04-11 14:58:44adminsetgithub: 73994
2017-05-10 11:12:11vinay.sajipsetmessages: + msg293401
2017-05-10 08:56:28socketpairsetmessages: + msg293391
2017-03-24 22:13:40vinay.sajipsetmessages: + msg290171
2017-03-24 22:12:34vinay.sajipsetmessages: + msg290169
2017-03-24 22:12:26vinay.sajipsetmessages: + msg290168
2017-03-17 16:34:33vinay.sajipsetpull_requests: + pull_request570
2017-03-17 16:31:43vinay.sajipsetpull_requests: + pull_request569
2017-03-17 16:21:49vinay.sajipsetmessages: + msg289768
2017-03-17 15:45:43socketpairsetmessages: + msg289765
2017-03-17 15:36:52Mariattasetnosy: + Mariatta
messages: + msg289762
2017-03-17 15:27:08vinay.sajipsetstatus: open -> closed
resolution: fixed
stage: resolved
2017-03-15 03:35:45socketpairsetmessages: + msg289635
2017-03-14 23:02:18vinay.sajipsetmessages: + msg289627
2017-03-14 17:20:40socketpairsetmessages: + msg289611
2017-03-14 17:09:13vinay.sajipsetnosy: + vinay.sajip
messages: + msg289609
2017-03-14 10:12:25python-devsetpull_requests: + pull_request548
2017-03-14 09:36:41socketpaircreate