Re: TypeError coercing to Unicode with field read from XML file

2006-03-22 Thread Fredrik Lundh
Randall Parker wrote: > I'm probably doing something dumb as I've never done XML in Python > before. Any ideas what? using minidom ? ;-) if you're not wedded to minidom, there are alternatives that are easier to use for things like this. here's an ElementTree version of your code: ConfigTr

Re: TypeError coercing to Unicode with field read from XML file

2006-03-21 Thread Ben Cartwright
Randall Parker wrote: > My problem is that once I parse the file with minidom and a field from > it to another variable as shown with this line: > IPAddr = self.SocketSettingsObj.IPAddress > > I get this error: [...] > if TargetIPAddrList[0] <> "" and TargetIPPortList[0]

TypeError coercing to Unicode with field read from XML file

2006-03-21 Thread Randall Parker
Running Python 2.4.2 on Windows in SPE. I have a very small XML file (see below) that is in UTF-8 and saved by Windows Notepad as such. I'm reading it with minidom. My problem is that once I parse the file with minidom and a field from it to another variable as shown with this line: IP