You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CsvStatementParser.__init__() takes a fin Parameter that is later used by csv.reader . In theory fin could be any iterable but in practice it will most likely be a file object created by calling open() .
Generally it is responsability of the open() caller to close the file after being done with it. The problem with ofxstatement is that the general workflow is to create a Plugin class that returns a Parser. There is therefore no possibility to close the file.
Since currently this is not possible when using a file as parameter (see
kedder/ofxstatement#71) the easiest workaround
is to simply pass the file content to the parser. The csv.reader() takes
any iterable (such as a list of lines, as in this case) as input.
CsvStatementParser.__init__()
takes afin
Parameter that is later used bycsv.reader
. In theoryfin
could be any iterable but in practice it will most likely be a file object created by callingopen()
.Generally it is responsability of the
open()
caller to close the file after being done with it. The problem with ofxstatement is that the general workflow is to create a Plugin class that returns a Parser. There is therefore no possibility to close the file.I see two general approaches to fixing this:
cleanup()
function that can be defined for the plugin and that is called at the end of execution by ofxstatementSome basic code for the second approach:
The text was updated successfully, but these errors were encountered: