[tor-commits] [bridgedb/master] Fix urlencode call

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


commit 7cc865b7899ad9389d4748ce1ed388282df5995c
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Jan 13 18:10:21 2020 -0800

    Fix urlencode call
    
    Oops, my bad on this one. Earlier I ported from urllib2 to urllib, but the
    urlencode function is on urllib.parse instead...
    
      https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode
    
    This fixes...
    
      Traceback (most recent call last):
        File "/home/atagar/Desktop/tor/bridgedb/bridgedb/test/test_txrecaptcha.py", line 205, in test_submit_returnsDeferred
          self.ip)
        File "/home/atagar/Desktop/tor/bridgedb/bridgedb/txrecaptcha.py", line 294, in submit
          params = urllib.urlencode({
      builtins.AttributeError: module 'urllib' has no attribute 'urlencode'
    
    Test results unchanged...
    
      before: FAILED (skips=109, failures=18, errors=386, successes=468)
      after: FAILED (skips=109, failures=18, errors=386, successes=468)
---
 bridgedb/txrecaptcha.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bridgedb/txrecaptcha.py b/bridgedb/txrecaptcha.py
index 26ead43..6308af8 100644
--- a/bridgedb/txrecaptcha.py
+++ b/bridgedb/txrecaptcha.py
@@ -291,7 +291,7 @@ def submit(recaptcha_challenge_field, recaptcha_response_field,
         d.errback(failure.Failure(ValueError('incorrect-captcha-sol')))
         return d
 
-    params = urllib.urlencode({
+    params = urllib.parse.urlencode({
         'privatekey': _encodeIfNecessary(private_key),
         'remoteip':   _encodeIfNecessary(remoteip),
         'challenge':  _encodeIfNecessary(recaptcha_challenge_field),





More information about the tor-commits mailing list