summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-01-08 04:04:34 (GMT)
committerFred Drake <fdrake@acm.org>2001-01-08 04:04:34 (GMT)
commitdaa823ad9a2d8c76ddc152b1ccae26251500efda (patch)
tree12e9c3d15dcb5541b3efdc6f72b22899c1fa269f /Lib/xml
parent1c73323d6fb1807123ccbf56019d70d4832f9590 (diff)
downloadcpython-daa823ad9a2d8c76ddc152b1ccae26251500efda.zip
cpython-daa823ad9a2d8c76ddc152b1ccae26251500efda.tar.gz
cpython-daa823ad9a2d8c76ddc152b1ccae26251500efda.tar.bz2
Text.__init__(): Make sure the data parameter is a string (8-bit or
Unicode); raise TypeError if not. This closes SF bug #126866.
Diffstat (limited to 'Lib/xml')
-rw-r--r--Lib/xml/dom/minidom.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 74c9664..65af4c7 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -553,6 +553,8 @@ class Text(Node):
childNodeTypes = ()
def __init__(self, data):
+ if type(data) not in _StringTypes:
+ raise TypeError, "node contents must be a string"
Node.__init__(self)
self.data = self.nodeValue = data