UnicodeEncodeError when sending e-mails with some iso-8859 characters (€ symbol)
@pengfeiye đang làm issue này rồi.
Từ ngày 15/1/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Describe the bug
On last version (nylas==6.14.0), I'm getting an UnicodeEncodeError when sending an e-mail with a message body payload containing some special characters. The € currency symbol raise the error for example.
To Reproduce
With the following payload and Nylas client usage:
from nylas import Client
message = {
'subject': 'Test envoi avec accent',
'attachments': [],
'from': [{'name': 'Maxime L', 'email': '[email protected]'}],
'cc': [],
'bcc': [],
'to': [{'name': '', 'email': '[email protected]'}],
'reply_to': []
'body': '<p>À noter que lorem ipsum dolor sit...même éàçéàéà<br /><br />€€€€ ça c\'est de l\'euro</p>\r\n<br />---<br />Me',
}
client = Client("some-api-key", "some Nylas root URL")
client.messages.send(
"123456abcdef", # my grant is valid
request_body=message
)
The following exception is raised:
ERROR 'latin-1' codec can't encode characters in position 430-433: Body ('€€€€') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.
Traceback (most recent call last):
File "my_code.py", line 419, in send
client.messages.send(
File "~venv_packages/nylas/resources/messages.py", line 196, in send
json_response, headers = self._http_client._execute(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
File "/usr/local/lib/python3.12/http/client.py", line 1327, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.12/http/client.py", line 1372, in _send_request
body = _encode(body, 'body')
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/http/client.py", line 166, in _encode
raise UnicodeEncodeError(
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 430-433: Body ('€€€€') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.
(characters position slightly changed as I simplified my payload for anonymization)
Expected behavior
E-mail sent without errors, which is the behaviour on nylas 6.13.0 package and earlier.
SDK Version:
6.14.0.
- Ngôn ngữ chính
- Python
- Star
- 109
- Fork
- 85
- Merge trung bình
- 8 giờ 41 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nylas/nylas-python
-
Attachment downloads ignore request URL and header overridesCó thể đã có người làm @Kayvan-Zahiri đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 39/100
nylas/nylas-python#491 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
nylas/nylas-python#455 ·
-
Bug: drafts.create() fails with TypeError for multipart requests (attachments > 3MB)Có thể đã có người làm @benjaminwhtan đã nhận 266 ngày trước. Đang mở
nylas/nylas-python#454 · 3 bình luận · 1 người được giao ·
-
Create an async version of the clientCó thể làm lại được @AaronDDM đã nhận 495 ngày trước và không có pull request nào đang mở. Đang mởenhancement
nylas/nylas-python#412 · 1 bình luận · 5 reaction · 1 người được giao ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
nylas/nylas-python#402 · 1 reaction ·
Tất cả issue của nylas/nylas-python
Issue tương tự
-
wr.dynamodb.read_items returns [{}] for a single partition value that does not existCó thể đã có người làm @auraseb đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
aws/aws-sdk-pandas#3520 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
requires triage typing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sqlalchemy/sqlalchemy#13704 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Edit tool converts CRLF files to LFCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
huggingface/tau#774 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
show ignores the row limit when a column or table name contains "limit"Có thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
What happened to `check.py`?Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
linebender/resvg#1179 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày