Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'str' object has no attribute 'strftime' in ofxprinter #145

Open
aforch opened this issue Sep 9, 2018 · 1 comment
Open

'str' object has no attribute 'strftime' in ofxprinter #145

aforch opened this issue Sep 9, 2018 · 1 comment

Comments

@aforch
Copy link

aforch commented Sep 9, 2018

I'm encountering an issue when attempting to utilize the ofxprinter write function. The error info is below:

Traceback (most recent call last):
File "ofx_parse.py", line 32, in
printer.write(tabs=0)
File "/Users/adam/miniconda3/lib/python3.6/site-packages/ofxparse/ofxprinter.py", line 200, in write
self.writeToFile(f)
File "/Users/adam/miniconda3/lib/python3.6/site-packages/ofxparse/ofxprinter.py", line 190, in writeToFile
self.writeOfx(tabs=tabs)
File "/Users/adam/miniconda3/lib/python3.6/site-packages/ofxparse/ofxprinter.py", line 177, in writeOfx
self.writeBankMsgsRsv1(tabs=tabs)
File "/Users/adam/miniconda3/lib/python3.6/site-packages/ofxparse/ofxprinter.py", line 167, in writeBankMsgsRsv1
self.writeStmTrs(tabs=tabs)
File "/Users/adam/miniconda3/lib/python3.6/site-packages/ofxparse/ofxprinter.py", line 129, in writeStmTrs
self.printDate(acct.statement.start_date)
File "/Users/adam/miniconda3/lib/python3.6/site-packages/ofxparse/ofxprinter.py", line 43, in printDate
strdt = dt.strftime('%Y%m%d%H%M%S')
AttributeError: 'str' object has no attribute 'strftime'

@rdsteed
Copy link

rdsteed commented Oct 24, 2018

The printDate method of an OfxPrinter object should be called with a first parameter dt.

dt should be a datetime object which does have a strftime method. Looks like in this case the printDate method was called with dt being a string instead of a datetime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants