Jun-17-2020, 10:06 PM
(This post was last modified: Jun-17-2020, 10:07 PM by BradLivingstone.)
Error:TypeError: scrape_child_link() missing 1 required positional argument: 'failure'When I get to the following part in my code the above happens. class A(object):
def start(self):
....
kill = threading.Event()
# starting here
child_link_thread = threading.Thread(target=ThreadExecutioner.execute_child,args=(self.scrape_child_link, child_link_queue, self.site, code_io_handle, text_io_handle, kill)).start()
....
@staticmethod
def scrape_child_link(self, link: str, used_children: Queue, site: StackOverflow, code_io_handle, text_io_handle,failure: threading.Event):
....
class ThreadExecutioner():
@staticmethod
def execute_child(target: callable(object), tasks: Queue, site: source, code_io_handle, text_io_handle,kill: threading.Event):
parent_threader = threading.Thread(target=target,args=(task, hit_queue, site, code_io_handle,text_io_handle, kill),daemon=True)
parent_threader.start() #Exception thrown here
Ive stepped through this and all of the variables are set by the time the second thread is dispatched. But for some reason the thread does not recognize the kill variable
