When you instantiate your thread, you need to provide the arguments to o.open
, not arguments to the http_response
method of ExportHandler
.
In this case, o.open
has the following method signature:
open(self, fullurl, data=None, timeout=<object object>) method of urllib2.OpenerDirector instance
My guess is that you should only need to set args=(link,)
.
If you still need to use those other arguments, you'll probably want to modify the constructor of ExportHandler
to take the other arguments you need, and then use them as appropriate in the http_response
method. Take a look at the Python Class tutorial for more information on defining a class constructor.