Drop unneccessary binascii import (#2909)
* Drop unneccessary binascii import * Update httpx/_multipart.py Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com> * boundary is 'bytes' not 'str' --------- Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>
This commit is contained in:
parent
31a7bb381a
commit
9751f76186
@ -1,4 +1,3 @@
|
||||
import binascii
|
||||
import io
|
||||
import os
|
||||
import typing
|
||||
@ -200,7 +199,7 @@ class MultipartStream(SyncByteStream, AsyncByteStream):
|
||||
boundary: typing.Optional[bytes] = None,
|
||||
) -> None:
|
||||
if boundary is None:
|
||||
boundary = binascii.hexlify(os.urandom(16))
|
||||
boundary = os.urandom(16).hex().encode("ascii")
|
||||
|
||||
self.boundary = boundary
|
||||
self.content_type = "multipart/form-data; boundary=%s" % boundary.decode(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user