Closed paulmalherbe closed 3 years ago
Without anything else to go on, I have to agree, that's severely malformed. It doesn't appear to be an OFX file at all.
How do I attach a copy of the ofx file as .ofx is not a supported file type?
You can try changing the file extension, or pasting the text here protected by code
formatting indicators.
The first line of the file contains:
<?xml version='1.0' encoding='utf-8' standalone='no'?>
If I replace the single inverted commas with double inverted
commas it passes.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
On 2021/02/09 15:43, Christopher
Singley wrote:
You can try changing the file extension, or pasting the text
here protected by code formatting indicators.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
[
{ "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/csingley/ofxtools/issues/119#issuecomment-775945382", "url": "https://github.com/csingley/ofxtools/issues/119#issuecomment-775945382", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
OK, I understand now.
The XML spec allows either single or double quotes in the XML declaration, but my code only allows double quotes.
Thank you for the bug report; this should not be difficult to fix.
Traceback (most recent call last): File "/home/paul/test.py", line 4, in
parser.parse("test.ofx")
File "/home/paul/.pyenv/versions/3.9.1/lib/python3.9/site-packages/ofxtools/Parser.py", line 85, in parse
self.header, message = self._read(source)
File "/home/paul/.pyenv/versions/3.9.1/lib/python3.9/site-packages/ofxtools/Parser.py", line 118, in _read
header, message = parse_header(source)
File "/home/paul/.pyenv/versions/3.9.1/lib/python3.9/site-packages/ofxtools/header.py", line 294, in parse_header
header, header_end_index = OFXHeaderV1.parse(rawheader)
File "/home/paul/.pyenv/versions/3.9.1/lib/python3.9/site-packages/ofxtools/header.py", line 81, in parse
raise OFXHeaderError(f"OFX header is malformed:\n{rawheader}")
ofxtools.header.OFXHeaderError: OFX header is malformed:
<?xml version='1.0' encoding='utf-8' standalone='no'?>
<?OFX OFXHEADER="200" VERSION="200" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?>
0