Encoding iterator. Encodes the input strings from the iterator using an IncrementalEncoder. errors and kwargs are passed through to the IncrementalEncoder constructor.
(iterator, encoding, errors='strict', **kwargs)
| 1041 | return lookup(encoding).streamwriter |
| 1042 | |
| 1043 | def iterencode(iterator, encoding, errors='strict', **kwargs): |
| 1044 | """ |
| 1045 | Encoding iterator. |
| 1046 | |
| 1047 | Encodes the input strings from the iterator using an IncrementalEncoder. |
| 1048 | |
| 1049 | errors and kwargs are passed through to the IncrementalEncoder |
| 1050 | constructor. |
| 1051 | """ |
| 1052 | encoder = getincrementalencoder(encoding)(errors, **kwargs) |
| 1053 | for input in iterator: |
| 1054 | output = encoder.encode(input) |
| 1055 | if output: |
| 1056 | yield output |
| 1057 | output = encoder.encode("", True) |
| 1058 | if output: |
| 1059 | yield output |
| 1060 | |
| 1061 | def iterdecode(iterator, encoding, errors='strict', **kwargs): |
| 1062 | """ |
nothing calls this directly
no test coverage detected
searching dependent graphs…