[Python-au] String Problem
Richard Colley
rcolley@cardaccess.com.au
Fri, 24 Jan 2003 14:53:21 +1100
Is __getElementValue() case sensitive? If so, you have a mismatch in
oTimeStamp & oTimestamp.
Richard
-----Original Message-----
From: Graeme Matthew [mailto:graeme_matthew@hotmail.com]
Sent: Thursday, 23 January 2003 10:24 PM
To: python-au@python.net
Subject: [Python-au] String Problem
Hi all im busy parsing an Order xml file and building an SQL string but keep
getting this error only on the deliveryDate
Traceback (most recent call last):
File "<pyshell#74>", line 1, in ?
mb.delegateMessage()
File "C:/BIS/classes\MessageBroker.py", line 62, in delegateMessage
op.processOrders()
File "C:/BIS/classes\OrderProcessor.py", line 56, in processOrders
#vals = vals + self.__getElementValue(order,'deliveryDate') + ","
TypeError: coercing to Unicode: need string or buffer, NoneType found
Heres a sample of the xml
<instructions>Deliver before 7.00am</instructions> <jobNo>R5555</jobNo>
<costCentre>Framing</costCentre> <loadNo>2222X</loadNo>
<orderDate>16/01/2003</orderDate> <deliveryDate>20/01/2003</deliveryDate>
<oTimestamp>16/01/2003 14:00:25</oTimestamp>
biOrderId = self.__getElementValue(order,'biOrderId')
vals = biOrderId + ","
vals = vals + self.__getElementValue(order,'orderId') + "," vals = vals +
self.__getElementValue(order,'invoiceAddress') + "," vals = vals +
self.__getElementValue(order,'deliveryAddress') + "," vals = vals +
self.__getElementValue(order,'instructions') + "," vals = vals +
self.__getElementValue(order,'jobNo') + "," vals = vals +
self.__getElementValue(order,'costCentre') + "," vals = vals +
self.__getElementValue(order,'loadNo') + "," vals = vals +
self.__getElementValue(order,'orderDate') + "," vals = vals +
self.__getElementValue(order,'deliveryDate') + "," vals = vals +
self.__getElementValue(order,'oTimeStamp') + "," print vals
** do not fear sql characters for field wraps will come later :-)
any ideas would be nice
tks
Graeme
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
_______________________________________________
python-au maillist - python-au@starship.python.net
http://starship.python.net/mailman/listinfo/python-au
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003