私のテスト コードは、GAE バージョン 1.7.1 で失敗し始めました。修正を待つために 1.7.0 に戻しましたが、テスト コードは 1.7.2 でまだ失敗しています。失敗の原因となる最小限のテストを次に示します。
mail.send_mail("sender@example.com", "receiver@example.com",
u"sübject".encode("utf-8"), "body")
mail_list = self.mail_stub.get_sent_messages()
そして、次のエラーが表示されます。
Traceback (most recent call last):
File "/Users/.../tests/unit_tests.py", line 19, in testTest
mail_list = self.mail_stub.get_sent_messages()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub.py", line 184, in WrappedMethod
return method(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail_stub.py", line 183, in get_sent_messages
email_message = mail.EmailMessage(mime_message=mime_message)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail.py", line 742, in __init__
self.update_from_mime_message(mime_message)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail.py", line 1213, in update_from_mime_message
super(EmailMessage, self).update_from_mime_message(mime_message)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail.py", line 1093, in update_from_mime_message
subject = _decode_and_join_header(mime_message['subject'], separator=u'')
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail.py", line 558, in _decode_and_join_header
for s, c in email.header.decode_header(header))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail.py", line 558, in <genexpr>
for s, c in email.header.decode_header(header))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
何か間違っているのか、それとも GAE のバグなのか教えていただけますか?