New submission from Serhiy Storchaka <storchaka+cpyt...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue38175>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to