celery/celery — pull request #835 by mattlong (2012-07-03 16:50:23+00:00)
Title: ensure args to an unpickleable exception are pickleable

It's possible for an instance of UnpickleableExceptionWrapper to still be unpickleable. This can happen when one of the args of the exception being wrapped is unpickleable itself. As of celery 2.5.5, it appears that the unpickleable exception's arguments are accepted as is without any inspection or sanitation.

I first encountered this scenario while using the requests package to perform a post to a URL with an unresolveable host within a celery task. The requests package wraps exceptions in its own exception classes; often including the original exception as an argument. In this scenario the original exception is unpickleable. Before the fix included in the pull request, the following errors are the end result: http://pastebin.com/wmVS8JaZ.