New issue 146: bean-format fails on currencies that contain "_" (underscore)
https://bitbucket.org/blais/beancount/issues/146/bean-format-fails-on-currencies-that

Stefano Zacchiroli:

The following beancount input:
```
#!beancount

1970-01-01 open Equity:Opening-balances
1970-01-01 open Assets:Investments

2014-03-31 * "opening"
  Assets:Investments                 1.23 FOO_BAR
  Equity:Opening-balances
```
passes bean-check just fine, but makes bean-format fail with an assertion error:
```
#!

Traceback (most recent call last):
  File "/home/zack/.local/bin/bean-format", line 2, in <module>
    from beancount.scripts.format import main; main()
  File 
"/home/zack/.local/lib/python3.5/site-packages/beancount/scripts/format.py", 
line 154, in main
    formatted_contents = align_beancount(contents)
  File 
"/home/zack/.local/lib/python3.5/site-packages/beancount/scripts/format.py", 
line 81, in align_beancount
    assert (old_stripped == new_stripped), (old_stripped, new_stripped)
AssertionError: ('1970-01-01 open Equity:Opening-balances 1970-01-01 open 
Assets:Investments 2014-03-31 * "opening" Assets:Investments 1.23 FOO_BAR 
Equity:Opening-balances', '1970-01-01 open Equity:Opening-balances 1970-01-01 
open Assets:Investments 2014-03-31 * "opening" Assets:Investments 
Equity:Opening-balances')
```
By the look of it, it's possible that just an "_" is missing in the final part 
of the regex in python/beancount/scripts/format.py:align_beancount(). But I 
haven't tested the fix yet.


-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20161109160926.13738.19595%40celery-worker-105.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to