07-16-2020, 03:35 PM
(This post was last modified: 07-16-2020, 03:35 PM by remkonoteboom.)
Somehow, one of the elements in the array "M" is still a bytes type even though even though this code:
i supposed to decode it into a string. I can see in our code, that the exceptions are just "pass". Could you actually print out "e" or call "raise" instead or "pass" to see exactly if there are any errors?
Also, we are using "writelines" to quickly take in the entire array at once. Maybe replacing:
with
will show exactly which line is causing the error.
Code:
for l in L:
try:
l = l.decode()
except UnicodeDecodeError as e:
pass
except AttributeError as e:
pass
M.append(l)
M.append(CRLF)
i supposed to decode it into a string. I can see in our code, that the exceptions are just "pass". Could you actually print out "e" or call "raise" instead or "pass" to see exactly if there are any errors?
Also, we are using "writelines" to quickly take in the entire array at once. Maybe replacing:
Code:
buf.writelines(M)
with
Code:
for m in M:
print(m)
buf.write(m)
will show exactly which line is causing the error.