#14747: parse error on HTTP_IF_MODIFIED_SINCE header
-------------------------------------+--------------------------------------
          Reporter:  shaohua         |         Owner:  nobody
            Status:  new             |     Milestone:        
         Component:  Core framework  |       Version:  1.2   
        Resolution:                  |      Keywords:        
             Stage:  Accepted        |     Has_patch:  0     
        Needs_docs:  0               |   Needs_tests:  0     
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Changes (by ramiro):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

Old description:

> Some mobile browsers send localized time in 'HTTP_IF_MODIFIED_SINCE'
> like: '???, 21 ?? 2010 05:55:07 GMT', which can not be correctly parsed
> and cause exceptions:
>
>  File "/usr/local/lib/python2.6/dist-
> packages/django/core/handlers/base.py", line 100, in get_response
>    response = callback(request, *callback_args, **callback_kwargs)
>
>  File "/usr/local/lib/python2.6/dist-packages/django/views/static.py",
> line 61, in serve
>    statobj[stat.ST_MTIME], statobj[stat.ST_SIZE]):
>
>  File "/usr/local/lib/python2.6/dist-packages/django/views/static.py",
> line 129, in was_modified_since
>    header_mtime = mktime_tz(parsedate_tz(matches.group(1)))
>
>  File "/usr/lib/python2.6/email/_parseaddr.py", line 142, in mktime_tz
>    if data[9] is None:
>
> TypeError: 'NoneType' object is unsubscriptable

New description:

 Some mobile browsers send localized time in 'HTTP_IF_MODIFIED_SINCE' like:
 '???, 21 ?? 2010 05:55:07 GMT', which can not be correctly parsed and
 cause exceptions:
 {{{
  File "/usr/local/lib/python2.6/dist-
 packages/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/local/lib/python2.6/dist-packages/django/views/static.py",
 line 61, in serve
    statobj[stat.ST_MTIME], statobj[stat.ST_SIZE]):

  File "/usr/local/lib/python2.6/dist-packages/django/views/static.py",
 line 129, in was_modified_since
    header_mtime = mktime_tz(parsedate_tz(matches.group(1)))

  File "/usr/lib/python2.6/email/_parseaddr.py", line 142, in mktime_tz
    if data[9] is None:

 TypeError: 'NoneType' object is unsubscriptable
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14747#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to