code: def safe_mkdtemp(cleaner=_mkdtemp_atexit_cleaner, **kw):
    
    # Proper lock sanitation on fork [issue 6721] would be desirable here.
    with _MKDTEMP_LOCK:
      return register_rmtree(tempfile.mkdtemp(**kw), cleaner=cleaner)
docs: Create a temporary directory that is cleaned up on process exit.
  
    Arguments are as to tempfile.mkdtemp.
  
    :API: public