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: Error sending utf8 strings over syslog udp protocol
Type: Stage:
Components: Unicode Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: skliarie, vinay.sajip
Priority: normal Keywords:

Created on 2010-05-23 11:28 by skliarie, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
logger_udp_utf8.py skliarie, 2010-05-23 11:28 python script to simulate logs sending
Messages (4)
msg106330 - (view) Author: Arie Skliarouk (skliarie) Date: 2010-05-23 11:28
I am trying to send utf8 strings over syslog/udp and get strange error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/logging/handlers.py", line 788, in emit
    self.socket.sendto(msg, self.address)
TypeError: sendto() takes exactly 3 arguments (2 given)

See the attached program, at the beginning it has two parameters - log to file or udp and use utf8 or not. It works in all cases but the udp+utf8.
msg106348 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-05-24 09:43
The message is a misleading one which seems to happen because a Unicode object is passed to the socket.

This was fixed in trunk in r75586 (21 October 2009). I've now backported it to release26-maint (r81494).
msg106352 - (view) Author: Arie Skliarouk (skliarie) Date: 2010-05-24 11:26
How come the fix from October 21 have not got into Python 2.6.5 that is packaged into ubuntu 10.04?

I overwrote the handlers.py from existing python 2.6.5 installation with the patched version and verified that utf8-encoded logs pass properly now.

Thank you!
msg106361 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-05-24 13:02
----- Original Message ----

> From: Arie Skliarouk <report@bugs.python.org>
> How come the fix from October 21 have not got into Python 2.6.5 
> that is packaged into ubuntu 10.04?

Not all bug-fixes are automatically backported from trunk to release26-maint branch, which is where 2.6.x releases come from. If someone reports a problem, then I would certainly look to see if a backport is feasible, and this time it was :-)
History
Date User Action Args
2022-04-11 14:57:01adminsetgithub: 53041
2010-05-24 13:02:00vinay.sajipsetmessages: + msg106361
2010-05-24 11:26:36skliariesetmessages: + msg106352
2010-05-24 09:43:57vinay.sajipsetstatus: open -> closed
resolution: fixed
messages: + msg106348
2010-05-23 11:44:53pitrousetassignee: vinay.sajip

nosy: + vinay.sajip
2010-05-23 11:28:42skliariecreate