non ascii characters in 'subject' field of a mail

18 views
Skip to first unread message

Fekete Zoltán

unread,
Oct 26, 2025, 6:40:24 AMOct 26
to web2py-users
Hi There,

I have upgraded web2py to the most recent version from 2024.09.something.

I use a the subject 'Kétlépcsős azonosító kód' for 2 factor auth in my local language.

The former version worked as expected. But, after the upgrade, the framework throws a warning:

WARNING:web2py:Mail.send failure:'ascii' codec can't encode character '\\xe9' in position 208: ordinal not in range(128)

And, the email is not sent at all.

I fixed the issue modifying gluon/tools.py:825

---  payload["Subject"] = subject
+++  payload["Subject"] = encode_header(subject) 

I'm not sure this is the best solution, though. Would you please analyze?

Thank you,

Zoltán
Reply all
Reply to author
Forward
0 new messages