id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux
20321 MergeDict should give key as argument to KeyError mark.harviston@… nobody "Normally when a dict raises a `KeyError` it passes the key to `.args[0]`, but `MergeDict` does not do this.
to fix simply change `raise KeyError` to `raise KeyError(key)` on line 23 of utils/datastructures.py
I'm making a REST-like API that takes input on either POST or GET I wanted to wrap my whole thing in a try...except KeyError, and then give an appropriate error message with the missing field, but unlike request.GET and response.POST which are real dicts, request.REQUEST is a MergeDict and does not pass they key that failed as an argument." Cleanup/optimization closed Utilities 1.4 Normal fixed Accepted 0 0 0 0 1 0