#37102 new Bug

CountsDict.__init__() passes *kwargs instead of **kwargs to super().__init__()

Reported by: 王鑫 Owned by:
Component: Utilities Version: 6.0
Severity: Normal Keywords:
Cc: 王鑫 Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top