Fix exit error TypeError("'NoneType' object is not callable",) using catch try block in close method - #45
Fix exit error TypeError("'NoneType' object is not callable",) using catch try block in close method#45janrygl wants to merge 5 commits into
Conversation
| # all data is persisted to disk before returning. | ||
| self.conn.commit(blocking=True) | ||
| self.conn.close() | ||
| except TypeError: |
There was a problem hiding this comment.
Is TypeError enough? May be better to catch all Exceptions?
|
@tmylk @piskvorky I rebased commits to return to original |
| # prevent error log flood in case of multiple SqliteDicts | ||
| # closed after connection lost (exceptions are always ignored | ||
| # in __del__ method. | ||
| pass |
There was a problem hiding this comment.
Can we print the exception to sys.stderr?
As in del docs
exceptions that occur during their execution are ignored, and a warning is printed to sys.stderr instead.
There was a problem hiding this comment.
No, getting rid of the flood of logged exceptions is the entire reason for this PR.
There was a problem hiding this comment.
Can we at least print a warning instead of an exception?
|
The read-only commits have already been merged. I was planning to cherry-pick just @janrygl's changes once we converge here. |
…tch try block in close method #45
|
Merged in 9cc6dd3 |
Fixes #44
@piskvorky
Added
try catchblock toclosefunction to prevent error log message in__del__method whensqlitedictis not closed correctly. Error was raised byconn.close()andconn.commit()