diff -r 65f96010b35c Lib/test/test_os_jy.py --- a/Lib/test/test_os_jy.py Fri Feb 06 20:21:15 2015 -0700 +++ b/Lib/test/test_os_jy.py Fri Feb 20 11:51:50 2015 -0800 @@ -58,6 +58,21 @@ else: self.assertTrue(False) + def test_issue2068(self): + os.remove(test_support.TESTFN) + for i in range(2): + fd = os.open(test_support.TESTFN, os.O_RDWR | os.O_CREAT | os.O_APPEND) + try: + os.write(fd, bytes('one')) + os.write(fd, bytes('two')) + os.write(fd, bytes('three')) + finally: + fd.close() + + with open(test_support.TESTFN, 'rb') as f: + content = f.read() + self.assertEqual(content, 2 * b'onetwothree') + class OSDirTestCase(unittest.TestCase):