Bug 1215 - printer --raw has buffer restriction of 8192
Summary: printer --raw has buffer restriction of 8192
Alias: None
Product: Ledger
Classification: Unclassified
Component: misc (show other bugs)
Version: 3.1.1
Hardware: PC Linux
: P5 enhancement
Assignee: John Wiegley
Depends on:
Reported: 2017-07-13 14:16 UTC by Martin Michlmayr
Modified: 2017-07-13 14:17 UTC (History)
0 users

See Also:

Test case (8.05 KB, text/plain)
2017-07-13 14:17 UTC, Martin Michlmayr

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2017-07-13 14:16:28 UTC
I get:

ledger -f tmp --sort d print --raw > /dev/null
Error: Assertion failed in "/build/ledger-n7b8wc/ledger-3.1.2~pre1+g3a00e1c+dfsg1/src/error.cc", line 91:ledger::string ledger::source_context(const path&, istream_pos_type, istream_pos_type, const string&): len < 8192

This does not happen without --raw.

The test file is attached.

It basically looks like this:

2017-01-01 * Opening balance
    ; :opening-balance:
    Assets:Investments       1.00 AAPL {{1.00 EUR}} [2016-01-01] @@ 1.00 EUR
    Assets:Investments       1.00 AAPL {{1.00 EUR}} [2016-01-01] @@ 1.00 EUR
    Equity:Opening balance

The 1 AAPL is repeated so often the entry is larger than 8192 bytes.  Obviously, this is just a test case but I came across this with my ledger file - it's an opening balance for the new year for an investment account which contains lots of small lots.
Comment 1 Martin Michlmayr 2017-07-13 14:17:07 UTC
Created attachment 134 [details]
Test case