summaryrefslogtreecommitdiffstats
path: root/Lib/xmllib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-06-21 20:01:10 (GMT)
committerGuido van Rossum <guido@python.org>2000-06-21 20:01:10 (GMT)
commitd468bd3463085b1544a8f09981dc81fd615d2da7 (patch)
treeff2a872e205791419005a8fec41d2b88593f7f84 /Lib/xmllib.py
parent7c6395a6a30eeb5c4120d09de487d869b7606e13 (diff)
downloadcpython-d468bd3463085b1544a8f09981dc81fd615d2da7.zip
cpython-d468bd3463085b1544a8f09981dc81fd615d2da7.tar.gz
cpython-d468bd3463085b1544a8f09981dc81fd615d2da7.tar.bz2
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...
Diffstat (limited to 'Lib/xmllib.py')
-rw-r--r--Lib/xmllib.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/xmllib.py b/Lib/xmllib.py
index 16a56b0..4c6594b 100644
--- a/Lib/xmllib.py
+++ b/Lib/xmllib.py
@@ -27,7 +27,7 @@ newline = re.compile('\n')
attrfind = re.compile(
_S + '(?P<name>' + _Name + ')'
'(' + _opS + '=' + _opS +
- '(?P<value>'+_QStr+'|[-a-zA-Z0-9.:+*%?!()_#=~]+))?')
+ '(?P<value>'+_QStr+'|[-a-zA-Z0-9.:+*%?!\(\)_#=~]+))?')
starttagopen = re.compile('<' + _Name)
starttagend = re.compile(_opS + '(?P<slash>/?)>')
starttagmatch = re.compile('<(?P<tagname>'+_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)