Opened 22 months ago

Closed 22 months ago

Last modified 22 months 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 22 months ago by jgmize

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jgmize
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 22 months ago by jgmize

  • Has patch set

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

Last edited 22 months ago by jgmize (previous) (diff)

comment:3 Changed 22 months ago by timo

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.
Back to Top