Reproducible bug on the "next" branch

24 views
Skip to first unread message

Samuel Tardieu

unread,
Apr 29, 2013, 4:41:07 PM4/29/13
to ledge...@googlegroups.com
The following file does not work with ledger on the "next" branch, while it works fine with "master".

Of course, this is not a real file, it is a reduced example coming from a multi-k lines ledger.

% cat x.dat
2011-12-26 X
    A:B                          30.00€
    A:C:D
% ledger -f x.dat --sort date bal
While comparing if 0 is less than 2011/12/26:
Error: Cannot compare an integer to a date

  Sam

Craig Earls

unread,
Apr 29, 2013, 4:43:56 PM4/29/13
to ledge...@googlegroups.com
What is your date format set to in .ledgerrc?
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Ledger" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ledger-cli+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

Samuel Tardieu

unread,
Apr 29, 2013, 4:46:06 PM4/29/13
to ledge...@googlegroups.com



2013/4/29 Craig Earls <ende...@gmail.com>

What is your date format set to in .ledgerrc?

I have removed the .ledgerrc for the purpose of this test.

Using the date format I usually use, it gives the same thing:

% ledger -f x.dat --sort date bal --date-format "%Y-%m-%d"

Craig Earls

unread,
Apr 29, 2013, 4:47:36 PM4/29/13
to ledge...@googlegroups.com
Thanks. Does it happen if there are two xacts in the file?

Samuel Tardieu

unread,
Apr 29, 2013, 4:52:06 PM4/29/13
to ledge...@googlegroups.com



2013/4/29 Craig Earls <ende...@gmail.com>

Thanks.  Does it happen if there are two xacts in the file?

You mean more than one? Sure, it comes from a multi-file transactions.

Craig Earls

unread,
Apr 29, 2013, 4:55:58 PM4/29/13
to ledge...@googlegroups.com
Interesting. I just tried it and can repeat it. It is certainly a
bug, but I am not sure why you would be sorting by date on a balance
report. This is more of an unexpected error...

Samuel Tardieu

unread,
Apr 29, 2013, 4:59:20 PM4/29/13
to ledge...@googlegroups.com



2013/4/29 Craig Earls <ende...@gmail.com>

Interesting.  I just tried it and can repeat it.  It is certainly a
bug, but I am not sure why you would be sorting by date on a balance
report.  This is more of an unexpected error...

As I said, this is a reduced test case, to help narrowing down the problem.

In the real case, my .ledgerrc contains:

 --wide
--date-format %Y-%m-%d
--sort date,amount
--pedantic
--effective
--start-of-week 1
--file [REDACTED]
--no-color

So the date-format and sort are always defined, including when they are not used (such as bal), which means that the balances cannot be printed.

Craig Earls

unread,
Apr 29, 2013, 5:03:10 PM4/29/13
to ledge...@googlegroups.com
I haven't used master in a long time. What version is it showing? I
think it might still be a 2.6

Samuel Tardieu

unread,
Apr 29, 2013, 5:08:35 PM4/29/13
to ledge...@googlegroups.com

2013/4/29 Craig Earls <ende...@gmail.com>

I haven't used master in a long time.  What version is it showing?  I
think it might still be a 2.6


Nope. It gives me: (build from 20 minutes ago)

% ledger --version
Ledger 3.0.0-20120518, the command-line accounting tool

Copyright (c) 2003-2012, John Wiegley.  All rights reserved.

This program is made available under the terms of the BSD Public License.
See LICENSE file included with the distribution for details and disclaimer.

Reply all
Reply to author
Forward
0 new messages