Bug#913274: Incorrectly parsing whitespace in Sources.iter_paragraphs
Stuart Prescott
stuart at debian.org
Tue Jan 1 07:01:39 GMT 2019
Control: tags -1 + patch
Dear Marcus & python-debian co-maintainers,
> > If other tools/libraries are more tolerant, including python-apt,
> > would it make sense for python-debian to be more tolerant when using
> > the in-built parser? In that case, the two parser implementations
> > would be more consistent.
>
> The problem is that iter_paragraphs is used in situations where that
> construct should be a paragraph separator, such as in debian/control.
>
> https://bugs.debian.org/715558 (and many duplicates)
>
> Perhaps the internal parser needs a 'strict'ness parameter that controls
> this behaviour. I'll look at that next.
Some code that:
* allows the caller to explicitly say whether whitespace-only lines delimit
paragraphs (`whitespace-separates-paragraphs`)
* implicitly sets `whitespace-separates-paragraphs=True` if called through
generic Deb822.iter_paragraphs (the `debian/control` / wrap-and-sort case;
#715558)
* implicitly sets `whitespace-separates-paragraphs=False` if called through
specific Packages.iter_paragraphs or Sources.iter_paragraphs (the emulating
python-apt case; #913274)
https://salsa.debian.org/python-debian-team/python-debian/merge_requests/9
Comments and reviews needed!
cheers
Stuart
--
Stuart Prescott http://www.nanonanonano.net/ stuart at nanonanonano.net
Debian Developer http://www.debian.org/ stuart at debian.org
GPG fingerprint 90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7
More information about the pkg-python-debian-maint
mailing list