| 208 | # String subclasses are accepted, but they should be converted |
| 209 | # to a standard str without calling any of their methods. |
| 210 | class CustomStr(str): |
| 211 | def splitlines(self, *args, **kwargs): |
| 212 | raise AssertionError() |
| 213 | |
| 214 | def __len__(self): |
| 215 | raise AssertionError() |
| 216 | |
| 217 | def __str__(self): |
| 218 | raise AssertionError() |
| 219 | |
| 220 | write(CustomStr("custom\n"), ["custom"], write_len=7) |
| 221 |