4 ms·
If there's a mix of byte and unicode strings then 2to3 won't work. Consider: with open("a", "rb") as f: with open("b", "w") as g: g.write(">" + f.
by eesmith 6y ago
If there's a mix of byte and unicode strings then 2to3 won't work. Consider:
with open("a", "rb") as f:
with open("b", "w") as g:
g.write(">" + f.read(1))
There are also conversions in Python 2 between byte and string which aren't supported in Python 3:
s = "123".encode("hex")
t = "abcd".decode("hex")