[tor-commits] [bridgedb/master] Fix type issue for moat response

phw at torproject.org phw at torproject.org
Wed Feb 19 18:26:38 UTC 2020


commit 702abdb2c00101962fc840d35f1c441c7ca67f91
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Jan 19 18:05:41 2020 -0800

    Fix type issue for moat response
    
    Fixing the following...
    
      Traceback (most recent call last):
        File "/home/atagar/Desktop/tor/bridgedb/bridgedb/test/test_distributors_moat_server.py", line 298, in test_getChild
          self.assertIn('does not implement GET http://dummy/', detail)
        File "/usr/local/lib/python3.5/dist-packages/twisted/trial/_synctest.py", line 492, in assertIn
          % (containee, container))
      twisted.trial.unittest.FailTest: 'does not implement GET http://dummy/' not in "moat version 0.1.0 does not implement b'GET' b'http://dummy/'"
    
    Test results changed as follows...
    
      before: FAILED (skips=115, failures=20, successes=849)
      after:  FAILED (skips=115, failures=19, successes=850)
---
 bridgedb/distributors/moat/server.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bridgedb/distributors/moat/server.py b/bridgedb/distributors/moat/server.py
index 4dde385..e49a6bb 100644
--- a/bridgedb/distributors/moat/server.py
+++ b/bridgedb/distributors/moat/server.py
@@ -240,7 +240,7 @@ class CustomErrorHandlingResource(resource.Resource):
 
         response = resource501
         response.detail = "moat version %s does not implement %s %s" % \
-                          (MOAT_API_VERSION, request.method, request.uri)
+                          (MOAT_API_VERSION, request.method.decode('utf-8'), request.uri.decode('utf-8'))
         return response
 
 





More information about the tor-commits mailing list