In short, Uthey bdonโt go together.
Python 3 PEP-3116 -. open() , , b Buffered*, TextIOWrapper. , b , .
, open() , . mode U , newline.
, U . , , , .
Python 2 -. io.open(), , Python 3. open(), C file ( : (), , get_line()), . , .
, : . Python 3 , - . b , U, . Python 2 , b, U .
:
$ printf '1\n2\r\n3\n\r4\r5' > f
$ ipython3.3
In [1]: open('f', 'Ub').read()
Out[1]: b'1\n2\r\n3\n\r4\r5'
$ ipython2.7
In [1]: import io
In [2]: io.open('f', 'Ub').read()
Out[2]: '1\n2\r\n3\n\r4\r5'
In [3]: open('f', 'Ub').read()
Out[3]: '1\n2\n3\n\n4\n5'