Python multiprocessing doesn't play nicely with uuid.uuid4()

This is the correct way to generate your own uuid4, if you need to do that:

import os, uuid
return uuid.UUID(bytes=os.urandom(16), version=4)

Python should be doing this automatically--this code is right out of uuid.uuid4, when the native _uuid_generate_random doesn't exist. There must be something wrong with your platform's _uuid_generate_random.

If you have to do this, don't just work around it yourself and let everyone else on your platform suffer; report the bug.