I am reading from a file that contains byte data but when I open the file and store the readline data into a variable it stores it in a string with backslash escapes, So when trying to decode that data I am getting the exact string data and not actually decoding.
File Example:
b'\xe0\xa8\xaa\xe0\xa9\xb0\xe0\xa8\x9c\xe0\xa8\xbe\xe0\xa8\xac\xe0\xa9\x80'
b'\xd9\xbe\xd9\x86\xd8\xac\xd8\xa7\xd8\xa8\xdb\x8c'
b'\xd9\xbe\xda\x9a\xd8\xaa\xd9\x88'
readline
returns:
"b'\\xe0\\xa8\\xaa\\xe0\\xa9\\xb0\\xe0\\xa8\\x9c\\xe0\\xa8\\xbe\\xe0\\xa8\\xac\\xe0\\xa9\\x80'"
I get why there is an extra backslash, but I don't know how to remove it or read the file without it.
I have tried to replace those double backslashes but that raises an EOL error.