We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Rtorrent Not connecting
### Before submitting your issue:

Enable debug logging in Medusa settings, reproduce the error (be sure to disable after the bug is fixed)

**Branch/Commit:Main/latest
**OS:Ubuntu 16.x
**What you did: Attempted to connect my seedboxes rTorrent instance, doublechecked with seedbox company to confirm my information is correct
**What happened: "Could Not connect to rtorrent"
**What you expected: .... Connection to r torrent
**Logs:**
```
2017-09-06 14:43:36 DEBUG    SNATCHQUEUE-MANUALSNATCH-72218 :: [3f23fd2] Traceback (most recent call last):
  File "/opt/medusa/medusa/search/queue.py", line 487, in run
    self.success = snatch_episode(result)
  File "/opt/medusa/medusa/search/core.py", line 153, in snatch_episode
    result_downloaded = client.send_torrent(result)
  File "/opt/medusa/medusa/clients/torrent/generic.py", line 242, in send_torrent
    if not self._get_auth():
  File "/opt/medusa/medusa/clients/torrent/rtorrent_client.py", line 50, in _get_auth
    self.auth = RTorrent(self.host, self.username, self.password, True, tp_kwargs=tp_kwargs)
  File "/opt/medusa/lib/rtorrent/__init__.py", line 83, in __init__
    self._verify_conn()
  File "/opt/medusa/lib/rtorrent/__init__.py", line 122, in _verify_conn
    assert "system.client_version" in self._get_rpc_methods(
  File "/opt/medusa/lib/rtorrent/__init__.py", line 161, in _get_rpc_methods
    return(self._rpc_methods or self._update_rpc_methods())
  File "/opt/medusa/lib/rtorrent/__init__.py", line 150, in _update_rpc_methods
    self._rpc_methods = self._get_conn().system.listMethods()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
    verbose=self.__verbose
  File "/opt/medusa/lib/rtorrent/lib/xmlrpc/requests_transport.py", line 150, in request
    response.headers)
ProtocolError: <ProtocolError for http://nl4727.dediseedbox.com//rutorrent/plugins/httprpc/action.php: 401 Client Error: Unauthorized for url: http://nl4727.dediseedbox.com//rutorrent/plugins/httprpc/action.php Traceback (most recent call last):
  File "/opt/medusa/lib/rtorrent/lib/xmlrpc/requests_transport.py", line 145, in request
    response.raise_for_status()
  File "/opt/medusa/lib/requests/models.py", line 844, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 401 Client Error: Unauthorized for url: http://nl4727.dediseedbox.com//rutorrent/plugins/httprpc/action.php
```
Side Note, this does work with couchpotato

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `lib/rtorrent/lib/xmlrpc/requests_transport.py`
Content:
```
1 # Copyright (c) 2013-2015 Alexandre Beloin, <alexandre.beloin@gmail.com>
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 
13 # You should have received a copy of the GNU General Public License
14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
15 
16 """A transport for Python2/3 xmlrpc library using requests
17 
18 Support:
19 -SSL with Basic and Digest authentication
20 -Proxies
21 """
22 
23 try:
24     import xmlrpc.client as xmlrpc_client
25 except ImportError:
26     import xmlrpclib as xmlrpc_client
27 
28 import traceback
29 
30 import requests
31 from requests.exceptions import RequestException
32 from requests.auth import HTTPBasicAuth
33 from requests.auth import HTTPDigestAuth
34 from requests.packages.urllib3 import disable_warnings  # @UnresolvedImport
35 
36 
37 class RequestsTransport(xmlrpc_client.Transport):
38 
39     """Transport class for xmlrpc using requests"""
40 
41     def __init__(self, use_https=True, authtype=None, username=None,
42                  password=None, check_ssl_cert=True, proxies=None):
43         """Inits RequestsTransport.
44 
45         Args:
46             use_https: If true, https else http
47             authtype: None, basic or digest
48             username: Username
49             password: Password
50             check_ssl_cert: Check SSL certificate
51             proxies: A dict of proxies(
52                      Ex: {"http": "http://10.10.1.10:3128",
53                           "https": "http://10.10.1.10:1080",})
54 
55         Raises:
56             ValueError: Invalid info
57         """
58         # Python 2 can't use super on old style class.
59         if issubclass(xmlrpc_client.Transport, object):
60             super(RequestsTransport, self).__init__()
61         else:
62             xmlrpc_client.Transport.__init__(self)
63 
64         self.user_agent = "Python Requests/" + requests.__version__
65 
66         self._use_https = use_https
67         self._check_ssl_cert = check_ssl_cert
68 
69         if authtype == "basic" or authtype == "digest":
70             self._authtype = authtype
71         else:
72             raise ValueError(
73                 "Supported authentication are: basic and digest")
74         if authtype and (not username or not password):
75             raise ValueError(
76                 "Username and password required when using authentication")
77 
78         self._username = username
79         self._password = password
80         if proxies is None:
81             self._proxies = {}
82         else:
83             self._proxies = proxies
84 
85     def request(self, host, handler, request_body, verbose=0):
86         """Replace the xmlrpc request function.
87 
88         Process xmlrpc request via requests library.
89 
90         Args:
91             host: Target host
92             handler: Target PRC handler.
93             request_body: XML-RPC request body.
94             verbose: Debugging flag.
95 
96         Returns:
97             Parsed response.
98 
99         Raises:
100             RequestException: Error in requests
101         """
102         if verbose:
103             self._debug()
104 
105         if not self._check_ssl_cert:
106             disable_warnings()
107 
108         headers = {'User-Agent': self.user_agent, 'Content-Type': 'text/xml', }
109 
110         # Need to be done because the schema(http or https) is lost in
111         # xmlrpc.Transport's init.
112         if self._use_https:
113             url = "https://{host}/{handler}".format(host=host, handler=handler)
114         else:
115             url = "http://{host}/{handler}".format(host=host, handler=handler)
116 
117         # TODO Construct kwargs query instead
118         try:
119             if self._authtype == "basic":
120                 response = requests.post(
121                     url,
122                     data=request_body,
123                     headers=headers,
124                     verify=self._check_ssl_cert,
125                     auth=HTTPBasicAuth(
126                         self._username, self._password),
127                     proxies=self._proxies)
128             elif self._authtype == "digest":
129                 response = requests.post(
130                     url,
131                     data=request_body,
132                     headers=headers,
133                     verify=self._check_ssl_cert,
134                     auth=HTTPDigestAuth(
135                         self._username, self._password),
136                     proxies=self._proxies)
137             else:
138                 response = requests.post(
139                     url,
140                     data=request_body,
141                     headers=headers,
142                     verify=self._check_ssl_cert,
143                     proxies=self._proxies)
144 
145             response.raise_for_status()
146         except RequestException as error:
147             raise xmlrpc_client.ProtocolError(url,
148                                               error.message,
149                                               traceback.format_exc(),
150                                               response.headers)
151 
152         return self.parse_response(response)
153 
154     def parse_response(self, response):
155         """Replace the xmlrpc parse_response function.
156 
157         Parse response.
158 
159         Args:
160             response: Requests return data
161 
162         Returns:
163             Response tuple and target method.
164         """
165         p, u = self.getparser()
166         p.feed(response.text.encode('utf-8'))
167         p.close()
168         return u.close()
169 
170     def _debug(self):
171         """Debug requests module.
172 
173         Enable verbose logging from requests
174         """
175         # TODO Ugly
176         import logging
177         try:
178             import http.client as http_client
179         except ImportError:
180             import httplib as http_client
181 
182         http_client.HTTPConnection.debuglevel = 1
183 
184         logging.basicConfig()
185         logging.getLogger().setLevel(logging.DEBUG)
186         requests_log = logging.getLogger("requests.packages.urllib3")
187         requests_log.setLevel(logging.DEBUG)
188         requests_log.propagate = True
189
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/lib/rtorrent/lib/xmlrpc/requests_transport.py b/lib/rtorrent/lib/xmlrpc/requests_transport.py
--- a/lib/rtorrent/lib/xmlrpc/requests_transport.py
+++ b/lib/rtorrent/lib/xmlrpc/requests_transport.py
@@ -110,9 +110,9 @@
         # Need to be done because the schema(http or https) is lost in
         # xmlrpc.Transport's init.
         if self._use_https:
-            url = "https://{host}/{handler}".format(host=host, handler=handler)
+            url = "https://{host}{handler}".format(host=host, handler=handler)
         else:
-            url = "http://{host}/{handler}".format(host=host, handler=handler)
+            url = "http://{host}{handler}".format(host=host, handler=handler)
 
         # TODO Construct kwargs query instead
         try:

{"golden_diff": "diff --git a/lib/rtorrent/lib/xmlrpc/requests_transport.py b/lib/rtorrent/lib/xmlrpc/requests_transport.py\n--- a/lib/rtorrent/lib/xmlrpc/requests_transport.py\n+++ b/lib/rtorrent/lib/xmlrpc/requests_transport.py\n@@ -110,9 +110,9 @@\n         # Need to be done because the schema(http or https) is lost in\n         # xmlrpc.Transport's init.\n         if self._use_https:\n-            url = \"https://{host}/{handler}\".format(host=host, handler=handler)\n+            url = \"https://{host}{handler}\".format(host=host, handler=handler)\n         else:\n-            url = \"http://{host}/{handler}\".format(host=host, handler=handler)\n+            url = \"http://{host}{handler}\".format(host=host, handler=handler)\n \n         # TODO Construct kwargs query instead\n         try:\n", "issue": "Rtorrent Not connecting\n### Before submitting your issue:\r\n\r\nEnable debug logging in Medusa settings, reproduce the error (be sure to disable after the bug is fixed)\r\n\r\n**Branch/Commit:Main/latest\r\n**OS:Ubuntu 16.x\r\n**What you did: Attempted to connect my seedboxes rTorrent instance, doublechecked with seedbox company to confirm my information is correct\r\n**What happened: \"Could Not connect to rtorrent\"\r\n**What you expected: .... Connection to r torrent\r\n**Logs:**\r\n```\r\n2017-09-06 14:43:36 DEBUG    SNATCHQUEUE-MANUALSNATCH-72218 :: [3f23fd2] Traceback (most recent call last):\r\n  File \"/opt/medusa/medusa/search/queue.py\", line 487, in run\r\n    self.success = snatch_episode(result)\r\n  File \"/opt/medusa/medusa/search/core.py\", line 153, in snatch_episode\r\n    result_downloaded = client.send_torrent(result)\r\n  File \"/opt/medusa/medusa/clients/torrent/generic.py\", line 242, in send_torrent\r\n    if not self._get_auth():\r\n  File \"/opt/medusa/medusa/clients/torrent/rtorrent_client.py\", line 50, in _get_auth\r\n    self.auth = RTorrent(self.host, self.username, self.password, True, tp_kwargs=tp_kwargs)\r\n  File \"/opt/medusa/lib/rtorrent/__init__.py\", line 83, in __init__\r\n    self._verify_conn()\r\n  File \"/opt/medusa/lib/rtorrent/__init__.py\", line 122, in _verify_conn\r\n    assert \"system.client_version\" in self._get_rpc_methods(\r\n  File \"/opt/medusa/lib/rtorrent/__init__.py\", line 161, in _get_rpc_methods\r\n    return(self._rpc_methods or self._update_rpc_methods())\r\n  File \"/opt/medusa/lib/rtorrent/__init__.py\", line 150, in _update_rpc_methods\r\n    self._rpc_methods = self._get_conn().system.listMethods()\r\n  File \"/usr/lib/python2.7/xmlrpclib.py\", line 1243, in __call__\r\n    return self.__send(self.__name, args)\r\n  File \"/usr/lib/python2.7/xmlrpclib.py\", line 1602, in __request\r\n    verbose=self.__verbose\r\n  File \"/opt/medusa/lib/rtorrent/lib/xmlrpc/requests_transport.py\", line 150, in request\r\n    response.headers)\r\nProtocolError: <ProtocolError for http://nl4727.dediseedbox.com//rutorrent/plugins/httprpc/action.php: 401 Client Error: Unauthorized for url: http://nl4727.dediseedbox.com//rutorrent/plugins/httprpc/action.php Traceback (most recent call last):\r\n  File \"/opt/medusa/lib/rtorrent/lib/xmlrpc/requests_transport.py\", line 145, in request\r\n    response.raise_for_status()\r\n  File \"/opt/medusa/lib/requests/models.py\", line 844, in raise_for_status\r\n    raise HTTPError(http_error_msg, response=self)\r\nHTTPError: 401 Client Error: Unauthorized for url: http://nl4727.dediseedbox.com//rutorrent/plugins/httprpc/action.php\r\n```\r\nSide Note, this does work with couchpotato\n", "before_files": [{"content": "# Copyright (c) 2013-2015 Alexandre Beloin, <alexandre.beloin@gmail.com>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n\"\"\"A transport for Python2/3 xmlrpc library using requests\n\nSupport:\n-SSL with Basic and Digest authentication\n-Proxies\n\"\"\"\n\ntry:\n    import xmlrpc.client as xmlrpc_client\nexcept ImportError:\n    import xmlrpclib as xmlrpc_client\n\nimport traceback\n\nimport requests\nfrom requests.exceptions import RequestException\nfrom requests.auth import HTTPBasicAuth\nfrom requests.auth import HTTPDigestAuth\nfrom requests.packages.urllib3 import disable_warnings  # @UnresolvedImport\n\n\nclass RequestsTransport(xmlrpc_client.Transport):\n\n    \"\"\"Transport class for xmlrpc using requests\"\"\"\n\n    def __init__(self, use_https=True, authtype=None, username=None,\n                 password=None, check_ssl_cert=True, proxies=None):\n        \"\"\"Inits RequestsTransport.\n\n        Args:\n            use_https: If true, https else http\n            authtype: None, basic or digest\n            username: Username\n            password: Password\n            check_ssl_cert: Check SSL certificate\n            proxies: A dict of proxies(\n                     Ex: {\"http\": \"http://10.10.1.10:3128\",\n                          \"https\": \"http://10.10.1.10:1080\",})\n\n        Raises:\n            ValueError: Invalid info\n        \"\"\"\n        # Python 2 can't use super on old style class.\n        if issubclass(xmlrpc_client.Transport, object):\n            super(RequestsTransport, self).__init__()\n        else:\n            xmlrpc_client.Transport.__init__(self)\n\n        self.user_agent = \"Python Requests/\" + requests.__version__\n\n        self._use_https = use_https\n        self._check_ssl_cert = check_ssl_cert\n\n        if authtype == \"basic\" or authtype == \"digest\":\n            self._authtype = authtype\n        else:\n            raise ValueError(\n                \"Supported authentication are: basic and digest\")\n        if authtype and (not username or not password):\n            raise ValueError(\n                \"Username and password required when using authentication\")\n\n        self._username = username\n        self._password = password\n        if proxies is None:\n            self._proxies = {}\n        else:\n            self._proxies = proxies\n\n    def request(self, host, handler, request_body, verbose=0):\n        \"\"\"Replace the xmlrpc request function.\n\n        Process xmlrpc request via requests library.\n\n        Args:\n            host: Target host\n            handler: Target PRC handler.\n            request_body: XML-RPC request body.\n            verbose: Debugging flag.\n\n        Returns:\n            Parsed response.\n\n        Raises:\n            RequestException: Error in requests\n        \"\"\"\n        if verbose:\n            self._debug()\n\n        if not self._check_ssl_cert:\n            disable_warnings()\n\n        headers = {'User-Agent': self.user_agent, 'Content-Type': 'text/xml', }\n\n        # Need to be done because the schema(http or https) is lost in\n        # xmlrpc.Transport's init.\n        if self._use_https:\n            url = \"https://{host}/{handler}\".format(host=host, handler=handler)\n        else:\n            url = \"http://{host}/{handler}\".format(host=host, handler=handler)\n\n        # TODO Construct kwargs query instead\n        try:\n            if self._authtype == \"basic\":\n                response = requests.post(\n                    url,\n                    data=request_body,\n                    headers=headers,\n                    verify=self._check_ssl_cert,\n                    auth=HTTPBasicAuth(\n                        self._username, self._password),\n                    proxies=self._proxies)\n            elif self._authtype == \"digest\":\n                response = requests.post(\n                    url,\n                    data=request_body,\n                    headers=headers,\n                    verify=self._check_ssl_cert,\n                    auth=HTTPDigestAuth(\n                        self._username, self._password),\n                    proxies=self._proxies)\n            else:\n                response = requests.post(\n                    url,\n                    data=request_body,\n                    headers=headers,\n                    verify=self._check_ssl_cert,\n                    proxies=self._proxies)\n\n            response.raise_for_status()\n        except RequestException as error:\n            raise xmlrpc_client.ProtocolError(url,\n                                              error.message,\n                                              traceback.format_exc(),\n                                              response.headers)\n\n        return self.parse_response(response)\n\n    def parse_response(self, response):\n        \"\"\"Replace the xmlrpc parse_response function.\n\n        Parse response.\n\n        Args:\n            response: Requests return data\n\n        Returns:\n            Response tuple and target method.\n        \"\"\"\n        p, u = self.getparser()\n        p.feed(response.text.encode('utf-8'))\n        p.close()\n        return u.close()\n\n    def _debug(self):\n        \"\"\"Debug requests module.\n\n        Enable verbose logging from requests\n        \"\"\"\n        # TODO Ugly\n        import logging\n        try:\n            import http.client as http_client\n        except ImportError:\n            import httplib as http_client\n\n        http_client.HTTPConnection.debuglevel = 1\n\n        logging.basicConfig()\n        logging.getLogger().setLevel(logging.DEBUG)\n        requests_log = logging.getLogger(\"requests.packages.urllib3\")\n        requests_log.setLevel(logging.DEBUG)\n        requests_log.propagate = True\n", "path": "lib/rtorrent/lib/xmlrpc/requests_transport.py"}], "after_files": [{"content": "# Copyright (c) 2013-2015 Alexandre Beloin, <alexandre.beloin@gmail.com>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n\"\"\"A transport for Python2/3 xmlrpc library using requests\n\nSupport:\n-SSL with Basic and Digest authentication\n-Proxies\n\"\"\"\n\ntry:\n    import xmlrpc.client as xmlrpc_client\nexcept ImportError:\n    import xmlrpclib as xmlrpc_client\n\nimport traceback\n\nimport requests\nfrom requests.exceptions import RequestException\nfrom requests.auth import HTTPBasicAuth\nfrom requests.auth import HTTPDigestAuth\nfrom requests.packages.urllib3 import disable_warnings  # @UnresolvedImport\n\n\nclass RequestsTransport(xmlrpc_client.Transport):\n\n    \"\"\"Transport class for xmlrpc using requests\"\"\"\n\n    def __init__(self, use_https=True, authtype=None, username=None,\n                 password=None, check_ssl_cert=True, proxies=None):\n        \"\"\"Inits RequestsTransport.\n\n        Args:\n            use_https: If true, https else http\n            authtype: None, basic or digest\n            username: Username\n            password: Password\n            check_ssl_cert: Check SSL certificate\n            proxies: A dict of proxies(\n                     Ex: {\"http\": \"http://10.10.1.10:3128\",\n                          \"https\": \"http://10.10.1.10:1080\",})\n\n        Raises:\n            ValueError: Invalid info\n        \"\"\"\n        # Python 2 can't use super on old style class.\n        if issubclass(xmlrpc_client.Transport, object):\n            super(RequestsTransport, self).__init__()\n        else:\n            xmlrpc_client.Transport.__init__(self)\n\n        self.user_agent = \"Python Requests/\" + requests.__version__\n\n        self._use_https = use_https\n        self._check_ssl_cert = check_ssl_cert\n\n        if authtype == \"basic\" or authtype == \"digest\":\n            self._authtype = authtype\n        else:\n            raise ValueError(\n                \"Supported authentication are: basic and digest\")\n        if authtype and (not username or not password):\n            raise ValueError(\n                \"Username and password required when using authentication\")\n\n        self._username = username\n        self._password = password\n        if proxies is None:\n            self._proxies = {}\n        else:\n            self._proxies = proxies\n\n    def request(self, host, handler, request_body, verbose=0):\n        \"\"\"Replace the xmlrpc request function.\n\n        Process xmlrpc request via requests library.\n\n        Args:\n            host: Target host\n            handler: Target PRC handler.\n            request_body: XML-RPC request body.\n            verbose: Debugging flag.\n\n        Returns:\n            Parsed response.\n\n        Raises:\n            RequestException: Error in requests\n        \"\"\"\n        if verbose:\n            self._debug()\n\n        if not self._check_ssl_cert:\n            disable_warnings()\n\n        headers = {'User-Agent': self.user_agent, 'Content-Type': 'text/xml', }\n\n        # Need to be done because the schema(http or https) is lost in\n        # xmlrpc.Transport's init.\n        if self._use_https:\n            url = \"https://{host}{handler}\".format(host=host, handler=handler)\n        else:\n            url = \"http://{host}{handler}\".format(host=host, handler=handler)\n\n        # TODO Construct kwargs query instead\n        try:\n            if self._authtype == \"basic\":\n                response = requests.post(\n                    url,\n                    data=request_body,\n                    headers=headers,\n                    verify=self._check_ssl_cert,\n                    auth=HTTPBasicAuth(\n                        self._username, self._password),\n                    proxies=self._proxies)\n            elif self._authtype == \"digest\":\n                response = requests.post(\n                    url,\n                    data=request_body,\n                    headers=headers,\n                    verify=self._check_ssl_cert,\n                    auth=HTTPDigestAuth(\n                        self._username, self._password),\n                    proxies=self._proxies)\n            else:\n                response = requests.post(\n                    url,\n                    data=request_body,\n                    headers=headers,\n                    verify=self._check_ssl_cert,\n                    proxies=self._proxies)\n\n            response.raise_for_status()\n        except RequestException as error:\n            raise xmlrpc_client.ProtocolError(url,\n                                              error.message,\n                                              traceback.format_exc(),\n                                              response.headers)\n\n        return self.parse_response(response)\n\n    def parse_response(self, response):\n        \"\"\"Replace the xmlrpc parse_response function.\n\n        Parse response.\n\n        Args:\n            response: Requests return data\n\n        Returns:\n            Response tuple and target method.\n        \"\"\"\n        p, u = self.getparser()\n        p.feed(response.text.encode('utf-8'))\n        p.close()\n        return u.close()\n\n    def _debug(self):\n        \"\"\"Debug requests module.\n\n        Enable verbose logging from requests\n        \"\"\"\n        # TODO Ugly\n        import logging\n        try:\n            import http.client as http_client\n        except ImportError:\n            import httplib as http_client\n\n        http_client.HTTPConnection.debuglevel = 1\n\n        logging.basicConfig()\n        logging.getLogger().setLevel(logging.DEBUG)\n        requests_log = logging.getLogger(\"requests.packages.urllib3\")\n        requests_log.setLevel(logging.DEBUG)\n        requests_log.propagate = True\n", "path": "lib/rtorrent/lib/xmlrpc/requests_transport.py"}]}