[Patches] [ python-Patches-429171 ] sgmllib - leading spaces in declaration

noreply@sourceforge.net noreply@sourceforge.net
Thu, 07 Jun 2001 13:05:50 -0700


Patches item #429171, was updated on 2001-05-31 15:26
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=429171&group_id=5470

Category: library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Doug Fort (dougfort)
Assigned to: Nobody/Anonymous (nobody)
Summary: sgmllib - leading spaces in declaration

Initial Comment:
Some sites sloppily leave a space in their doctype
declaration:  i.e. <! doctype...>. The Python 2.1 sgml
parser raises an exception for this.  This patch
modifies sgmllib.py to allow leading whitespace in the
declaration.  It also adds a little information to the
exception message.



----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2001-06-07 13:05

Message:
Logged In: YES 
user_id=21627

I don't have an SGML spec, so I can only check the XML 
spec. In XML, such a DOCTYPE declaration is ill-formed; I 
expect the same to be true for SGML. Therefore, I 
recommend to reject this patch.

If you have a need to process such ill-formed documents, I 
recommend to derive from SGMLParser and replace 
parse_declaration appropriately. E.g. you could advance i 
until after the space, then call the base method.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=429171&group_id=5470