Opened 5 years ago

Closed 5 years ago

#28064 closed Bug (fixed)

MultiValueDictKeyError double quotes missing str keys in error messages

Reported by: petedmarsh Owned by: nobody
Component: Utilities Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

With a builtin dict a KeyError error message looks like this:

>>> {}['key']
#...
KeyError: 'key'

However, with MultiValueDict the error message looks like this:

MultiValueDict()['key']
#...
django.utils.datastructures.MultiValueDictKeyError: "'key'"

I was a bit surprised when I first noticed this, as at first glance it looked as if I had somehow quoted some keys ('key' rather than just key) before looking them up in a dictionary.

Change History (2)

comment:1 Changed 5 years ago by Tim Graham

Triage Stage: UnreviewedReady for checkin

comment:2 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 14671aff:

Fixed #28064 -- Removed double-quoting of key names in MultiValueDictKeyError.

Note: See TracTickets for help on using tickets.
Back to Top