Module: kamailio
Branch: 5.6
Commit: a4fc8afea094b6778b9d264cf9911b69c1a6d22f
URL:
https://github.com/kamailio/kamailio/commit/a4fc8afea094b6778b9d264cf9911b6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-06-24T11:09:27+02:00
kamctl/dbtextdb: solve TypeError: a bytes-like object is required, not 'str'
- GH #2469
(cherry picked from commit 6aa1a84c6e37e0d6d5a725d43636debeaf5fa3b4)
---
Modified: utils/kamctl/dbtextdb/dbtextdb.py
---
Diff:
https://github.com/kamailio/kamailio/commit/a4fc8afea094b6778b9d264cf9911b6…
Patch:
https://github.com/kamailio/kamailio/commit/a4fc8afea094b6778b9d264cf9911b6…
---
diff --git a/utils/kamctl/dbtextdb/dbtextdb.py b/utils/kamctl/dbtextdb/dbtextdb.py
index 581496c309d..0efe419026c 100755
--- a/utils/kamctl/dbtextdb/dbtextdb.py
+++ b/utils/kamctl/dbtextdb/dbtextdb.py
@@ -1135,7 +1135,7 @@ def WriteTempTable(self):
else:
header = '%s)' % header
- self.temp_file.write(header.strip() + '\n')
+ self.temp_file.write((header.strip() + '\n').encode())
# write data
for row in self.data:
@@ -1143,7 +1143,7 @@ def WriteTempTable(self):
for col in columns:
row_str = '%s:%s' % (row_str, row[col])
- self.temp_file.write(row_str[1:] + '\n')
+ self.temp_file.write((row_str[1:] + '\n').encode())
self.temp_file.flush()