egh / ledger-autosync

Synchronize your ledger-cli files with your bank.
GNU General Public License v3.0
273 stars 42 forks source link

One test fails #123

Closed DamienCassou closed 3 years ago

DamienCassou commented 3 years ago

I have a problem with the ledger-autosync package in Nix. Do you have an idea what could be wrong?

running install tests
..LEDGER_FILE environment variable not set, and no .ledgerrc file found, and -l argument was not supplied: running with deduplication disabled. All transactions will be printed!
.......LEDGER_FILE environment variable not set, and no .ledgerrc file found, and -l argument was not supplied: running with deduplication disabled. All transactions will be printed!
.....................F................................................
======================================================================
FAIL: test_ofx_payee_quoting (tests.test_ledger.TestHledger)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/source/tests/test_ledger.py", line 65, in test_ofx_payee_quoting
    self.assertNotEqual(
AssertionError: None == None : Did not find PAYEE TEST"QUOTE in <ledgerautosync.ledgerwrap.HLedger object at 0x7ffff54cb4c0>
-------------------- >> begin captured logging << --------------------
root: DEBUG: hledger -f fixtures/checking.lgr reg -O csv --real
--------------------- >> end captured logging << ---------------------

I have tried with both the latest commit and 1.0.2.

egh commented 3 years ago

Looks like a problem with the recent version of hledger. I can reproduce with 1.21 (hledger below) but not with 1.18 (/usr/bin/hledger below)

🤔 /usr/bin/hledger -f fixtures/checking.lgr reg -O csv --real |grep QUOTE
"12","2011-03-31","","PAYEE TEST""QUOTE","Assets:Foo","$0.01","$0.01"
"12","2011-03-31","","PAYEE TEST""QUOTE","Income:Bar","$-0.01","0"
🤔 hledger -f fixtures/checking.lgr reg -O csv --real |grep QUOTE
"12","2011-03-31","","PAYEE TEST\"\"QUOTE","Assets:Foo","$0.01","$0.01"
"12","2011-03-31","","PAYEE TEST\"\"QUOTE","Income:Bar","$-0.01","0"

The output of the new hledger version looks weird to me - it seems like it is double escaping for csv, first by doubling the quote, then with backslash (\)

egh commented 3 years ago

https://github.com/simonmichael/hledger/commit/4cb9dfb5b8d130b1005fbd5a8fc73e068a7d527f maybe

egh commented 3 years ago

https://github.com/simonmichael/hledger/issues/1552

egh commented 3 years ago

Apparently fixed but unreleased https://github.com/simonmichael/hledger/issues/1508

DamienCassou commented 3 years ago

Awesome, thank you very much!