[Django] #23253: "MANAGERS" setting doesn't correctly process the value, if it is given as described in the documentation

2 views
Skip to first unread message

Django

unread,
Aug 7, 2014, 5:13:18 AM8/7/14
to django-...@googlegroups.com
#23253: "MANAGERS" setting doesn't correctly process the value, if it is given as
described in the documentation
----------------------------------+--------------------
Reporter: angry.kustomer@… | Owner: nobody
Type: Bug | Status: new
Component: Core (Mail) | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------
Django 1.6.5
According to the docs
(https://docs.djangoproject.com/en/1.6/ref/settings/#managers) MANAGERS
expects a tuple
of the same format as for ADMINS, that is tuple of tuples.
In the practice it crashes with an error:

PATH_TO_MY_VIRTUAL_ENV/lib/python3.4/site-
packages/django/core/mail/message.py", line 244, in message
msg['To'] = self.extra_headers.get('To', ', '.join(self.to))

TypeError: sequence item 0: expected str instance, tuple found


That is system currently expects it to be a tuple of strings, not other
tuples. If given so, everything works fine.

--
Ticket URL: <https://code.djangoproject.com/ticket/23253>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 7, 2014, 5:28:01 AM8/7/14
to django-...@googlegroups.com
#23253: "MANAGERS" setting doesn't correctly process the value, if it is given as
described in the documentation
----------------------------------+--------------------------------------
Reporter: angry.kustomer@… | Owner: nobody
Type: Bug | Status: closed

Component: Core (Mail) | Version: 1.6
Severity: Normal | Resolution: worksforme
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by bmispelon):

* status: new => closed
* needs_better_patch: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_docs: => 0


Comment:

Hi,

What code is triggering this error (can you also provide the full
traceback)?

Using the example from the documentation, I can't reproduce your error (I
tried on master and on 1.6):
{{{#!python
# settings.py
ADMINS = (('John', 'jo...@example.com'), ('Mary', 'ma...@example.com'))
MANAGERS = ADMINS

# test.py
from django.core.mail import mail_managers, mail_admins
mail_managers('test', 'test')
mail_admins('test', 'test')
}}}

I'm closing this as `worksforme`. Can you please reopen with the full
traceback?

Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/23253#comment:1>

Django

unread,
Aug 7, 2014, 6:18:43 AM8/7/14
to django-...@googlegroups.com
#23253: "MANAGERS" setting doesn't correctly process the value, if it is given as
described in the documentation
----------------------------------+--------------------------------------
Reporter: angry.kustomer@… | Owner: nobody
Type: Bug | Status: closed

Component: Core (Mail) | Version: 1.6
Severity: Normal | Resolution: worksforme
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------

Comment (by anonymous):

My bad, sorry. Looks like a minor difference in function parameters.
I'm using send_mail() and it expects list of strings, it cannot just take
MANAGERS instead.
Thank you.

--
Ticket URL: <https://code.djangoproject.com/ticket/23253#comment:2>

Reply all
Reply to author
Forward
0 new messages