mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Update vendored requests to 2.25.1
Updates certifi to 2021.5.30 Updates chardet to 4.0.0 Updates idna to 2.10 Updates urllib3 to 1.26.13
This commit is contained in:
parent
56c6773c6b
commit
501be2c479
81 changed files with 38530 additions and 4957 deletions
|
@ -1,15 +1,15 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import binascii
|
||||
import codecs
|
||||
import os
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from .fields import RequestField
|
||||
from .packages import six
|
||||
from .packages.six import b
|
||||
from .fields import RequestField
|
||||
|
||||
writer = codecs.lookup('utf-8')[3]
|
||||
writer = codecs.lookup("utf-8")[3]
|
||||
|
||||
|
||||
def choose_boundary():
|
||||
|
@ -17,8 +17,8 @@ def choose_boundary():
|
|||
Our embarrassingly-simple replacement for mimetools.choose_boundary.
|
||||
"""
|
||||
boundary = binascii.hexlify(os.urandom(16))
|
||||
if six.PY3:
|
||||
boundary = boundary.decode('ascii')
|
||||
if not six.PY2:
|
||||
boundary = boundary.decode("ascii")
|
||||
return boundary
|
||||
|
||||
|
||||
|
@ -76,7 +76,7 @@ def encode_multipart_formdata(fields, boundary=None):
|
|||
boundary = choose_boundary()
|
||||
|
||||
for field in iter_field_objects(fields):
|
||||
body.write(b('--%s\r\n' % (boundary)))
|
||||
body.write(b("--%s\r\n" % (boundary)))
|
||||
|
||||
writer(body).write(field.render_headers())
|
||||
data = field.data
|
||||
|
@ -89,10 +89,10 @@ def encode_multipart_formdata(fields, boundary=None):
|
|||
else:
|
||||
body.write(data)
|
||||
|
||||
body.write(b'\r\n')
|
||||
body.write(b"\r\n")
|
||||
|
||||
body.write(b('--%s--\r\n' % (boundary)))
|
||||
body.write(b("--%s--\r\n" % (boundary)))
|
||||
|
||||
content_type = str('multipart/form-data; boundary=%s' % boundary)
|
||||
content_type = str("multipart/form-data; boundary=%s" % boundary)
|
||||
|
||||
return body.getvalue(), content_type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue