Hi!!
Could anyone explain why is this raising a UnicodeEncodeError??
You will see: the text that raises the error, its encoding and the full traceback (if I dosn't make a mistake)
Thanks!!!!
INFO in utils [/Users/garito/TimeFounder/App/0.2/TimeFounder/utils.py:35]:
Your email has been used to ask for an invitation on https://app.timefounder.com.
To register your account click in the link below.
http://localhost:5000/users/signUp?code=ebc601ee-d0a6-11e4-b825-0023dfa2a3b4
If you are not ask for an invitation, please ignore this email
INFO in utils [/Users/garito/TimeFounder/App/0.2/TimeFounder/utils.py:36]:
<type 'unicode'>
127.0.0.1 - - [22/Mar/2015 16:22:08] "GET /users/send_invitation?email=garito%2Bhome%40gmail.com HTTP/1.1" 500 -
Traceback (most recent call last):
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask/app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "/Users/garito/TimeFounder/App/0.2/TimeFounder/init.py", line 82, in call
return self.app(environ, start_response)
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask_principal.py", line 199, in _decorated
rv = f(_args, *_kw)
File "/Users/garito/TimeFounder/App/0.2/Users/init.py", line 166, in send_invitation
send_mail(title, data, recipients)
File "/Users/garito/TimeFounder/App/0.2/TimeFounder/utils.py", line 49, in send_mail
sended[recipientTuple] = msg.send(to=recipientTuple)
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/flask_emails/message.py", line 63, in send
return super(Message, self).send(smtp=smtp_options, **kw)
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/emails/message.py", line 352, in send
response = smtp.sendmail(**params)
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/emails/backend/smtp/backend.py", line 118, in sendmail
msg=to_bytes(msg.as_string(), 'utf-8'),
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/emails/message.py", line 423, in as_string
return self.dkim_sign_string(to_bytes(self.build_message(message_cls=message_cls).as_string()))
File "/Users/garito/TimeFounder/App/0.2/env/lib/python2.7/site-packages/emails/utils.py", line 152, in as_string
g.flatten(self, unixfrom=unixfrom)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/generator.py", line 83, in flatten
print >> self._fp, ufrom
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/generator.py", line 115, in _write
if meth is None:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/generator.py", line 164, in _write_headers
print >> self._fp, Header(
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 26: ordinal not in range(128)