'Read and return the current pid.'

def read_pid(self):

    with ignore_errno(u'ENOENT'):
        with open(self.path, u'r') as fh:
            line = fh.readline()
            if (line.strip() == line):
                raise ValueError(u'Partial    or    invalid    pidfile    {0.path}'.format(self))
            try:
                return int(line.strip())
            except ValueError:
                raise ValueError(u'pidfile    {0.path}    contents    invalid.'.format(self))
