wligithub/tax-tool

Can't read CSV file due to incorrect csv format of utf-8 and not utf-8-sig.

Closed this issue · 2 comments

@wligithub I am getting an error when the tool tries to read in my gainsloss file. It doesn't like the keyword encoding when I run it. does it have to be a particular version that runs the script? I am on a Macbook Pro M3 chip.

this is what the script kicks out when it errors out:

Traceback (most recent call last):
File "tax.py", line 241, in
main()
File "tax.py", line 38, in main
calc_tax(args.input, output_file, csv_file)
File "tax.py", line 52, in calc_tax
with open(input_file_path, 'r', encoding='utf-8-sig') as file:
TypeError: 'encoding' is an invalid keyword argument for this function

I check the options for encoding when I saved the file using numbers and I only have the option of UTF-8. Line 52 in the script says that encoding is an invalid keyword for the function. Does that mean that the it doesn't matter that the gainloss file is encoded as UTF-8? That the function doesn't have the correct keywords is the problem?

Run using python3. If still have this issue, just remove encoding part in tax.py.

Upgraded to Python3 3.17 and it works now.