1

What is the difference between using codecs.StreamReader and io.TextIOWrapper on a binary stream?

#!/usr/bin/env python3

import codecs
import io

stream = io.BytesIO(b'abc')
#reader = codecs.getreader('utf-8')(stream)
reader = io.TextIOWrapper(stream)
print(reader, reader.read())
Cyker
  • 9,946
  • 8
  • 65
  • 93

0 Answers0