Open Kodiologist opened 8 years ago
I got the above with Python 2.7.12. With 3.5.2, the bug doesn't arise.
I get this error with Python 2.7.9
I am receiving a similar error:
Traceback (most recent call last): File "/usr/local/bin/ofxclient", line 9, in <module> load_entry_point('ofxclient==2.0.3', 'console_scripts', 'ofxclient')() File "/usr/local/lib/python2.7/dist-packages/ofxclient/cli.py", line 63, in run main_menu(args) File "/usr/local/lib/python2.7/dist-packages/ofxclient/cli.py", line 83, in main_menu add_account_menu(args) File "/usr/local/lib/python2.7/dist-packages/ofxclient/cli.py", line 130, in add_account_menu if login_check_menu(bank, args): File "/usr/local/lib/python2.7/dist-packages/ofxclient/cli.py", line 219, in login_check_menu GlobalConfig.add_account(a) File "/usr/local/lib/python2.7/dist-packages/ofxclient/config.py", line 244, in add_account self.parser.set(section_id, key, section_items[key]) File "/usr/local/lib/python2.7/dist-packages/ofxclient/config.py", line 122, in set ConfigParser.set(self, section, option, value) File "/usr/local/lib/python2.7/dist-packages/backports/configparser/__init__.py", line 1238, in set _, option, value = self._validate_value_types(option=option, value=value) File "/usr/local/lib/python2.7/dist-packages/backports/configparser/__init__.py", line 1221, in _validate_value_types raise TypeError("option values must be strings") TypeError: option values must be strings
For what it's worth, I'm no longer seeing this as of 2.0.3, but I did have to make some other changes to the code to get Wells Fargo (and Discover Card) to work.
Wells Fargo needs DEFAULT_OFX_VERSION
bumped to 103, and possibly also DEFAULT_APP_VERSION
bumped to 2600.
Discover needs a time.sleep(5)
in login_check_menu
after i.authenticate()
but before i.accounts()
.
And I needed to change section_items[key]
in OfxConfig.add_account
to str(section_items[key])
, at least for Python 3.6.
I get the following error from configparser. It's complaining about inputs not being strings. Note that my bank uses my account number for the login... so perhaps that's where it's barfing.
+----------------------------------
Main
Edit /home/chris/ofxclient.ini to
change descriptions or ofx options
+----------------------------------
(A) Add an account
(Q) Quit
choice> a
+----------------------------------
Add account
+----------------------------------
------
Notice
------
You are about to search for bank connection information
on a third party website. This means you are trusting
http://ofxhome.com and their security policies.
You will be sending your bank name to this website.
------
bank name eg. "express" (enter to exit)> fifth third
(0) Fifth Third Bancorp
choice> 0
------
Notice
------
You are about to test to make sure your username and password
are correct. This means you will be sending it to the URL below.
If the URL does not appear to belong to your bank then you should
exit this program by hitting CTRL-C.
bank name: Fifth Third Bancorp
bank url: https://banking.53.com/ofx/OFXServlet
------
username> ****************
password>
Traceback (most recent call last):
File "/usr/bin/ofxclient", line 11, in <module>
sys.exit(run())
File "/usr/lib/python3.5/site-packages/ofxclient/cli.py", line 63, in run
main_menu(args)
File "/usr/lib/python3.5/site-packages/ofxclient/cli.py", line 83, in main_menu
add_account_menu(args)
File "/usr/lib/python3.5/site-packages/ofxclient/cli.py", line 130, in add_account_menu
if login_check_menu(bank, args):
File "/usr/lib/python3.5/site-packages/ofxclient/cli.py", line 219, in login_check_menu
GlobalConfig.add_account(a)
File "/usr/lib/python3.5/site-packages/ofxclient/config.py", line 244, in add_account
self.parser.set(section_id, key, section_items[key])
File "/usr/lib/python3.5/site-packages/ofxclient/config.py", line 122, in set
ConfigParser.set(self, section, option, value)
File "/usr/lib64/python3.5/configparser.py", line 1189, in set
self._validate_value_types(option=option, value=value)
File "/usr/lib64/python3.5/configparser.py", line 1174, in _validate_value_types
raise TypeError("option values must be strings")
TypeError: option values must be strings
Maybe changing the type of "value" to a string prior to passing it to ConfigParser would fix it?
118 def set(self, section, option, value):
119 """Set an option value. Knows how to set options properly marked
120 as secure."""
121 if value is False:
122 value = '!!False!!'
123 if self.is_secure_option(section, option):
124 self.set_secure(section, option, value)
125 else:
126 ConfigParser.set(self, section, option, str(value))
I confirmed that forcing the value coming into ConfigParser to be a string fixes the problem, but I can't figure out how to make the test suite work... otherwise I'd send a pull request.
Nonetheless, please see the snippet above.
Just a note that the version of ofxclient
on PyPi is a version behind and still has this problem. Installing the latest version from github fixes it.
I download Wells Fargo transactions with the command
ofxclient -a [...] -d - -c ~/.config/ofxclient.ini
. This has worked fine for a while, but today, I gotTypeError: get() got an unexpected keyword argument 'raw'
. I upgraded from 2.0.2 to 93d2924, which is the current tip of master, but I got the same error. I'm on Ubuntu 16.04.1. Here's the stack trace: