(self)
Create a file in the tmp subdirectory and open and return it.
Create a file in the tmp subdirectory and open and return it.
Create a file in the tmp subdirectory and open and return it .
def _create_tmp(self):
        """Create a file in the tmp subdirectory and open and return it."""
        now = time.time()
        hostname = socket.gethostname()
        if '/' in hostname:
            hostname = hostname.replace('/', r'\057')
        if ':' in hostname:
            hostname = hostname.replace(':', r'\072')
        uniq = "%s.M%sP%sQ%s.%s" % (int(now), int(now % 1 * 1e6), os.getpid(),
                                    Maildir._count, hostname)
        path = os.path.join(self._path, 'tmp', uniq)
        try:
            os.stat(path)
        except FileNotFoundError:
            Maildir._count += 1
            try:
                return _create_carefully(path)
            except FileExistsError:
                pass

        # Fall through to here if stat succeeded or open raised EEXIST.
        raise ExternalClashError('Name clash prevented file creation: %s' %
                                 path)
def _create_tmp ( self ) : now = time . time ( ) hostname = socket . gethostname ( ) if '/' in hostname : hostname = hostname . replace ( '/' , r'\057' ) if ':' in hostname : hostname = hostname . replace ( ':' , r'\072' ) uniq = "%s.M%sP%sQ%s.%s" % ( int ( now ) , int ( now % 1 * 1e6 ) , os . getpid ( ) , Maildir . _count , hostname ) path = os . path . join ( self . _path , 'tmp' , uniq ) try : os . stat ( path ) except FileNotFoundError : Maildir . _count += 1 try : return _create_carefully ( path ) except FileExistsError : pass # Fall through to here if stat succeeded or open raised EEXIST. raise ExternalClashError ( 'Name clash prevented file creation: %s' % path )