I've found Python3's open("filename", "r", encoding="ascii", errors="surrogateescape") to be useful. How do I wrap an io.BytesIO() (or any not-a-real-file source of bytes) to create a text-mode file-like object with the same decoding behavior?
That's what TextIOWrapper does.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With