Lines Matching refs:name
168 if _os.name == 'nt':
190 service, the name of the test file must be randomized."""
200 name = next(namer)
201 filename = _os.path.join(dir, name)
215 # This exception is thrown when a directory with the chosen name
217 if (_os.name == 'nt' and _os.path.isdir(dir) and
252 name = next(names)
253 file = _os.path.join(dir, pre + name + suf)
260 # This exception is thrown when a directory with the chosen name
262 if (_os.name == 'nt' and _os.path.isdir(dir) and
270 "No usable temporary file name found")
276 elif _os.name == 'nt' or not _os.path.islink(path):
323 file. The return value is a pair (fd, name) where fd is the
324 file descriptor returned by os.open, and name is the filename.
326 If 'suffix' is not None, the file name will end with that suffix,
329 If 'prefix' is not None, the file name will begin with that prefix,
339 same type. If they are bytes, the returned name will be bytes; str
380 name = next(names)
381 file = _os.path.join(dir, prefix + name + suffix)
388 # This exception is thrown when a directory with the chosen name
390 if (_os.name == 'nt' and _os.path.isdir(dir) and
398 "No usable temporary directory name found")
401 """User-callable function to return a unique temporary file name. The
408 THIS FUNCTION IS UNSAFE AND SHOULD NOT BE USED. The file name may
423 name = next(names)
424 file = _os.path.join(dir, prefix + name + suffix)
440 def __init__(self, file, name, delete=True):
442 self.name = name
447 # file.name is useful (i.e. not "(fdopen)") with NamedTemporaryFile.
448 if _os.name != 'nt':
452 # name TemporaryFileWrapper may also get None'd out before
462 unlink(self.name)
483 def __init__(self, file, name, delete=True):
485 self.name = name
487 self._closer = _TemporaryFileCloser(file, name, delete)
489 def __getattr__(self, name):
494 a = getattr(file, name)
505 setattr(self, name, a)
552 Returns an object with a file-like interface; the name of the file
553 is accessible as its 'name' attribute. The file will be automatically
567 if _os.name == 'nt' and delete:
573 name = None
575 nonlocal name
576 fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
585 raw.name = name
586 return _TemporaryFileWrapper(file, name, delete)
591 if name is not None and not (_os.name == 'nt' and delete):
592 _os.unlink(name)
595 if _os.name != 'posix' or _sys.platform == 'cygwin':
620 name, and will cease to exist when it is closed.
643 raw.name = fd
666 fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
668 _os.unlink(name)
678 raw.name = fd
789 def name(self):
791 return self._file.name
870 self.name = mkdtemp(suffix, prefix, dir)
873 self, self._cleanup, self.name,
878 def _rmtree(cls, name, ignore_errors=False):
882 if path != name:
899 _shutil.rmtree(name, onerror=onerror)
902 def _cleanup(cls, name, warn_message, ignore_errors=False):
903 cls._rmtree(name, ignore_errors=ignore_errors)
907 return "<{} {!r}>".format(self.__class__.__name__, self.name)
910 return self.name
916 if self._finalizer.detach() or _os.path.exists(self.name):
917 self._rmtree(self.name, ignore_errors=self._ignore_cleanup_errors)