from beancount import loaderfrom beancount.parser import printer
# example file, generated by beancountfilename='example.beancount'
entries, errors, options = loader.load_file(filename)
for entry in entries: printer.print_entry(entry)Traceback (most recent call last): File "C:\_code\fava&BC testing\test.py", line 14, in <module> printer.print_entry(entry) File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\beancount\parser\printer.py", line 351, in print_entry output = file or codecs.getwriter("utf-8")(sys.stdout.buffer)AttributeError: 'PseudoOutputFile' object has no attribute 'buffer'--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/c47d8b86-2da8-4900-b94c-9fa27877c379%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bean...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/7ae93ead-2718-413f-b6a9-558ef79b10af%40googlegroups.com.
There's a related discussion here:I could potentially change this code to wrap the output encoder differently, or encode explicitly and write bytes.Problem is, I don't have access to a Windows box, so I can't really test the differences there.If someone's up for it, test a few of the options in the thread and let me know which works on Windows and I'll make the adjustment.
printer.print_entry(entry,file=open('output.txt','a'))