beancount/ledger2beancount

regression in 2.4: "Cannot parse commodity format information"

zacchiro opened this issue · 3 comments

since version 2.4, ledger2beancount fails on this commodity directive:

commodity CTGXXV
    note Core Series - Core Target Allocation 25
    format 1000.000 CTG25
    ; fineco-name: CORE TG ALL 25 E ACC

with the following error:

$ ledger2beancount --config ledger2beancount.nohead.yml commodities.ledger | sponge commodities.beancount
Cannot parse commodity format information: 25 at /home/zack/bin/ledger2beancount line 1591.

I'm not sure exactly which line causes the failure, but it should be that directive as it's the only one that has 25 among my commodities.

tbm commented
format 1000.000 CTG25

I'd argue that this input file is invalid because CTG25 should be a quoted commodity, so it would have to be "CTG25" and that is accepted.

I'm not sure what to do about this. Obviously ledger accepts it, so arguably it should be accepted, but imho it's incorrect and ledger should reject it.

tbm commented

hledger rejects it:

commodity directive symbol "CTGXXV" and format directive symbol "CTG25" should be the same

right, i'm OK with closing this :)