-
Notifications
You must be signed in to change notification settings - Fork 3
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
_is_ibmi() returning incorrect result? #9
Comments
I think you meant to check this:
Confusingly, Python has both Seems like there's a bug in the ibm_db_dbi code that is setting this attribute (which is not defined on IBM i) and perhaps IBM i 7.4 has changed behavior in how it deals with undefined/invalid attributes. Looks like this line should have been in the else block above it. |
You're right... I thought I had double checked this but I was changing multiple things at a time. Turns out it works for me as long as I use a DSN that includes UID and PWD like: But not if I try to supply the user and password as the 2nd and 3rd params to the connect function. The platform was not the issue. Thanks! |
Ahh yes, that's slightly confusing and something we inherited from upstream. You should use either a DSN string or the DB/UID/PWD parameters, but not both. |
When I connect to my POWER9 running i7.4 via ssh and run
$ python3.6 -c "import sys; print(sys.platform)"
I get:
'aix7'
But
_is_ibmi()
seems to be checking for'OS400'
here. When I try to useibm_db_dbi
to connect to a database other than *LOCAL, I'm getting an error which seems related to this:The reason I think it is related is that if I first SET
sys.platform = 'OS400'
, the connect() does complete properly.I attempted to run a later version of ibm_db via
pip install
but as noted elsewhere (ibmdb#624) this is not currently working).The text was updated successfully, but these errors were encountered: