Bug#1141352: python3-debian: merge_fields can raise ValueError
Niels Thykier
niels at thykier.net
Tue Nov 10 16:43:17 GMT 2026
Mathis Faivre:
> Thanks, that shape works for me. I am dropping the small fix (1): it unfolded both values as soon as one side was on a single line, so a short value merged with a Description-style one turned into a sorted bag of words with no error. Without a type that case cannot be told apart from a folded field.
>
> (2) comes as separate MRs. The first one is ready:
>
> [...]
>
Thanks for looking into this. With a few minor tweaks, I am happy to see
that MR merged.
> Next MR: folding on dump in Deb822._dump_format, driven by field_meta.
> Only FOLDED fields, only over 980 characters, at the last blank like
> dpkg-genchanges. Already folded short values are written back as they
> are. _multivalued_fields and _relationship_fields stay out for now;
> FieldMeta leaves room to absorb them later.
>
> One place where I plan to differ from what you wrote: you said
> Deb822ParagraphElement needs similar support for its dump. Its dump
> concatenates the tokens and gives the file back byte for byte, and
> folding there would rewrite fields the caller never touched. I plan to
> fold when the value is set (__setitem__, set_field_to_simple_value, and a
> folding formatter for the list views) and leave dump exact. Tell me if
> you would rather have it in dump.
Sounds very reasonable for the delta here. It means the RTS parser
(Deb822ParagraphElement stack) does not auto-correct fields with a
simple load + save cycle like Deb822. But there is certainly a Conflict
of Interest here between roundtrip safe and auto-correcting. With
roundtrip safety being the entire thing of Deb822ParagraphElement, I
agree that is the better choice.
Best regards,
Niels
More information about the pkg-python-debian-maint
mailing list