csingley / ofxtools

Python OFX Library
Other
303 stars 68 forks source link

Error "OFXSpecError: must contain exactly 1 of ['signonmsgsrqv1', 'signonmsgsrsv1'] (not 0)", but there are SIGNONMSGSRSV1 tags #178

Open youainti opened 1 year ago

youainti commented 1 year ago

When attempting to import and convert the attached ofx file using

parser = OFXTree()
with open("./test1.ofx", "rb") as fh:
    parser.parse(fh)
parser.convert()

I get the following error

OFXSpecError('OFX(signonmsgsrqv1=None, signonmsgsrsv1=None): must contain exactly 1 of [['signonmsgsrqv1', 'signonmsgsrsv1']] (not 0)')

I suspect it is a formatting issue on my side. The tag <signonmsgsrsv1> exists in the document but the error suggests it is not found.

test1.ofx.txt

csingley commented 1 year ago

Huh, weird. What version of ofxtools are you using?

youainti commented 1 year ago

OFXTools = 0.9.5 Python = 3.9.12

csingley commented 1 year ago

This is on current master.

Python 3.11.6 (main, Oct  3 2023, 00:00:00) [GCC 12.3.1 20230508 (Red Hat 12.3.1-1)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.5.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import ofxtools

In [2]: parser = ofxtools.OFXTree()
   ...: with open("/home/csingley/Downloads/test1.ofx", "rb") as fh:
   ...:     parser.parse(fh)
   ...: parser.convert()
Out[2]: <OFX len(statements)=1 len(securities)=0>
youainti commented 1 year ago

I'll give it a try with both OFXTools 0.9.5 and python 3.11 and try python 3.9 with the master branch.