From ef194f0331cf433096ddb22a694d3401ab18d347 Mon Sep 17 00:00:00 2001 From: Calin Culianu Date: Fri, 1 Mar 2019 00:22:08 +0200 Subject: [PATCH] Fix for Electron-Cash#1172 -- Workaround missing requests.urllib3 Also bumped version to 3.9.1ShufBeta since I noticed people using it already and this is a somewhat crucial fix. --- contrib/update_checker/releases.json | 4 ++-- lib/version.py | 2 +- plugins/shuffle/comms.py | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/contrib/update_checker/releases.json b/contrib/update_checker/releases.json index e6aafe8db1eb..02c5d535b8f0 100644 --- a/contrib/update_checker/releases.json +++ b/contrib/update_checker/releases.json @@ -5,7 +5,7 @@ "3.3.4CS": { "bitcoincash:qphax4cg8sxuc0qnzk6sx25939ma7y877uz04s2z82": "HNkxAJzvWGP5/YPIJrZRQFK5btM1nd/NKCwWAlejc5oEJ6VNbzo6KfqOoIBpPTauK21Tp/qXY7SMmlO+6ssMPOA=" }, - "3.9.0ShufBeta": { - "bitcoincash:qphax4cg8sxuc0qnzk6sx25939ma7y877uz04s2z82": "G4EnHCg4Ar6G8nPqIX5x0imPrpbu9nq63cnxibC6c0NZQ6HLulvhsc/osaJaC7d8xOUxKkjFI5ROgeRhdpJg1Qk=" + "3.9.1ShufBeta": { + "bitcoincash:qphax4cg8sxuc0qnzk6sx25939ma7y877uz04s2z82": "G1JYWsdrgHKnSsXbO7IV6LlJrBuOSMT1fpwvIcmvAWjZPcb0j5Gkr7kWCVVdXMXXoezn313Hpq/K6vQdSEHo5xc=" } } diff --git a/lib/version.py b/lib/version.py index c7749ea6a3a0..deb6a5487d04 100644 --- a/lib/version.py +++ b/lib/version.py @@ -1,4 +1,4 @@ -PACKAGE_VERSION = '3.9.0ShufBeta' # version of the client package +PACKAGE_VERSION = '3.9.1ShufBeta' # version of the client package PROTOCOL_VERSION = '1.4' # protocol version requested # The hash of the mnemonic seed must begin with this diff --git a/plugins/shuffle/comms.py b/plugins/shuffle/comms.py index 20312a37c209..0b1e1c0017ed 100644 --- a/plugins/shuffle/comms.py +++ b/plugins/shuffle/comms.py @@ -4,14 +4,17 @@ from electroncash.interface import Connection from electroncash.util import print_error -# Temporary hack to suppress InsecureRequestWarning. Need to actually do a -# whole song and dance to verify SSL certs. Blergh. -# https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl -# -# Note: We do end up verifying SSL certs per-socket, but we do it explicitly -# in verify_ssl_socket() in this fiile, and not necessarily for _every_ urllib3 -# request. -requests.urllib3.disable_warnings(requests.urllib3.exceptions.InsecureRequestWarning) +# urllib3 may be missing from requests namespace in older requests versions. safe to ignore. See Electron-Cash#1172 +if hasattr(requests, 'urllib3'): + # Temporary hack to suppress InsecureRequestWarning. Need to actually do a + # whole song and dance to verify SSL certs. Blergh. + # https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl + # + # Note: We do end up verifying SSL certs per-socket, but we do it explicitly + # in verify_ssl_socket() in this fiile, and not necessarily for _every_ urllib3 + # request. + requests.urllib3.disable_warnings(requests.urllib3.exceptions.InsecureRequestWarning) + class Channel(queue.Queue): """ simple Queue wrapper for using recv and send """