(self)
| 3859 | wrapper.reconfigure(encoding="locale") |
| 3860 | |
| 3861 | def test_reconfigure_encoding_read(self): |
| 3862 | # latin1 -> utf8 |
| 3863 | # (latin1 can decode utf-8 encoded string) |
| 3864 | data = 'abc\xe9\n'.encode('latin1') + 'd\xe9f\n'.encode('utf8') |
| 3865 | raw = self.BytesIO(data) |
| 3866 | txt = self.TextIOWrapper(raw, encoding='latin1', newline='\n') |
| 3867 | self.assertEqual(txt.readline(), 'abc\xe9\n') |
| 3868 | with self.assertRaises(self.UnsupportedOperation): |
| 3869 | txt.reconfigure(encoding='utf-8') |
| 3870 | with self.assertRaises(self.UnsupportedOperation): |
| 3871 | txt.reconfigure(newline=None) |
| 3872 | |
| 3873 | def test_reconfigure_write_fromascii(self): |
| 3874 | # ascii has a specific encodefunc in the C implementation, |
nothing calls this directly
no test coverage detected