]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
- xmllib.py - Moved clearing of "literal" flag. The flag is set in setliteral
authorMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 14:26:54 +0000 (14:26 +0000)
committerMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 14:26:54 +0000 (14:26 +0000)
  which can be called from a start tag handler.  When the corresponding end
  tag is read the flag is cleared.  However, it didn't get cleared when
  the start tag was for an empty element of the type <tag .../>.  This
  modification fixes the problem.

Lib/xmllib.py
Misc/NEWS

index b8422cb4508c175d22f38059d2adf281c92805f2..89d7a8af7fb90bede690f8e138fb63b00295de46 100644 (file)
@@ -683,7 +683,6 @@ class XMLParser:
                 if not self.stack or tag != self.stack[-1][0]:
                     self.handle_data(rawdata[i])
                     return i+1
-                self.literal = 0
             k = res.end(0)
         if endbracket.match(rawdata, k) is None:
             self.syntax_error('garbage in end tag')
@@ -699,6 +698,7 @@ class XMLParser:
 
     # Internal -- finish processing of end tag
     def finish_endtag(self, tag):
+        self.literal = 0
         if not tag:
             self.syntax_error('name-less end tag')
             found = len(self.stack) - 1
index 15d0e61ce90ee4df5a5866a5ea87af3122be6ff0..9e4fd9d661b8db84b3c1607ea46ae8b0c6803b47 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -131,6 +131,14 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=<id>&group_id=5470&atid
 
 - #12195 - webbrowser.py - there was typo in Mac code
 
+- quopri.py - treat \r as whitespace too
+
+- xmllib.py - Moved clearing of "literal" flag.  The flag is set in setliteral 
+  which can be called from a start tag handler.  When the corresponding end
+  tag is read the flag is cleared.  However, it didn't get cleared when
+  the start tag was for an empty element of the type <tag .../>.  This
+  modification fixes the problem.
+
 What's New in Python 2.0?
 =========================