[pgAdmin4][RM#4750] Query tool history throws an error for encoding

Murtuza Zabuawala <[email protected]>
Newsgroups gmane.comp.db.postgresql.pgadmin.devel
Message-ID <CAKKotZRQ7PwVCs69JFUY1Hmx3+9xxa9PvBOWxg2c+xuZujBLHw@mail.gmail.com>
Hi,

PFA minor patch for the backend encoding error from query history.


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
RM_4750.diff (application/octet-stream, 641 B)
diff --git a/web/pgadmin/tools/sqleditor/utils/query_history.py b/web/pgadmin/tools/sqleditor/utils/query_history.py
index 41c7b974a..84faaa8a4 100644
--- a/web/pgadmin/tools/sqleditor/utils/query_history.py
+++ b/web/pgadmin/tools/sqleditor/utils/query_history.py
@@ -19,7 +19,10 @@ class QueryHistory:
             data={
                 'status': True,
                 'msg': '',
-                'result': [bytes(rec.query_info) for rec in list(result)]
+                'result': [
+                    bytes(rec.query_info, encoding='utf8')
+                    for rec in list(result)
+                ]
             }
         )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.