MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / get_data

Method get_data

tools/python-3.11.9-amd64/Lib/zipimport.py:199–216  ·  view source on GitHub ↗

get_data(pathname) -> string with file data. Return the data associated with 'pathname'. Raise OSError if the file wasn't found.

(self, pathname)

Source from the content-addressed store, hash-verified

197
198
199 def get_data(self, pathname):
200 """get_data(pathname) -> string with file data.
201
202 Return the data associated with 'pathname'. Raise OSError if
203 the file wasn't found.
204 """
205 if alt_path_sep:
206 pathname = pathname.replace(alt_path_sep, path_sep)
207
208 key = pathname
209 if pathname.startswith(self.archive + path_sep):
210 key = pathname[len(self.archive + path_sep):]
211
212 try:
213 toc_entry = self._files[key]
214 except KeyError:
215 raise OSError(0, '', key)
216 return _get_data(self.archive, toc_entry)
217
218
219 # Return a string matching __file__ for the named module

Callers

nothing calls this directly

Calls 3

_get_dataFunction · 0.85
startswithMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected