def read(path):
    # This function implementation was chosen to be compatible across Python 2/3.
    f = open(path, 'rb')
    # We avoid use of the with keyword for Python 2.4 support.
    try:
        b = f.read()
    finally:
        f.close()

    return b.decode(FILE_ENCODING)
Read and return the contents of a text file as a unicode string.
dataset/ETHPy150Open defunkt/pystache/setup.py/read