| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Ledger's expression parser considers quoted_rfc4180 to be an
amount (quantity 4180 of commodity "quoted_rfc").
Fixes #2007.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
1. Remove references to modules (exceptions, StringIO) no longer needed for Pythn3
2. Use assertEqual instead of assertEquals
3. Clear journal files with a close_journal_files() function that uses the then-current underlying python_session pointer. Calling session.close_journal_files() sometimes leads to segfaults because python_session has changed after it was injected into the python module (as "session") on module startup.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The github mac runner images added python 3.11 but, unlike 3.10, not via
brew. This causes brew install to fail with link conflict errors now
that boost-python3 switched over to 3.11. Workaround this, and future
python brew link errors, by overwriting all links for python packages.
https://github.com/Homebrew/homebrew-core/commit/8c79089ae410bcd38065dfa3748bbcdb64b228d2
https://github.com/orgs/Homebrew/discussions/3895
https://github.com/actions/setup-python/issues/577
https://github.com/actions/runner-images/issues/6459
https://github.com/actions/runner-images/issues/6507
https://github.com/actions/runner-images/issues/2322
|
| |
|
|
|
|
| |
Fixes #2154
|
|
|
|
| |
Fixes #2149
|
| |
|
|
|
|
|
|
| |
Added ledger.session.error_context()
to py_session.cc to get the error context
message when exceptions are thrown.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In `ledger xml` export, include the `<posting>`-specific payee (from the
`Payee:` tag) as `<payee>`. This data is already included under
`<metadata>` as `<value key="Payee">`, but that is more specific to
Ledger's implementation; if in the future there is another way to set
the payee (or perhaps an option to have the Payee tag in one's own
language), that field wouldn't be a reliable method of getting this
info.
Example:
2022-01-01 Transaction-level payee
a 10
b ; Payee: Posting-level payee
Relevant XML output:
<transaction>
<date>2022-01-01</date>
<payee>Transaction-level payee</payee>
<postings>
<posting>
<account ref="0000558defd6f260">
<name>a</name>
</account>
<post-amount>
<amount>
<quantity>10</quantity>
</amount>
</post-amount>
<total>
<amount>
<quantity>10</quantity>
</amount>
</total>
</posting>
<posting>
<payee>Posting-level payee</payee>
<account ref="0000558defd6f960">
<name>b</name>
</account>
<post-amount>
<amount>
<quantity>-10</quantity>
</amount>
</post-amount>
<note> Payee: Posting-level payee</note>
<metadata>
<value key="Payee">
<string>Posting-level payee</string>
</value>
</metadata>
<total>
<amount>
<quantity>0</quantity>
</amount>
</total>
</posting>
</postings>
</transaction>
|
|
|
|
|
|
| |
to ensure access macros are only called on "legacy" unicode string
objects that are "ready".
See https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_READY
|
|
|
|
|
|
| |
Add test to python/demo.py
Fixes #2132
|
|
|
|
| |
Add test to python/demo.py
|
| |
|
|
|
|
|
|
|
|
| |
replacing it with APIs introduced in Python 3.3 to ensure ledger's
Python bindings continue to function when the legacy Unicode API is
removed in Python 3.12.
For details see https://docs.python.org/3.10/c-api/unicode.html
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, `ledger python -- -c 'raise RuntimeError'` would terminate
messily via SIGABRT, printing the following:
terminate called after throwing an instance of 'int'
[1] 2151711 abort (core dumped) ledger python -c 'raise RuntimeError'
This change makes the python subcommand throw a standard C++ exception
rather than just a plain int, which is never caught and triggers the
SIGABRT. Now, the process prints the uncaught Python exception as
usual and then exits with exit code 1.
|
| |
|
|
|
|
| |
to toggle building ledger's Python bindings.
|
|
|
|
|
| |
to toggle building ledger with support for encrypted journal files
using gpgme.
|
| |
|
| |
|
|
|
|
|
|
| |
to fix failing tests on Darwin, where /tmp is a symlink to /private/tmp
and the tests fail as ledger reports filenames with the symlink resolved
to /private/tmp, but the tests expect files with /tmp.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The --exchange option can accept multiple comma-separated commodities,
but this is only mentioned in one place where --exchange is documented,
and notably not in the Texinfo manual.
Examples made with the following ledger file:
```
P 2022-06-28 USD 54.81 PHP
P 2022-06-28 EUR 58.01 PHP
2022-06-28 * Opening Balances
Equity:Opening Balances
Assets:USD Bank 100 USD
Assets:EUR Bank 100 EUR
Assets:PHP Bank 100 PHP
```
[ci skip]
|
| |
|
|
|
|
|
|
|
|
| |
CMake 3.21.4 reports that compatibility with CMake < 2.8.12 will be
removed from a future version of CMake.
CMake 3.0 has new defaults for MACOSX_RPATH. It seems ledger works fine
with them. See CMake Policy CMP0042 for the details.
|
| |
|
|
|
|
| |
git is now provided by GitHub Actions by default
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes #2061.
|
|
|
| |
resolves #2077
|
|
|
|
| |
Fixes #2049
|
|
|
|
|
|
|
|
|
|
|
| |
In README we provide instructions for how to build Ledger instead of
how to use Ledger. So the sections for Homebrew and Conda are
currently inconsistent with others.
Therefore, we update the two sections to provide installation
instructions for build dependencies.
[ci skip]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In `compare_items` if `sort_order` is a top level expression, it has
no context and `get_context()` method returns the null pointer. To see
this, run
$ ledger -f test/input/demo.ledger --sort display_amount reg --debug scope.symbols
and there will be many lines like
[DEBUG] Binding scope 0 with ...
In such case making a reference to the context is an undefined
behavior (honestly the dereferencing itself feels quite problematic,
but many compilers just run without any complaints) and could
potentially cause segfaults.
Therefore, we change to use only the grandchild scope (`left` or
`right`) for `find_sort_values` here. Note that it may seem to be more
appropriate to use `report` here for the parent scope. However, in
`find_sort_values` which is called right after, the `report` scope is
always bound to this scope. So we only use grandchild scope to avoid
unnecessary operations.
Fixes #2069.
|
| |
|
|
|
|
| |
[ci skip]
|
|
|
|
|
|
|
| |
Here `comm` could be a null pointer (the new test regress/2057 shows
such a case). So test it before dereferencing to avoid segfault.
Re: #2057
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure the path of file to include in `instance_t::include_directive`
is always an absolute path.
Previously when the journal file is given through stdin, we prepend a
"./" to the filename to include. However, in Boost >= 1.77,
`path::normalize` strips the leading "./" [1]. Our `resolve_path`
function calls `normalize` and thus now it returns "file" for "./file"
instead of the previous "./file".
This change causes a failing test regress/BF3C1F82-2 [2], and also
breaks the `include` directive for stdin input:
$ touch file-to-include
$ echo "include file-to-include" | ledger -f - reg
gives
While parsing file "", line 1:
Error: File to include was not found: "file-to-include"
Therefore, we change to prepend the `context.current_directory` to
make the filename absolute in this case as well. The test
regress/BF3C1F82-2 is also updated to match the new output.
Fixes #2075.
[1] https://github.com/boostorg/filesystem/commit/16bd89b7c0398d0dc5904148a865ef3fc3ece7ec
[2] https://github.com/ledger/ledger/issues/2075
|
| |
|
|
|
|
| |
A better fix for this issue is needed, however.
|
|
|
|
|
|
|
|
|
|
|
| |
it is currently not required but set. Incidentally, calling file_size()
on a bash pipe e.g. /proc/self/fd/11 fails with:
Error: boost::filesystem::file_size: Operation not permitted: "/proc/self/fd/11"
when executing ledger as
ledger -f <(cat journal)
|
|
|
|
| |
This reverts commit 7baa0efd71896711e563feb957926433f529d892.
|
| |
|
|
|
|
| |
closes 1948
|