Decoding iterator. Decodes the input strings from the iterator using an IncrementalDecoder. errors and kwargs are passed through to the IncrementalDecoder constructor.
(iterator, encoding, errors='strict', **kwargs)
| 1054 | yield output |
| 1055 | |
| 1056 | def iterdecode(iterator, encoding, errors='strict', **kwargs): |
| 1057 | """ |
| 1058 | Decoding iterator. |
| 1059 | |
| 1060 | Decodes the input strings from the iterator using an IncrementalDecoder. |
| 1061 | |
| 1062 | errors and kwargs are passed through to the IncrementalDecoder |
| 1063 | constructor. |
| 1064 | """ |
| 1065 | decoder = getincrementaldecoder(encoding)(errors, **kwargs) |
| 1066 | for input in iterator: |
| 1067 | output = decoder.decode(input) |
| 1068 | if output: |
| 1069 | yield output |
| 1070 | output = decoder.decode(b"", True) |
| 1071 | if output: |
| 1072 | yield output |
| 1073 | |
| 1074 | ### Helpers for charmap-based codecs |
| 1075 |
nothing calls this directly
no test coverage detected