Opened 3 weeks ago
Last modified 3 weeks ago
#37102 assigned Bug
CountsDict.__init__() passes *kwargs instead of **kwargs to super().__init__() — at Version 1
| Reported by: | 王鑫 | Owned by: | |
|---|---|---|---|
| Component: | Utilities | Version: | 6.0 |
| Severity: | Normal | Keywords: | |
| Cc: | 王鑫 | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The CountsDict class in django/utils/html.py has a bug in its init method:
class CountsDict(dict): def __init__(self, *args, word, **kwargs): super().__init__(*args, *kwargs) # BUG: should be **kwargs self.word = wordThe call uses *kwargs (positional unpacking) instead of kwargs (keyword unpacking). Currently this never triggers because CountsDict is only called with
word=middle, but it would fail if any keyword arguments were passed.
The fix is to change *kwargs to kwargs on line 281.
Note:
See TracTickets
for help on using tickets.