I'm using Odoo and to upload a text file I need to encode it with base64, but encoding removes all '\n' elements and then I have everything in one line. How can I leave those new lines?
with open("Invoices.txt") as text_file:
attachment=text_file.read()
new_attach =attachment.encode('base64')
Just had to open file as 'rb' not 'r'