Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/loader.py
Show First 20 Lines • Show All 372 Lines • ▼ Show 20 Lines | def _load_revision(self, p_info, origin) -> Tuple[Optional[Sha1Git], bool]: | ||||
except Exception: | except Exception: | ||||
logger.exception('Unable to retrieve %s', | logger.exception('Unable to retrieve %s', | ||||
p_info) | p_info) | ||||
return (None, False) | return (None, False) | ||||
try: | try: | ||||
uncompressed_path = self.uncompress(dl_artifacts, dest=tmpdir) | uncompressed_path = self.uncompress(dl_artifacts, dest=tmpdir) | ||||
logger.debug('uncompressed_path: %s', uncompressed_path) | logger.debug('uncompressed_path: %s', uncompressed_path) | ||||
except ValueError: | except (ValueError, EOFError): | ||||
ardumont: you can add a test on functional loader which patches the `uncompress` method to raise this. | |||||
logger.exception('Fail to uncompress %s', | logger.exception('Fail to uncompress %s', | ||||
p_info['url']) | p_info['url']) | ||||
return (None, False) | return (None, False) | ||||
directory = from_disk.Directory.from_disk( | directory = from_disk.Directory.from_disk( | ||||
path=uncompressed_path.encode('utf-8'), | path=uncompressed_path.encode('utf-8'), | ||||
max_content_length=self.max_content_size) | max_content_length=self.max_content_size) | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |
you can add a test on functional loader which patches the uncompress method to raise this.