How is it possible to determine what line an error occurred on while using the multiprocessing
package in Python? For example I currently get an error similar to:
File "C:\Users\user\file.py", line 76, in <module>
loop_over()
File "C:\Users\user\file.py", line 56, in loop_over
results = [pool.apply(process_file, args=(file_name,year)) for file_name in files_in_folder]
File "C:\Python27\lib\multiprocessing\pool.py", line 244, in apply
return self.apply_async(func, args, kwds).get()
File "C:\Python27\lib\multiprocessing\pool.py", line 567, in get
raise self._value
KeyError: 'column_a'
In this instance, all i know is that the 'KeyError' arose somewhere after the multiprocessing was called [i.e it results somewhere in the function proecess_file
that was called on line 56], but no more specifics over what actual line of my code caused the error.