I am new to Python and trying to use the multiprocessing.pool program to process files, it works fine until there are no exceptions. If any thread / process gets an exception, the whole program waits for the thread
code snippet:
cp = ConfigParser.ConfigParser() cp.read(gdbini) for table in cp.sections(): jobs.append(table)
Error message:
Traceback (most recent call last): File "/opt/cnet-python/default-2.6/lib/python2.6/threading.py", line 525, in __bootstrap_inner self.run() File "/opt/cnet-python/default-2.6/lib/python2.6/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/opt/cnet-python/default-2.6/lib/python2.6/multiprocessing/pool.py", line 259, in _handle_results task = get() TypeError: ('__init__() takes exactly 3 arguments (2 given)', <class 'ConfigParser.NoOptionError'>, ("No option 'inputfilename' in section: 'section-1'",))
I went further, added an exception handler to complete the process
try: ifile=cp.get(table,'inputfilename') except ConfigParser.NoSectionError,ConfigParser.NoOptionError: usage("One of Parameter not found for"+ table) terminate()
but still he is waiting, not sure what is missing.
mk.
source share