eprbell / rp2

Privacy-focused, free, open-source cryptocurrency tax calculator for multiple countries: it handles multiple coins/exchanges and computes long/short-term capital gains, cost bases, in/out lot relationships/fractioning, and account balances. It supports FIFO, LIFO, HIFO and it outputs in form 8949 format. It has a programmable plugin architecture
https://pypi.org/project/rp2/
Apache License 2.0
256 stars 42 forks source link

Exception when executing #80

Closed gbtorrance closed 1 year ago

gbtorrance commented 1 year ago

I hope you can help. I'm trying to run RP2 for the first time on some initial files I've created, and I'm receiving the following exception:

rp2_us -m fifo -o output test_config.ini RP2_Input.ods 
INFO: Country: us
INFO: Generation Language: en
ERROR: Fatal exception occurred:
Traceback (most recent call last):
  File "/home/mint21/.local/lib/python3.10/site-packages/rp2/rp2_main.py", line 70, in _rp2_main_internal
    configuration: Configuration = Configuration(
  File "/home/mint21/.local/lib/python3.10/site-packages/rp2/configuration.py", line 76, in __init__
    json_configuration: Any = json.load(configuration_file)
  File "/usr/lib/python3.10/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)

My test_config.ini file is as follows:

[in_header]
timestamp = 0
asset = 4
exchange = 1
holder = 2
transaction_type = 3
spot_price = 6
crypto_in = 5
fiat_in_no_fee = 7
fiat_in_with_fee = 8
fiat_fee = 9
notes = 10

[general]
assets = BTC
exchanges = Unknown
holders = Greg

I'm running Python 3.10.4 on Linux Mint 21 (running in a VirtualBox Guest VM).

Thoughts? Thanks!

gbtorrance commented 1 year ago

I get the same exception when running the "crypto_example" files here, so it's apparently nothing to do with my ini or ods files, but rather with my installation?

gbtorrance commented 1 year ago

I had version 1.2.0 installed, but upgraded to 1.3.1 and now it works. Sorry for any inconvenience. Thanks.

eprbell commented 1 year ago

Ah, yes: JSON-format for configuration files was deprecated in version 1.3.0 (see the changelog). Glad you already resolved the issue!