get_data(pathname) -> string with file data. Return the data associated with 'pathname'. Raise OSError if the file wasn't found.
(self, pathname)
| 133 | |
| 134 | |
| 135 | def get_data(self, pathname): |
| 136 | """get_data(pathname) -> string with file data. |
| 137 | |
| 138 | Return the data associated with 'pathname'. Raise OSError if |
| 139 | the file wasn't found. |
| 140 | """ |
| 141 | if alt_path_sep: |
| 142 | pathname = pathname.replace(alt_path_sep, path_sep) |
| 143 | |
| 144 | key = pathname |
| 145 | if pathname.startswith(self.archive + path_sep): |
| 146 | key = pathname[len(self.archive + path_sep):] |
| 147 | |
| 148 | try: |
| 149 | toc_entry = self._get_files()[key] |
| 150 | except KeyError: |
| 151 | raise OSError(0, '', key) |
| 152 | if toc_entry is None: |
| 153 | return b'' |
| 154 | return _get_data(self.archive, toc_entry) |
| 155 | |
| 156 | |
| 157 | # Return a string matching __file__ for the named module |
nothing calls this directly
no test coverage detected