A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/oracle/python-oracledb/issues/339 below:

Internal exception raised when DSN connection string is badly formatted · Issue #339 · oracle/python-oracledb · GitHub

If I try to connect to an Oracle server and my connection string is badly formatted (here ADRESS instead of ADDRESS), oracledb raises an internal exception. (note oracledb before 2.0 crashes with a segfault)

sys.maxsize > 2**32: True
platform.python_version: 3.11.8
oracledb.__version__: 2.2.0

Ex:

import oracledb

con = oracledb.connect(
    dsn='(DESCRIPTION=(ADRESS=(PROTOCOL=TCP)(HOST=123.123.123.123)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=SERVER.COMPANY.com)))',
    user='myuser', password='mypassword'
)
cur = con.cursor()

cur.execute("select 1 from dual")
row = cur.fetchone()
print(row)
Traceback (most recent call last):
  File "test_oracledb.py", line 9, in <module>
    cur.execute("select 1 from dual")
  File ".venv/lib/python3.11/site-packages/oracledb/cursor.py", line 701, in execute
    impl.execute(self)
  File "src/oracledb/impl/thin/cursor.pyx", line 178, in oracledb.thin_impl.ThinCursorImpl.execute
  File "src/oracledb/impl/thin/protocol.pyx", line 438, in oracledb.thin_impl.Protocol._process_single_message
  File "src/oracledb/impl/thin/protocol.pyx", line 439, in oracledb.thin_impl.Protocol._process_single_message
  File "src/oracledb/impl/thin/protocol.pyx", line 400, in oracledb.thin_impl.Protocol._process_message
  File "src/oracledb/impl/thin/protocol.pyx", line 377, in oracledb.thin_impl.Protocol._process_message
  File "src/oracledb/impl/thin/messages.pyx", line 319, in oracledb.thin_impl.Message.send
  File "src/oracledb/impl/thin/packet.pyx", line 780, in oracledb.thin_impl.WriteBuffer.end_request
  File "src/oracledb/impl/thin/packet.pyx", line 753, in oracledb.thin_impl.WriteBuffer._send_packet
  File "src/oracledb/impl/thin/transport.pyx", line 348, in oracledb.thin_impl.Transport.write_packet
AttributeError: 'NoneType' object has no attribute 'send'

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4