Bug 239182 - koji traceback on mail with non-ASCII
Summary: koji traceback on mail with non-ASCII
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: koji
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-05-05 18:27 UTC by Ville Skyttä
Modified: 2013-01-10 01:37 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-22 22:02:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ville Skyttä 2007-05-05 18:27:04 UTC
My perltidy build succeeded (I think), but the state is "failed" and there's a
backtrace in the "Result" section, which I guess is triggered by the "ä" in my
surname:

http://koji.fedoraproject.org/koji/taskinfo?taskID=3265

Result  	

Traceback (most recent call last):
  File "/usr/sbin/kojid", line 1109, in runTask
    response = (handler.run(),)
  File "/usr/sbin/kojid", line 1185, in run
    return self.handler(*self.params,**self.opts)
  File "/usr/sbin/kojid", line 2128, in handler
    server.sendmail(from_addr, recipients, message)
  File "/usr/lib64/python2.4/smtplib.py", line 696, in sendmail
    (code,resp) = self.data(msg)
  File "/usr/lib64/python2.4/smtplib.py", line 493, in data
    self.send(q)
  File "/usr/lib64/python2.4/smtplib.py", line 320, in send
    self.sock.sendall(str)
  File "<string>", line 1, in sendall
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position
588: ordinal not in range(128)

Comment 1 Jesse Keating 2007-05-05 20:30:12 UTC
Mike B, thoughts?

Comment 2 Frank Büttner 2007-05-06 07:05:25 UTC
Same for me.

Comment 3 David Woodhouse 2007-05-06 09:28:24 UTC
We should surely be assuming utf-8 everywhere -- in Content-Type: of all
text/plain parts, and by RFC2047-encoding the headers.

Comment 4 Mike Bonnet 2007-05-07 17:07:47 UTC
All the data in the database is stored as UTF-8, but comes back from the
database as Python Unicode objects if it contains any non-ASCII characters, and
smtplib apparently doesn't know how to handle Unicode.  I just checked in a
change to convert the Unicode to UTF-8-encoded str objects, which should resolve
the problem.  There will be an update to Koji soon to deploy this fix in production.

There should be no non-ASCII characters in the email headers, so RFC2047
shouldn't be an issue.


Comment 5 Mike McLean 2007-05-07 17:23:16 UTC
I wonder if we should be using the email module...

Comment 6 Jesse Keating 2007-05-22 22:02:25 UTC
I think this should be fixed now.


Note You need to log in before you can comment on or make changes to this bug.