Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: list indices must be integers, not str #3

Closed
CoolSpot opened this issue Apr 16, 2018 · 4 comments
Closed

TypeError: list indices must be integers, not str #3

CoolSpot opened this issue Apr 16, 2018 · 4 comments

Comments

@CoolSpot
Copy link
Contributor

Sorting the buy and sell orders by time
Traceback (most recent call last):
File "CoinTaxes.py", line 166, in
main()
File "CoinTaxes.py", line 135, in main
buys_sorted = sorted(buys, key=lambda buy_order: buy_order['order_time'])
File "CoinTaxes.py", line 135, in
buys_sorted = sorted(buys, key=lambda buy_order: buy_order['order_time'])
TypeError: list indices must be integers, not str

I suspect it was caused by fix_orders() because it appends lists instead of objects into buys and sells lists.

@nitrocode
Copy link
Owner

Thanks for finding this! I'll have to step through when I have some more time. As always, PRs are accepted.

@robbpf
Copy link

robbpf commented May 26, 2018

Having similar issues with the latest commits available, any thoughts?

Normal Mode
Connected to GDAX.
Traceback (most recent call last):
File "C:/Users/XXXX/PycharmProjects/CoinTaxes/CoinTaxes.py", line 160, in
main()
File "C:/Users/XXXX/PycharmProjects/CoinTaxes/CoinTaxes.py", line 113, in main
exchange_buys, exchange_sells = exchange.get_buys_sells()
File "C:\Users\XXXX\PycharmProjects\CoinTaxes\exchanges\gdax_reader.py", line 140, in get_buys_sells
if account['currency'] == 'USD':
TypeError: string indices must be integers

Debug Mode
C:\Users\XXXX\AppData\Local\Programs\Python\Python36-32\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 64403 --file C:/Users/XXXX/PycharmProjects/CoinTaxes/CoinTaxes.py
pydev debugger: process 437820 is connecting

Connected to pydev debugger (build 181.4668.75)
Connected to GDAX.
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev\pydevd.py", line 1664, in
main()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev\pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev\pydevd.py", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/XXXX/PycharmProjects/CoinTaxes/CoinTaxes.py", line 160, in
main()
File "C:/Users/XXXX/PycharmProjects/CoinTaxes/CoinTaxes.py", line 113, in main
exchange_buys, exchange_sells = exchange.get_buys_sells()
File "C:\Users\XXXX\PycharmProjects\CoinTaxes\exchanges\gdax_reader.py", line 140, in get_buys_sells
if account['currency'] == 'USD':
TypeError: string indices must be integers

Process finished with exit code 1

@nitrocode
Copy link
Owner

@CoolSpot @robbpf apologies. It's been a while since I've updated. Do you still notice this issue?

@CoolSpot
Copy link
Contributor Author

Yes, it is still in latest master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants