mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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...
This commit is contained in:
parent
7c6395a6a3
commit
d468bd3463
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue