Lines Matching refs: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.
68 raise ZipImportError('archive path is empty', path=path)
97 self.archive = path
139 return None, [f'{self.archive}{path_sep}{modpath}']
181 path = f'{self.archive}{path_sep}{modpath}'
209 if pathname.startswith(self.archive + path_sep):
210 key = pathname[len(self.archive + path_sep):]
216 return _get_data(self.archive, toc_entry)
236 if the module couldn't be found, return None if the archive does
254 return _get_data(self.archive, toc_entry).decode()
295 fullpath = _bootstrap_external._path_join(self.archive, path)
330 """Reload the file data of the archive path."""
332 self._files = _read_directory(self.archive)
333 _zip_directory_cache[self.archive] = self._files
335 _zip_directory_cache.pop(self.archive, None)
340 return f'<zipimporter object "{self.archive}{path_sep}{self.prefix}">'
344 # archive: we first search for a package __init__, then for
356 # archive (without extension).
381 # _read_directory(archive) -> files dict (new reference)
383 # Given a path to a Zip archive, build a dict, mapping file names
384 # (local to the archive, using SEP as a separator) to toc entries.
393 # file_offset, # offset of file header from start of archive
401 def _read_directory(archive):
403 fp = _io.open_code(archive)
405 raise ZipImportError(f"can't open Zip file: {archive!r}", path=archive)
418 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
420 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
428 raise ZipImportError(f"can't read Zip file: {archive!r}",
429 path=archive)
436 raise ZipImportError(f"can't read Zip file: {archive!r}",
437 path=archive)
440 raise ZipImportError(f'not a Zip file: {archive!r}',
441 path=archive)
444 raise ZipImportError(f"corrupt Zip file: {archive!r}",
445 path=archive)
451 raise ZipImportError(f'bad central directory size: {archive!r}', path=archive)
453 raise ZipImportError(f'bad central directory offset: {archive!r}', path=archive)
457 raise ZipImportError(f'bad central directory size or offset: {archive!r}', path=archive)
465 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
488 raise ZipImportError(f'bad local header offset: {archive!r}', path=archive)
494 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
496 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
502 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
504 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
517 path = _bootstrap_external._path_join(archive, name)
523 _bootstrap._verbose_message('zipimport: found {} names in {!r}', count, archive)
587 def _get_data(archive, toc_entry):
592 with _io.open_code(archive) as fp:
597 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
604 raise ZipImportError(f'bad local file header: {archive!r}', path=archive)
613 raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
631 # in the archive is lower than the mtime stored in a .pyc: we
697 # Convert the date/time values found in the Zip archive to a value
709 # Given a path to a .pyc file in the archive, return the
728 # Given a path to a .pyc file in the archive, return the
741 return _get_data(self.archive, toc_entry)
751 _bootstrap._verbose_message('trying {}{}{}', self.archive, path_sep, fullpath, verbosity=2)
758 data = _get_data(self.archive, toc_entry)