In open_text, just wrap open_binary. Saves a lot of repetition.
In reviewing the code and attempting to understand the processes, I noticed that open_binary
and open_text
were nearly identical. In fact, these two implementations are functionally identical except that instead of using io.open
to decode text, the data is always read as binary and always wrapped in the TextIOWrapper
. This change reduces the amount of repetitive code substantially and reduces the Python version variance. Is there any downside?