MCPcopy Index your code
hub / github.com/treeverse/dvc / read_text

Method read_text

dvc/testing/tmp_dir.py:223–232  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

221 self.scm.checkout(old)
222
223 def read_text(self, *args, **kwargs):
224 # NOTE: on windows we'll get PermissionError instead of
225 # IsADirectoryError when we try to `open` a directory, so we can't
226 # rely on exception flow control
227 if self.is_dir():
228 return {
229 path.name: path.read_text(*args, **kwargs) for path in self.iterdir()
230 }
231 kwargs.setdefault("encoding", "utf-8") # type: ignore[call-overload]
232 return super().read_text(*args, **kwargs)
233
234 def oid_to_path(self, hash_):
235 return str(self / hash_[0:2] / hash_[2:])

Callers

nothing calls this directly

Calls 1

is_dirMethod · 0.80

Tested by

no test coverage detected