mozilla / f1

INACTIVE - http://mzl.la/ghe-archive - F1 is a browser extension that allows you to share links in a fast and fun way. Share links from within the browser, from any webpage, using the same services you already know and love. F1 is made by Mozilla.
http://f1.mozillamessaging.com/
Other
51 stars 10 forks source link

unicode error sending to google #61

Closed mhammond closed 13 years ago

mhammond commented 13 years ago

From the production logs and reproduced here. Share to an email address with a non-ascii character in the address portion. Log output shown below. FWIW, it is also possible to reproduce by creating a contact in the gmail UI with a non-ascii char in the email address portion (yes, gmail lets you do that), then select the name from the autocomplete list.

Strangely, F1 then thinks I am logged out - it fails to display/acknowledge this error at all

14:51:21,841 ERROR [linkdrop.controllers.send] [worker 5] error providing item to google.com: 'ascii' codec can't encode character u'\xa9' in position 15: ordinal not in range(128)
Traceback (most recent call last):
  File "O:\src\mm\f1\work\linkdrop\controllers\send.py", line 175, in send
    result, error = provider.api(acct).sendmessage(message, args)
  File "O:\src\mm\f1\work\linkdrop\lib\oauth\google_.py", line 333, in sendmessage
    server.sendmail(from_, to_, msg.as_string())
  File "o:\src\python-2.6-svn\Lib\smtplib.py", line 703, in sendmail
    (code,resp)=self.rcpt(each, rcpt_options)
  File "o:\src\python-2.6-svn\Lib\smtplib.py", line 457, in rcpt
    self.putcmd("rcpt","TO:%s%s" % (quoteaddr(recip),optionlist))
  File "o:\src\python-2.6-svn\Lib\smtplib.py", line 318, in putcmd
    self.send(str)
  File "o:\src\python-2.6-svn\Lib\smtplib.py", line 305, in send
    self.sock.sendall(str)
  File "o:\src\python-2.6-svn\Lib\ssl.py", line 203, in sendall
    v = self.send(data[count:])
  File "o:\src\python-2.6-svn\Lib\ssl.py", line 174, in send
    v = self._sslobj.write(data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position 15: ordinal not in range(128)
mixedpuppy commented 13 years ago

fixed