ofxtools icon indicating copy to clipboard operation
ofxtools copied to clipboard

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

Open youainti opened this issue 2 years ago • 4 comments

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

youainti avatar Oct 31 '23 17:10 youainti

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

csingley avatar Oct 31 '23 17:10 csingley

OFXTools = 0.9.5 Python = 3.9.12

youainti avatar Oct 31 '23 17:10 youainti

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>

csingley avatar Oct 31 '23 18:10 csingley

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.

youainti avatar Oct 31 '23 18:10 youainti