csingley / ofxtools

Python OFX Library
Other
301 stars 68 forks source link

parser.convert() fails for sample file #27

Closed chbndrhnns closed 7 years ago

chbndrhnns commented 7 years ago

I am following the Usage Example:

from ofxtools.Parser import OFXTree
parser = OFXTree()
parser.parse('file') 
ofx = parser.convert()

gives me

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Users/jo/.virtualenvs/m2ynab/lib/python2.7/site-packages/ofxtools-0.5-py2.7.egg/ofxtools/models/ofx.py", line 51, in __repr__
    self.sonrs.fi.fid,
AttributeError: 'NoneType' object has no attribute 'fid'

ofx.txt

csingley commented 7 years ago

Yup, SONRS isn't required to have an FI. Try the fix I just pushed to master.

chbndrhnns commented 7 years ago

Works perfectly now in this regard!