#37102: CountsDict.__init__() passes *kwargs instead of **kwargs to
super().__init__()
---------------------------+--------------------------------------
Reporter: 王鑫 | Owner: (none)
Type: Bug | Status: new
Component: Utilities | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------+--------------------------------------
Description changed by Raffaella:
Old 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.
New description:
The CountsDict class in django/utils/html.py has a bug in its __init__
method:
{{{#!python
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#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019e377aa87a-6214ad37-c628-4bec-b30b-5a9feba1217c-000000%40eu-central-1.amazonses.com.