python - Error Traceback is not descriptive when using multiprocessing pool -


hi using python multiprocessing module , problem when error code has been executed in thread, traceback pointing multiprocessing/pool.py", line 520 instead of line number of caused error exactly.

traceback (most recent call last):   file "analyzer.py", line 196, in <module>     ret in pool.imap(processrow, rows):   file "/usr/lib64/python2.6/multiprocessing/pool.py", line 520, in next     raise value typeerror: unsupported operand type(s) +: 'nonetype' , 'str' 

so line 196 in analyzer.py when call for ret in pool.imap(processrow, rows):

so it's not helpful....any advice ?

the error raised processrow() or function called (why function camelcaseupper?).

you not getting proper stack trace, because exception pickled subprocess (hence name of module: multiprocessing) code executing in , raised again in manager process. hence stack trace shows if local (while exception raised in subprocess).

the preferred way of dealing seems to catch exception in forked of code , printing proper stacktrace there.


Comments