Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: Help me with this code PLEASE Date: Tue, 5 Nov 2013 22:06:48 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 27 Message-ID: References: NNTP-Posting-Host: panix1.panix.com X-Trace: reader1.panix.com 1383689208 9222 166.84.1.1 (5 Nov 2013 22:06:48 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Tue, 5 Nov 2013 22:06:48 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:58529 In Nick the Gr33k writes: > # fetch those columns that act as lists but are stored as strings > cur.execute('''SELECT refs, visits, downloads FROM visitors WHERE > counterID = %s and host = %s''', (cID, host) ) > data = cur.fetchone() > if cur.rowcount: > # unpack data into variables > (ref, visit, download) = data > > visit = visit.split() > > [Tue Nov 05 23:21:52 2013] [error] [client 176.92.96.218] visit = > visit.split() > [Tue Nov 05 23:21:52 2013] [error] [client 176.92.96.218] > AttributeError: 'NoneType' object has no attribute 'split' It appears that in the row you're fetching from the visitors table, the 'visits' column is NULL. Your next step is track down why. -- John Gordon Imagine what it must be like for a real medical doctor to gordon@panix.com watch 'House', or a real serial killer to watch 'Dexter'.