[sr-dev] [kamailio/kamailio] [Feature Request] Python3 compatibility for dbtextdb (#1747)

Victor Seva notifications at github.com
Mon May 4 14:52:46 CEST 2020


with https://github.com/kamailio/kamailio/commit/b722a48144ac9e029bdbc2968dedbe56966a3f7c :
```
python2 dbtextdb_test.py
...
----------------------------------------------------------------------
Ran 3 tests in 0.006s

OK
```

But for python3:
```
python3 dbtextdb_test.py
/home/vseva/data/projects/kamailio/utils/kamctl/dbtextdb/dbtextdb.py:1074: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/subscriber' mode='r' encoding='UTF-8'>
  self.fd = open(os.path.join(self.location, self.table), 'r')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/vseva/data/projects/kamailio/utils/kamctl/dbtextdb/dbtextdb.py:1074: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/test' mode='r' encoding='UTF-8'>
  self.fd = open(os.path.join(self.location, self.table), 'r')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/vseva/data/projects/kamailio/utils/kamctl/dbtextdb/dbtextdb.py:1074: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/unsorted_table' mode='r' encoding='UTF-8'>
  self.fd = open(os.path.join(self.location, self.table), 'r')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.7/unittest/case.py:615: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/test' mode='r' encoding='UTF-8'>
  testMethod()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
.dbtextdb_test.py:353: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/test' mode='r' encoding='UTF-8'>
  db_conn = DBText('./tests')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
dbtextdb_test.py:363: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/test' mode='r' encoding='UTF-8'>
  db_conn = DBText('./tests')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
dbtextdb_test.py:375: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/bad_table_wrong_type' mode='r' encoding='UTF-8'>
  db_conn = DBText('./tests')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
dbtextdb_test.py:381: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/bad_table_short_row' mode='r' encoding='UTF-8'>
  db_conn = DBText('./tests')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
dbtextdb_test.py:387: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/bad_table_long_row' mode='r' encoding='UTF-8'>
  db_conn = DBText('./tests')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
dbtextdb_test.py:393: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/bad_table_null' mode='r' encoding='UTF-8'>
  db_conn = DBText('./tests')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.7/unittest/case.py:615: ResourceWarning: unclosed file <_io.TextIOWrapper name='./tests/bad_table_int' mode='r' encoding='UTF-8'>
  testMethod()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
.dbtextdb_test.py:28: DeprecationWarning: Please use assertTrue instead.
  self.assert_(db_conn.command == 'SELECT')
..
----------------------------------------------------------------------
Ran 3 tests in 0.008s

OK
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1747#issuecomment-623445144
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200504/f4d76d71/attachment-0001.html>


More information about the sr-dev mailing list