Skip to content

AttributeError: 'NoneType' object has no attribute 'SSLError' #59

@tobyych

Description

@tobyych
  1. What versions are you using?

platform.platform: Linux-5.10.60.1-microsoft-standard-WSL2-x86_64-with-glibc2.29
sys.maxsize > 2**32: True
platform.python_version: 3.8.10
oracledb.version: 1.0.3

  1. Is it an error or a hang or a crash?

There is a message in console reading "Exception ignored".

  1. What error(s) or behavior you are seeing?
...
...
Exception ignored in: <function Connection.__del__ at 0x7f5a0eb16280>
Traceback (most recent call last):
  File "/home/toby/projects/mai/.venv/lib/python3.8/site-packages/oracledb/connection.py", line 144, in __del__
  File "src/oracledb/impl/thin/connection.pyx", line 283, in oracledb.thin_impl.ThinConnImpl.close
AttributeError: 'NoneType' object has no attribute 'SSLError'
  1. Does your application call init_oracle_client()?

No, running Thin mode.

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

I'm running other's code and there is a little wrapper class as follows. I run a Flask app that connects to Oracle DB, and the message always shows when I do Ctrl+C to stop the process. I see this message occasionally otherwise, but not sure about the root cause.

import oracledb as cx_Oracle

class OracleDB(object):
    def __init__(self, connection_str):
        self.con = cx_Oracle.connect(
            self.connection_str, encoding="UTF-8", nencoding="UTF-8", threaded=True
        )
        self.cursor = None
        self.cursor2 = None

    # some other methods here...

    def close(self):
        logger.info("closing db connection...")
        try:
            self.cursor.close()
            del self.cursor
        except:
            pass

        try:
            self.cursor2.close()
            del self.cursor2
        except:
            pass

        try:
            self.con.close()
            del self.con
        except:
            pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions