kopia lustrzana https://github.com/micropython/micropython-lib
http.client: Explicitly check for str type instead of "encode" method.
MicroPython string type shares setup with bytes, and thus both have entries for "encode" and "decode" (but only one valid for a type really works).pull/118/head^2
rodzic
5fb6c52c1f
commit
471d805b45
|
@ -1037,7 +1037,7 @@ class HTTPConnection:
|
|||
header = header.encode('ascii')
|
||||
values = list(values)
|
||||
for i, one_value in enumerate(values):
|
||||
if hasattr(one_value, 'encode'):
|
||||
if isinstance(one_value, str):
|
||||
values[i] = one_value.encode('latin-1')
|
||||
elif isinstance(one_value, int):
|
||||
values[i] = str(one_value).encode('ascii')
|
||||
|
|
Ładowanie…
Reference in New Issue