Ticket #439 (closed defect: fixed)
Critical error with WebOb, when in French (unicode error with rendered date)
| Reported by: | abourget | Owned by: | maluke |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.1 |
| Component: | webob | Version: | released-version |
| Severity: | normal | Keywords: | |
| Cc: | maluke@… |
Description
Hello, I've discovered a bug in WebOb? 0.9.8 (which seems the latest released).
When creating the "expire" date for the set_cookie function in response.py, the function that is called is "_serialize_cookie_date". Unfortunately, this function is buggy, as it renders using strftime, which goes through the locale (and in French, it adds an accent in the month of August! for Août).
So my application just broke trying to set a cookie to next week.
In fact, the function _serialize_date (which is beside _serialize_cookie_date) in datetime_utils.py does exactly what's required, calling "formatdate" from the "rfc822" module. I tried to keep using the ...cookie_date function, but hit another bug and another, until the fixes made the two function identical. My suggestion is to just use _serialize_date() in response.py instead of _serialize_cookie_date() and ditch the ..cookie_date() function altogether. This is really a blocker for me, thanks for attention to this bug.
Follow up also the thread on GGroups: http://groups.google.com/group/pylons-discuss/browse_thread/thread/46fcb63c8b18fd0d
