(self)
| 427 | return self |
| 428 | |
| 429 | def __next__(self): |
| 430 | self.parse_reset() |
| 431 | |
| 432 | while True: |
| 433 | try: |
| 434 | lineobj = next(self.input_iter) |
| 435 | except StopIteration: |
| 436 | if len(self.field) != 0 or self.state == IN_QUOTED_FIELD: |
| 437 | if self.dialect.strict: |
| 438 | raise Error('unexpected end of data') |
| 439 | self.parse_save_field() |
| 440 | if self.fields: |
| 441 | break |
| 442 | raise |
| 443 | |
| 444 | if not isinstance(lineobj, str): |
| 445 | typ = type(lineobj) |
| 446 | typ_name = 'bytes' if typ == bytes else typ.__name__ |
| 447 | err_str = ('iterator should return strings, not {0}' |
| 448 | ' (did you open the file in text mode?)') |
| 449 | raise Error(err_str.format(typ_name)) |
| 450 | |
| 451 | self.line_num += 1 |
| 452 | for c in lineobj: |
| 453 | if c == '\0': |
| 454 | raise Error('line contains NULL byte') |
| 455 | self.parse_process_char(c) |
| 456 | |
| 457 | self.parse_process_char('\0') |
| 458 | |
| 459 | if self.state == START_RECORD: |
| 460 | break |
| 461 | |
| 462 | fields = self.fields |
| 463 | self.fields = None |
| 464 | return fields |
| 465 | |
| 466 | next = __next__ |
| 467 |
nothing calls this directly
no test coverage detected