You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently all of the streaming APIs we're providing are byte-wise. We ought to also support text-decoding interfaces.
This would likely mean that we'd want stream(text=True). Difficulties here are that we don't have .apparent_encoding available to us prior to the content being available. We'd need to use chardet's incremental decoding as well as an incremental decoder
I'd suggest we'd want to implement this by adding a TextDecoder(encoding=None) class to decoders.py that takes the charset_encoding as it's initial argument. It would implement the same interface as the existing decoders, except returning str.
Aside: It's possible that in the future we might start to move more into line with requests' iter_content() and iter_lines().
Activity
graingert commentedon Jul 10, 2019
having incrementally decoding File like and StreamReader wrapper objects would be amazing contributions to the chardet project chardet/chardet#154