From daa823ad9a2d8c76ddc152b1ccae26251500efda Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 8 Jan 2001 04:04:34 +0000 Subject: Text.__init__(): Make sure the data parameter is a string (8-bit or Unicode); raise TypeError if not. This closes SF bug #126866. --- Lib/xml/dom/minidom.py | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v0.12