Hi Martin, Happy New Year!
I wasn't sure if this should be entered as an issue, thought I would let you decide. I am working on importing my credit card statements by running bean-extract and saving to a file, copying the credit card opening statement and expenses to the new file, and then adding the other half of the transactions. When I ran bean-check on the completed file, I got the following error. I figured I must have missed something in the new file, so I copied all the completed transactions to my normal beancount file, which had passed bean-check. It then incurred the same error. By process of elimination, I found I had missed putting the 'USD' after a transaction. After adding the 'USD', bean-check worked fine. Your code seems to handle most other errors, so I didn't think the Traceback was your way of notifying of a syntax error. Jonathan Enter code here...JFSMini1:Beancount$ bean-check jfsgmsbgn.bean Traceback (most recent call last): File "/usr/local/bin/bean-check", line 2, in <module> from beancount.scripts.check import main; main() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/scripts/check.py", line 39, in main extra_validations=validation.HARDCORE_VALIDATIONS) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/loader.py", line 87, in load_file extra_validations, encoding) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/loader.py", line 200, in wrapped result = function(toplevel_filename, *args, **kw) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/loader.py", line 219, in _load_file return _load([(filename, True)], *args, **kw) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/loader.py", line 460, in _load extra_validations) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/ops/validation.py", line 395, in validate new_errors = validation_function(entries, options_map) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/ops/validation.py", line 348, in validate_check_transaction_balances "Transaction does not balance: {}".format(residual), File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/core/inventory.py", line 104, in __str__ return self.to_string() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/core/inventory.py", line 96, in to_string ', '.join(pos.to_string(dformat) for pos in sorted(self))) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/core/position.py", line 228, in __lt__ return self.sortkey() < other.sortkey() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beancount/core/position.py", line 210, in sortkey order_units = CURRENCY_ORDER.get(currency, NCURRENCIES + len(currency)) TypeError: object of type 'type' has no len() -- 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+unsubscr...@googlegroups.com. To post to this group, send email to beancount@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/df2169e7-a716-496d-9eb8-d38ea670c4da%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.