Python Multiprocessing geoprocessing sys.stdout flush error

Discussion created by nheick on Dec 4, 2013
Latest reply on Jan 2, 2014 by nheick
I am trying to run a geoprocessing script tool in a multiprocessing.Pool.  Initially, I had problems with pickling my tool, which was imported from a custom toolbox.  Then, I defined a top-level function that executed the call.  My tool runs and I am even seeing a message from the tool, but then I get the following error:

Process PoolWorker-1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\ArcGIS10.1\lib\multiprocessing\forking.py", line 379, in main
    exitcode = self._bootstrap()
  File "C:\Python27\ArcGIS10.1\lib\multiprocessing\process.py", line 275, in _bootstrap
AttributeError: 'geoprocessing sys.stdout object' object has no attribute 'flush'

After that, the program hangs.  Looking at the multiprocessing package, it looks a SystemExit error is raised while or after the tool is run.  Any ideas?