News for hackers. Stuff that matters.
Re:Why Is the Migration to Python 3 Taking So Long? by test7777 on Thursday November 14, 2019 @03:53PM (#21539272)
unix pipes (stdin, stdout) are bytes, files are bytes, filenames are bytes. yet, for some reason python3 thinks al of those are text. its not the coders that are wrong, it is the language.
Re:Why Is the Migration to Python 3 Taking So Long? by kstrauser on Thursday November 14, 2019 @04:01PM (#21539354)
No, it's Python 2 that thinks those are all text. Python 3 makes you explicitly say "convert this stream of bytes into a text encoded string", and from then on it's a str object.

Python 2 was happy to (try to) let you call text methods on a JPEG. Python 3 draws an appropriate distinction between the two.

Re:Why Is the Migration to Python 3 Taking So Long? by test7777 on Sunday November 17, 2019 @07:06AM (#21557587)
Python 2's "str" is a bytestring. All of those are bytestrings in Python 2 as they should be. Python 3 makes them text and suddenly i can not output data over stdout anymore without extra steps of switching the mode of stdout from some arbitrary text default.
Re:Why Is the Migration to Python 3 Taking So Long? by joshuamorton on Thursday November 14, 2019 @04:11PM (#21539467)
kstrauer is right, but I'll elaborate and say that places where you are interfacing with Unix threads are input boundaries, so having the programmer make a choice makes sense. Arbitrary switching within a program does not.
Re:Why Is the Migration to Python 3 Taking So Long? by test7777 on Sunday November 17, 2019 @08:06AM (#21557754)
the issue is that the language arbitrarily decides those things should be treated as text with some arbitrary encoding when all of them are decidedly not text.