wligithub/tax-tool

'KeyError' when 'Date Acquired Wash Sale Toggle = On' is 12/31/1969

Closed this issue · 5 comments

Thank you for creating this!

I ran it against my data and received the following error:

Traceback (most recent call last):
  File "/Users/me/Downloads/tax-tool/tax.py", line 199, in <module>
    main()
  File "/Users/me/Downloads/tax-tool/tax.py", line 36, in main
    calc_tax(args.input, output_file, csv_file)
  File "/Users/me/Downloads/tax-tool/tax.py", line 60, in calc_tax
    if row["Symbol"] == "VMW" and row["Record Type"] == "Sell":
KeyError: 'Record Type'

I noticed that in my Gains & Losses file, I had several rows with strange data in the 6th column, Date Acquired Wash Sale Toggle = On. They had the date set to 12/31/1969. Toggling Wash Sale Adjustment and downloading the file again had no effect on this column.

I changed these records so that this field was the same as Date Acquired. The script then ran successfully.

I also have this issue. however my dates all look good.

Try running dos2unix on the csv file.

that did the trick good catch!

Thank you, that fixed it!

If on macOS, use Numbers instead of MS Excel to export the xlsx file as CSV and that works fine.