Skip to content

IFILE path incorrectly appended to CONFIG_DIR #589

@GlastokTV

Description

@GlastokTV
  1. What versions are you using?

I am using oracledb==3.4.2 in thin mode.

My Oracle Database version is 19.29.0.0.0 (Enterprise 19c).

My platform is as follows

import sys
import platform

print("platform.platform:", platform.platform())
print("sys.maxsize > 2**32:", sys.maxsize > 2**32)
print("platform.python_version:", platform.python_version())

> platform.platform: Windows-11-10.0.26100-SP0
> sys.maxsize > 2**32: True
> platform.python_version: 3.14.4
  1. Is it an error or a hang or a crash?

It is an error

  1. What error(s) or behavior you are seeing?

The error happens when establishing a connection using a TNSNAMES file that contains an IFILE directive and the config_dir parameter is explicitely passed.

Assuming config_dir='C:/Oracle/12.1.0/Client_lite/NETWORK/ADMIN' and IFILE="Q:\WAPPL\Ora11g\client_1\network\Admin\tnsnames.ora" this is the output I get.

DPY-4026: file 'C:/Oracle/12.1.0/Client_lite/NETWORK/ADMIN\"Q:\WAPPL\Ora11g\client_1\network\Admin\tnsnames.ora"' is missing or unreadable

[WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:/Oracle/12.1.0/Client_lite/NETWORK/ADMIN\\"Q:\\WAPPL\\Ora11g\\client_1\\network\\Admin\\tnsnames.ora"'
  1. Does your application call init_oracle_client()?

No, I use thin mode.

  1. Include a runnable Python script that shows the problem.

A reproducible example would be as follows (assuming a TNSNAMES.ORA file exists and that it has the IFILE directive established as mentioned in question 3):

import oracledb

with oracledb.connect(
    user=os.environ['DB_USER'],
    password=os.environ['DB_USER_PWD'],
    dsn=os.environ['TNS_ALIAS'],
    config_dir=os.environ['TNS_ADMIN']
) as con:
    with con.cursor() as cur:
        cur.execute("SELECT * FROM v$version")
        print(cur.fetchall())
  1. Expected behaviour

Considering the purpose for which the IFILE directory was created, I believe that when the user explicitely passes the config_dir, the behaviour should be to look in both directories separately, not appending one to another and assuming that is the actual directory that should be looked into.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions