| 223 | # String subclasses are accepted, but they should be converted |
| 224 | # to a standard str without calling any of their methods. |
| 225 | class CustomStr(str): |
| 226 | def splitlines(self, *args, **kwargs): |
| 227 | raise AssertionError() |
| 228 | |
| 229 | def __len__(self): |
| 230 | raise AssertionError() |
| 231 | |
| 232 | def __str__(self): |
| 233 | raise AssertionError() |
| 234 | |
| 235 | write(CustomStr("custom\n"), ["custom"], write_len=7) |
| 236 |