Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#21078 closed Bug (fixed)

django.utils.translation.trans_real.parse_accept_lang_header raises ValueError for certain bad headers

Reported by: jgmize Owned by: jgmize
Component: Utilities Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If the Accept-Language header is 'en; q=1,' parse_accept_lang_header raises a "ValueError: invalid literal for float(): 1,". We are seeing this in production on Django version 1.4.6, but this bug has been present in past versions (not sure how far back) and is currently present in master. I will follow up with a pull request that has a test and error handling shortly.

Change History (3)

comment:1 Changed 3 years ago by jgmize

Needs documentation: unset
Needs tests: unset
Owner: changed from nobody to jgmize
Patch needs improvement: unset
Status: newassigned

comment:2 Changed 3 years ago by jgmize

Has patch: set

I've submitted https://github.com/django/django/pull/1606 to fix this.

Last edited 3 years ago by jgmize (previous) (diff)

comment:3 Changed 3 years ago by Tim Graham

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.
Back to Top