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

--download option throws exception under python3 #52

Open
smithbone opened this issue Mar 27, 2018 · 4 comments
Open

--download option throws exception under python3 #52

smithbone opened this issue Mar 27, 2018 · 4 comments

Comments

@smithbone
Copy link

If the --download option is used with python3 then a exception occurs.

File "/usr/local/bin/ofxclient", line 9, in
load_entry_point('ofxclient==2.0.3', 'console_scripts', 'ofxclient')()
File "/usr/local/lib/python3.5/dist-packages/ofxclient-2.0.3-py3.5.egg/ofxclient/cli.py", line 56, in run
args.download.write(ofxdata.read())
TypeError: a bytes-like object is required, not 'str'

I fixed it locally by adding a .encode() call into the strings returned by
ofxdata.read().

However, That's not a fix for both python2&3. I see account.py has some 2/3 support but account.download() doesn't use it.

@e2thenegpii
Copy link
Contributor

Why isn't adding .encode() a fix for 2&3? In Python2 the encode is basically a no-op and it is fixed in python3.

@smithbone
Copy link
Author

Sorry. I missed a word or 2 and that is not very clear on what I meant. What I should have said is that I'm not claiming this is a complete fix for all python 2/3 compatibility issues. I've only fixed this specific instance that was throwing the exception.

@bmcdonough
Copy link

I fixed it locally by adding a .encode() call into the strings returned by
ofxdata.read().

I have this exact issue and am struggling with where to implement the encode.
Could you elaborate so I could patch mine?

@bmcdonough
Copy link

smithbone replied to my email directly and pointed out my issue.
I was using the pip copy not the github copy.
This issue is actually resolved

60f0f49

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

3 participants