'Tests invoking FileInput.readline() when os.chmod() raises OSError.
This exception should be silently discarded.'

@unittest.skipIf((not hasattr(os, 'chmod')), 'os.chmod    does    not    exist')
def test_readline_os_chmod_raises_OSError(self):

    os_chmod_orig = os.chmod
    os_chmod_replacement = UnconditionallyRaise(OSError)
    try:
        t = writeTmp(1, ['\n'])
        self.addCleanup(remove_tempfiles, t)
        with FileInput(files=[t], inplace=True) as fi:
            os.chmod = os_chmod_replacement
            fi.readline()
    finally:
        os.chmod = os_chmod_orig
    self.assertTrue(os_chmod_replacement.invoked, 'os.fstat()    was    not    invoked')
