Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.133.141.143
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : fields.cpython-312.pyc
�

=f[*���ddlmZddlZddlZddlZejeefZ	eje	ejee	fejee	effZ	d
					dd�Zdd�Z
dd�Zdd�Zdd�ZGd�d	�Zy)
�)�annotationsNc�B�|rtj|�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)�	mimetypes�
guess_type)�filename�defaults  �E/usr/local/python-3.12/lib/python3.12/site-packages/urllib3/fields.py�guess_content_typer
s'����#�#�H�-�a�0�;�G�;��N�c�Z��ddl}|jdtd��t�t�r�jd��t
�fd�dD��s|�d	��d
�}	|jd�|Stjj�d��|�d�����S#ttf$rY�: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�'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.���
stacklevel�utf-8c3�&�K�|]}|�v���
y�w�N�)�.0�ch�values  �r	�	<genexpr>z.format_header_param_rfc2231.<locals>.<genexpr>@s�����/�r�r�U�{�/�s�z"\
�="�"�asciiz*=)
�warnings�warn�DeprecationWarning�
isinstance�bytes�decode�any�encode�UnicodeEncodeError�UnicodeDecodeError�email�utils�encode_rfc2231)�namerr�results `  r	�format_header_param_rfc2231r*s����(��M�M�	1�	�����%������W�%���/�Y�/�/��6��E�7�!�$��	��M�M�'�"��M��K�K�&�&�u�g�6�E��f�B�u�g��E��L��#�$6�7�	��	�s�B�B*�)B*c�~�t|t�r|jd�}|jdddd��}|�d|�d�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)�
�
�"rr)rrr �	translate)r(rs  r	�format_multipart_header_paramr0OsF��<�%������W�%��
�O�O��E�u�=�>�E��V�2�e�W�A��rc�R�ddl}|jdtd��t||�S)��
    .. deprecated:: 2.0.0
        Renamed to :func:`format_multipart_header_param`. Will be
        removed in urllib3 v2.1.0.
    rNz�'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�rrrr0�r(rrs   r	�format_header_param_html5r5u�4����M�M�	%�	����)��u�5�5rc�R�ddl}|jdtd��t||�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	�format_header_paramr8�r6rc��eZdZdZ			d										d
d�Ze	d							dd��Zd
d�Z				dd�Zdd�Z				d								dd�Z
y)�RequestFielda�
    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���||_||_||_i|_|rt	|�|_|�$ddl}|j
dtd��||_yt|_y)NrzUThe 'header_formatter' parameter is deprecated and will be removed in urllib3 v2.1.0.r
r)
�_name�	_filename�data�headers�dictrrr�header_formatterr0)�selfr(r>rr?rArs       r	�__init__zRequestField.__init__�se����
�!�����	�.0������=�D�L��'���M�M�5�"��	
�
�%5�D�!�$A�D�!rc��t|t�r&t|�dk(r|\}}}n|\}}t|�}nd}d}|}|||||��}|j	|��|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.
        �N)rrA)�content_type)r�tuple�lenr
�make_multipart)�cls�	fieldnamerrArr>rF�
request_params        r	�from_tupleszRequestField.from_tuples�st��6�e�U�#��5�z�Q��/4�,��$��!&���$�1�(�;���H��L��D���t�h�AQ�
�
�	�$�$�,�$�?��rc�&�|j||�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	�_render_partzRequestField._render_part�s���$�$�T�5�1�1rc���g}t|t�r|j�}n|}|D])\}}|��	|j|j	||���+dj|�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"; ...`.
        �; )rr@�items�appendrO�join)rB�header_parts�parts�iterabler(rs      r	�
_render_partszRequestField._render_partssi��&���l�D�)�#�)�)�+�H�#�H�#�	=�K�D�%�� ����T�.�.�t�U�;�<�	=��y�y���rc�`�g}gd�}|D]B}|jj|d�s� |j|�d|j|����D|jj�D]#\}}||vs�|s�|j|�d|����%|jd�dj	|�S)z=
        Renders the headers for this request field.
        )�Content-Disposition�Content-Type�Content-LocationFz: z
)r?�getrSrRrT)rB�lines�	sort_keys�sort_key�header_name�header_values      r	�render_headerszRequestField.render_headers#s�����O�	�!�	F�H��|�|����%�0�����z��D�L�L��,B�+C�D�E�	F�*.���);�);�)=�	C�%�K���)�+���L�L�K�=��<�.�!A�B�	C�
	���V���{�{�5�!�!rc	���|xsddjd|jd|jfd|jff�g�z}||jd<||jd<||jd<y	)
a�
        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�r(rrZr[r\N)rTrXr<r=r?)rB�content_dispositionrF�content_locations    r	rIzRequestField.make_multipart6s��( 3�A�k�T�Y�Y���"�"��d�j�j�)�J����+G�H��
�F
�
��/B����*�+�'3����^�$�+;����'�(r)NNN)
r(�strr>�_TYPE_FIELD_VALUEr�
str | Noner?ztyping.Mapping[str, str] | NonerA�5typing.Callable[[str, _TYPE_FIELD_VALUE], str] | Noner)rKrhr�_TYPE_FIELD_VALUE_TUPLErArk�returnr:�r(rhrrirmrh)rUz[dict[str, _TYPE_FIELD_VALUE | None] | typing.Sequence[tuple[str, _TYPE_FIELD_VALUE | None]]rmrh)rmrh)rfrjrFrjrgrjrm�None)�__name__�
__module__�__qualname__�__doc__rC�classmethodrMrOrXrcrIrrr	r:r:�s����* $�37�RV�
B��B� �B��	B�
1�B�P�
B�8�
SW�	*��*�'�*�P�	*�

�*��*�X2�  �
D� �

�
 �>"�*+/�#'�'+�	<�'�<�!�<�%�	<�

�<rr:)zapplication/octet-stream)rrjrrhrmrhrn)�
__future__r�email.utilsr%r�typing�Unionrhrri�Tuplerlr
r*r0r5r8r:rrr	�<module>rzs���"���
��L�L��e��,�� �,�,��
�L�L��'�'�(�
�L�L��'��,�-�/���*D�
��
�#&�
��
� -�`#�L6�$6�$|<�|<r
© 2025 GrazzMean