The example given in the documentation:
att_content = base64.b64encode(att_file.read())
does not work, because the content string in the generated XML has a leading literal "b" and is enclosed with quotes (b'XXXXX' instead of just XXXXX). As a result, the contents is stored in OTRS but unreadable due to those unwanted characters.
As a workaround, I was obliged to do:
att_content = base64.b64encode(att_file.read()).decode('utf-8')
But the root cause of this is probably a bug in the way "unicode" function is defined in client.py when using python 3.
Not sure yet if it's indeed related to this "unicode" function, however docs should be correct of course. I'm leaning towards scrapping Python 2 compatibility altogether and simplify some of these things.
The example given in the documentation: att_content = base64.b64encode(att_file.read()) does not work, because the content string in the generated XML has a leading literal "b" and is enclosed with quotes (b'XXXXX' instead of just XXXXX). As a result, the contents is stored in OTRS but unreadable due to those unwanted characters.
As a workaround, I was obliged to do: att_content = base64.b64encode(att_file.read()).decode('utf-8')
But the root cause of this is probably a bug in the way "unicode" function is defined in client.py when using python 3.