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

OfxParser.parse fails: unknown encoding: cpNONE #154

Open
fugwort opened this issue Nov 15, 2019 · 0 comments · May be fixed by #163
Open

OfxParser.parse fails: unknown encoding: cpNONE #154

fugwort opened this issue Nov 15, 2019 · 0 comments · May be fixed by #163

Comments

@fugwort
Copy link

fugwort commented Nov 15, 2019

I downloaded some transactions from my bank using ofxget to a file. I I tried to parse the file with OfxParser.parse and got this:
Traceback (most recent call last): File "./ofxParseTest.py", line 37, in <module> main() File "./ofxParseTest.py", line 11, in main ofx = OfxParser.parse(fileobj) File "/home/yates/.local/lib/python3.7/site-packages/ofxparse/ofxparse.py", line 387, in parse ofx_file = OfxPreprocessedFile(file_handle) File "/home/yates/.local/lib/python3.7/site-packages/ofxparse/ofxparse.py", line 147, in __init__ super(OfxPreprocessedFile, self).__init__(fh) File "/home/yates/.local/lib/python3.7/site-packages/ofxparse/ofxparse.py", line 78, in __init__ self.handle_encoding() File "/home/yates/.local/lib/python3.7/site-packages/ofxparse/ofxparse.py", line 125, in handle_encoding codec = codecs.lookup(encoding) LookupError: unknown encoding: cpNONE
The first few lines of the file are:
OFXHEADER:100 DATA:OFXSGML VERSION:160 SECURITY:NONE ENCODING:USASCII CHARSET:NONE COMPRESSION:NONE
I discovered that by changing CHARSET:NONE to CHARSET:1252 OfxParser.parse would parse the file.

@pcekm pcekm linked a pull request Feb 7, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant