[issue1812] doctest _load_testfile function -- newline handling seems incorrect

Éric Araujo report at bugs.python.org
Wed Feb 12 20:25:34 EST 2020


Éric Araujo <merwok at netwok.org> added the comment:

Ah, I got it wrong, get_data itself uses `rb`, not default `r`.
It makes sense given that package data could be any kind of file, not necessarily text.  Too bad there isn’t a `get_text(encoding)` method in the loader API!

With Python 3’s rich IO system, isn’t there a quick and correct way to get a text file from a bytes stream?  TextIOWrapper?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1812>
_______________________________________


More information about the Python-bugs-list mailing list