[twill] Bug with find in 0.8

Titus Brown titus at caltech.edu
Tue Nov 29 21:18:33 PST 2005


-> For Twill 0.8 I can use find successfully from the shell, but I am 
-> getting errors if I use it from a python script.
-> 
-> For example I can do this fine from Twill:
-> 
-> go www.google.com
-> find google
-> 
-> Running the same from a python script (e.g. test.py) throws the 
-> following error
-> 
-> Traceback (most recent call last):
->   File "test.py", line 7, in ?
->     find("google")
->   File 
-> "/Library/Python/2.3/site-packages/twill-0.8-py2.3.egg/twill/commands.py", 
-> line 183, in find
->     global_dict, local_dict = get_twill_glocals()
->   File 
-> "/Library/Python/2.3/site-packages/twill-0.8-py2.3.egg/twill/namespaces.py", 
-> line 45, in get_twill_glocals
->     assert len(_local_dict_stack) >= 1, "must create a local namespace!"
-> AssertionError: must create a local namespace!
-> 
-> If I swap out the commands.pyin the site packages folder with the 0.7.4 
-> version the error goes away.
-> 
-> Thanks!

Ahh, sorry -- I need to document this, obviously.  Or maybe just make it
work automatically; that'd probably be best.

The solution for the nonce is to 

import twill.namespaces
twill.namespaces.new_local_dict()

sorry 'bout that.

--titus



More information about the twill mailing list