From 126eae8793db89090fb8f4ca6466e938c350545f Mon Sep 17 00:00:00 2001 From: sfromis <47082390+sfromis@users.noreply.github.com> Date: Fri, 26 Jun 2020 01:37:38 +0200 Subject: [PATCH] Fixing TypeError in error message It is pretty annoying to get ```File "urequests.py", line 95, in request TypeError: can't convert 'bytes' object to str implicitly``` instead of being told what was not supported. :-) Fixing --- urequests/urequests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/urequests/urequests.py b/urequests/urequests.py index acb220e85..e7fa3b19d 100644 --- a/urequests/urequests.py +++ b/urequests/urequests.py @@ -92,7 +92,7 @@ def request(method, url, data=None, json=None, headers={}, stream=None): #print(l) if l.startswith(b"Transfer-Encoding:"): if b"chunked" in l: - raise ValueError("Unsupported " + l) + raise ValueError("Unsupported " + str(l)) elif l.startswith(b"Location:") and not 200 <= status <= 299: raise NotImplementedError("Redirects not yet supported") except OSError: