#420636 crashes on feeds that contain invalid utf-8 sequences

Package:
libxml-parser-perl
Source:
libxml-parser-perl
Description:
Perl module for parsing XML files
Submitter:
Joey Hess
Date:
2011-12-03 16:51:34 UTC
Severity:
wishlist
#420636#5
Date:
2007-04-23 17:19:02 UTC
From:
To:
XML::Parser is not robust enough to handle all the broken rss feeds out
there. The most common breakage that it fails on is a feed that contains
an invalid utf-8 sequence:

not well-formed (invalid token) at line 86, column 165, byte 4698 at
/usr/lib/perl5/XML/Parser.pm line 187

I've attached a copy of this feed.

The approach taken in other languages XML parsers, such as python's
feedparser, is to attempt to be as robust as possible, to be forgiving in
what is accepted. They also set a bozo bit if a feed is not well-formed,
so that tools that care can detect this.

#420636#10
Date:
2007-04-23 17:51:14 UTC
From:
To:
severity 420636 wishlist
thanks

Such a lax xml parser is not an xml parser. This bug is therefore a
wishlist bug.

Mike

#420636#17
Date:
2007-04-23 18:03:44 UTC
From:
To:
Mike Hommey wrote:

Not being able to parse as many xml feeds out in the wild as other
language's parsers is not a bug?

#420636#22
Date:
2007-04-23 18:06:58 UTC
From:
To:
The fact is they are *not* xml feeds.

Mike

#420636#27
Date:
2007-04-23 18:34:25 UTC
From:
To:
Mike Hommey wrote:

The fact is that they are out there in the wild and tools are needed to
parse them. Do you read Planet Debian? I'll guarantee you that at least
one feed currently on there is not valid xml.

It seems that you are more interested in arguing semantics than actually
fixing the problem? (Which I've worked around in my code now anyway by
calling Encode::decode_utf8 on the feed if XML::Feed crashes.)

#420636#32
Date:
2007-04-23 18:57:17 UTC
From:
To:
And this is exactly how you should be dealing with the "problem". There
are requirements from XML parsers in the XML specifications. If you want
an XML parser to parse something else than valid XML data, you should
make your own steps so that your data becomes valid XML data.

This is because of the existence of tools that torerate invalid XML that
there are still invalid XML files around.

Mike

#420636#37
Date:
2011-04-29 12:12:35 UTC
From:
To:
tag 420636 +wontfix
thanks

Not quite sure if I agree with the conclusions but reading the bug
report, looking at the Debian and upstream bug reports I think it best
to mark this as wontfix.