Bug 239182 - koji traceback on mail with non-ASCII
koji traceback on mail with non-ASCII
Product: Fedora
Classification: Fedora
Component: koji (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-05-05 14:27 EDT by Ville Skyttä
Modified: 2013-01-09 20:37 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-22 18:02:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ville Skyttä 2007-05-05 14:27:04 EDT
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



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
  File "/usr/lib64/python2.4/smtplib.py", line 320, in send
  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 16:30:12 EDT
Mike B, thoughts?
Comment 2 Frank Büttner 2007-05-06 03:05:25 EDT
Same for me.
Comment 3 David Woodhouse 2007-05-06 05:28:24 EDT
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 13:07:47 EDT
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 13:23:16 EDT
I wonder if we should be using the email module...
Comment 6 Jesse Keating 2007-05-22 18:02:25 EDT
I think this should be fixed now.

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