code: def open_file(self, filename):
          
          try:
              if filename.endswith('.gz'):
                  self.blob_file = gzip.open(filename, 'rb')
              else:
                  self.blob_file = open(filename, 'rb')
          except TypeError:
              log.error("Please specify a valid filename.")
              raise SystemExit
          except IOError as error_message:
              log.error(error_message)
              raise SystemExit
docs: Open the file with filename