Control: tags -1 moreinfo

Jelmer Vernooij:
> Package: python3-debian
> Version: 0.1.39
> Severity: normal
> 
> The new deb822 repro interface paragraph iterator yields objects of type
> debian._util._CaseInsensitiveString rather than strings.
> 
> This breaks e.g. checks that verify that the name of the field appears in a
> list of strings when there are non-lowercase field names:
> 
>>>> import debian._util
>>>> x = debian._util._CaseInsensitiveString('Oo')
>>>> x in set(['Oo'])
> False
> 
> [...]


Hi Jelmer,

This is correct and unfortunately I do not have a good solution for it.

It might be possible to return a "regular str" in this case, but the
behaviour would still fall a part for paragraphs with duplicate keys
where the keys are not even strings[1] (admittedly, they are a rarity
and you can filter those out by having the parse reject them).



Maybe we should reject paragraphs with duplicate keys by default to
side-step that issue?  What is your take on this?


Thanks,
~Niels


[1]: They cannot be regular strings as that would fail the:

"""
 for k in paragraphs.keys():
    v = paragraphs[k]
"""
(anti-)pattern.

Reply via email to