+ path = os.path.join(directory, self.input_filename)
+ try:
+ with open(path) as fh:
+ self.check_fh(fh)
+ except IOError as e:
+ if e.errno == errno.ENOENT:
+ raise FileDoesNotExist(self.input_filename)
+ raise
+
+ def check_fh(self, fh):
+ size = os.fstat(fh.fileno()).st_size
+ fh.seek(0)
+ hashes = apt_pkg.Hashes(fh)