Opened 9 years ago
Closed 9 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.
Note:
See TracTickets
for help on using tickets.
PR