Lines Matching refs:path

177     src = os.path.abspath(TESTFN)
333 dirname, name = os.path.split(pathname)
365 def _rmtree(path):
368 def _rmtree_inner(path):
369 for name in _force_run(path, os.listdir, path):
370 fullname = os.path.join(path, name)
383 _waitfor(_rmtree_inner, path, waitall=True)
384 _waitfor(lambda p: _force_run(p, os.rmdir, p), path)
386 def _longpath(path):
393 buffer = ctypes.create_unicode_buffer(len(path) * 2)
394 length = ctypes.windll.kernel32.GetLongPathNameW(path, buffer,
398 return path
403 def _rmtree(path):
406 shutil.rmtree(path)
411 def _rmtree_inner(path):
413 for name in _force_run(path, os.listdir, path):
414 fullname = os.path.join(path, name)
421 _force_run(path, os.rmdir, fullname)
423 _force_run(path, os.unlink, fullname)
424 _rmtree_inner(path)
425 os.rmdir(path)
427 def _longpath(path):
428 return path
438 def rmtree(path):
440 _rmtree(path)
446 def temp_dir(path=None, quiet=False):
451 path: the directory to create temporarily. If omitted or None,
455 on error. Otherwise, if the path is specified and cannot be
461 if path is None:
462 path = tempfile.mkdtemp()
464 path = os.path.realpath(path)
467 os.mkdir(path)
473 f'temporary directory {path!r}: {exc}',
478 yield path
483 rmtree(path)
487 def change_cwd(path, quiet=False):
492 path: the directory to use as the temporary current working directory.
501 os.chdir(os.path.realpath(path))
506 f'directory to {path!r}: {exc}',
529 with temp_dir(path=name, quiet=quiet) as temp_path:
541 def open_dir_fd(path):
543 assert os.path.isdir(path)
547 dir_fd = os.open(path, flags)
564 return os.path.samefile(base_path, case_path)
570 """Simple implementing of the path protocol.
572 def __init__(self, path):
573 self.path = path
576 return f'<FakePath {self.path!r}>'
579 if (isinstance(self.path, BaseException) or
580 isinstance(self.path, type) and
581 issubclass(self.path, BaseException)):
582 raise self.path
584 return self.path