Skip to content

OfxParser.parse fails: unknown encoding: cpNONE #154

@fugwort

Description

@fugwort

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions