Re: problem with appending to a list, possibly mysqldb related
- From: John Salerno <johnjsal@xxxxxxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 19:06:16 GMT
John Purser wrote:
On Thu, 31 Aug 2006 18:39:45 GMT
John Salerno <johnjsal@xxxxxxxxxxxxxxx> wrote:
John Salerno wrote:Your original python error was telling you that .join() didn't likeJohn Purser wrote:Just tried again with:
I'd say you had a record with a null value for the namefirst field.Wow, you're right! I tried this:
The join method don't like that.
if x[0] and not x[0] == 'NULL':
and sure enough it works after that. (Not sure if that's the best
way to test, though. Just testing for NULL still produced the
error, so I guessed that some namefirst fields were actually blank.)
if x[0]:
and that worked, so I guess NULL isn't a string value.
--
http://mail.python.org/mailman/listinfo/python-list
receiving a 'NoneType'. Try entering type(None) from the python prompt.
By the time Python is seeing it it's not a MySQL null, it's a python
None.
Well, that makes sense! I guess it just didn't occur to me that some entries would have no first name, but I was ignoring all the obvious signs! :)
.
- References:
- problem with appending to a list, possibly mysqldb related
- From: John Salerno
- Re: problem with appending to a list, possibly mysqldb related
- From: John Purser
- Re: problem with appending to a list, possibly mysqldb related
- From: John Salerno
- Re: problem with appending to a list, possibly mysqldb related
- From: John Salerno
- Re: problem with appending to a list, possibly mysqldb related
- From: John Purser
- problem with appending to a list, possibly mysqldb related
- Prev by Date: Re: python loops
- Next by Date: Re: SQLObject or SQLAlchemy?
- Previous by thread: Re: problem with appending to a list, possibly mysqldb related
- Next by thread: SQLObject or SQLAlchemy?
- Index(es):
Relevant Pages
|