give the C implementation of TextIOWrapper the errors property #6217

This commit is contained in:
Benjamin Peterson 2009-06-06 18:02:12 +00:00
parent 3bbbf18a38
commit 0926ad1f05
7 changed files with 50 additions and 26 deletions

View file

@ -2024,6 +2024,12 @@ class TextIOWrapperTest(unittest.TestCase):
with self.open(filename, 'rb') as f:
self.assertEquals(f.read(), 'bbbzzz'.encode(charset))
def test_errors_property(self):
with self.open(support.TESTFN, "w") as f:
self.assertEqual(f.errors, "strict")
with self.open(support.TESTFN, "w", errors="replace") as f:
self.assertEqual(f.errors, "replace")
class CTextIOWrapperTest(TextIOWrapperTest):