[Python-checkins] CVS: python/dist/src/Lib xmllib.py,1.17,1.18

Guido van Rossum python-dev@python.org
Wed, 21 Jun 2000 13:01:13 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv311

Modified Files:
	xmllib.py 
Log Message:
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...


Index: xmllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xmllib.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** xmllib.py	2000/02/04 15:39:30	1.17
--- xmllib.py	2000/06/21 20:01:10	1.18
***************
*** 28,32 ****
      _S + '(?P<name>' + _Name + ')'
      '(' + _opS + '=' + _opS +
!     '(?P<value>'+_QStr+'|[-a-zA-Z0-9.:+*%?!()_#=~]+))?')
  starttagopen = re.compile('<' + _Name)
  starttagend = re.compile(_opS + '(?P<slash>/?)>')
--- 28,32 ----
      _S + '(?P<name>' + _Name + ')'
      '(' + _opS + '=' + _opS +
!     '(?P<value>'+_QStr+'|[-a-zA-Z0-9.:+*%?!\(\)_#=~]+))?')
  starttagopen = re.compile('<' + _Name)
  starttagend = re.compile(_opS + '(?P<slash>/?)>')
***************
*** 44,49 ****
  # PUBLIC PubidLiteral SystemLiteral
  _SystemLiteral = '(?P<%s>'+_QStr+')'
! _PublicLiteral = '(?P<%s>"[-\'()+,./:=?;!*#@$_%% \n\ra-zA-Z0-9]*"|' \
!                         "'[-()+,./:=?;!*#@$_%% \n\ra-zA-Z0-9]*')"
  _ExternalId = '(?:SYSTEM|' \
                   'PUBLIC'+_S+_PublicLiteral%'pubid'+ \
--- 44,49 ----
  # PUBLIC PubidLiteral SystemLiteral
  _SystemLiteral = '(?P<%s>'+_QStr+')'
! _PublicLiteral = '(?P<%s>"[-\'\(\)+,./:=?;!*#@$_%% \n\ra-zA-Z0-9]*"|' \
!                         "'[-\(\)+,./:=?;!*#@$_%% \n\ra-zA-Z0-9]*')"
  _ExternalId = '(?:SYSTEM|' \
                   'PUBLIC'+_S+_PublicLiteral%'pubid'+ \
***************
*** 653,657 ****
              if not self.__accept_missing_endtag_name:
                  self.syntax_error('no name specified in end tag')
!                 tag = self.stack[-1][0]
              k = i+2
          else:
--- 653,657 ----
              if not self.__accept_missing_endtag_name:
                  self.syntax_error('no name specified in end tag')
!             tag = self.stack[-1][0]
              k = i+2
          else: