2to3?
2to3?
Posted May 30, 2025 21:46 UTC (Fri) by Cyberax (✭ supporter ✭, #52523)In reply to: 2to3? by mb
Parent article: Recent disruptive changes from Setuptools
And I would take that over Py3 string mess. It could have been easily fixed by just setting the string encoding to utf-8.
> If you handle strings you *need* to be aware of (2). Always.
No, you don't. If you're only using string operations for protocol-level stuff, like splitting the HTTP headers on a ":" character, then you can just treat strings as bags of bytes. Same for filesystem operations.
Posted May 30, 2025 21:49 UTC (Fri)
by mb (subscriber, #50428)
[Link] (1 responses)
Posted May 30, 2025 21:58 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link]
That is correct. The problem is that the type for string literals in Python is, well, a string. It pops up in a myriad of places in the standard library.
For example, the exception message is (you guessed it) a string.
> That's trivially true and I don't see the problem. Just use bytes.
Well, I recommend you to try your own advice.
2to3?
That's trivially true and I don't see the problem. Just use bytes.
2to3?
