[web/application] fix query log handling on python3
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 08 Feb 2016 16:10:22 +0100
changeset 11163 141e96f93c4d
parent 11162 d60d181b2b17
child 11164 e3fa26bd9ce0
[web/application] fix query log handling on python3 Writing bytes to a file opened in text mode doesn't work.
cubicweb/web/application.py
--- a/cubicweb/web/application.py	Mon Feb 08 16:32:36 2016 +0100
+++ b/cubicweb/web/application.py	Mon Feb 08 16:10:22 2016 +0100
@@ -232,13 +232,12 @@
                         result += ['%s %s -- (%.3f sec, %.3f CPU sec)' % q
                                    for q in cnx.executed_queries]
                         cnx.executed_queries = []
-                        self._query_log.write('\n'.join(result).encode(req.encoding))
+                        self._query_log.write('\n'.join(result))
                         self._query_log.flush()
                     except Exception:
                         self.exception('error while logging queries')
 
 
-
     def main_handle_request(self, req, path):
         """Process an http request