Ticket #35 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

Still encoding problems when sending email

Reported by: jerome Owned by: jerome
Priority: major Milestone:
Component: pykota Version: development
Keywords: Cc:

Description

When sending email messages to the end user or administrator, sometimes a character encoding error remains as can be shown in the traceback below :

E [25/Nov/2008:18:30:16 +0100] [Job 317] PyKota v1.27alpha6_unofficial
E [25/Nov/2008:18:30:16 +0100] [Job 317] cupspykota backend failed
E [25/Nov/2008:18:30:16 +0100] [Job 317] Traceback (most recent call last):
E [25/Nov/2008:18:30:16 +0100] [Job 317] File "/usr/lib/cups/backend/cupspykota", line 1338, in <module>
E [25/Nov/2008:18:30:16 +0100] [Job 317] retcode = wrapper.mainWork()
E [25/Nov/2008:18:30:16 +0100] [Job 317] File "/usr/lib/cups/backend/cupspykota", line 1008, in mainWork
E [25/Nov/2008:18:30:16 +0100] [Job 317] return self.doWork()
E [25/Nov/2008:18:30:16 +0100] [Job 317] File "/usr/lib/cups/backend/cupspykota", line 1087, in doWork
E [25/Nov/2008:18:30:16 +0100] [Job 317] self.tellUser()
E [25/Nov/2008:18:30:16 +0100] [Job 317] File "/usr/lib/cups/backend/cupspykota", line 946, in tellUser
E [25/Nov/2008:18:30:16 +0100] [Job 317] msg = MIMEText(fullmessage, _charset=self.charset)
E [25/Nov/2008:18:30:16 +0100] [Job 317] File "/usr/lib/python2.5/email/mime/text.py", line 30, in __init__
E [25/Nov/2008:18:30:16 +0100] [Job 317] self.set_payload(_text, _charset)
E [25/Nov/2008:18:30:16 +0100] [Job 317] File "/usr/lib/python2.5/email/message.py", line 220, in set_payload
E [25/Nov/2008:18:30:16 +0100] [Job 317] self.set_charset(charset)
E [25/Nov/2008:18:30:16 +0100] [Job 317] File "/usr/lib/python2.5/email/message.py", line 262, in set_charset
E [25/Nov/2008:18:30:16 +0100] [Job 317] self._payload = charset.body_encode(self._payload)
E [25/Nov/2008:18:30:16 +0100] [Job 317] File "/usr/lib/python2.5/email/charset.py", line 384, in body_encode
E [25/Nov/2008:18:30:16 +0100] [Job 317] return email.base64mime.body_encode(s)
E [25/Nov/2008:18:30:16 +0100] [Job 317] File "/usr/lib/python2.5/email/base64mime.py", line 148, in encode
E [25/Nov/2008:18:30:16 +0100] [Job 317] enc = b2a_base64(s[i:i + max_unencoded])
E [25/Nov/2008:18:30:16 +0100] [Job 317] UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 43: ordinal not in range(128)

Unfortunately the context of this traceback was lost, since it was detected only 12 days after it happened (my fault, it happened on my own machine...)

Change History

Changed 14 years ago by jerome

  • status changed from new to closed
  • resolution set to fixed

(In [3464]) Added proper encoding to fix #35.

Note: See TracTickets for help on using tickets.