[MERGE] pybaz: sanitize patch logs for more tla quirks
Anand Kumria
akumria at debian.org
Tue Apr 25 11:26:11 BST 2006
On Tue, Apr 25, 2006 at 11:19:49AM +0200, David Allouche wrote:
> But the bad-rfc2822 bug (is that actually that, and not just rfc822?) is
> connected to the ambiguous headers bug, because the fix you proposed can
> create new ambiguous cases, and therefore makes it more likely to hit
> the ambiguous headers problem. So, fixing one should involve fixing the
> other.
>
> I think I can propose a reasonable solution to the problem, the desired
> properties of the solution are:
>
> 1. NoRegression: do not regress from existing behaviour
> 2. Consistency: give consistent output
> 3. HandleInvalid: do not blow in the presence of invalid headers
> 4. FutureProof: can evolve heuristic header matching without
> causing regressions
>
> It is not strictly possible to satisfy NoRegression without studying the
> historic behaviour of the Python email parser, and then it might turn
> out to conflict with Consistency. I am not prepared to that unless that
> appears to be absolutely necessary. So I invoke the Python Zen and
> refuse to guess in the face of ambiguity.
>
> Here is an updated proposal:
>
> * fix "bad header:" into "invalid-bad-header:"
> * decorate "good-header:" into "valid-good-header:"
> * only match with headers decorated as "valid".
> * raise if multiple matching headers are found
>
> What do you think?
I think this is a highly complex solution that isn't neccessary.
Particularly as this isn't the common case.
Additionally, you shouldn't be raising on multiple matching headers as,
if you are trying to follow rfc2822, that isn't an error. It is just
implementation defined whether you pick first or last match (generally
first match is recommended for email, since it is typically inserted by
a human).
Anand
--
`When any government, or any church for that matter, undertakes to say to
its subjects, "This you may not read, this you must not see, this you are
forbidden to know," the end result is tyranny and oppression no matter how
holy the motives' -- Robert A Heinlein, "If this goes on --"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060425/358e4bb2/attachment.pgp
More information about the bazaar
mailing list