stephenmcd/mezzanine — pull request #1141 by wrwrwr (2014-10-27 10:43:58+00:00)
Title: Set_cookie encoding issues

Fixed three issues mostly relevant to those that use non-English locales:
* ``%a`` and ``%b`` markers in ``strftime`` are locale dependent, while cookie dates ought to be English-only (trivia -- with certain locales this could take you by surprise -- on a first day of a month with an abbreviation with non-ASCII characters, gUnicorn would start throwing ``UnicodeEncodeError`` on every request, with a stack trace not even mentioning anything of Mezzanine if I remember :-)

* Django suppresses illegal cookie key error when setting a cookie with a name with unsupported characters (but likely doesn't mean to as it leads to sending cookies with Nones; could use a Django ticket, some relevant existing tickets: [#13007](https://code.djangoproject.com/ticket/13007) introduces the code catching the exception, [#19802](https://code.djangoproject.com/ticket/19802) opened with a key exception, ended only fixing a problem with Python 2-specific cookie value encoding);

* The one-line fix from [#19802](https://code.djangoproject.com/ticket/19802) only applies to Django 1.8+, while it's more useful in the context of older ones (that are more likely to be used with Python 2).

Note: Only the first commit contains the fixes, the rest is needed to properly test them.