def GetNumberOfRows(self):
    file_object = self.GetFileObject()
    if not file_object:
      raise errors.BackEndError(
          u'Unable to retrieve SQLite blob file-like object.')

    try:
      # TODO: move this function out of SQLiteBlobFile.
      self._number_of_entries = file_object.GetNumberOfRows()
    finally:
      file_object.close()

    return self._number_of_entries
Regression test for https://github.com/astropy/astropy/issues/2794
dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/vfs/sqlite_blob_file_entry.py/SQLiteBlobFileEntry.GetNumberOfRows--crossover with--dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/tests/test_core.py/TestFileFunctions.test_write_read_gzip_file