def foo(file_path):
with open(file_path, 'z') as fh:
contents = fh.read()
return contents
def foo(file_path):
with open(file_path, 'r') as fh:
contents = fh.read()
return contents
Python supports r, w, a[, x] modes with b, +, and U (only with
r) options.