Find why this helper fails only when its result is consumed.
Python
def read_lines(path):
with open(path, encoding="utf-8") as source:
return (line.rstrip() for line in source)
def read_lines(path):
with open(path, encoding="utf-8") as source:
return (line.rstrip() for line in source)