From: Guido van Rossum Date: Wed, 21 Jun 2000 20:01:10 +0000 (+0000) Subject: Sjoerd Mullender: X-Git-Tag: v2.0b1~1446 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d468bd3463085b1544a8f09981dc81fd615d2da7;p=python Sjoerd Mullender: These two fixes were approved by me. Peter Kropf: There's a problem with the xmllib module when used with JPython. Specifically, the JPython re module has trouble with the () characters in strings passed into re.compile. Spiros Papadimitriou: I just downloaded xmllib.py ver. 0.3 from python.org and there seems to be a slight typo: Line 654 ("tag = self.stack[-1][0]" in parse_endtag), is indented one level more than it should be. I just thought I'd let you know... --- diff --git a/Lib/xmllib.py b/Lib/xmllib.py index 16a56b04fb..4c6594be3e 100644 --- a/Lib/xmllib.py +++ b/Lib/xmllib.py @@ -27,7 +27,7 @@ newline = re.compile('\n') attrfind = re.compile( _S + '(?P' + _Name + ')' '(' + _opS + '=' + _opS + - '(?P'+_QStr+'|[-a-zA-Z0-9.:+*%?!()_#=~]+))?') + '(?P'+_QStr+'|[-a-zA-Z0-9.:+*%?!\(\)_#=~]+))?') starttagopen = re.compile('<' + _Name) starttagend = re.compile(_opS + '(?P/?)>') starttagmatch = re.compile('<(?P'+_Name+')' @@ -43,8 +43,8 @@ cdataclose = re.compile(r'\]\]>') # SYSTEM SystemLiteral # PUBLIC PubidLiteral SystemLiteral _SystemLiteral = '(?P<%s>'+_QStr+')' -_PublicLiteral = '(?P<%s>"[-\'()+,./:=?;!*#@$_%% \n\ra-zA-Z0-9]*"|' \ - "'[-()+,./:=?;!*#@$_%% \n\ra-zA-Z0-9]*')" +_PublicLiteral = '(?P<%s>"[-\'\(\)+,./:=?;!*#@$_%% \n\ra-zA-Z0-9]*"|' \ + "'[-\(\)+,./:=?;!*#@$_%% \n\ra-zA-Z0-9]*')" _ExternalId = '(?:SYSTEM|' \ 'PUBLIC'+_S+_PublicLiteral%'pubid'+ \ ')'+_S+_SystemLiteral%'syslit' @@ -652,7 +652,7 @@ class XMLParser: return i+1 if not self.__accept_missing_endtag_name: self.syntax_error('no name specified in end tag') - tag = self.stack[-1][0] + tag = self.stack[-1][0] k = i+2 else: tag = res.group(0)