Lines Matching full:archive
4 - zipimporter: a class; its constructor takes a path to a Zip archive.
7 - _zip_directory_cache: a dict, mapping archive paths to zip directory
52 valid directory inside the archive.
55 archive.
57 The 'archive' attribute of zipimporter objects contains the name of the
61 # Split the "subdirectory" from the Zip archive path, lookup a matching
63 # if found, or else read it from the archive.
69 raise ZipImportError('archive path is empty', path=path)
98 self.archive = path
140 return None, [f'{self.archive}{path_sep}{modpath}']
182 path = f'{self.archive}{path_sep}{modpath}'
210 if pathname.startswith(self.archive + path_sep):
211 key = pathname[len(self.archive + path_sep):]
217 return _get_data(self.archive, toc_entry)
237 if the module couldn't be found, return None if the archive does
255 return _get_data(self.archive, toc_entry).decode()
296 fullpath = _bootstrap_external._path_join(self.archive, path)
331 """Reload the file data of the archive path."""
333 self._files = _read_directory(self.archive)
334 _zip_directory_cache[self.archive] = self._files
336 _zip_directory_cache.pop(self.archive, None)
341 return f'<zipimporter object "{self.archive}{path_sep}{self.prefix}">'
345 # archive: we first search for a package __init__, then for
357 # archive (without extension).
382 # _read_directory(archive) -> files dict (new reference)
384 # Given a path to a Zip archive, build a dict, mapping file names
385 # (local to the archive, using SEP as a separator) to toc entries.
394 # file_offset, # offset of file header from start of archive
402 def _read_directory(archive): argument
404 fp = _io.open_code(archive)
406 raise ZipImportError(f"can't open Zip file: {archive!r}", path=archive)
414 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
416 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
424 raise ZipImportError(f"can't read Zip file: {archive!r}",
425 path=archive)
432 raise ZipImportError(f"can't read Zip file: {archive!r}",
433 path=archive)
436 raise ZipImportError(f'not a Zip file: {archive!r}',
437 path=archive)
440 raise ZipImportError(f"corrupt Zip file: {archive!r}",
441 path=archive)
447 raise ZipImportError(f'bad central directory size: {archive!r}', path=archive)
449 raise ZipImportError(f'bad central directory offset: {archive!r}', path=archive)
453 raise ZipImportError(f'bad central directory size or offset: {archive!r}', path=archive)
461 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
484 raise ZipImportError(f'bad local header offset: {archive!r}', path=archive)
490 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
492 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
498 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
500 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
513 path = _bootstrap_external._path_join(archive, name)
517 _bootstrap._verbose_message('zipimport: found {} names in {!r}', count, archive)
581 def _get_data(archive, toc_entry): argument
586 with _io.open_code(archive) as fp:
591 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
598 raise ZipImportError(f'bad local file header: {archive!r}', path=archive)
607 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
625 # in the archive is lower than the mtime stored in a .pyc: we
691 # Convert the date/time values found in the Zip archive to a value
703 # Given a path to a .pyc file in the archive, return the
722 # Given a path to a .pyc file in the archive, return the
735 return _get_data(self.archive, toc_entry)
745 _bootstrap._verbose_message('trying {}{}{}', self.archive, path_sep, fullpath, verbosity=2)
752 data = _get_data(self.archive, toc_entry)