Changes between Initial Version and Version 2 of Ticket #12197


Ignore:
Timestamp:
Jan 9, 2010, 2:33:15 PM (15 years ago)
Author:
Adrian Holovaty
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12197 – Description

    initial v2  
    77But the re.split seems return a list with a empty string as first element, such as
    88
     9{{{
    910s = 'da, en-gb;q=0.8, en;q=0.7'
    1011
     
    1213
    1314['', 'da', None, '', 'en-gb', '0.8', '', 'en', '0.7', '']
     15}}}
    1416
    1517But parse_accept_lang_header use it from index 0, it means they align to wrong index
     
    1719To fix the issues, you could modify the accept_language_re, or use the return list from index 1.
    1820
     21{{{
    1922def parse_accept_lang_header(lang_string):
    2023    """
     
    3639    result.sort(lambda x, y: -cmp(x[1], y[1]))
    3740    return result
     41}}}
Back to Top