[portland] Please explain this error

jason kirtland jek at discorporate.us
Wed Jan 16 22:05:47 CET 2008

Rich Shepard wrote:
> On Wed, 16 Jan 2008, jason kirtland wrote:
>> looks like the value of row[16] is a unicode string, not a number.  you
>> could check it via
>   ...
>> and/or workaround it by converting to an integer:
>>   for i in range(int(row[16])):
> Jason,
>   That's what I thought, too, but when I had tried the above I get:
> Traceback (most recent call last):
>   File "eikos.py", line 145, in OnProjParms
>     projectReports().inputVals()
>   File "/data1/eikos/reports.py", line 394, in inputVals
>     for i in range(int(row[16])):
> ValueError: invalid literal for int():
>   That's why I'm having difficulty discerning where the error originates.

What's the repr() of row[16] at that point?  I'll guess that it's the 
empty string: u'', coming from the database row.  Perhaps something is 
storing '' where it means to be storing NULL.

More information about the Portland mailing list