Skip to content

Mail helper library breaks with unicode recipient names #334

@openly-retro

Description

@openly-retro

I encountered an issue using the helper library to send mails to recipients with unicode first name / last name:

File "/usr/local/lib/python2.7/dist-packages/sendgrid/helpers/mail/mail.py", line 379, in __init__ self.value = value
File "/usr/local/lib/python2.7/dist-packages/sendgrid/helpers/mail/mail.py", line 395, in value self._value = str(value)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)

self._value = str(value)

Setting the encoding of the python document to utf-8 does not resolve/affect this issue. The code is converting unicode values to ascii.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions