<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_file(self, infile):
 """Read a reST file into a string. """

        try:
            with open(infile, 'rt') as file:
                return file.read()
        except UnicodeDecodeError as e:
            err_exit('Error reading %s: %s' % (infile, e))
        except (IOError, OSError) as e:
            err_exit('Error reading %s: %s' % (infile, e.strerror or e))