Skip to content

Commit ccfe4b7

Browse files
authored
Merge pull request #11 from jerryneedell/jerryn_bytes
fix byte strings for Blinka compatibility
2 parents 31d7845 + d20bddf commit ccfe4b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_requests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ def request(method, url, data=None, json=None, headers=None, stream=False, timeo
192192
else:
193193
conntype = _the_interface.TCP_MODE
194194
sock.connect(addr_info[-1], conntype)
195-
sock.send(b"%s /%s HTTP/1.0\r\n" % (method, path))
195+
sock.send(b"%s /%s HTTP/1.0\r\n" % (bytes(method, "utf-8"), bytes(path, "utf-8")))
196196
if "Host" not in headers:
197-
sock.send(b"Host: %s\r\n" % host)
197+
sock.send(b"Host: %s\r\n" % bytes(host, "utf-8"))
198198
if "User-Agent" not in headers:
199199
sock.send(b"User-Agent: Adafruit CircuitPython\r\n")
200200
# Iterate over keys to avoid tuple alloc

0 commit comments

Comments
 (0)