Closed
Description
- What versions are you using?
SQL> SELECT BANNER FROM v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
import oracledb
print("oracledb.__version__:", oracledb.__version__)
oracledb.__version__: 2.1.0
>>> import sys
>>> import platform
>>> print("platform.platform:", platform.platform())
platform.platform: Linux-5.10.0-22-amd64-x86_64-with-glibc2.31
>>> print("sys.maxsize > 2**32:", sys.maxsize > 2**32)
sys.maxsize > 2**32: True
>>> print("platform.python_version:", platform.python_version())
platform.python_version: 3.11.8
- Is it an error or a hang or a crash?
a crash
- What error(s) or behavior you are seeing?
DatabaseError: (oracledb.exceptions.DatabaseError) DPY-4000: unable to find "XXXX.WORLD" in /opt/oracle/instantclient_19_16/network/admin/tnsnames.ora
- Does your application call init_oracle_client()?
No, running Thin mode
- Include a runnable Python script that shows the problem.
import oracledb
with oracledb.connect(user="myuser", password="secretpassword", dsn="XXXX.WORLD") as connection:
with connection.cursor() as cursor:
sql = """select sysdate from dual"""
for r in cursor.execute(sql):
print(r)
- crashes if the tnsnames.ora file contains FILE=
- works if all definitions are included directly in tnsnames.ora file