code: def first_line(path):
      
      try:
          with io.open(path, "rt", errors="ignore") as fh:
              return fh.readline().strip()
  
      except (IOError, TypeError):
          return None
docs: :param str|None path: Path to file
      :return str|None: First line of file, if any