Antti Koskimaa
unread,Nov 24, 2009, 4:45:53 AM11/24/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Paste Users
I had a radio button and hidden field with same names in a form.
Webtest Form's parser has an assert that checks that all the fields
that has a same name than a radio button are radio buttons, which
caused the test to fail. This would have been an easy one to solve,
but when Python's inspect tried to find the line where the program
crashed, linecache for some reason returned the lines of PIL's
__init__.py instead of webtest's and caused inspect to crash on
IndexError because there weren't 930 lines in PIL's __init__.py.
So, I copied little by little some of the code of webtest to my test
case, trying to manually find the line where it crashed.
I'm not sure what causes this and why can't linecache find webtest's
source code, but I think this can be reproduced by trying to submit a
form that has a radio button and hidden field with same names. I'd say
that this is a serious problem when webtest's parser causes the test
to fail and linecache can't find the correct source file.
I have WebTest-1.2.1dev r8084 and the operating system is OS X. The
file where linecache tried to find the source was "build/
bdist.macosx-10.3-fat/__init__.py".