Python Error Messages
jonathon
jblake at stamp-coin.com
Thu Sep 9 20:34:51 EDT 1999
On Thu, 9 Sep 1999, Charles G Waldman wrote:
>jonathon writes:
> >
> > The current exasperating error message:
>It seems pretty likely to me (but this is just a guess!) that the
>error is on the line:
>
>add_keywords = ( pre_keywords + country_name + country_section_name +
> scott_data + michel_data + y_t_data + s_g_data + minkus_data +
> end_of_line )
That wasn't the error. Some of the errors turned out to
be the result of my not setting "return return_object"
in a couple of defs. Python very nicelly returned NULL.
Still haven't managed to track the rest down. :-(
For the curious the other obnoxious error is:
"IndexError: string index out of range"
Obnoxious, because:
A) It is supposed to be looking at a list, not a string.
B) The actual error is several hundred lines from where
the message occurs.
>What seems most annoying to me, and I really don't have a clue about,
>is why you're getting an off-by-one error on the line number. Is
>there something strange about this file perhaps?
The file it is reading is roughly 4 MB in size. Each line is
roughly 420 characters long.
>By the way, I'd write the line in question as:
>
>add_keywords = "%s%s%s%s%s%s%s%s%s" % (pre_keywords, country_name,
> country_section_name, scott_data, michel_data, y_t_data,
> s_g_data, minkus_data, end_of_line )
Did that, and replaced most, if not all of the similar lines.
Didn't fix the error, since it wasn't the error, but it did
speed up the script by a considerable margin. :-)
xan
jonathon
More information about the Python-list
mailing list