From: Fred Drake Date: Mon, 8 Jan 2001 04:04:34 +0000 (+0000) Subject: Text.__init__(): Make sure the data parameter is a string (8-bit or X-Git-Tag: v2.1a1~389 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=daa823ad9a2d8c76ddc152b1ccae26251500efda;p=python Text.__init__(): Make sure the data parameter is a string (8-bit or Unicode); raise TypeError if not. This closes SF bug #126866. --- diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 74c9664dfb..65af4c7231 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