csingley / ofxtools

Python OFX Library
Other
301 stars 68 forks source link

'ofxget prof bbt' fails with TypeError: 'NoneType' object is not subscriptable #165

Open sbrown4 opened 1 year ago

sbrown4 commented 1 year ago

Seems to go off the air while parsing the FI. in the request. As fidelity and wells return profiles, I suspect the '&' in the name is the problem.

sbrown4 commented 1 year ago

After some more digging: The log from quicken doesn't have many end tags. Here is the request ofxtools sent to bbt. Returns added to make it readable.

<?OFX OFXHEADER="200" VERSION="220" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="7476685A-A546-4FD1-8F2C-648D05DDF328"?>
<OFX>
<SIGNONMSGSRQV1>
<SONRQ>
<DTCLIENT>20221223140216.649[+0:UTC]</DTCLIENT>
<USERID>anonymous00000000000000000000000</USERID>
<USERPASS>anonymous00000000000000000000000</USERPASS>
<LANGUAGE>ENG</LANGUAGE>
<FI><ORG>BB&amp;T</ORG><FID>BB&amp;T</FID></FI>
<APPID>QWIN</APPID>
<APPVER>2700</APPVER>
</SONRQ></SIGNONMSGSRQV1>
<PROFMSGSRQV1><PROFTRNRQ>
<TRNUID>26B5B916-94A2-44CB-A5D9-2461D0D46AF2</TRNUID>
<PROFRQ>
<CLIENTROUTING>NONE</CLIENTROUTING>
<DTPROFUP>19900101000000.000[+0:UTC]</DTPROFUP>
</PROFRQ></PROFTRNRQ></PROFMSGSRQV1>
</OFX>

And the BB&T response

response: b'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r\n<?OFX OFXHEADER="200" VERSION="220" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="7476685A-A546-4FD1-8F2C-648D05DDF328"?>\r\n
<OFX>
<SIGNONMSGSRSV1>
<SONRS>
<STATUS><CODE>2000</CODE><SEVERITY>ERROR</SEVERITY>
<MESSAGE>For input string: "+0"::DTCLIENT</MESSAGE></STATUS>
<DTSERVER>20221223090218.408[-5:GMT]</DTSERVER>
<LANGUAGE>ENG</LANGUAGE>
<FI><ORG>BB&amp;T</ORG><FID>BB&amp;T</FID></FI>
</SONRS>
</SIGNONMSGSRSV1>
</OFX>'

And this is one from a quicken log that BB&T accepts.

<!--
OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE

-->
<OFX>
<SIGNONMSGSRQV1>
<SONRQ>
<DTCLIENT>20221221135059.123[-5:EST]
<USERID>anonymous00000000000000000000000
<USERPASS>X<GENUSERKEY>N
<LANGUAGE>ENG
<FI>
<ORG>BB&amp;T
<FID>BB&amp;T
</FI>
<APPID>QWIN
<APPVER>2700
</SONRQ>
</SIGNONMSGSRQV1>
<PROFMSGSRQV1>
<PROFTRNRQ>
<TRNUID>E26D1F22-7E47-1000-90DD-F2A201070026
<PROFRQ>
<CLIENTROUTING>MSGSET
<DTPROFUP>20160604231616.520[-4:GMT]
</PROFRQ>
</PROFTRNRQ>
</PROFMSGSRQV1>
</OFX>
csingley commented 1 year ago

Read the error message. It doesn’t like your time zone. Sounds like their parser barfed as soon as it hit a + sign. In-house development, not a standard library, with overly strict validation… coded to test data from Quicken, not the OFX spec.

<DTPROFUP>19900101000000.000[+0:UTC]</DTPROFUP>

vs.

<DTPROFUP>20160604231616.520[-4:GMT]

sbrown4 commented 1 year ago

Using my system timezone, EST, and not UTC solves the problem. At least for me. Thanks for your help.