#37102: CountsDict.__init__() passes *kwargs instead of **kwargs to
super().__init__()
----------------------+--------------------------------------
Reporter: 王鑫 | Type: Bug
Status: new | Component: Utilities
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------+--------------------------------------
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 = word
The 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.
--
Ticket URL: <
https://code.djangoproject.com/ticket/37102>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.