The corect way is to try os.mkdir, catch the exception and check the errno value, which tell you why the call failed.
If the directory exists, you can ignore the exception, if its another error, you usually had to raise it again and let the caller handle it. Example: import errno try: os.mkdir(path) except OSError, err: if err.errno != errno.EEXIST: raise Any other way may have race conditions, for example, you check if the directory exits, and its missing, then another process or thread creates it before you try to create the missing directory, and your mkdir call will raise. -- http://mail.python.org/mailman/listinfo/python-list