Query params MultiDict.getlist raises KeyError on missing key
Open
investigating
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
```python
@app.route('/')
def index():
query_params = app.current_request.query_params
stuff = query_params.getlist("stuff") # KeyError if query param not passed in request
```
I believe that it makes sense that a behavior similar to using `get` (fall back to a value) is expected when using `getlist`.
Contributor guide
Research direction
Start by locating the MultiDict implementation and comparing getlist with get, then inspect existing tests for missing query parameters. Clarify the expected fallback value for a missing key, implement the agreed behavior, and add or update a regression test showing that getlist no longer raises KeyError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100