Code

Opened 5 years ago

Closed 4 years ago

#11934 closed (duplicate)

UnicodeDecodeError while sending an e-mail

Reported by: Goldan Owned by: nobody
Component: Core (Mail) Version: master
Severity: Keywords:
Cc: denis.golomazov@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When I'm trying to send an e-mail using django.core.mail.send_mail function, I get the following error:

DjangoUnicodeDecodeError: 'utf8' codec can't decode bytes in position 27-28: invalid data. You passed in '<20090923114122.7992.11505@\xc4\xe5\xed\xe8\xf1-\xcf\x
ca.ipib.msu.ru>' (<type 'str'>)

Let us consider these lines in django/core/mail.py:

65 idhost = DNS_NAME

66 msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, idhost)

When I replace line 65 with

65 idhost = 'example'

e-mails are sent successfully.

So the problem seems to be that my DNS_NAME contains non-ascii characters.
Hope it will be fixed. Thanks in advance.

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

I think this might be a variant on #11924.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.