[tor-commits] [stem/master] Fixing trace truncation for received messages

atagar at torproject.org atagar at torproject.org
Mon Aug 14 17:13:15 UTC 2017


commit 2d25cf9f103f9a876dcfee9d3e2b233a97f3e0c3
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Aug 14 10:12:26 2017 -0700

    Fixing trace truncation for received messages
    
    Oops, missed that these were the lines themselves rather than the count.
---
 stem/socket.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stem/socket.py b/stem/socket.py
index 8c3e4205..d10b40d2 100644
--- a/stem/socket.py
+++ b/stem/socket.py
@@ -599,7 +599,7 @@ def recv_message(control_file):
       if TRUNCATE_LOGS and len(log_message_lines) > TRUNCATE_LOGS:
         log_message = '\n'.join(log_message_lines[:TRUNCATE_LOGS] + ['... %i more lines...' % (len(log_message_lines) - TRUNCATE_LOGS)])
 
-      if log_message_lines > 2:
+      if len(log_message_lines) > 2:
         log.trace('Received from tor:\n%s' % log_message)
       else:
         log.trace('Received from tor: %s' % log_message.replace('\n', '\\n'))



More information about the tor-commits mailing list