Skip to content

AttributeError object has no attribute 'logging_id' in __del__ methods #48

Closed
@Fred-si

Description

@Fred-si

Hi

After update to firebird-driver 2.0.0, I have been noticed by Python about about ignored AttributeError in some __del__ methods (at this time, Cursor.__del__ and Connection.__del__) raised at these lines

warn(f"Connection '{self.logging_id}' disposed without prior close()", ResourceWarning)
warn(f"Cursor '{self.logging_id}' disposed without prior close()", ResourceWarning)
.

Full trace look like this

Exception ignored in: <function Connection.__del__ at 0x7ba85ba82980>
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/firebird/driver/core.py", line 1798, in __del__
    warn(f"Connection '{self.logging_id}' disposed without prior close()", ResourceWarning)
AttributeError: 'Connection' object has no attribute 'logging_id'
Exception ignored in: <function Cursor.__del__ at 0x7f21b59dcb80>
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/firebird/driver/core.py", line 3295, in __del__
    warn(f"Cursor '{self.logging_id}' disposed without prior close()", ResourceWarning)
AttributeError: 'Cursor' object has no attribute 'logging_id'

After verify, logging_id is never declared in the code, but, I have found several _logging_id_ assignement (example here

self._ic._logging_id_ = 'Cursor.internal'
). Maybe logging_id should be replaced by _logging_id_ ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions