[PATCH] relax pgp signed paragraph parser

Filippo Giunchedi filippo at debian.org
Tue Jun 3 17:10:11 UTC 2008


Hi,
while parsing a lot of changes files from debian-devel-changes archives I
noticed that the pgp parser is a bit "strict", e.g. it might happen to have
Hash: foobar\n\n and the parser just stops at the first empty line yielding an
empty deb822.Changes, attached there's a patch to (hopefully) fix this.

Also, would it be okay to break after the end of signature is read? I guess
we can assume the content being before it, as in:

-            elif m.group('action') == 'END':
-                state = 'SAFE'
+            elif m.group('action') == 'END' and m.group('what') == 'SIGNATURE':
+                break

thanks,
filippo
--
Filippo Giunchedi - http://esaurito.net
PGP key: 0x6B79D401
random quote follows:

Either this man is dead or my watch has stopped.
-- Groucho Marx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pd_relax_pgp.diff
Type: text/x-diff
Size: 1127 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-python-debian-discuss/attachments/20080603/345133e2/attachment.diff 


More information about the pkg-python-debian-discuss mailing list