1👍
✅
One of the strings probably contains some trailing characters that print
isn’t showing. If you use repr
then you should be able to see what the difference is.
print(repr(key_session))
print(repr(key_db))
You can then strip any characters as necessary before encoding the string, for example:
key_session = key_session.rstrip('\x02')
Source:stackexchange.com