The python-oracledb code:
import oracledb
import os
un = os.environ.get("PYTHON_USERNAME")
pw = os.environ.get("PYTHON_PASSWORD")
cs = "localhost/orclpdb1"
c = oracledb.connect(un, pw, dsn=cs)
fails with the error:
TypeError: connect() got multiple values for argument 'dsn'
How do I fix this?
Update: in python 1.0.0 the error was TypeError: wrapped() got multiple values for argument 'dsn'
In 1.0.1 the wrapped()
was replaced by the connect or create pool function name used in the application code.
The solution is to consistently use keyword parameters:
or
The
oracledb.connect()
andoracledb.create_pool()
(and deprecatedoracledb.SessionPool()
) parameters are keyword, not positional. This complies with the Python Database API spec PEP 249.