Changes between Initial Version and Version 2 of Ticket #12197
- Timestamp:
- Jan 9, 2010, 2:33:15 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12197 – Description
initial v2 7 7 But the re.split seems return a list with a empty string as first element, such as 8 8 9 {{{ 9 10 s = 'da, en-gb;q=0.8, en;q=0.7' 10 11 … … 12 13 13 14 ['', 'da', None, '', 'en-gb', '0.8', '', 'en', '0.7', ''] 15 }}} 14 16 15 17 But parse_accept_lang_header use it from index 0, it means they align to wrong index … … 17 19 To fix the issues, you could modify the accept_language_re, or use the return list from index 1. 18 20 21 {{{ 19 22 def parse_accept_lang_header(lang_string): 20 23 """ … … 36 39 result.sort(lambda x, y: -cmp(x[1], y[1])) 37 40 return result 41 }}}