[issue38175] Memory leak in comparison of sqlite.Row objects

Serhiy Storchaka report at bugs.python.org
Sun Sep 15 03:29:07 EDT 2019


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

There is a memory leak in comparison of sqlite.Row objects when row descriptors are different. There were not tests for this case.

Also, the code compares the result of PyObject_RichCompare() with Py_True and Py_False. It is better to avoid such code, because technically PyObject_RichCompare() can return an arbitrary value, although in this particular case description can only be tuple or None (or NULL, but this is other issue).

Also, there is a test for inequality of hash codes. Since hashes depend on hashes of strings, they value is random, and there is a small chance of failure. Hashes should not be tested for inequality.

----------
components: Library (Lib)
messages: 352465
nosy: berker.peksag, ghaering, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Memory leak in comparison of sqlite.Row objects
type: resource usage
versions: Python 2.7, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38175>
_______________________________________


More information about the Python-bugs-list mailing list