Files
pyGoEdge-UserPanel/.venv/Lib/site-packages/urllib3/__pycache__/fields.cpython-312.pyc

161 lines
12 KiB
Plaintext
Raw Normal View History

2025-11-18 03:36:49 +08:00
<EFBFBD>
f<> iM*<00><01><><00>ddlmZddlZddlZddlZej eefZ ej e e
ee fe
ee effZ d
d d<03>Z d d<04>Z d d<05>Zd d<06>Zd d<07>ZGd<08>d <09>Zy) <0A>)<01> annotationsNc<01>B<00>|rtj|<00>dxs|S|S)z<>
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Content-Type" can be guessed, default to `default`.
r)<02> mimetypes<65>
guess_type)<02>filename<6D>defaults <20>=E:\Project\pygoedge\.venv\Lib\site-packages\urllib3/fields.py<70>guess_content_typer
s'<00><00><10><18>#<23>#<23>H<EFBFBD>-<2D>a<EFBFBD>0<>;<3B>G<EFBFBD>;<3B> <12>N<EFBFBD>c<01>Z<00><01>ddl}|jdtd<04><05>t<00>t<00>r<11>j d<06><00>t <00>fd<07>dD<00><00>s|<00>d <09><01>d
<EFBFBD>} |jd <0B>|Stjj<00>d<06><00>|<00>d <0C><01><00><03><01>S#ttf$rY<00>:wxYw) a<>
Helper function to format and quote a single header parameter using the
strategy defined in RFC 2231.
Particularly useful for header parameters which might contain
non-ASCII values, like file names. This follows
`RFC 2388 Section 4.4 <https://tools.ietf.org/html/rfc2388#section-4.4>`_.
:param name:
The name of the parameter, a string expected to be ASCII only.
:param value:
The value of the parameter, provided as ``bytes`` or `str``.
:returns:
An RFC-2231-formatted unicode string.
.. deprecated:: 2.0.0
Will be removed in urllib3 v2.1.0. This is not valid for
``multipart/form-data`` header parameters.
rNz<4E>'format_header_param_rfc2231' is deprecated and will be removed in urllib3 v2.1.0. This is not valid for multipart/form-data header parameters.<2E><00><01>
stacklevel<EFBFBD>utf-8c3<01>&<00>K<00>|]}|<01>v<00><01><00>
y<00>w<01>N<>)<03>.0<EFBFBD>ch<63>values <20>r <00> <genexpr>z.format_header_param_rfc2231.<locals>.<genexpr>@s<00><><00><><00>/<2F>Y<EFBFBD>r<EFBFBD>r<EFBFBD>U<EFBFBD>{<7B>Y<EFBFBD>s<00>z"\
<EFBFBD>="<22>"<22>asciiz*=) <0A>warnings<67>warn<72>DeprecationWarning<6E>
isinstance<EFBFBD>bytes<65>decode<64>any<6E>encode<64>UnicodeEncodeError<6F>UnicodeDecodeError<6F>email<69>utils<6C>encode_rfc2231)<04>namerr<00>results ` r <00>format_header_param_rfc2231r*s<><00><><00>(<14> <0C>M<EFBFBD>M<EFBFBD> 1<> <1B><14> <12><06><12>%<25><15><1F><15> <0C> <0C>W<EFBFBD>%<25><05> <0E>/<2F>Y<EFBFBD>/<2F> /<2F><18>6<EFBFBD><12>E<EFBFBD>7<EFBFBD>!<21>$<24><06> <1A> <12>M<EFBFBD>M<EFBFBD>'<27> "<22><1A>M<EFBFBD> <11>K<EFBFBD>K<EFBFBD> &<26> &<26>u<EFBFBD>g<EFBFBD> 6<>E<EFBFBD><13>f<EFBFBD>B<EFBFBD>u<EFBFBD>g<EFBFBD> <1E>E<EFBFBD> <10>L<EFBFBD><4C>#<23>$6<>7<> <11> <10> <11>s<00>B<00>B*<03>)B*c<01>~<00>t|t<00>r|jd<01>}|jdddd<05><03>}|<00>d|<01>d<07>S)a<>
Format and quote a single multipart header parameter.
This follows the `WHATWG HTML Standard`_ as of 2021/06/10, matching
the behavior of current browser and curl versions. Values are
assumed to be UTF-8. The ``\n``, ``\r``, and ``"`` characters are
percent encoded.
.. _WHATWG HTML Standard:
https://html.spec.whatwg.org/multipage/
form-control-infrastructure.html#multipart-form-data
:param name:
The name of the parameter, an ASCII-only ``str``.
:param value:
The value of the parameter, a ``str`` or UTF-8 encoded
``bytes``.
:returns:
A string ``name="value"`` with the escaped value.
.. versionchanged:: 2.0.0
Matches the WHATWG HTML Standard as of 2021/06/10. Control
characters are no longer percent encoded.
.. versionchanged:: 2.0.0
Renamed from ``format_header_param_html5`` and
``format_header_param``. The old names will be removed in
urllib3 v2.1.0.
rz%0Az%0Dz%22)<03>
<00> <00>"rr)rrr <00> translate)r(rs r <00>format_multipart_header_paramr0OsF<00><00><<12>%<25><15><1F><15> <0C> <0C>W<EFBFBD>%<25><05> <12>O<EFBFBD>O<EFBFBD><15>E<EFBFBD>u<EFBFBD>=<3D> ><3E>E<EFBFBD><12>V<EFBFBD>2<EFBFBD>e<EFBFBD>W<EFBFBD>A<EFBFBD> <1E>r c<01>R<00>ddl}|jdtd<04><05>t||<01>S)<06><>
.. deprecated:: 2.0.0
Renamed to :func:`format_multipart_header_param`. Will be
removed in urllib3 v2.1.0.
rNz<4E>'format_header_param_html5' has been renamed to 'format_multipart_header_param'. The old name will be removed in urllib3 v2.1.0.r r<00>rrrr0<00>r(rrs r <00>format_header_param_html5r5u<00>4<00><00> <14> <0C>M<EFBFBD>M<EFBFBD> %<25> <1B><14> <12><06> )<29><14>u<EFBFBD> 5<>5r c<01>R<00>ddl}|jdtd<04><05>t||<01>S)r2rNzz'format_header_param' has been renamed to 'format_multipart_header_param'. The old name will be removed in urllib3 v2.1.0.r rr3r4s r <00>format_header_paramr8<00>r6r c<01><><00>eZdZdZ d d
d<03>Ze d d d<04><05>Zd d<05>Z dd<06>Zdd<07>Z d dd<08>Z
y)<11> RequestFielda<64>
A data container for request body parameters.
:param name:
The name of this request field. Must be unicode.
:param data:
The data/value body.
:param filename:
An optional filename of the request field. Must be unicode.
:param headers:
An optional dict-like object of headers to initially use for the field.
.. versionchanged:: 2.0.0
The ``header_formatter`` parameter is deprecated and will
be removed in urllib3 v2.1.0.
Nc<01><><00>||_||_||_i|_|rt |<04>|_|<05>$ddl}|j dtd<03><04>||_yt|_y)NrzUThe 'header_formatter' parameter is deprecated and will be removed in urllib3 v2.1.0.r r)
<EFBFBD>_name<6D> _filename<6D>data<74>headers<72>dictrrr<00>header_formatterr0)<07>selfr(r>rr?rArs r <00>__init__zRequestField.__init__<5F>se<00><00><1A><04>
<EFBFBD>!<21><04><0E><18><04> <09>.0<EFBFBD><04> <0C> <12><1F><07>=<3D>D<EFBFBD>L<EFBFBD> <1B> '<27> <1B> <14>M<EFBFBD>M<EFBFBD>5<>"<22><1C> <1A> <0E> %5<>D<EFBFBD> !<21>$A<>D<EFBFBD> !r c<01><><00>t|t<00>r&t|<02>dk(r|\}}}n|\}}t|<04>}nd}d}|}|||||<03><03>}|j |<06><04>|S)a<>
A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters.
Supports constructing :class:`~urllib3.fields.RequestField` from
parameter of key/value strings AND key/filetuple. A filetuple is a
(filename, data, MIME type) tuple where the MIME type is optional.
For example::
'foo': 'bar',
'fakefile': ('foofile.txt', 'contents of foofile'),
'realfile': ('barfile.txt', open('realfile').read()),
'typedfile': ('bazfile.bin', open('bazfile').read(), 'image/jpeg'),
'nonamefile': 'contents of nonamefile field',
Field names and filenames must be unicode.
<20>N)rrA)<01> content_type)r<00>tuple<6C>lenr
<00>make_multipart)<08>cls<6C> fieldnamerrArr>rF<00> request_params r <00> from_tupleszRequestField.from_tuples<65>st<00><00>6 <16>e<EFBFBD>U<EFBFBD> #<23><12>5<EFBFBD>z<EFBFBD>Q<EFBFBD><EFBFBD>/4<>,<2C><08>$<24> <0C>!&<26><0E><08>$<24>1<>(<28>;<3B> <0C><1B>H<EFBFBD><1F>L<EFBFBD><18>D<EFBFBD><1B> <15>t<EFBFBD>h<EFBFBD>AQ<41>
<EFBFBD> <0A> <16>$<24>$<24>,<2C>$<24>?<3F><1C>r c<01>&<00>|j||<02>S)a<>
Override this method to change how each multipart header
parameter is formatted. By default, this calls
:func:`format_multipart_header_param`.
:param name:
The name of the parameter, an ASCII-only ``str``.
:param value:
The value of the parameter, a ``str`` or UTF-8 encoded
``bytes``.
:meta public:
)rA)rBr(rs r <00> _render_partzRequestField._render_part<72>s<00><00><14>$<24>$<24>T<EFBFBD>5<EFBFBD>1<>1r c<01><><00>g}t|t<00>r|j<00>}n|}|D])\}}|<05><01> |j|j ||<05><00><00>+dj |<02>S)aO
Helper function to format and quote a single header.
Useful for single headers that are composed of multiple items. E.g.,
'Content-Disposition' fields.
:param header_parts:
A sequence of (k, v) tuples or a :class:`dict` of (k, v) to format
as `k1="v1"; k2="v2"; ...`.
<20>; )rr@<00>items<6D>appendrO<00>join)rB<00> header_parts<74>parts<74>iterabler(rs r <00> _render_partszRequestField._render_partssd<00><00>&<13><05> <15>l<EFBFBD>D<EFBFBD> )<29>#<23>)<29>)<29>+<2B>H<EFBFBD>#<23>H<EFBFBD>#<23>K<EFBFBD>D<EFBFBD>%<25><14> <20><15> <0C> <0C>T<EFBFBD>.<2E>.<2E>t<EFBFBD>U<EFBFBD>;<3B><<3C>$<24><14>y<EFBFBD>y<EFBFBD><15><1F>r c<01>`<00>g}gd<01>}|D]B}|jj|d<02>s<01> |j|<03>d|j|<00><00><03><00>D|jj<00>D]#\}}||vs<01> |s<01>|j|<04>d|<05><00><03><00>%|jd<04>dj |<01>S)z=
Renders the headers for this request field.
)<03>Content-Disposition<6F> Content-Type<70>Content-LocationFz: z
)r?<00>getrSrRrT)rB<00>lines<65> sort_keys<79>sort_key<65> header_name<6D> header_values r <00>render_headerszRequestField.render_headers#s<><00><00><13><05>O<> <09>!<21>H<EFBFBD><13>|<7C>|<7C><1F><1F><08>%<25>0<><15> <0C> <0C><08>z<EFBFBD><12>D<EFBFBD>L<EFBFBD>L<EFBFBD><18>,B<>+C<>D<>E<>"<22>*.<2E><1C><1C>);<3B>);<3B>)=<3D> %<25>K<EFBFBD><1C><1A>)<29>+<2B><1F><19>L<EFBFBD>L<EFBFBD>K<EFBFBD>=<3D><02><<3C>.<2E>!A<>B<>*><3E>
<0E> <0C> <0C>V<EFBFBD><1C><15>{<7B>{<7B>5<EFBFBD>!<21>!r c <01><><00>|xsddjd|jd|jfd|jff<02>g<02>z}||jd<||jd<||jd<y )
a<EFBFBD>
Makes this request field into a multipart request field.
This method overrides "Content-Disposition", "Content-Type" and
"Content-Location" headers to the request parameter.
:param content_disposition:
The 'Content-Disposition' of the request body. Defaults to 'form-data'
:param content_type:
The 'Content-Type' of the request body.
:param content_location:
The 'Content-Location' of the request body.
z form-datarQ<00>r(rrZr[r\N)rTrXr<r=r?)rB<00>content_dispositionrF<00>content_locations r rIzRequestField.make_multipart6s<00><00>( 3<>A<>k<EFBFBD>T<EFBFBD>Y<EFBFBD>Y<EFBFBD><12><14>"<22>"<22><1C>d<EFBFBD>j<EFBFBD>j<EFBFBD>)<29>J<EFBFBD><04><0E><0E>+G<>H<><12> <0E>F
<EFBFBD>
<EFBFBD><1B>/B<01><04> <0C> <0C>*<2A>+<2B>'3<><04> <0C> <0C>^<5E>$<24>+;<3B><04> <0C> <0C>'<27>(r )NNN)
r(<00>strr><00>_TYPE_FIELD_VALUEr<00>
str | Noner?ztyping.Mapping[str, str] | NonerA<00>5typing.Callable[[str, _TYPE_FIELD_VALUE], str] | Noner)rKrhr<00>_TYPE_FIELD_VALUE_TUPLErArk<00>returnr:<00>r(rhrrirmrh)rUz[dict[str, _TYPE_FIELD_VALUE | None] | typing.Sequence[tuple[str, _TYPE_FIELD_VALUE | None]]rmrh)rmrh)rfrjrFrjrgrjrm<00>None) <0B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rC<00> classmethodrMrOrXrcrIrr r r:r:<00>s<><00><00><08>* $<24>37<33>RV<52> B<01><11>B<01> <20>B<01><1D> B<01>
1<> B<01> P<01> B<01>8<11>
SW<01> *<1D><16>*<1D>'<27>*<1D>P<01> *<1D>
<16> *<1D><11>*<1D>X2<>  <20> D<01> <20>
<0A>  <20>>"<22>*+/<2F>#'<27>'+<2B> <<3C>'<27><<3C>!<21><<3C>%<25> <<3C>
<0E> <r r:)zapplication/octet-stream)rrjrrhrmrhrn)<12>
__future__r<00> email.utilsr%r<00>typing<6E>UnionrhrrirGrlr
r*r0r5r8r:rr r <00><module>rys<><00><01>"<22><12><10> <0A><1A>L<EFBFBD>L<EFBFBD><13>e<EFBFBD><1A>,<2C><11> <20>,<2C>,<2C><15> <09>#<23> <20>
<20>!<21> <09>#<23> <20>#<23>
%<25>&<26>(<28><02><17>*D<01> <13><18> <13>#&<26> <13><08> <13> -<11>`#<1F>L6<>$6<>$|<<3C>|<r