True. Embedding the guilty strings/bytes could be a solution, but that's an issue in and of itself.
The best way I've found to deal with this is to decide if something uses bytes or text and only use that inside the function, the only exception being is if something is going from bytes to text or vice versa.
But that still runs the risk of the error happening in code I didn't write (in which case, I check their issue tracker).
1
u/[deleted] Nov 24 '16
True. Embedding the guilty strings/bytes could be a solution, but that's an issue in and of itself.
The best way I've found to deal with this is to decide if something uses bytes or text and only use that inside the function, the only exception being is if something is going from bytes to text or vice versa.
But that still runs the risk of the error happening in code I didn't write (in which case, I check their issue tracker).