News for hackers. Stuff that matters.
Re:Pip has dropped support for Python 2 by tsimionescu on Sunday January 24, 2021 @04:25PM (#25896228)
And what is wrong with an invalid UTF-8 string? Why were you truncating the string in the first place?

Basically, I believe the point here is that a Unicode aware truncation should be done in a Unicode aware truncate method. There is no good reason to parse a string as UTF-8 ahead of time - just keep it as a blob of bytes until you need to do some something "texty" with it. It is the truncate-at-word-boundaries() method that should interpret the bytes as UTF-8 and fail if they are not valid. Why parse it sooner?

There are no comments on this comment yet.