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

Invalid ledger file encoding #94

Open
artkpv opened this issue Nov 7, 2016 · 0 comments
Open

Invalid ledger file encoding #94

artkpv opened this issue Nov 7, 2016 · 0 comments

Comments

@artkpv
Copy link

artkpv commented Nov 7, 2016

Thanks for the great tool! Here is an error.

Given file in UTF-8, under Windows 10, Powershell 5, Python 3, I call:

py -3 .\icsv2ledger\icsv2ledger.py -c .icsv2ledgerrc -a ROCKET --quiet --encoding utf-8 .\rub.pdf.csv

And it breaks with:

Traceback (most recent call last):
  File ".\icsv2ledger\icsv2ledger.py", line 867, in <module>
    main()
  File ".\icsv2ledger\icsv2ledger.py", line 744, in main
    csv_comments = csv_from_ledger(options.ledger_file)
  File ".\icsv2ledger\icsv2ledger.py", line 579, in csv_from_ledger
    for line in f:
  File "C:\Users\art\AppData\Local\Programs\Python\Python35-32\lib\encodings\cp1251.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 1020: character maps to <undefined>

How to fix it?

UPDATE.

578:    with open(ledger_file) as f:
579:        for line in f:

artkpv added a commit to artkpv/icsv2ledger that referenced this issue Nov 7, 2016
@artkpv artkpv changed the title Invalid infile encoding Invalid ledger file encoding Nov 7, 2016
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

1 participant