import errno


def read_file(path):
  """Returns contents of a file or None if missing."""
  try:
    with open(path, 'r') as f:
      return f.read()
  except IOError as e:
    if e.errno == errno.ENOENT:
      return None
    raise