Bug#686638: Bug#649220: ftp.debian.org: please allow for whitespace around ", " when splitting Uploaders

Stuart Prescott stuart at debian.org
Sat Aug 2 14:24:04 UTC 2014


Control: tags -1 + moreinfo

> python-debian does not parse Uploaders field correctly when separated
> by commas and multiple spaces in control file
> $ cat */debian/control | grep Uploaders
> Uploaders: Foo <foo at debian.org> , Bar <bar at debian.org>
> $ python
> >>> from debian.debfile import Deb822
> >>> fields = Deb822(open('test_0.1.dsc', 'r'))
> >>> print fields['Uploaders']
> Foo <foo at debian.org> , Bar <bar at debian.org>

I don't believe that python-debian actually attempts to parse Uploaders at 
all, let alone doing so incorrectly. Like most other fields, the data in 
Uploaders is just added to the dict entry and python-debian is neither parsing 
nor normalising this data.

> Other fields are parsed correctly:
> root at debomatic64:/haha# cat */debian/control | grep Build-Depends:
> Build-Depends: debhelper , quilt
> $ python
> >>> from debian.debfile import Deb822
> >>> fields = Deb822(open('test_0.1.dsc', 'r'))
> >>> print fields['Build-Depends']
> debhelper, quilt

In contrast to most other fields, Build-Depends *is* actually parsed, data 
structures are created and the print statement is then flattening that data 
structure back into a string. That has the effect of normalising the data as 
well.

Normalisation of Uploaders implies loading the list of uploaders into some 
sort of data structure. Any suggestions on what data structure should be used 
(bearing in mind that changing from a string to a list would be API breaking 
and there are users of this API both inside and outside the archive)? 
Moreover, I'm not sure whether Policy §5.6.3 and §5.6.2 is actually saying 
that you could naively split on "\s*,\s*" in any case -- is the maintainer's 
name allowed to contain commas and be quoted in an rfc822-compliant way?

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