Lines Matching defs:path

131 PAX_FIELDS = ("path", "linkpath", "size", "mtime",
135 PAX_NAME_FIELDS = {"path", "linkpath", "uname", "gname"}
429 self.name = os.path.basename(self.name)
727 super().__init__(f'member {tarinfo.name!r} has an absolute path')
730 def __init__(self, tarinfo, path):
732 self._path = path
733 super().__init__(f'{tarinfo.name!r} would be extracted to {path!r}, '
744 super().__init__(f'{tarinfo.name!r} is a symlink to an absolute path')
747 def __init__(self, tarinfo, path):
749 self._path = path
750 super().__init__(f'{tarinfo.name!r} would link to {path!r}, '
756 dest_path = os.path.realpath(dest_path)
760 name = new_attrs['name'] = member.path.lstrip('/' + os.sep)
761 if os.path.isabs(name):
766 target_path = os.path.realpath(os.path.join(dest_path, name))
767 if os.path.commonpath([target_path, dest_path]) != dest_path:
802 if os.path.isabs(member.linkname):
804 target_path = os.path.realpath(os.path.join(dest_path, member.linkname))
805 if os.path.commonpath([target_path, dest_path]) != dest_path:
900 def path(self):
901 'In pax headers, "name" is called "path".'
904 @path.setter
905 def path(self, name):
1031 ("name", "path", LENGTH_NAME), ("linkname", "linkpath", LENGTH_LINK),
1440 # the encoding of the path, linkpath, uname and gname fields. Normally,
1563 setattr(self, "path", value)
1574 if keyword == "path":
1684 if self.mode == "a" and not os.path.exists(name):
1697 self.name = os.path.abspath(name) if name else None
2047 drv, arcname = os.path.splitdrive(arcname)
2179 if self.name is not None and os.path.abspath(name) == self.name:
2208 self.add(os.path.join(name, f), os.path.join(arcname, f),
2257 def extractall(self, path=".", members=None, *, numeric_owner=False,
2261 directories afterwards. `path' specifies a different directory
2278 tarinfo = self._get_extract_tarinfo(member, filter_function, path)
2286 self._extract_one(tarinfo, path, set_attrs=not tarinfo.isdir(),
2294 dirpath = os.path.join(path, tarinfo.name)
2302 def extract(self, member, path="", set_attrs=True, *, numeric_owner=False,
2307 specify a different directory using `path'. File attributes (owner,
2317 tarinfo = self._get_extract_tarinfo(member, filter_function, path)
2319 self._extract_one(tarinfo, path, set_attrs, numeric_owner)
2321 def _get_extract_tarinfo(self, member, filter_function, path):
2330 tarinfo = filter_function(tarinfo, path)
2341 tarinfo._link_target = os.path.join(path, tarinfo.linkname)
2344 def _extract_one(self, tarinfo, path, set_attrs, numeric_owner):
2349 self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
2420 upperdirs = os.path.dirname(targetpath)
2421 if upperdirs and not os.path.exists(upperdirs):
2529 if os.path.lexists(targetpath):
2534 if os.path.exists(tarinfo._link_target):
2685 # Happy fast path
2689 name = os.path.normpath(name)
2697 member_name = os.path.normpath(member.name)
2733 linkname = "/".join(filter(None, (os.path.dirname(tarinfo.name), tarinfo.linkname)))
2880 tf.extractall(path=curdir, filter=args.filter)
2893 _, ext = os.path.splitext(tar_name)