[debug] use repr() in some place where you'll have a chance to get an unicode error if output encoding isn't properly detected stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 13 Sep 2011 14:41:53 +0200
branchstable
changeset 7779 3826d8480a68
parent 7778 262ff5d8fddc
child 7780 a1d5365fefc1
[debug] use repr() in some place where you'll have a chance to get an unicode error if output encoding isn't properly detected
server/querier.py
server/sources/__init__.py
--- a/server/querier.py	Mon Sep 12 17:24:14 2011 +0200
+++ b/server/querier.py	Tue Sep 13 14:41:53 2011 +0200
@@ -666,7 +666,7 @@
         if server.DEBUG & (server.DBG_RQL | server.DBG_SQL):
             if server.DEBUG & (server.DBG_MORE | server.DBG_SQL):
                 print '*'*80
-            print 'querier input', rql, args
+            print 'querier input', repr(rql), repr(args)
         # parse the query and binds variables
         cachekey = rql
         try:
--- a/server/sources/__init__.py	Mon Sep 12 17:24:14 2011 +0200
+++ b/server/sources/__init__.py	Tue Sep 13 14:41:53 2011 +0200
@@ -37,11 +37,11 @@
 
 def dbg_st_search(uri, union, varmap, args, cachekey=None, prefix='rql for'):
     if server.DEBUG & server.DBG_RQL:
-        print '  %s %s source: %s' % (prefix, uri, union.as_string())
+        print '  %s %s source: %s' % (prefix, uri, repr(union.as_string()))
         if varmap:
             print '    using varmap', varmap
         if server.DEBUG & server.DBG_MORE:
-            print '    args', args
+            print '    args', repr(args)
             print '    cache key', cachekey
             print '    solutions', ','.join(str(s.solutions)
                                             for s in union.children)