Re ddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ej dd Zd Zd Zd Zdd ZdS))absolute_importN)BytesIO) RequestField)six)bzutf-8ctjtjd}tjs|d}|S)zN Our embarrassingly-simple replacement for mimetools.choose_boundary. ascii)binasciihexlifyosurandomrPY2decode)boundarys /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/urllib3/filepost.pychoose_boundaryrs< 2//H 7,??7++ Oc#Kt|trtj|}nt |}|D],}t|t r|Vt j|V-dS)z Iterate over fields. Supports list of (k, v) tuples and dicts, and lists of :class:`~urllib3.fields.RequestField`. N) isinstancedictr iteritemsiterr from_tuples)fieldsifields riter_field_objectsr s&$ M& ! ! LL33 e\ * * 3KKKK*E2 2 2 2 2 33rct|trdtj|DSd|DS)a- .. deprecated:: 1.6 Iterate over fields. The addition of :class:`~urllib3.fields.RequestField` makes this function obsolete. Instead, use :func:`iter_field_objects`, which returns :class:`~urllib3.fields.RequestField` objects. Supports list of (k, v) tuples and dicts. c3$K|] \}}||fV dSN.0kvs r ziter_fields..:s*9941aA999999rc3$K|] \}}||fV dSr#r$r%s rr)ziter_fields..<s* & &tq!QF & & & & & &r)rrrr)rs r iter_fieldsr+-sH&$:993=#8#89999 & &v & & &&rct}|t}t|D]}|t d|zt |||j}t|trt|}t|tj r#t ||n|||d|t d|ztd|z}| |fS)aQ Encode a dictionary of ``fields`` using the multipart/form-data MIME format. :param fields: Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`). :param boundary: If not specified, then a random boundary will be generated using :func:`urllib3.filepost.choose_boundary`. Nz--%s s z--%s-- z multipart/form-data; boundary=%s)rrr writerwriterrender_headersdatarintstrr text_typegetvalue)rrbodyrr0 content_types rencode_multipart_formdatar7?s; 99D"$$#F++ 1Z8,--...t 5//11222z dC  t99D dCM * *  4LL  t $ $ $ $ JJt    7JJq*++,,,9HDEEL ==??L ((rr#) __future__rr codecsriorrrpackagesr packages.sixrlookupr.rr r+r7r$rrr>s&&&&&&   w   "333('''$#)#)#)#)#)#)r