Issue #360: invalid beancount file: ValueError: '=' alignment not allowed in string format specifier (blais/beancount)

10 views
Skip to first unread message

Martin Michlmayr

unread,
Jan 17, 2019, 8:19:05 PM1/17/19
to bean...@googlegroups.com
New issue 360: invalid beancount file: ValueError: '=' alignment not allowed in string format specifier
https://bitbucket.org/blais/beancount/issues/360/invalid-beancount-file-valueerror

Martin Michlmayr:

This invalid file leads to:

```
1970-01-01 open Assets:Cash
1970-01-01 open Equity:Adjustments

2014-04-10 txn "Adjustment"
Assets:Cash
Equity:Adjustments
```

```
Traceback (most recent call last):
File "/home/tbm/.local/bin/bean-check", line 6, in <module>
sys.exit(main())
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/scripts/check.py", line 40, in main
extra_validations=validation.HARDCORE_VALIDATIONS)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/loader.py", line 90, in load_file
_log_errors(errors, log_errors)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/loader.py", line 128, in _log_errors
printer.print_errors(errors, file=log_errors)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/parser/printer.py", line 444, in print_errors
output.write(format_error(error))
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/parser/printer.py", line 414, in format_error
error_string = '\n'.join(format_entry(entry) for entry in entries)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/parser/printer.py", line 414, in <genexpr>
error_string = '\n'.join(format_entry(entry) for entry in entries)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/parser/printer.py", line 339, in format_entry
return EntryPrinter(dcontext, render_weights)(entry)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/parser/printer.py", line 117, in __call__
method(obj, oss)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/parser/printer.py", line 201, in Transaction
oss.write(fmt(account, position_str))
ValueError: '=' alignment not allowed in string format specifier
```


Reply all
Reply to author
Forward
0 new messages