In concurrent applications like pulp there can be a race condition between seeing if a directory exists and trying to create it, I think creating directories within a try:except: and catching the IOError, and checking the errno is safer.