simon-v / bean-add

A beancount transaction entry assistant (GitHub mirror)
https://simonvolpert.com/bean-add/
Apache License 2.0
31 stars 2 forks source link

AttributeError when calling on empty file #2

Closed matthiasbeyer closed 8 years ago

matthiasbeyer commented 8 years ago

I did:

touch /tmp/test
bean-add /tmp/test

and I got:

Traceback (most recent call last):
  File "/nix/store/0ifv12y2fh63ak30c6b3c6sczi776ixr-bean-add-2016-09-29-76945c320e6f028223e4420956c80c421c4fe74a/bin/.bean-add-wrapped", line 149, in <module>
    data.saved = data.journal.copy()
AttributeError: 'list' object has no attribute 'copy'

I use nixos (and I'm packaging bean-add for it right now), hence the long path to the bean-add binary.

simon-v commented 8 years ago

The list.copy() method is in Python 3, but not in Python 2; And bean-add just so happens to be written in Python 3. Perhaps i should've been more explicit about that.

In any case, even with that solved, you wouldn't be able to run bean-add on an empty file anyway, because i seem to have neglected to plan for that possibility. Oops. I'll get to it, i guess.

matthiasbeyer commented 8 years ago

Awesome! Feel free to ping me as soon as this is implemented. I will then update the package.

simon-v commented 8 years ago

I think i'm done; Is there anything else you need for the packaging?

matthiasbeyer commented 8 years ago

No, we struggle a bit packaging it, but that's an issue on our side, I guess. Your latest changes won't be packaged in the first step, but I'll file an update for the package after the build succeeds and we can use it. Currently we're packaging 76945c320e6f028223e4420956c80c421c4fe74a.

Thank you for your help!