403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
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_os/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/test_os/__pycache__/test_os.cpython-315.pyc
R
>lqj�Lc	��]PHs]PHs]PHs]PHs]PHs]PHs]PHs]PHs]PH s]PH$s	]PH(s
]PH,s]PH0s]PH4s
]PH8s]PH<s]PH@s]PHDs]PHHs]PHLs]PHPs]PHTs]PHXs]PH\s]PH`s]PHds]PHhs]QHlGs]QHtGs]QHtGs]QHtG s ]QHtG!s!]QHtG"s"]QHtG#s#]QH�G%s%]Q	H�G's']PH�s(]PH�s*]PH�s+\+OX2Tt,tFDpOZMJ	tos.]PH�s0]Q
H�G1s1G2s2]PH�s4]QH�G6s6]QHtG7s7]Q
H�G9s9\:\Q2%cC\OvOx%c'\OvOxO{Q2s>LP
s>\OHO{Q29%c\O~2]6Hs@QsA\O�\C\D\QP2\O�2Q2sF\O�\OHO{Q2Q2sHQsIQQ\O�2sKQQ\O�2sLQQ\O�2sMQQ\O�2sN]QHlGOsOQ Q!\OO�2sQQ"Q#\O�2sR\O�\:\Q$2Q%2Q&Q'\R22sSQ(Q)\R2sT\O�\:\Q$2Q%2Q*Q+\S22sUQ,Q-\O�2sV\O�\:\Q.2Q/2Q0Q1\O�22sWQ2Q3\O�2sX\O�\O�Q42Q5Q6\O�22sZQ7Q8\O�2s[\O�\:\Q92Q:2Q;Q<\O�22s\\O�Q=2]6H9%f3\O�Q>2]6H9%f\O�Q?2]6Hs^\O�\^Q@2\O�\OHQA6HQB2QCQD\O�222s_\O�Q�QEk2sa\O�\:\QF2QG2QHQI\O�22sb\O�\O�QJ2QKQL\O�22sc\O�\:\QM2QN2QOQP\O�22sd\O�\OHQQ6HQR2QSQT\O�22se\O�\OHQQ6HQR2QUQV\O�22sf\O�\:\QW2QX2QYQZ\O�22sg\O�Q[Q\\O�22siQ]Q^\O�2sjQ_Q`\O�2sk\O�2QaQb\O�22sm\O�2QcQd\O�22sn\O�\:\Qe2Qf2QgQh\O�22so\O�\:\Qi29%c
\:\Qj2Qk2QlQm\O�22sp\O�\:\Qn2Qo2QpQq\O�22srQrss\O�\s2Qs2\O�]]]'2QtQu\O�222su\O�\:\Qv2Qw2QxQy\O�22sv\O�\:\Qz2Q{2\O�]]2Q|Q}\O�222sw\O�\:\Q~2Q2\O�]]]2Q�Q�\O�222sx\O�\:\Q�2Q�2\O�\OHQ�6HQ�2\O�]]]2Q�Q�\O�2222syQ�Q�\O�2szQ�Q�\O�2s{\O�2Q�Q�\O�22s|\O�\:\Q�2Q�2Q�Q�\O�22s}Q�Q�\O�2s~\O�\:\Q�2Q�2\O�\O�Q�2\O�\OHQQ6HQ�2Q�Q�\O�2222s�Q�Q�\O�2s�Q�Q�\O�2s�Q�Q�\O�2s�Q�Q�\O�2s�Q�Q�\O�2s�\CO2Q�Q�\O�22s�\:\Q�2%cQ�Q�\�2s�\�Q�6Xc\CO2P!P!\)cPs(C	K�h9h\)cPs*C	K�h9httoh\)\/1c,s.C	K{h9h\)cPs0\Of9s1s2C	K�h9h\)cPs4C	K�h9h)��)�support)�	os_helper)�
socket_helper)�infinite_recursion)�requires_root_user)�requires_non_root_user)�warnings_helper)�win32_is_iot)�create_file)�INT_MAX�PY_SSIZE_T_MAX��assert_python_ok)�
unix_shell)�FakePath�thread_info�linuxthreads�freebsdc�\�[O[[U2QU*2!)zrequires os.%s)�unittest�
skipUnless�hasattr�os��names&�)C:\Python315\\Lib\test\test_os\test_os.py�requires_os_funcrUs"�����w�r�4�0�2B�T�2I�J�J��spawnvzrequires the native C os.spawnv�aixz%on AIX, splice() only accepts socketsc�F�[OOP2P!�N)�asyncio�events�_set_event_loop_policy�rr�tearDownModuler&gs���N�N�)�)�$�/rc�:`�\sQs]ksnQsQsQsQsQsUs	P!)�	MiscTestsc�^�[O2oUOU[2P!r!)r�getcwd�assertIsInstance�str��self�cwds& r�test_getcwd�MiscTests.test_getcwdls���i�i�k�����c�3�'rc
��Qo[OQ6XcQo]�oQoUQU[U2*
**o[O29^tt^2o[
OU29^tt^2oSo[O2oUOVv2U[U2[[OO2**
oU]6:cLl[U2U6�c
U]6�cUPUo[OOVS2o[OU2[OU2SoJ�[(O*%c[-Q[U202PPP2PPP2P![cJM[ c<o	S	O"["O$["O&17cPo	=	J�gPo	=	hh9h)%fhKp9h)%fhP!9h)i��vxworks���python_test_dir_�az!Tested current directory length: )�sys�platform�len�tempfile�TemporaryDirectoryr�
change_cwdrr*�assertEqual�path�sep�join�mkdir�chdir�FileNotFoundError�OSError�errno�ENAMETOOLONG�EFAULTr�verbose�print)
r.�min_len�dirlen�dirname�tmpdirr>�expectedr/�need�excs
&         r�test_getcwd_long_path�MiscTests.test_getcwd_long_pathps������<�<�9�$��G���$���S�F�S��\�$9�:�;��
�
(�
(�
*�
*�f��%�%�f�-�-������)�)�+�C��$�$�S�3�"�c�#�h��R�W�W�[�[�1A�&A�B�D��q�y���7�|�d�*�t�a�x�")�%�4�.���7�7�<�<��6�D�"����������� $�H��?�?�?��=�c�#�h�Z�H�I�E.�+�
*��(-���"�"��9�9��);�);�U�\�\�(J�J�!�!��"��1.�-��+�
*�
*�s��G;�;A*G(	�&G(	�7G(	�>$G(	�#,F�G(	�)G(	�G;�	G%�G%�G(	� G%�)G%�*.G �G(	�G � G%�%G(	�(G8
�1G8
�3G;�;H	�H	c���[O2oUOU[2UO	[O
U2[O22P!r!)r�getcwdbr+�bytesr=�fsdecoder*r-s& r�test_getcwdb�MiscTests.test_getcwdb�s<���j�j�l�����c�5�)�������S�)�2�9�9�;�7rc�>�Qo[OoUOU[O2Q2UOU[O2UQ12[[Q2%c'UOU[O2Q2[[Q2%c)UOU[O2UQ12[[Q2%c+UOU[O2UQ12P!P!)c�4�UOUO1!r!)�
__module__�__qualname__)�objs&r�fqdn�&MiscTests.test_type_fqdn.<locals>.fqdn�s���N�N�C�$4�$4�5�5r�times_result�statvfs_result�sched_param�
waitid_result)r�stat_result)rra)	rrr=rdr`rrarbrc)r.r^�natives&  r�test_type_fqdn�MiscTests.test_type_fqdn�s���	6���������b�n�n�-�/D�E�����b�o�o�.���0H�I��2�'�(�(����T�"�"3�"3�4�6N�O��2�}�%�%����T�"�.�.�1�F�M�3J�K��2��'�'����T�"�"2�"2�3�f�o�5N�O�(rr%)
�__name__r[r\�__firstlineno__r0rQrWrf�__static_attributes__�__classdictcell__��
__classdict__s@rr(r(ks"����(�8J�t8�
P�Prr(c��`�\sQs]�snQs\sQs\O\	OQ2Q2s\	OQ2s
QsQs\O \\Q2Q	2\O \\Q
2Q2\O\	O&Q2Q
222sQs\	O\O \\6Q2\	O0\]
*]P
Q5Q222s\	O\O \\6Q2\	O0\]
*]P
Q5Q222sQsQs\O \O<Q6HQ2Q2sQs Qs!Qs"Qs#Qs$\O \\Q2Q2Q2s%\O \\Q2Q2Q 2s&\O \\Q2Q2Q!2s'\O \\Q"2Q#2Q$2s(\O \\Q"2Q#2\)Q%22s*\O \\Q"2Q#2\)Q&22s+\O \\Q"2Q#2\)Q'22s,Q(s-Us.P!))�	FileTestsc��[OO[O2%c'[O
[O2P!P!r!)rr>�lexistsr�TESTFN�unlink�r.s&r�setUp�FileTests.setUp�s2��
�7�7�?�?�9�+�+�,�,��I�I�i�&�&�'�-rc�H�[O[O[O[O
*2o[OU2UO[O[O[O22P!r!)
r�openrrr�O_CREAT�O_RDWR�close�
assertTrue�access�W_OK�r.�fs& r�test_access�FileTests.test_access�sQ���G�G�I�$�$�b�j�j����&:�;��
���������	�	�)�"2�"2�B�G�G�<�=rzWASI does not support dup.c�n�[O[O[O[O
*2o[OU2o]oV!]*6wcQ[OU2U]*
oU]
6�cUOQ2S[OU2q!J][OU2[OV]*2UO[[OUQ2P![OS2h9h)rz%couldn't allocate two consecutive fds�a)
rrxrrrryrz�dupr{�skipTest�
closerange�assertRaisesrD�write)r.�first�second�retriess&   r�test_closerange�FileTests.test_closerange�s������	�(�(�"�*�*�R�Y�Y�*>�?��������
	��G��A�I�%�������1����R�<��M�M�"I�J� &����v��v�
&�
�H�H�V��
�
�
�e�Q�Y�'����'�2�8�8�U�D�9��
�H�H�V��s�!D�0%D�*D�D4c���[Oo[OU2oUO	[
[OU]2[OU2oUOV#2P!�r)	rrrr7�getrefcountr��	TypeErrorr�renamer=)r.r>�old�news&   r�test_rename�FileTests.test_rename�sO�������o�o�d�#�����)�R�Y�Y��a�8��o�o�d�#������"rc��[[OQ29^tt^2oUOQ2UO	2UO2o[OU]]2[OU]2oUO[U2[2UOUQ2PPP2P!)%fhP!9h)�w+b�spam)rxrrrr��flush�filenor�lseek�readr=�typerU)r.�fobj�fd�ss&   r�	test_read�FileTests.test_read�s���
�)�"�"�E�
*�
*�d��J�J�w���J�J�L�����B��H�H�R��A������A��A����T�!�W�e�,����Q��(�+�
*�
*�
*�s�BC�C	�	C	c	�.�[[OQ29^tt^2oUOQ2UO	2UO2o[OU]]2[]2o[OV#2oUO[U2[2UOU]2UOUQ*Q2QUQ$[OV#2oUO[U2[2UOU]2UO[U2Q2[OV#2oUOU]2UO[U2Q2UO[OU[22]2[OU]]2UO[OU[22]2PPP2P!)%fhP!9h)r�r��N�Nsnotspam�NNN)rxrrrr�r�r�rr��	bytearray�readintor=r��intrU)r.r�r��bufferr�s&    r�
test_readinto�FileTests.test_readinto�sv��
�)�"�"�E�
*�
*�d��J�J�w���J�J�L�����B��H�H�R��A���q�\�F����B�'�A����T�!�W�c�*����Q��"����V�B�Z��1�#�F�1�I����B�'�A����T�!�W�c�*����Q��"����U�6�]�J�7����B�'�A����Q��"����U�6�]�J�7�
���R�[�[��Y�[�9�1�=�
�H�H�R��A�����R�[�[��Y�[�9�1�=�9+�
*�
*�
*�s�GH�H	�H	�get_blocking�-needs os.get_blocking() and os.set_blocking()�pipe�requires os.pipe()z$set_blocking does not work correctlyc��[O2vq[OUP
2UO[29^tt^2[O
U[
]22PPP2[OUQ2UO[O
U[
]22]2UO[29^tt^2[O
U[
]22PPP2[OU2PoUO[O
U[
]22]2UO[O
U[
]22]2[OU2Ud[OU2P!P!)%fhCKJ9h)%fhK�9h[OS2Sd[OS2hh9h)Fr�)
rr��set_blockingr��BlockingIOErrorr�r�r�r=r{)r.�r�ws&  r�test_readinto_non_blocking�$FileTests.test_readinto_non_blockingsO���w�w�y���	��O�O�A�u�%��"�"�?�3�3����A�y��|�,�4�
�H�H�Q�� ����R�[�[��I�a�L�9�1�=��"�"�?�3�3����A�y��|�,�4�
�H�H�Q�K��A����R�[�[��I�a�L�9�1�=����R�[�[��I�a�L�9�1�=�
�H�H�Q�K��}�������'4�3�3��4�3��
�H�H�Q�K��}�������sO�4G�!F0�/A,G�!G�<BG�0G	�9G	�;	G�G	�
G	�G�H
�2H
c
��[[OQ29^tt^2oUOQ2UO	2UO2o[OU]]2Q[2]1FDmoUOQ[U2029^tt^2UO[29^tt^2[OV#2PPP2PPP2Jo	UOQ29^tt^2UO[29^tt^2[OU[]22PPP2PPP2UO[29^tt^2[OU2PPP2[]2o[OV$2oUOU]2UOUQ2PPP2P!)%fhCK9h)%fhCJ�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhP!9h)r�r��testzbad buffer zdoesn't work on file objects)rxrrrr�r�r�rr�rU�subTestr�r�r�r�r�r=)r.r�r��bad_argr�r�s&     r�test_readinto_badarg�FileTests.test_readinto_badarg2s���
�)�"�"�E�
*�
*�d��J�J�w���J�J�L�����B��H�H�R��A��"�E�G�R�0���\�\�K��W�
��"?�@�@��*�*�9�5�5����B�0�6�A�@�1�
���<�=�=��&�&�y�1�1��K�K��i��l�3�2�>�
�"�"�9�-�-����B��.��q�\�F����B�'�A����Q��"����V�W�-�/+�
*�6�5�5��A�@�@��
2�1��>�=��
.�-��!+�
*�
*�s��BI�$G4
�G �G4
�!%I�H	�$!H	
�H	�
%I�2H/	�	A
I� G1�)G1�+	G4
�4H�=H�?
I�	H�H�H	�H,
�%H,
�'I�/H?
�8H?
�:I�I	�I	zneeds INT_MAX < PY_SSIZE_T_MAX)�size�memuse�dry_runc��UO[O[O2[	[OQ2[[OQ29^tt^2o[OUO2U2oPPP2UOWQ2P!)%fhK$9h)�test�rb)
�
addCleanuprrsrrr
rxrr�r�r=)r.r��fp�datas&&  r�test_large_read�FileTests.test_large_readLs{��	
���	�(�(�)�*:�*:�;��I�$�$�g�.��)�"�"�D�
)�
)�R��7�7�2�9�9�;��-�D�*�
	
����w�'�*�
)�s�,&B.�.B>	�7B>	c���UO[O[O2[	[OQ2[[]
*2o[[OQ29^tt^2o[OUO2U2oPPP2UOW]2UOUQ*Q2P!)%fhK=9h)r�r�r�)r�rrsrrr
r�rrxrr�r�r=)r.r�r�r��lengths&&   r�test_large_readinto�FileTests.test_large_readinto`s���	
���	�(�(�)�*:�*:�;��I�$�$�g�.�
�7�R�<�(��
�)�"�"�D�
)�
)�R��[�[�����f�5�F�*�
	
�����#�������W�-�
*�
)�s�&C�C-	�&C-	c��[O[O[O[O
*2oUO
[[OUQ2[OUQ2[OU[Q22[OU[Q22[OU2[[OQ29^tt^2oUOUO2O2,QN2PPP2P!)%fhP!9h)�beanssbacon
seggs
sspam
r�)sbaconseggsr�)rrxrrrry�O_WRONLYr�r�r�r��
memoryviewr{r=r��
splitlines)r.r�r�s&  r�
test_write�FileTests.test_writevs���
�W�W�Y�%�%�r�z�z�B�K�K�'?�
@�����)�R�X�X�r�7�;�
����Z� �
����Y�y�)�*�
����Z�	�*�+�
�����
�)�"�"�D�
)�
)�T����T�Y�Y�[�3�3�5�,�
.�*�
)�
)�
)�s�?1D:�:E	�E	c�z�[OU[OP	Q5oUOU]2P!)T)�
creationflags�shell)�
subprocess�call�CREATE_NEW_CONSOLEr=)r.�args�retcodes&* r�write_windows_console�FileTests.write_windows_console�s0���/�/�$�$�7�7��	��
	
����!�$r�win32z$test specific to the Windows consolec��QoUO[OQU2UO[OQQU2P!)zprint('x' * 100000)�-cz-u)r�r7�
executable�r.�codes& r�test_write_windows_console�$FileTests.test_write_windows_console�s7��%���"�"�3�>�>�4��>��"�"�3�>�>�4��t�Drc���[O[O[O2o[O
U,UN3QQ-oUO
2P!)�encoding�utf-8)rrxrrr�O_RDONLY�fdopenr{)r.r�r�r�s&*  r�
fdopen_helper�FileTests.fdopen_helper�s=��
�W�W�Y�%�%�r�{�{�
3���I�I�b�2�4�2�'�2��	���	rc�*�[O[O[O[O
*2o[OU2UO2UOQ2UOQ]d2P!)r�)rrxrrrryrzr{r��r.r�s& r�test_fdopen�FileTests.test_fdopen�sZ��
�W�W�Y�%�%�r�z�z�"�)�)�';�
<��
������������3�����3��$rc�t�[OQ*oUO[O[O2UO[OU2[	[OQ2[	UQ2[
O[OU2UO[[
O[O2[UQQQ59^tt^2oUOUO2Q2PPP2P!)%fhP!9h)z.2�1�2r�r��r��1)
rrrr�rsr
r�replacer�rC�statrxr=r�)r.�TESTFN2r�s&  r�test_replace�FileTests.test_replace�s����"�"�T�)�����	�(�(�)�*:�*:�;����	�(�(�'�2��I�$�$�d�+��G�T�"�
�
�
�9�#�#�W�-����+�R�W�W�i�6F�6F�G�
�'�3��
1�
1�Q����Q�V�V�X�s�+�2�
1�
1�
1�s�;!D&�&D7	�/D7	c��[O[[OQPQ5o[OU2P!)�)r>�flags�mode�dir_fd)rrx�__file__r�r{rs& r�test_open_keywords�FileTests.test_open_keywords�s(���G�G�����5��
��
����rc��[O[Q2oUQ[OP
PQ5P![
[1cP!h9h)�symlink�target)�src�dst�target_is_directoryr)r�
get_attributerrrr�NotImplementedErrorrD)r.rs& r�test_symlink_keywords�FileTests.test_symlink_keywords�sG���'�'��I�6��	���i�&6�&6�$)�$�
8��#�W�-�	��	�s�:�A�
A�A�copy_file_rangeztest needs os.copy_file_range()c��UO[29^tt^2[O]]Q2PPP2P!)%fhP!9h�ri����)r��
ValueErrorrrrts&r�#test_copy_file_range_invalid_values�-FileTests.test_copy_file_range_invalid_values�s4��
�
�
�z�
*�
*����q�!�S�)�+�
*�
*�
*���A�A	�A	c��[OQ*oQo[[OU2UO[O[O2[[OQ2oUOUO2UO2o[UQ2oUO[OU2UOUO2UO2o[OVF]2oUOU[]]22[UQ29^tt^2oUOUO2UPU2PPP2P!)%fhP!9h[c=oSO[O 6wcgSO#S2Po=P!Po=hh9h)�.3�
0123456789r�r�)rrrr
r�rsrxr{r�rr�assertIn�ranger=r�rDrE�ENOSYSr�)	r.r�r��in_file�in_fd�out_file�out_fd�i�es	&        r�test_copy_file_range�FileTests.test_copy_file_range�sG���"�"�T�)�����I�$�$�d�+����	�(�(�)�*:�*:�;��y�'�'��.������
�
�&���� �����'�����	�(�(�'�2�������'����"��	;��"�"�5�!�4�A�
�M�M�!�U�1�a�[�)��g�t�$�$��� � ������b�q��:�%�$�$�$���	��w�w�%�,�,�&���M�M�!����
	�s6�F	�$E5�5F	�>F	�		G�G�G�3G�Gc��[OQ*oQo]o]o]o[[OU2UO[O[O2[[OQ2oUOUO2UO2o[UQ2oUO[OU2UOUO2UO2o	[OVyUUUQ5o
UOU
[]U]*22[UQ29^tt^2oUO2oPPP2UOWPUQU*2UOV�PV$VJ*2P!)%fhKJ9h[c=oSO[O 6wcgSO#S2Po=P!Po=hh9h)�.4rr�r�)�
offset_src�
offset_dst�)rrrr
r�rsrxr{r�rrrrr�r=rDrErr�)
r.�TESTFN4r��
bytes_to_copy�in_skip�out_seekrrrrr r�r!s
&            r�test_copy_file_range_offset�%FileTests.test_copy_file_range_offset�s����"�"�T�)�����
������I�$�$�d�+����	�(�(�)�*:�*:�;��y�'�'��.������
�
�&���� �����'�����	�(�(�'�2�������'����"��	6��"�"�5�-�.5�.6�8�A�
�M�M�!�U�1�m�A�o�6�7��g�t�$�$���|�|�~��%�
���T�)�8�_�g�h�.>�?�
���T�)�_�!�'�)�4�
6�
%�$���	��w�w�%�,�,�&���M�M�!����
	�s6�F=�F*�*F:	�3F:	�=	H�H�G?�'G?�?H�spliceztest needs os.splice()c��UO[29^tt^2[O]]Q2PPP2P!)%fhP!9hr)r�rrr/rts&r�test_splice_invalid_values�$FileTests.test_splice_invalid_valuess2��
�
�
�z�
*�
*��I�I�a��C� �+�
*�
*�
*�rc�.``�[OQ*oQo[[OU2UO[O[O2[[OQ2oUOUO2UO2o[O2vnnUOU1Qk2UOU1Qk2[OUR]2oUOU[]]22UO[OR]d2UPU2P![c=oSO [ O"6wcgSO%S2Po=P!Po=hh9h)rrr�c�2:�[OR2!r!�rr{��read_fds�r�<lambda>�'FileTests.test_splice.<locals>.<lambda>#�������� 1rc�2:�[OR2!r!r5��write_fds�rr8r9$�������� 2r)rrrr
r�rsrxr{r�rr�r/rrr=r�rDrErr�)	r.r�r�rrr r!r7r=s	&      @@r�test_splice�FileTests.test_splices ����"�"�T�)�����I�$�$�d�+����	�(�(�)�*:�*:�;��y�'�'��.������
�
�&���� ���G�G�I�������1�2����2�3�	>��	�	�%��1�-�A�
�M�M�!�U�1�a�[�)����R�W�W�W�c�2�D��!�H�=���	��w�w�%�,�,�&���M�M�!����
	�s$�-E
�
	F�F�F�7F�Fc�T`
`�[OQ*oQo]o]o[[OU2UO[O[O2[[OQ2oUOUO2UO2o[O2vn
nUOU
1Qk2UOU1Qk2[OURV4Q5oUOU[]U]*22[OR
]d2oUOV�VDU*2P![c=o	S	O [ O"6wcgSO%S	2Po	=	P!Po	=	hh9h)r%rr�c�2:�[OR2!r!r5r6s�rr8�1FileTests.test_splice_offset_in.<locals>.<lambda>Fr:rc�2:�[OR2!r!r5r<s�rr8rCGr>r)r&)rrrr
r�rsrxr{r�rr�r/rrr�r=rDrErr�)r.r)r�r*r+rrr r�r!r7r=s&         @@r�test_splice_offset_in�FileTests.test_splice_offset_in6s7����"�"�T�)�����
����I�$�$�d�+����	�(�(�)�*:�*:�;��y�'�'��.������
�
�&���� ���G�G�I�������1�2����2�3�	<��	�	�%��=�M�A�
�M�M�!�U�1�m�A�o�6�7��7�7�7�C�(�D�
���T���	�#:�;���	��w�w�%�,�,�&���M�M�!����
	�s$�1E � 	F'�*F'�+F"�
F"�"F'c�*``�[OQ*oQo]o]o[[OU2UO[O[O2[
O2vnnUOU1Qk2UOU1Qk2[
ORU2[UQ2oUO[OU2UOUO2UO2o[
ORVcUQ5oUOU[]U]*22[UQ29^tt^2oUO2o	PPP2UOW	PUQU*2UOV�PUPU2P!)%fhKE9h[ c=o
S
O"["O$6wcgSO'S
2Po
=
P!Po
=
hh9h)r%rc�2:�[OR2!r!r5r6s�rr8�2FileTests.test_splice_offset_out.<locals>.<lambda>hr:rc�2:�[OR2!r!r5r<s�rr8rIir>rr�)r'r�r()rrrr
r�rsrr�r�rxr{r�r/rrr�r=rDrErr�)
r.r)r�r*r,rrr rr�r!r7r=s
&          @@r�test_splice_offset_out� FileTests.test_splice_offset_out\s�����"�"�T�)�����
����I�$�$�d�+����	�(�(�)�*:�*:�;��G�G�I�������1�2����2�3�
����4� ����'�����	�(�(�'�2�������'����"��	8��	�	�'�6�X�N�A�
�M�M�!�U�1�m�A�o�6�7��g�t�$�$���|�|�~��%�
���T�)�8�_�g�h�.>�?�
���T�)�_�d�2�A�h�7�
%�$���	��w�w�%�,�,�&���M�M�!����
	�s6�G�*F8�8G	�G	�	H�H�H
�5H
�
Hr%)/rhr[r\riru�tearDownr�r�skipIfr�is_wasir��cpython_onlyr�r�r�rrr�
is_emscriptenr�r�rr�
bigmemtestr�r�r�r�r7r8r�r�r�r�rr
rr"r-r1�requires_splice_piper?rErKrjrkrls@rroro�s����(��H�>�
�_�_����5��:��:�*
���#��#�)�>�>�����^�4�D�F�
�����V�,�.B�C�
�_�_�W�*�*�,R�S��T�D�F��6.�4
�������>�1�9�;����W�r�\�!�U�C�(�D�;��(�
�������>�1�9�;����W�r�\�!�U�C�.�D�;��.� 
.�%��������0�?�A�E�A�E��
%�,��
������%6�7�9Z�[�*�\�*������%6�7�9Z�[�;�\�;�B�����%6�7�9Z�[�*6�\�*6�X�����X�.�0H�I�!�J�!������X�.�0H�I��>��J�>�>�����X�.�0H�I��"<��J�"<�H�����X�.�0H�I��'8��J�'8rroc�`�\sQsQsnQsQsQsQsQsQs	Qs
\O\
\Q	2Q
2Q2s\O\
\Q	2Q
2Q2s\O\
\Q	2Q
2Q
2s\O\
\Q	2Q
2Q2s\O\
\Q2Q2Q2s\O\
\Q2Q2Q2s\O\O,Q6HQ2Q2s\O\O,Q6HQ2\O\
\Q2Q2Q22sQs\O\O,Q6HQ2Q2s\O\O,Q6HQ2Q2s\O\O,Q6HQ2Q2sQsUsP!) �StatAttributeTests�c��[OUmUO[OUO2[UOQ2P!)�ABC)rrr�fnamer�rsr
rts&rru�StatAttributeTests.setUp�s5���%�%��
����	�(�(�$�*�*�5��D�J�J��'rc��SFDnoUOUQ59^tt^2[[V2Q*2o[VQ*2Q*oUOVE]UQ5PPP2Jp	P!)%fhJ�9h)ri���_nsi'��delta�msg)r�r��getattr�assertAlmostEqual)r.�result�namesr�floaty�nanosecondys&&&   r�check_timestamp_agreement�,StatAttributeTests.check_timestamp_agreement�sm���D����4��(�(��W�V�2�W�<�=��%�f�U�l�;�v�E���&�&�v�!��&�N�)�(��(�(�(�s�A	A9	�9B

�B

c
���[OU2oUOU[O*]2UOUO]2[U2o[[2FD�oUQ*Q6XfJUO
2oUOQ2%cQoLQoUOU[V%22U[[U2*2UOVS2J�	,QNoUOUOUOQ2UOV'2U]�*UOQ2]UmUOQ2]UmUOQ2]UmUOQ2[O*Q	2oUOQ2[O*Q
2oP![cK�h9h[ cK�h9h[cK�h9h[[&1cK�h9h[cK�h9h[&cK�h9h[&cP!h9h)�:NriN�ST_�TIMEc��[U2!r!)r���xs&r�trunc�7StatAttributeTests.check_stat_attributes.<locals>.trunc�s
���Q��-rc��U!r!r%rms&rrorp�s���(r�st_birthtime�No exception raised)�st_atime�st_mtime�st_ctime��
�r��rir������	rx���
�)rr�r=�ST_SIZE�st_size�dir�lower�endswithr`rrr�st_birthtime_ns�append�AttributeErrorrf�fail�
IndexError�st_mode�st_rdevr��parrotrd)	r.rYrb�membersr�attrro�time_attributes�result2s	&&       r�check_stat_attributes�(StatAttributeTests.check_stat_attributes�s��������	
�������-�q�1��������+��f�+����I�D��B�x�5� ��z�z�|���=�=��(�(�/�*�� � ��w�v�'<�!=�"(���t�)<�"=�?��
�
�d�,��?��	3�����"�"�
�"�"�>�2��&�&�v�?�	��3�K��I�I�+�,�
	��F�N��I�I�+�,�	��F�N��I�I�+�,�	��F�M��I�I�+�,�
	��n�n�U�+�G��I�I�+�,�
	��n�n�%I�J�G��Q�	��	���	��	���	��	���	�*�	��	���	��	���	��	���	��	�s��G(�G9�H
�6H�H2�('I�I�(	G6�2G6�5G6�9	H�H�H�
	H�H�H�H/�+H/�.H/�2	I�<I�?I�	I�
I�I�	I#�I#�"I#c�>�UOUO2P!r!)r�rYrts&r�test_stat_attributes�'StatAttributeTests.test_stat_attributes�s���"�"�4�:�:�.rc���UOO[O22oUO
W2P![c&SOQSO*2KBh9h�z#cannot encode %a for the filesystem)rY�encoder7�getfilesystemencoding�UnicodeEncodeErrorr�r��r.rYs& r�test_stat_attributes_bytes�-StatAttributeTests.test_stat_attributes_bytes�s^��	N��J�J�%�%�c�&?�&?�&A�B�E�	
�"�"�5�)��"�	N��M�M�?�$�*�*�L�M�	N���.A�	A4�#A4�3A4c	���[OUO2o[[O
]*2FD�oUO
QU029^tt^2[OV2oUOQU2U]6cUOQU2[OU2oUOV2PPP2J�	P!)%fhJ�9h)rzz	protocol sstat_resultscos
stat_result
)rr�rYr�pickle�HIGHEST_PROTOCOLr��dumpsr�loadsr=�r.rb�proto�p�	unpickleds&    r�test_stat_result_pickle�*StatAttributeTests.test_stat_result_pickle�s���������$���6�2�2�Q�6�7�E����	�%��1�2�2��L�L��/���
�
�n�a�0��1�9��M�M�"7��;�"�L�L��O�	�� � ��3�
3�2�8�2�2�2�s�"/C	�9C	�C*
�"C*
c
�
�]o[[2FD3oUOQ2%fJU[[U2*oJ5	[OV2o[O
U2oQ&oSTt,tFDo[VC2eJUMJ	ooUO
VF2Qo,Q[O1MQ[O1MQUQ	21MQ
UQ	21MQUQ	21MQUQ	21MQ'MQ(MQ)MQ
[O1MQ[O1MQ[O1MQ[O1MQ[O1MQ*MQ+MQ,MQUQ21MQUQ21MQUQ21MQ[O1MQ[O1MQ-MQUQ21MQ[O[O*1MQ[O1MQ[O1MQ[O 1MQ.MQ/MQ0MQ[O"1MQUQ21MQ[O$1M3o.Q1lo	.Q2lo
[&9PIc.Q [U22DjJ	LQ [U222o[&9PIc.Q!U2DjJ	LQ!U22oV�*
%c[)Q"V�*
02gSFCDvq=UO+UQ#59^tt^2[VC2oUO.U
*U
6XfUO1U2PPP2JaV:7cUO3U[42LUO3U[62[UQ$UQ%**2oUO9[;U2[;U22[=U[42%cUO?V�2LUO9V�2PPP2CJ	UO9UO@[OBUOD22UO9UOF[OHUOD22UO9UOJ[OBUOL22UO9UON[OHUOL22UO9UOPUOR*UOP2P!ttoh[,cX97c
PPP2CJ]gh9h[,cCKch9h)%fhCJ�9h)3r�STATX_�	stx_atime�	stx_btime�	stx_ctime�	stx_mtimec�&�[[U]2!r�)r`rrs&r�getmask�:StatAttributeTests.check_statx_attributes.<locals>.getmasks���2�t�Q�'�'r�stx_atime_ns�stx_atomic_write_segments_max�STATX_WRITE_ATOMIC�stx_atomic_write_unit_max�stx_atomic_write_unit_max_opt�stx_atomic_write_unit_min�
stx_blocks�stx_btime_ns�stx_ctime_ns�stx_dio_mem_align�STATX_DIOALIGN�stx_dio_offset_align�stx_dio_read_offset_align�STATX_DIO_READ_ALIGN�stx_gid�stx_ino�
stx_mnt_id�STATX_MNT_ID�stx_mode�stx_mtime_ns�	stx_nlink�stx_size�
stx_subvol�STATX_SUBVOL�stx_uidc3�d�SF �D!oUOQ2%fJUw�	J#	P!3h)�stx_)�
startswith)�.0rs& r�	<genexpr>�<StatAttributeTests.check_statx_attributes.<locals>.<genexpr>9s!��{���{�t�����0��d�{�s�0�0c3�6�SF �D
vqUw�	J	P!3hr!r%)r�r�masks&  rr�r�;s��L���L�j�d�T�L�s�zstatx members not tested: r�st_�r�NN)r�r�r�r�)�stx_attributesr)�stx_attributes_maskr)�stx_blksizer)�stx_devr)�
stx_dev_majorr)�
stx_dev_minorr)�stx_maskr)�stx_rdevr)�stx_rdev_majorr)�stx_rdev_minorr>	r�r�r�r�r�r�r�r�r�>r�r�r�r�)*r�rr�r`�statxr�rf�STATX_ATIME�STATX_BLOCKS�STATX_BTIME�STATX_CTIME�	STATX_GID�	STATX_INO�
STATX_TYPE�
STATX_MODE�STATX_MTIME�STATX_NLINK�
STATX_SIZE�	STATX_UID�setrr�r�r��assertIsNoner+�floatr�r=r��
isinstancerar��majorr�r��minorr�r�r�r�r�)r.�filename�maximal_maskrrbrdr�r��requirements�optional_members�
float_typer��testedr�rn�bs&&              r�check_statx_attributes�)StatAttributeTests.check_statx_attributes�sM������G�D����x�(�(����D� 1�1������(�1���g�g�h�'��N��-<�A�O�D�%�f�3� �4�O��A��&�&�v�?�	(�#
�
�"�.�.�)�#
�
�R�^�^�,�#
�-�g�6J�.K�L�#
�)�'�2F�*G�H�	#
�
-�g�6J�.K�L�#
�)�'�2F�*G�H�
#
�
"�#
�
'�#
�
�#
��2�?�?�+�#
��"�.�.�)�#
��R�^�^�,�#
��"�.�.�)�#
��R�^�^�,�#
�
�#
� 
!�!#
�"
!�##
�$!�'�*:�";�<�%#
�&$�W�-=�%>�?�'#
�()�'�2H�*I�J�)#
�*����%�+#
�,����%�-#
�.
�/#
�0�7�>�2�3�1#
�2�������6�7�3#
�4�"�.�.�)�5#
�6�R�^�^�,�7#
�8�"�.�.�)�9#
�:
�;#
�<
"�=#
�>
"�?#
�@����'�A#
�B�7�>�2�3�C#
�D����%�E#
��H

��
�
��#�2�s�6�{�2�#�#�2�s�6�{�2�2����9�L�9���9�L�9�9������9�'�:J�9K�L�M�M�&�J�D����4��(�(����-�A�����-��5��%�%�a�(��)�(��%��)�)�!�U�3��)�)�!�S�1�	/���U�T�"�X�-=�>�A��$�$�T�!�W�d�1�g�6�!�!�U�+�+��.�.�q�4��(�(��.�9)�(�'�>	
����.�.�������0I�J�����.�.�������0I�J�����-�-�r�x�x����/G�H�����-�-�r�x�x����/G�H�����.�.��1K�1K�K��.�.�	0��OA��N&���/� �)�(��	��$&�����+)�(�(�s��<T�T�5U		�7T�U		�U		�6U		�<-U		�*T7�9U		�>$U		�	T4�T4�&U		�2T4�4U		�7	U�U�U		�U�U		�	U
�U
r�ztest needs os.statx()c�>�UOUO2P!r!)r�rYrts&r�test_statx_attributes�(StatAttributeTests.test_statx_attributesfs���#�#�D�J�J�/rc���UOO[O22oUO
W2P![c&SOQSO*2KBh9hr�)rYr�r7r�r�r�r�r�s& r�test_statx_attributes_bytes�.StatAttributeTests.test_statx_attributes_bytesjs^��	N��J�J�%�%�c�&?�&?�&A�B�E�	
�#�#�E�*��"�	N��M�M�?�$�*�*�L�M�	N�r�c�P�UO[UO22P!r!)r�rrYrts&r�test_statx_attributes_pathlike�1StatAttributeTests.test_statx_attributes_pathlikers���#�#�H�T�Z�Z�$8�9rc�R�[OUO[O2o[	U2Tt,tFDoUOQ2%fJUMJ 	ooSFD!o[
V]2UOQ2J#	UO[Q29^tt^2U]*PPP2UO[Q29^tt^2UvoPPP2P!ttoh[cJ�h9h)%fhKU9h)%fhP!9h)r�rsznot subscriptablez
cannot unpack)rr�rY�STATX_BASIC_STATSr�r��setattrr�r��assertRaisesRegexr�)r.rbrr��_s&    r�test_statx_result�$StatAttributeTests.test_statx_resultvs������$�*�*�b�&:�&:�;��%(��K�/�K�D��o�o�f�-��4�K��/��D�
1���a�(��	�	�/�0�
��
#�
#�I�/B�
C�
C��1�I�D�
�
#�
#�I��
?�
?��D�A�q�@�
?��/��
"�
��
��D�
C��
?�
?�
?�sG�C+�C+�,C0�+
D�D�0	C?�:C?�>C?�D	�D	�D&	�D&	�statvfsztest needs os.statvfs()c	��[OUO2oUOUOU]*2Qo[U2FD.vq4UO[
UQU*2V*2J0	UO[UO[22UO[U2]
2]UmUOQ2]UmUOQ2[OQ2oUOQ2[OQ2oP![cKgh9h[cK_h9h[ cKHh9h[ cP!h9h)ri�f_rs)
�bsize�frsize�blocks�bfree�bavail�files�ffree�favail�flag�namemaxrwry)rrrYr=�f_bfree�	enumerater`r|r��f_fsidr�r9r�r�r�rar�)r.rbr��value�memberr�s&     r�test_statvfs_attributes�*StatAttributeTests.test_statvfs_attributes�sI�����D�J�J�'��	
���������3�:��&�w�/�M�E����W�V�T�F�]�;�V�]�K�0�	
���
�6�=�=�#�6�7�	
����V��b�)�	��F�N��I�I�+�,�	��F�M��I�I�+�,�
	��'�'��.�G��I�I�+�,�
	��'�'�(L�M�G��%�	��	���	��	���	��	���	��	�s`�
D<�#E
�<'E�$E/�<	E
�E
�	E
�
	E�E�E�	E,�(E,�+E,�/	E>�9E>�=E>�need os.statvfs()c�h�[OUO2o[[O
]*2FDko[OV2oUOQU2U]6cUOQU2[OU2oUOV2Jm	P!)rzsstatvfs_resultscos
statvfs_result
)
rrrYrr�r�r�rr�r=r�s&    r�test_statvfs_result_pickle�-StatAttributeTests.test_statvfs_result_pickle�s~�����D�J�J�'���6�2�2�Q�6�7�E����V�+�A��M�M�+�Q�/��q�y��
�
�6��:����Q��I����V�/�
8rr�zWin32 specific testsc���[OQ2P![cSOQ2P![coSOQ2Po=P!Po=hh9h)zc:\pagefile.syszc:\pagefile.sys does not existzCould not stat pagefile.sys)rr�rCr�rDr��r.r!s& r�test_1686475�StatAttributeTests.test_1686475�sI��	5��G�G�&�'�� �	=��M�M�;�<��	5��I�I�3�4�4��	5�s%��	A �A �A �A �A�A r�r�c�$�[O2vq[OU2[OU2[OU2UO	[
29^tt^2o[OU2PPP2UO
WOO[O2P![OS2[OS2h9h)%fhKw9hr!)
rr�r�r{r�rDr=�	exceptionrE�EBADF)r.r�r��ctxs&   r�
test_15261�StatAttributeTests.test_15261�s����w�w�y���	��G�G�A�J��H�H�Q�K��H�H�Q�K�
�
�
�w�
'�
'�3��G�G�A�J�(�������,�,�e�k�k�:��	
�H�H�Q�K��H�H�Q�K��
'�
'�s�C�9C?�.C<�?D	�D	c���UOUQ2UO[UO[22SO]UOt96*9%cQ6*2P!t2P!)�st_file_attributes���)�
assertHasAttrr|r�r4r�)r.rbs&&r�check_file_attributes�(StatAttributeTests.check_file_attributes�sQ�����6�#7�8����
�6�#<�#<�c�B�C�����V�6�6�D�D�*�D�E�D�Erz$st_file_attributes is Win32 specificc�2�[OUO2oUOU2UO	UO
[O*]2[OQ*o[OU2UO[OU2[OU2oUOU2UO	UO
[O*[O2P!)rr�)rr�rYr7r=r4�FILE_ATTRIBUTE_DIRECTORYrrrrAr��rmdir)r.rbrLs&  r�test_file_attributes�'StatAttributeTests.test_file_attributes�s���������$���"�"�6�*�����%�%��(E�(E�E�
�	�
�"�"�U�*��
�����������'�*�����!���"�"�6�*�����%�%��(E�(E�E��)�)�	+rc���[OO[OQ*UOQ*2oUO[OU2[UQ2]o[OQUQQ,UQ5[OU2oUOUO]2UO[OOU22P!)�TEMP�_accessrXz
icacls.exez/denyz*S-1-5-32-545:(S))r�)rr>r@�environrYr�rrsr
r��
check_callr��assertNotEqualr�r|�isfile)r.rY�DETACHED_PROCESSrbs&   r�test_access_denied�%StatAttributeTests.test_access_denied�s��������R�Z�Z��/����i�1G�H�����	�(�(�%�0��E�6�"�������5�'�+>�?�*�		
����������F�N�N�A�.���������u�-�.rc��Q[OO[O22]**o[OU2oUOUO[O2P!)z//./)rr>�
splitdriver*r�r=r��S_IFBLK)r.rYrbs&  r�test_stat_block_device�)StatAttributeTests.test_stat_block_devicesM������+�+�B�I�I�K�8��;�;�����������������6r)rY)rhr[r\rirurfr�r�r�r�r�rrrrrrrrr#r'r7r8r+r1r7r<rFrKrjrkrls@rrUrU�s.����(�
O�B�H/�*�	4�s0�j�����W�-�/F�G�0�H�0������W�-�/F�G�+�H�+������W�-�/F�G�:�H�:������W�-�/F�G��H��(�����Y�/�1J�K�)�L�)�V�����Y�/�,�.�	0�.�	0��������0�2H�I�5�J�5��������0�2H�I�
�����V�,�.B�C�
;�D�J�
;�F�
�������0�?�A�+�A�+�&�������0�2H�I�/�J�/�*�������0�2H�I�7�J�7rrUc�`�\sQsQsnQsQsQsQQksQs\	Q2s
\	Q2s\	Q	2sQ
s
QsQsQ
s\O$\O(\O*7Q2Q2s\O$\O(\O.7Q2Q2s\O$\O(\O27Q2Q2sQsQsQsQsQsQs Qs!Qs"\#OHQ2s%Qs&Us'P!)�
UtimeTestsic�N�[OUm[OOUOQ2UmUO[OUO2[OUO2[UO2P!)�f1)rrrrLrr>r@rYr��rmtreerAr
rts&rru�UtimeTests.setUps]�� �'�'����W�W�\�\�$�,�,��5��
����	�(�(�$�,�,�7�
��������D�J�J�rc���[OU2oUOU]*6g9%f5UOU]*6g9%fUOU]	*6g!)r~)rr�rtrurv)r.r��sts&& r�support_subsecond�UtimeTests.support_subseconds[���W�W�X�
������1��%�*�*��K�K�2�a�5�(�*�*��K�K�2�a�5�(�	+rc�x�[OUQ2[OU2O]6H!)rz)rzr{)r�utimer�rt)r.r�s&&r�
support_atime�UtimeTests.support_atime&s,��	����6�"��w�w�x� �)�)�Q�.�.rc��U%f
UOoUOU2oUOU2oU%cQoQoLQoQoUV%U12[OU2o[
O%c�QoU%cDUOUOUQ*QQ5UOUOUQQ5UOUOUQ*QQ5UOUOUQQ5P!U%cTU%c&UOUOUQ*QQ5UOUOUQ*QQ5LNU%c$UOUOUQ*2UOUOUQ*2U%cUOUOU2UOUOU2P!)	i8Z�;l�
o]g�h㈵��>��&�.>�r^g���ư>�rTlP�9g��@)
rYrUrYrr�rrQrart�st_atime_nsru�st_mtime_nsr=)	r.�set_timer�rUrY�atime_ns�mtime_nsrTr^s	&&&      r�_test_utime�UtimeTests._test_utime,s�����z�z�H� �2�2�8�<���*�*�8�4�
��"�H�!�H�!�H� �H���h�/�0�
�W�W�X�
��� � � ��E���&�&�r�{�{�H�t�O�4�&�P��&�&�r�~�~�x�z�&�R��"�"�2�;�;��4��t�"�L��"�"�2�>�>�8�:�"�N� � ��*�*�2�;�;��4��t�*�T��&�&�r�{�{�H�t�O�4�&�P� ��$�$�R�[�[�(�T�/�B�� � ����h��o�>��� � �����:����R�^�^�X�6rc�0�QoUOU2P!)c�6�[OVQ5P!���ns�rrX�r�rjs&&rra�'UtimeTests.test_utime.<locals>.set_time_����H�H�X�%r�rd�r.ras& r�
test_utime�UtimeTests.test_utime^s��	&�	
����"rc�$�UQ*Q*!)r\g��&�.>r%ris&r�	ns_to_sec�UtimeTests.ns_to_secds��
�T�	�V�#�#rc�t�[OQ2U*[OQ2*!)z1e-9z0.5e-9)�decimal�Decimalris&r�ns_to_sec_decimal�UtimeTests.ns_to_sec_decimalks&��
���v�&��+�g�o�o�h�.G�G�Grc�j�[OUQ2[O]Q2*!)rx�ʚ;i�5w)�	fractions�Fractionris&r�ns_to_sec_fraction�UtimeTests.ns_to_sec_fractionrs)��
�!�!�"�e�,�y�/A�/A�!�W�/M�M�Mrc�8`�U1QkoROU2P!)c�:�Uvq#ROU2oROU2o[OVU12P!r!�rtrrX�r�rjrbrc�atime�mtimer.s&&    �rra�2UtimeTests.test_utime_by_indexed.<locals>.set_time{s9���!#��H��N�N�8�,�E��N�N�8�,�E�
�H�H�X�u�~�.rrorpsf r�test_utime_by_indexed� UtimeTests.test_utime_by_indexedys���	/�	
����"rc�8`�U1QkoROU2P!)c�:�Uvq#ROU2oROU2o[OVU1Q5P!))�timesr�r�s&&    �rra�0UtimeTests.test_utime_by_times.<locals>.set_time�s7���!#��H��N�N�8�,�E��N�N�8�,�E��H�H�X�U�^�4rrorpsf r�test_utime_by_times�UtimeTests.test_utime_by_times�s���	5�	
����"rc�8`�U1QkoROU2P!)c�:�Uvq#ROU2oROU2o[OVU12P!r!)ryrrXr�s&&    �rra�/UtimeTests.test_utime_decimal.<locals>.set_time�s;���!#��H��*�*�8�4�E��*�*�8�4�E��H�H�X�u�~�.rrorpsf r�test_utime_decimal�UtimeTests.test_utime_decimal�����	/�
	
����"rc�8`�U1QkoROU2P!)c�:�Uvq#ROU2oROU2o[OVU12P!r!)rrrXr�s&&    �rra�0UtimeTests.test_utime_fraction.<locals>.set_time�s;���!#��H��+�+�H�5�E��+�+�H�5�E��H�H�X�u�~�.rrorpsf r�test_utime_fraction�UtimeTests.test_utime_fraction�r�rz9follow_symlinks support for utime required for this test.c�0�QoUOU2P!)c�8�[OVP
Q5P!)F)rj�follow_symlinksrkrls&&rra�9UtimeTests.test_utime_nofollow_symlinks.<locals>.set_time�s��
�H�H�X�e�<rrorps& r�test_utime_nofollow_symlinks�'UtimeTests.test_utime_nofollow_symlinks�s��	=�	
����"rz,fd support for utime required for this test.c�0�QoUOU2P!)c��[UQ]29^tt^2o[OUO2UQ5PPP2P!)%fhP!9h)�wbri)rxrrXr�)r�rjr�s&& rra�*UtimeTests.test_utime_fd.<locals>.set_time�s8���h��a�(�(�B���������,�)�(�(�(�s�'A�A	�A	rorps& r�
test_utime_fd�UtimeTests.test_utime_fd�s��	-�
	
����"rz0dir_fd support for utime required for this test.c�0�QoUOU2P!)c���[OOU2vq#[OU29^tt^2o[O
V4UQ5PPP2P!)%fhP!9h))rrj)rr>�splitr�open_dir_fdrX)r�rjrLr�dirfds&&   rra�.UtimeTests.test_utime_dir_fd.<locals>.set_time�sF���G�G�M�M�(�3�M�G��&�&�w�/�/�5������3�0�/�/�/�s�A$�$A5	�-A5	rorps& r�test_utime_dir_fd�UtimeTests.test_utime_dir_fd�s��	4�
	
����"rc�F�QoUOVOQ5P!)c�6�[OVQ5P!rhrkrls&&rra�1UtimeTests.test_utime_directory.<locals>.set_time�rnr)r�)rdrLrps& r�test_utime_directory�UtimeTests.test_utime_directory�s��	&�	
����L�L��9rc�p�[O2oUUO2UOUO2%fQoLQo[OUO2oQUO
8QU8QUO
U*
80oUO
UO
UV5Q5P!)��?g�������?zst_time=z
, current=z, dt=r])�timerYrUrr�rura)r.ra�currentr^rTr_s&&    r�_test_utime_current�UtimeTests._test_utime_current�s����)�)�+��	������%�%�d�j�j�1�1��E��E�
�W�W�T�Z�Z�
 ���+�+�w����g�(=�?�����r�{�{�G�%*�	�	5rc�8`�U1QkoROU2P!)c�J:�[ORO2P!r!�rrXrY�r�r.s&�rra�/UtimeTests.test_utime_current.<locals>.set_time�s����H�H�T�Z�Z� r�r�rpsf r�test_utime_current�UtimeTests.test_utime_current�s���	!�	
� � ��*rc�8`�U1QkoROU2P!)c�L:�[OROP2P!r!r�r�s&�rra�3UtimeTests.test_utime_current_old.<locals>.set_time�s����H�H�T�Z�Z��&rr�rpsf r�test_utime_current_old�!UtimeTests.test_utime_current_old�s���	'�	
� � ��*rc�$�[O2oQoUO[29^tt^2o[OV!U12PPP2UOWOOU2P!)%fhK89h)�nonexistent)r�r�rCrrXr=r.r�)r.�nowr��cms&   r�test_utime_nonexistent�!UtimeTests.test_utime_nonexistent�s^���i�i�k�� ��
�
�
�0�
1�
1�R��H�H�X�S�z�*�2�������.�.��9�2�
1�s�A?�?B	�B	c��[OQ6Xc�[OO	[OOU22]*Q*o]PHoUOOoUOP]d2oUOUP]PPPU[U22oU%c
UO!P!P!)r��\)
r7r8rr>rI�abspath�ctypes�windll�kernel32�create_unicode_buffer�GetVolumeInformationWr9r!)r.r>�rootr�r��buf�oks&&     r�get_file_system�UtimeTests.get_file_system�s����<�<�7�"��7�7�%�%�b�g�g�o�o�d�&;�<�Q�?�$�F�D���}�}�-�-�H��.�.�r�3�7�C��/�/��d�A�04�d�D�03�S��X�?�B���y�y� ��#rc	��UOUO2Q6wcUOQ2QoSFD�oUOUQ59^tt^2[O
UOV"12UO[OUO2OU2PPP2J�	P!)%fhJ�9h)�NTFSz
requires NTFS)�large)r^l����}�Kl����}�Kl}�Kl}�K)
r�rLr�r�rrXrYr=r�ru)r.r�r�s&  r�test_large_time�UtimeTests.test_large_time�s���������-��7��M�M�/�*�
��
�E����E��*�*�������e�^�4�� � �������!4�!=�!=�u�E�+�*��*�*�*�s�AC	�C
�	C
c	��UO[29^tt^2[OUOQQQ5PPP2UO[
29^tt^2[OUO]],2PPP2UO[
29^tt^2[OUOQ2PPP2UO[
29^tt^2[OUOQ2PPP2UO[
29^tt^2[OUO]],Q5PPP2UO[
29^tt^2[OUOQQ5PPP2UO[
29^tt^2[OUOQQ5PPP2[O[O7cJUO[29^tt^2[OUOQP
Q5PPP2[O[O7ct[UOQ]29^tt^2oUO[
29^tt^2[OUO2Q2PPP2PPP2[O[O7cLUO[29^tt^2[OUOQ]Q5PPP2P!P!)%fhCK49h)%fhCK�9h)%fhCK�9h)%fhCK�9h)%fhCKc9h)%fhCK/9h)%fhCK�9h)%fhCK�9h)%fhCK)9h)%fhCK59h)%fhP!9h)r|ri�r�r��r)r|r|�r|)r|r|r|)r�rrrXrYr��supports_follow_symlinksr�supports_fdrxr��supports_dir_fd)r.r�s& r�test_utime_invalid_arguments�'UtimeTests.test_utime_invalid_arguments	sv��
�
�
�z�
*�
*��H�H�T�Z�Z��F�3�+�
�
�
�y�
)�
)��H�H�T�Z�Z�!�Q��(�*�
�
�
�y�
)�
)��H�H�T�Z�Z��&�*�
�
�
�y�
)�
)��H�H�T�Z�Z��+�*�
�
�
�y�
)�
)��H�H�T�Z�Z�Q��F�+�*�
�
�
�y�
)�
)��H�H�T�Z�Z�D�)�*�
�
�
�y�
)�
)��H�H�T�Z�Z�I�.�*��8�8�2�6�6�6��"�"�#6�7�7�������V�U�C�8�
�8�8�2�>�>�)��d�j�j�$��*�*�b��&�&�y�1�1��H�H�R�Y�Y�[�&�1�2�+��8�8�2�-�-�-��"�"�#6�7�7�������V�A�6�8�7�.�-+�
*�
*��
)�
)�
)��
)�
)�
)��
)�
)�
)��
)�
)�
)��
)�
)�
)��
)�
)�
)��8�7�7��2�1�1��+�*�*��8�7�7�s��$M.�($N�1"N�8"N*�?%N>�	#O�#O&�<$O:�*P"�&P	�.P"�>$P6�.M?	�7M?	�N	�N	�N'	�N'	�*N;	�3N;	�>O	�O	�O#	�O#	�&O7	�/O7	�:P	�P	�P
�P
�	P"�"P3	�+P3	�6Q	�?Q	c�b�QoUO[29^tt^2[OUOU]*2]1Q5PPP2UO[29^tt^2[OUOUQ2]1Q5PPP2UO[29^tt^2[OUOUQ2]1Q5PPP2P!)%fhK�9h)%fhKu9h)%fhP!9h)c�.`�U1QkQ2oU2!)c�0:`�\sQsQsnU1QksQsUsP!)�?UtimeTests.test_issue31577.<locals>.get_bad_int.<locals>.BadInti*c�
:�R!r!r%)r��divmod_ret_vals*�r�
__divmod__�JUtimeTests.test_issue31577.<locals>.get_bad_int.<locals>.BadInt.__divmod__+s	���)�)rr%)rhr[r\rir�rjrk)rmr�s@�r�BadIntr�*s����*�*rr�r%)r�r�sf r�get_bad_int�/UtimeTests.test_issue31577.<locals>.get_bad_int)s���
*�
*��8�Orrir%)rzr{ri)r�r�rrXrY)r.r�s& r�test_issue31577�UtimeTests.test_issue31577%s���	�
�
�
�y�
)�
)��H�H�T�Z�Z�[��_�a�$8�9�*�
�
�
�y�
)�
)��H�H�T�Z�Z�[��_�a�$8�9�*�
�
�
�y�
)�
)��H�H�T�Z�Z�[��%;�Q�$?�@�*�
)�	*�
)��
)�
)��
)�
)�
)�s5�+C7�2+D
�+D�7D	�D	�
D	�D	�D.	�&D.	)rLrYr!)(rhr[r\rirurUrYrdrq�staticmethodrtryrr�r�r�r�rrrrXr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrPr�rjrkrls@rrNrNsU���� �+�/�07�d#��$��$��H��H��N��N�	#�#�#�#�������R�%@�%@�@�*�+�#�+�#�������R�^�^�3�G�I�#�I�#�������R�%7�%7�7�K�M�#�M�#�:�5�,+�+�:�
!�F� 7�8
���
A��
ArrN)�
mapping_testsc�`�\sQsQsnQsPsQsQsQsQs	\
O\9%c\
OO\2Q2\
O\\
Q2Q	2\O$2Q
222s\
O\9%c\
OO\2Q2\
O\\
Q2Q	2\O$2Q222sQsQ
sQsQs\
O\
O2Q2Q2s\O$2Q2s\O8]
]2Q2sQsQsQs Qs!Qs"Qs#Qs$Qs%Qs&Qs'Qs(Qs)Q s*Q!s+Us,P!)"�EnvironTestsi8z8check that os.environ object conform to mapping protocolc�"�[[O2Um[O%c[[O
2UmUO2O2FDvqU[OU$J	P!r!)	�dictrrA�_EnvironTests__save�supports_bytes_environ�environb�_EnvironTests__saveb�
_reference�items�r.�keyr!s&  rru�EnvironTests.setUp<sW���2�:�:�&���
�$�$�$�����,�D�L��/�/�+�1�1�3�J�C�#�B�J�J�s�O�4rc�T�[OO2[OOUO2[O
%cJ[OO2[OOUO2P!P!r!)rrA�clear�updater�r�r�r�rts&rrM�EnvironTests.tearDownCs_��
�
�
����
�
�
���$�+�+�&�
�$�$�$��K�K�����K�K���t�|�|�,�%rc��QQQQQQ-!)�KEY1�VALUE1�KEY2�VALUE2�KEY3�VALUE3r%rts&rr��EnvironTests._referenceJs���x���&��B�Brc�`�[OO2[O!r!)rrArrts&r�_empty_mapping�EnvironTests._empty_mappingMs��
�
�
�����z�z�r�requires a shell�popenzneeds os.popen()c�p�[OO2[OOQQ5[OQ[
*29^tt^2oUO
2O2oUOUQ2PPP2P!)%fhP!9h)�World)�HELLOz%s -c 'echo $HELLO')	rrArrrrr��stripr=)r.rr!s&  r�test_update2�EnvironTests.test_update2Rss��
	�
�
����
�
�
�����(�
�X�X�+�j�8�
9�
9�U��J�J�L�&�&�(�E����U�G�,�:�
9�
9�
9�s�)1B$�$B5	�-B5	c��[OQ[*29^tt^2o[U2oUO	[U2Q2UO	[U2Q2UO	[U2Q2UO
[[
U2PPP2P!)%fhP!9h)z %s -c 'echo "line1
line2
line3"'zline1
zline2
zline3
)rrr�iterr=�nextr��
StopIteration)r.r�its&  r�test_os_popen_iter�EnvironTests.test_os_popen_iter]s���
�X�X�<�"�#�$�$�',��e��B����T�"�X�y�1����T�"�X�y�1����T�"�X�y�1����m�T�2�6�
$�$�$�$�s�A8B-�-B>	�6B>	c���[OO2FDCvqUO[	U2[
2UO[	U2[
2JE	P!r!)rrArr=r�r,)r.r�vals&  r�test_keyvalue_types� EnvironTests.test_keyvalue_typeslsC���
�
�(�(�*�H�C����T�#�Y��,����T�#�Y��,�+rc��UO2O2FD4vqUO[OOU2U2J6	P!r!)r�rr=rrA�getrs&  r�
test_items�EnvironTests.test_itemsqs;���/�/�+�1�1�3�J�C����R�Z�Z�^�^�C�0�%�8�4rc��[OoQOQUO222oUO	[U2QUQ02P!)z>Check that the repr() of os.environ looks like environ({...}).z, c3�D�SF �DvqU8QU80w�	J	P!3h)z: r%)r�rr!s&  rr��-EnvironTests.test___repr__.<locals>.<genexpr>ys#��)���)�
���g�R��y�!�)�s� z	environ({z}))rrAr@rr=�repr)r.�env�formatted_itemss&  r�
test___repr__�EnvironTests.test___repr__vsL���j�j���)�)�$
�!�i�i�k�$
�
��	
����c��j��0A��$E�Frc���[OO[O2o,Q	NoQ[OO	U2-o[O
o[
U2[mUOU[O22UOU[OPQ52U[mUOU[O-22UOQ
[OQP-22UOU[OU22[O%c�[OP	Q59^tt^2QQQQ-oPPP2UO[[OW2UO[OQQ-2Q,2UO[OQQ-2Q,2UO[OQQ-2Q,2P!P!S[mh9h)%fhK�9h[cK�h9h)�/monty�PATH�r.)�recordr��PATHr��abc�abc)r3z/python�z/flying/circus�r:)r�defpathr��pathsepr@rAr��assertSequenceEqual�
get_exec_pathr��warnings�catch_warningsr�r�BytesWarning)r.�defpath_list�	test_path�test_env�
saved_environ�	mixed_envs&     r�test_get_exec_path�EnvironTests.test_get_exec_paths����z�z�'�'��
�
�3��?�	��B�J�J�O�O�I�6�7���
�
�
�	'��h��B�J��$�$�Y��0@�0@�0B�C��$�$�Y��0@�0@�T�0J�K�&�B�J�	
� � ��r�/?�/?��/C�D�� � ���(8�(8�&���(E�F�� � ��B�,<�,<�X�,F�G�
�$�$�$�
K��,�,�D�9�9�!'��g�t� <�I�:��!�!�*�b�.>�.>�	�J�
�$�$�R�%5�%5�w��6G�%H���
��$�$�R�%5�%5�w��6F�%G���
��$�$�R�%5�%5�v�v�6F�%G���
�#%��'�B�J��:�9���
��
�sC�%A H-�I�:H=�I�-
H:�=I
	�I
	�I�	I�I�Iz#os.environb required for this test.c��QoUO[O2Q2oU[
OQ$UO[
OQ*U2UO[
OQ*W2QoU[
OQ$UO[
OQ*U2UO[O2Q2oUO[
OQ*U2P![c/Q[O280oSO	S2CK#h9h)ueuro€�surrogateescapez%U+20AC character is not encodable to �unicodesunicode��sbytesrU)
r�r7r�r�r�rrAr=r��decode)r.r!�value_bytesr_�	value_strs&    r�
test_environb�EnvironTests.test_environb�s�����	��,�,�s�'@�'@�'B�'8�:�K�!&��
�
�9��������I�.��6�������Z�0�+�>��� %����H��������X�.��6��L�L��!:�!:�!<�>O�P�	�������G�,�i�8��"�	��)�)�+�.�C��M�M�#��	�s�%D�	E�+E�
Ec	��QoQoQU8Q0o[O29^tt^2oUOUP2[OV2[
O[OQU,P	[
OP	Q5oUOUOO2[U22[OU2[
O[OQU,P	[
OP	Q5oUOUOO2[P22PPP2P!)%fhP!9h)�
PYTHONTESTVAR�	testvaluez%import os; print(repr(os.environ.get(z)))r�)�check�stdout�text)r�EnvironmentVarGuard�popr�putenvr��runr7r��PIPEr=rW�rstripr-�unsetenv)r.rr!r�r.�procs&     r�test_putenv_unsetenv�!EnvironTests.test_putenv_unsetenv�s�������6�t�h�c�B��
�
*�
*�
,�
,���G�G�D�$���I�I�d�"��>�>�3�>�>�4��">�d�)3���t�E�D����T�[�[�/�/�1�4��;�?��K�K����>�>�3�>�>�4��">�d�)3���t�E�D����T�[�[�/�/�1�4��:�>�-�
,�
,�
,�s�DE�E	�E	c��QFDZoUO[[1[OUQ2UO[[1[O
U2J\	QFDNoUO[[OUQ2UO[[O
U2JP	[OQ6Xc}QQ*oUO[[OUQ2UO[[OQU2UO[[O
U2P!P!)	r:r!r�rn��r��X)r:z=namezna=mezname=)znamezname)r�rDrrr[r_r7r8)r.r�longstrs&  r�test_putenv_unsetenv_error�'EnvironTests.test_putenv_unsetenv_error�s���4�D����w�
�3�R�Y�Y��g�N����w�
�3�R�[�[�$�G�4�)�D����j�"�)�)�T�7�C����j�"�+�+�t�<�)��<�<�7�"��F�l�G����j�"�)�)�W�c�B����j�"�)�)�S�'�B����j�"�+�+�w�?�
#rc���QoUOU[O2UO[29^tt^2o[OU*PPP2UOWOO]*U2UOUOO2UO[29^tt^2o[OUPPP2UOUOO]*U2UOUOO2P!)%fhK�9h)%fhKw9h)�
missingkey)
�assertNotInrrAr��KeyError�assertIsr.r�r|�__suppress_context__)r.�missingr�s&  r�
test_key_type�EnvironTests.test_key_type�s���������"�*�*�-�
�
�
�x�
(�
(�B��J�J�w��)��
�
�b�l�l�'�'��*�G�4�������9�9�:�
�
�
�x�
(�
(�B��
�
�7�#�)��
�
�b�l�l�'�'��*�G�4�������9�9�:�)�
(��
)�
(�s$�D>�E�>E	�E	�E!	�E!	c��[U2oQo[U2Q[OU$[U2UO	[OU*Q2[OUP![OSh9h)�__new_key__�test_environ_iteration)rrrrAr=)r.�
collection�iterator�new_keys&&  r�_test_environ_iteration�$EnvironTests._test_environ_iteration�sg���
�#�����X��7��
�
�7��	$���N����R�Z�Z��0�2J�K��
�
�7�#���
�
�7�#�s�2A3�3Bc�F�UO[O2P!r!)rxrrArts&r�(test_iter_error_when_changing_os_environ�5EnvironTests.test_iter_error_when_changing_os_environs���$�$�R�Z�Z�0rc�b�UO[OO22P!r!)rxrrArrts&r�.test_iter_error_when_changing_os_environ_items�;EnvironTests.test_iter_error_when_changing_os_environ_itemss���$�$�R�Z�Z�%5�%5�%7�8rc�b�UO[OO22P!r!)rxrrA�valuesrts&r�/test_iter_error_when_changing_os_environ_values�<EnvironTests.test_iter_error_when_changing_os_environ_values	s���$�$�R�Z�Z�%6�%6�%8�9rc��[%c*[OO[2%fP![O
%fP![O[QUQ029^tt^2oUO2O2oPPP2UOUW2P!)%fhK$9h)Nz -c 'echo $�')
rrr>�existsr�has_subprocess_supportrr�rr=)r.�varrNrr!s&&&  r�_test_underlying_process_env�)EnvironTests._test_underlying_process_envs}���
�r�w�w�~�~�j�9�9���/�/�/��
�X�X���K��u�A�6�
7�
7�5��J�J�L�&�&�(�E�8�	
����5�)�8�
7�s�9B4�4C	�=C	c���QoQoU[OU$QQQQUQ-o[[O2oUOU2[OU*oUO	VE2UOQVQ*2UO
2oUO[[OOU22UOQP2UOV2P!��
_TEST_VAR_�original_value�_A_r��_B_�2�3)rrAr�r�assertDictEqualr=rrm�NotImplemented�__or__r��r.�overridden_keyr��
new_vars_dictrN�actual�new_vars_itemss&      r�test_or_operator�EnvironTests.test_or_operators���%��)��%3��
�
�>�"���U�C���E�
���
�
�#�����
�&����m�+�����X�.�����f�4�5�&�,�,�.���
�
�n�b�j�j�&7�&7��&G�H��)�)�%��4��)�)�.�Irc��QoQ[OU$QQQQUQ-o[[O2oUOU2[9OU*tmUO	U[O2UO	Q[OU*2UOQQ2UOUQ2P!r��rrAr�rr=r�)r.r�r�rNs&   r�test_ior_operator�EnvironTests.test_ior_operator*s���%��%5��
�
�>�"���U�C���E�
���
�
�#�����
�&�
�
�
�m�#�
�����2�:�:�.�����b�j�j��8�9��)�)�%��5��)�)�.�#�>rc���[OO2oUO[29^tt^2]Q-o[9OU*tmPPP2UO[29^tt^2Q]-o[9OU*tmPPP2UOU[O2P!)%fhKy9h)%fhKE9h)rzr�)rrA�copyr�r�r=)r.�os_environ_copy�dict_with_bad_key�dict_with_bad_vals&   r�test_ior_operator_invalid_dicts�,EnvironTests.test_ior_operator_invalid_dicts9s����*�*�/�/�+��
�
�
�y�
)�
)�!"�E�
���J�J�+�+�J�*��
�
�y�
)�
)�!&��
���J�J�+�+�J�*�
	
����"�*�*�5�*�
)��*�
)�s#�"C�"C#�C 	�C 	�#C3	�,C3	c��QoQ[OU$QQUQ11o[[O2oUOU2[9OU*tmUO	U[O2UO	Q[OU*2UOQQ2UOUQ2P!)r�r�r�r�r�)r�r�)r�r�r�)r.r�r�rNs&   r�$test_ior_operator_key_value_iterable�1EnvironTests.test_ior_operator_key_value_iterableFs���%��%5��
�
�>�"�&��~�s�6K�L����
�
�#������'�
�
�
�n�$�
�����2�:�:�.�����b�j�j��8�9��)�)�%��5��)�)�.�#�>rc���QoQoU[OU$QQQQUQ-o[U2oUO[O2U[O*oUO	VE2UOV%U*2UO
2oUO[[OOU22UOQP2UOV2P!r�)rrAr�rr�r=rrmr��__ror__r�r�s&      r�test_ror_operator�EnvironTests.test_ror_operatorUs���%��)��%3��
�
�>�"���U�C���E�
��
�&������
�
�#�����+�����X�.������)?�@�&�,�,�.���
�
�n�b�j�j�&8�&8��&H�I��)�)�%��4��)�)�.�Irc���[[Q2oQ[OQ$[OQQ2UO	[OQ*Q2U%c(UO	[O
Q*Q2[O2UO	[OQ*Q2U%c(UO	[O
Q*Q2[OQ2UO	[OQ*Q2U%c(UO	[O
Q*Q2[O2UOQ[O2U%c!UOQ[O
2U%Cc�Q[O
Q$[OQQ2UO	[O
Q*Q2UO	[OQ*Q	2[O2UO	[O
Q*Q
2UO	[OQ*Q2[OQ2UO	[O
Q*Q
2UO	[OQ*Q2[O2UOQ[O
2UOQ[O2P!P!)r��python_valuerE�	new_valuestest_envspython_values	new_values
python_value2�
new_value2�
python_value2s
new_value2)	rrrAr[r=r��reload_environr_rk)r.�has_environbs& r�test_reload_environ� EnvironTests.test_reload_environhs'���r�:�.��"0��
�
�:��
�	�	�*�k�*�������J�/��@�����R�[�[��5��G�
����������J�/��=�����R�[�[��5�|�D�	���J��������J�/��=�����R�[�[��5�|�D�
��������R�Z�Z�0�����[�"�+�+�6��<�'7�B�K�K��$��I�I�j�,�/����R�[�[��5�7G�H����R�Z�Z�
�3�_�E��������R�[�[��5�}�E����R�Z�Z�
�3�\�B�
�K�K�
�#����R�[�[��5�}�E����R�Z�Z�
�3�\�B��������[�"�+�+�6����Z����4�%rc��Q[OQ$[OO2UO[O-2UO	[
[OOP2P!)r��REMOVEME)rrArr=r�r�rts&r�
test_clearenv�EnvironTests.test_clearenv�sP��!$��
�
�:��
�
�
����������R�(����)�R�Z�Z�%5�%5�t�<r)�__save�__saveb)-rhr[r\ri�__doc__�	type2testrurMr�rrrrrr>r�rr�requires_subprocessrr r$r(r0rHr�rQra�requires_mac_verrgrprxr{r~r�r�r�r�r�r�r�r�r�rjrkrls@rr�r�8s�����B��I�$�-�C��
����B�B������z�(B�+�-�
�����W�-�/A�B�� � �"�-�#�C�-�-�����B�B������z�(B�+�-�
�����W�-�/A�B�� � �"�7�#�C�-�7�-�
9�
G�'�R����2�2�>�@�9�@�9�*
� � �"�?�#�?�&
���b�!�$�@�%�@�$;�
$�1�9�:�	*�J�&
?�6�
?�J�&-5�^=�=rr�c�|`�\sQsQsnQsP
sQsQsQsQQks	Qs
QsQ	sQ
s
Qs\O \\Q2Q
2\O&\O*Q6HQ2Q22s\O \\Q2Q
2\O&\O*Q6HQ2Q22sQsQsQsUsP!)�	WalkTestsi�zTests for os.walk().c�j�QU7cUOQ2UQ$[OU1-U@!)r��followlinks)rZr�walk)r.�top�kwargss&&,rr��WalkTests.walk�s2����&�$*�J�J�/@�$A�F�=�!��w�w�s�%�f�%�%rc	��[OOoUO[O
[O2U[OQ2UmUUOQ2UmUUOQ2Um	UUOQ2oUUQ2oUUOQ2Um
UUOQ2oUUQ2oUUQ2oUUQ2UmU[OQ	2oU[OQ	Q
2oUUQ2UmUUQ2o	UUQ
2o
[OUO2[OU2[OU2[OU2UOVEV�1FDAo[UQQQ59^tt^2oUOQU*Q*2PPP2JC	[O 2%c�[O"[OO%U2UO2[O"QUOP	2[O"UQQ2U	P	2[O"UQQ2U
P	2UQQ,,QN1UmLUQ,Q,1Um[O(U]2[O*U2[O(U[,O.2[O0U2[O2U2UO&]*QP!)%fhCJ�9h[4c4SO[O(S[,O.2P!h9h)�TEST1�SUB1�SUB11�SUB2�SUB21�tmp1�tmp2�tmp3�link�TEST2�tmp4�broken_link�broken_link2�broken_link3rnr�r�zI'm z" and proud of it.  Blame test_os.
�broken�tmp5:NrzN)r�r�r�r�)rr>r@r�rrQrr�	walk_path�	sub1_path�
sub11_path�	tmp1_path�	link_path�broken_link_path�makedirsrxr��can_symlinkrr��	sub2_tree�chmod�listdirr��S_IRWXUrsr;�PermissionError)
r.r@�	sub2_path�
sub21_path�	tmp2_path�	tmp3_path�	tmp5_path�t2_path�	tmp4_path�broken_link2_path�broken_link3_pathr>r�s
&            rru�WalkTests.setUp�s����w�w�|�|�����	�(�(�)�*:�*:�;�&�i�.�.��8����d�n�n�f�5����t�~�~�w�7��������0�	��)�W�-�
��d�n�n�f�5��������0�	���F�+�	���V�,�	��i��0����y�'�'��1����)�)�7�F�;�	� $�Y�
� >��� ��N�;�� ��N�;��	���D�O�O�$�
���I��
���J��
���G���N�N�I�)�N�D��d�C�'�2�2�a������
�(M�M�N�3�2�O�� � �"�"��J�J�r�w�w���w�/����@��J�J�x��!6�!6��=��J�J�t�F�H�-�/@�$�G��J�J�t�G�V�,�.?��F�'�'�6�):�'�(�D�N�(�'��V�H�=�D�N�
����Q��	&��J�J�z�"�
�H�H�Z����.��I�I�i� ��H�H�Z� ����q�!�"�%�/3�2�2��"�	@��O�O�B�H�H�j�$�,�,�?�	@�s*� M,	�/N�,M>
�5M>
�	N?�0N?�>N?c��[UOUO22oUO[	U2]2U]*]*]*Q6goU]*]*O2U]]U**
*P*O2U]]U**
*]*O2UOU]*UOQQ,Q,12UOU]U**UOQ,Q,12UOU]U**UO,,12UOU]]U**
*UO2P!)r�r�r�r�r�r�)	�listr�r�r=r9�sortr�r�r��r.�all�flippeds&  r�test_walk_topdown�WalkTests.test_walk_topdown�s&���4�9�9�T�^�^�,�-������S��1�%��a�&��)�A�,�&�(���A��q�	�����A��G��O��R� �%�%�'��A��G��O��Q��$�$�&�����Q��$�.�.�6�6�2B�V�H�!M�N�����Q��[�)�D�N�N�W�I��x�+P�Q�����Q��[�)�D�O�O�R��+D�E�����Q��W��_�-�t�~�~�>rc��Ue
UOo,oUOU2FD3vq4oUOV4U12QU7fJ"UOQ2J5	UO	[U2]2UO	U]*UOQ,Q,12U]*P*O
2U]*]*O
2UO	U]*UO2P!)Nr�r�r�)r�r�r��remover=r9r�r�)r.r�r�r��dirsrs&&    r�test_walk_prune�WalkTests.test_walk_prunes��������I���!%���9�!5��D���J�J��E�*�+���~����F�#�"6�	
����S��1�%�����Q��$�.�.�6�(�V�H�!E�F��A��r�
�����A��q�	��������Q�����0rc�P�UO[UO22P!r!)r�rr�rts&r�test_file_like_path�WalkTests.test_file_like_paths�����X�d�n�n�5�6rc��[UOUOP
Q52oUO[	U2]U2U]*]*]*Q6goU]*]*O2U]]U**
*P*O2U]]U**
*]*O2UOU]*UOQQ,Q,12UOV*UO,,12UOV]**UOQ,Q,12UOU]]U**
*UO2P!)F��topdownr�r�r�r�r�)	r�r�r�r=r9r�r�r�r�r�s&  r�test_walk_bottom_up�WalkTests.test_walk_bottom_ups1���4�9�9�T�^�^�U�9�;�<������S��1�c�*��a�&��)�A�,�&�(���A��q�	�����A��G��O��R� �%�%�'��A��G��O��Q��$�$�&�����Q���.�.�6�6�*:�V�H�E�	G�������/�/�2�r�2�	4�����q�[�)��.�.�7�)�f�X�>�	@�����Q��W��_�-����	)rc��[O2%fUOQ2UOUOP	Q5oSFD>vq#oV O
6XfJUO
U,2UO
UQ,2L	UOQ2UOUOP	Q5oUO%cUO[[U2UO[[U2P!)zneed symlink supportr�r�z+Didn't follow symlink with followlinks=True)rr�r�r�r�r�r=r�r��is_fwalkr�rCrr)r.�walk_itr�r�rs&    r�test_walk_symlink�WalkTests.test_walk_symlink+s����$�$�&�&��M�M�0�1��)�)�D�N�N�D�)�A��!(��D���~�~�%�� � ��r�*�� � ����1��	")�
�I�I�C�D��)�)�D�1�1�4�)�H���=�=�=����/��w�?����-��w�7rc	���,oUOUOUOQ5o[U2vq4oUO	U,2Qo[
OOV62o[
OOV6Q*2o[
OVx2ST	T
Tt,tFDvq�p�MJ		oo
o	oUOU2UOV|2UOV�2SFD:o
V�6wfJUO[
OOV=2U2J<	[
OV�2P!ttoo
o	h[
OX�2h9h)��onerrorr�z.new)r�r�r�rr=rr>r@r�r|rkr)r.�errorsr	r�r�r�dir1�path1�path1newr��dr��roots�dir2s&             r�test_walk_bad_dir�WalkTests.test_walk_bad_dir>s
�����)�)�D�N�N�F�M�M�)�B�� ��M���E������$��������T�(���7�7�<�<��V�m�4��
�	�	�%�"�		'�&-�.�g�7�1��Q�g�E�.��O�O�F�#����U�*����X�-����<��M�M�"�'�'�,�,�t�":�E�B��
�I�I�h�&��/��
�I�I�h�&�s%�)E�.E
�=AE�3E�
E�E,c��UOQ2oUO%cUO[[U2UO[
[U2UOQP	Q5oUO%cUO[[U2UO[
[U2UOUO2oUO[
[U2UOUOP	Q5oUO%cUO[[U2UO[
[U2P!)�nonexistingr�)r�rr�rCrrr��NotADirectoryError)r.r	s& r�test_walk_bad_dir2�WalkTests.test_walk_bad_dir2Ss����)�)�M�*���=�=�=����/��w�?����-��w�7��)�)�M�4�)�@���=�=�=����/��w�?����-��w�7��)�)�D�N�N�+�����-��w�7��)�)�D�N�N�D�)�A���=�=�=����0�$��@����-��w�7r�mkfifozrequires os.mkfifo()r3z%fifo requires special path on VxWorksc��[OQ*o[OU2UO	[O
U2UO
U2oUO[[U2UO
UP	Q5oUO%cUO[[U2UO[[U2P!)z-piper�)rrrrrr�rsr�r�rrrr)r.r>r	s&  r�test_walk_named_pipe�WalkTests.test_walk_named_pipefs������'�)��
�	�	�$������	�	�4�(��)�)�D�/�����-��w�7��)�)�D�$�)�7���=�=�=����0�$��@����-��w�7rc�
�[OQ*o[OU2UO	[
OU2[O[OOUQ22,oUOVOQ5o[U2UO[[U2UOU,2,oUOVOQ5o[U2vqEoUOVA2UOU,2UOUQ,2UO!U2UO#2UO$%cUO[&[U2UO[[U2UO$%cUOU,2P!UO[)U2]U2UO+U]*[&2P!)z-dir�mypiper
)rrrrrAr��shutilrQrr>r@r�r�rr�rr=�extendrrrr9r+)r.r>rr	r�r�rs&      r�test_walk_named_pipe2�WalkTests.test_walk_named_pipe2vsl�����&�(��
���������
�
�t�,�
�	�	�"�'�'�,�,�t�X�.�/����)�)�D�-�-�)�8���W�
����-��w�7������$����)�)�D�-�-�)�8�� ��M���E�����$�����r�"������
�+����E��
���
��=�=�=����0�$��@����-��w�7��=�=�=����V�R�(����S��[�!�V�4��!�!�&��)�-?�@rc	�b�]o[OO[OQ2o[OOU,Q,U*N3o[O
U2[
]d2Tt,tFDp@OUP
Q5MJ	oo[
U]*2FDVoX6%cQ,L,,1oSFDoUO[U2U2J 	[OOU2oJX	[
]d2Tt,tFDp@OUP	Q5MJ	ooSo[
U]*2FDVoX6U6cQ,L,,1oSFDoUO[U2U2J 	[OOUQ2oJX	P!ttohttoh)��deeprr)rr>r@rrrr�rr�r=rrL)	r.�depth�baser��j�itersr rNrs	&        r�test_walk_many_open_files�#WalkTests.test_walk_many_open_files�sP�����w�w�|�|�I�,�,�f�5���G�G�L�L��.�#��u��.��
���A��9>�s��D��A���4���/���D��u�q�y�!�A��A�C�5�2�r�2�H���� � ��b��8�4��������"�A�	"�9>�c�
�C�
�1���4���.�
��C����u�q�y�!�A���I�C�5�2�r�:�H���� � ��b��8�4�������Q��$�A�	"��E��Ds�?F'�F,c�R�]2o[O[OOUO,Q,U*N32[U]*
29^tt^2[
UOUO22oPPP2UO]*oWFD.vqEoVC6XfJUO2UO2J0	,oUOo[U2FD8o	[OOUQ2oUOUQ,,12J:	UP*]*O2QUOQ,Q,1UO,,1,QUO,QU-o
U]*]*oUOUQ,1,oSFDoUOV�*2J	UO![#U2U]*2UO![%U2,QN2UO!V+2P!)%fhCK�9h)�2rr�r�r�r�r�)r�r�r)rr�r>r@r�rr�r�r�r�rr�rr�r�r$r=r9�sorted)
r.r*r�r�r�r�r�	d_entries�d_pathr�sectionsrNrs
&            r�test_walk_above_recursion_limit�)WalkTests.test_walk_above_recursion_limit�s�����
���B�G�G�L�L����B�C�5�5�=�B�C�
���	�
*�
*��t�y�y����0�1�C�+��N�N�1�%�	�!$��D��� ��	�	���
�
��"%�
�	������u��A��W�W�\�\�&�#�.�F����f�s�e�R�0�1��	�"�
�a���� �
����'��V�H�5����"�b�)��
�T�^�^�$���

���1�v�a�y���^�^�T�F�8�4�5���A��O�O�H�K�(��	
����S��5�1�9�-�������'<�=�����'�G+�
*�
*�s�'%H�H&	�H&	)r�r�r�r�r�r�r�r!)rhr[r\rir�rr�rur�r�rrr
rrrrrrrNr7r8rr%r.r6rjrkrls@rr�r��s�������H�&�
C&�J?�"1�&7�)�*8�&'�*8�&�����X�.�0F�G�
�_�_�S�\�\�Y�.�;�=�8�=�H�8������X�.�0F�G�
�_�_�S�\�\�Y�.�;�=�A�=�H�A�:%�*&(�&(rr��fwalkzTest needs os.fwalk()c��`�\sQsQsnQsP	sQsQsQsQs	Qs
Qs\O\OQ	2Q
2s\O\OQ	2Q2sPsQsUsP!)
�
FwalkTestsi�zTests for os.fwalk().c+�\ �UOU1-U@FD
vq4qVV4U1w�	J	P!3hr!)r8)r.r�r�r�r�r�root_fds&&,    rr��FwalkTests.walk�s.���*.�*�*�S�*C�F�*C�&�D���u�%�%�+D�s�*,c�2�[OU-U@!r!)rr8�r.r�r�s&*,rr8�FwalkTests.fwalk�s���x�x��(��(�(rc��UO2oUO2o[OQ]Q5FD�vq4UOV4Q5UOV4Q5-o[O
Q-U@FDvqgo[
U2[
U21VV$J 	UOQ-U@FDCvqgq�UOVe2UOVV*[
U2[
U212JE	J�	P!)z
compare with walk() results.
��repeat)rr�)rr��TFr%)
r��	itertools�productrrr�r�r8rr=)
r.�walk_kwargs�fwalk_kwargsrr�rNr�r�r�rootfds
&&&       r�_compare_to_walk�FwalkTests._compare_to_walk�s���"�&�&�(��#�(�(�*��(1�(9�(9�-�PQ�(R�(R�$�G����w��L������Q��H�%'�W�W�%;�{�%;�!��E�"%�d�)�S��Z�!8���&<�.2�Z�Z�-G�,�-G�)��E��
�
�d�-�� � ���#�d�)�S��Z�1H�I�.H�)Src�N�Q[O-oUOV2P!)r�)rrrrJ)r.r�s& r�test_compare_to_walk�FwalkTests.test_compare_to_walk�s ����)�)�*�����f�-rc�$�[OQ[O2oQ[O-oUO2oVQ$UO
V#2[OU2P![OW2h9h)�.r�r)rrxr�rrrr�rJr{)r.r�rGrHs&   r�test_dir_fd�FwalkTests.test_dir_fd�sf��	�����b�k�k�*�B� �)�"2�"2�3�K�&�+�+�-�L�%'��"��!�!�+�<��H�H�R�L��B�H�H�R�L�s�AA7�7Bc��[OQ]Q5FD�vq[OUP1oUOUQU-FDzvqEqg[
OU2[
OU2UO[[
OU22[U2[U2*2J|	J�	P!)TrBr�rD)rErFrrrr8r�fstatr�r=r�r�)r.rr�r�r�r�rrIs&       r�test_yields_correct_dir_fd�%FwalkTests.test_yields_correct_dir_fds���(1�(9�(9�-�PQ�(R�(R�$�G��#�#�W�d�2�D�-1�Z�Z��-_��-_�)��E����� ������� � ��R�Z�Z��%7�!8�#�d�)�c�%�j�:P�Q�
.`�)Srz,dup return value is unpredictable on Androidc�b�[O]2o[OU2[Q2FD*oUO	[
O2FDoJ	J,	[O]2oUO[OU2UOVA2P!)rz�)	rr�r{rr8rrrr�r=)r.�minfdr rn�newfds&    r�test_fd_leak�FwalkTests.test_fd_leaksu�����q�	��
������s��A��Z�Z�	� 0� 0�1���2�����q�	��������%�(�����&rc�2�QoQFD�oU2oUO[OUQ5oUOU2U2[	U2UOU2U2UO
2UOU2U2J�	P!)c�`�[O]2o[OU2U!�rz)rr�r{)r�s r�getfd�.FwalkTests.test_fd_finalization.<locals>.getfd!s�������B��H�H�R�L��Irr�FT)r8rrrr=r�
assertGreaterr{)r.r`r�old_fdrs&    r�test_fd_finalization�FwalkTests.test_fd_finalizationsx��
	�%�G��W�F����I�,�,�g��>�B����U�W�f�-���H����u�w��/��H�H�J����U�W�f�-�%rr%)rhr[r\rir�rr�r8rJrMrQrUrrNr�
is_androidr[rer.rjrkrls@rr:r:�s�������H�&�)�J�$.��
R��_�_����J��'��'��_�_����J��
.��
.� !%�rr:c�,`�\sQsQsnQsQsQsUsP!)�BytesWalkTestsi2�Tests for os.walk() with bytes.c+� �QU7cUOQ2UQ$[O[OU21-U@FD�vq4o[OU2o[[
[OU22o[[
[OU22oVgU1w�	[[
[OU22UQ$[[
[OU22UQ$J�	P!3h)r�r�r�)rZrr��fsencoderVr��map)	r.r�r��broot�bdirs�bfilesr�r�rs	&&,      rr��BytesWalkTests.walk4s������&�$*�J�J�/@�$A�F�=�!�$&�G�G�B�K�K��,<�$G��$G� �E�&��;�;�u�%�D���B�K�K��/�0�D���R�[�[�&�1�2�E��u�%�%��C����T�2�3�E�!�H��S����e�4�5�F�1�I�
%H�s�D�C<Dr%)rhr[r\rir�r�rjrkrls@rriri2s����)�	6�	6rric�0`�\sQsQsnQsQQksQsUsP!)�BytesFwalkTestsi?rjc/�� �[O[OU2,UN3-U@FD�vqEqg[OU2o[	[[OU22o	[	[[OU22o
V�V�1w�	[	[[OU	22UQ$[	[[OU
22UQ$J�	P!3h)r�)rr8rlrVr�rm)r.r�r�r�rnrorp�topfdr�r�rs&&*,       rr8�BytesFwalkTests.fwalkBs����+-�8�8�B�K�K��4D�+V�t�+V�v�+V�'�E�&��;�;�u�%�D���B�K�K��/�0�D���R�[�[�&�1�2�E��u�,�,��C����T�2�3�E�!�H��S����e�4�5�F�1�I�
,W�s�C-C/r%)rP)rhr[r\rir�r8rjrkrls@rrsrs?s����)�6�6rrsc�(`�\sQsQsnQsQs\O\OQ2Q2s
\O\O9%f
\OQ2\O\OQ6HQ2Q	22s\O\O9%f
\OQ2\O\OQ6HQ2Q
22s\O\O9%f
\OQ2\O\OQ6HQ2Q22s\O\O9%f
\OQ2\O\OQ6HQ2Q22s\O\OQ2Q
2s\O\OQ2Q2sQs\O*\O.Q6HQ2Q2sQsQsUsP!)�MakedirTestsiLc�P�[O[O2P!r!�rrArrrrts&rru�MakedirTests.setUpMs��
����!�!�"rc
��[Oo[OO	UQQQ2o[O
U2[OO	UQQQQ2o[O
U2UO
[[O
[O2[OO	UQQQQQ[O2o[O
U2[OO	UQ[OQQQQQ2o[O
U2P!)rr�dir3�dir4�dir5�dir6)	rrrrr>r@r�r�rD�curdir)r.r+r>s&  r�test_makedir�MakedirTests.test_makedirPs��������w�w�|�|�D�&�&�&�9��
���D���w�w�|�|�D�&�&�&�&�A��
���D��	
���'�2�;�;��	�	�:��w�w�|�|�D�&�&�&�&�&�"�)�)�T��
���D���w�w�|�|�D�&�"�)�)�V�V�V�"�F�,��
���D�rzWASI's umask is a stub.c�
�[O]29^tt^2[Oo[OOUQ2o[OOUQ2o[OUQ2UO[OOU22UO[OOU22[OQ6wcoUO[OU2OQ*Q2UO[OU2OQ*Q2PPP2P!)%fhP!9h)r{rr�m�ntr��)r�
temp_umaskrrrr>r@r�r|r��isdirrr=r�r�)r.r+�parentr>s&   r�	test_mode�MakedirTests.test_mode_s����
!�
!�%�
(�
(��#�#�D��W�W�\�\�$��/�F��7�7�<�<���/�D��K�K��e�$��O�O�B�G�G�N�N�4�0�1��O�O�B�G�G�M�M�$�/�0��w�w�$��� � ������!6�!6��!>��F�� � ������!8�!8�5�!@�%�H�)�
(�
(�
(�s�CE1�9A.E1�1F	�:F	z,umask is not implemented on Emscripten/WASI.�androidz7Android filesystem may not honor requested permissions.c�
�[OO[OQ2o[OOUQ2o[O
]29^tt^2[OUQQQ5UO[OOU22UO[OOU22[OQ6wcoUO[OU2OQ*Q2UO[OU2OQ*Q2PPP2P!)%fhP!9h)rr�����parent_moder�r�)rr>r@rrrr�r�r|r�r�rr=r�r��r.r�r>s&  r�test_mode_with_parent_mode�'MakedirTests.test_mode_with_parent_modeqs��������i�.�.��7���w�w�|�|�F�F�+��
�
!�
!�%�
(�
(��K�K��e��7��O�O�B�G�G�N�N�4�0�1��O�O�B�G�G�M�M�$�/�0��w�w�$��� � ������!6�!6��!>��F�� � ������!8�!8�5�!@�%�H�)�
(�
(�
(�s�.B
E1�9A.E1�1F	�:F	c�|�[OO[OQQQ2o[O
]29^tt^2[OUQQQ5UO[OOU22[OQ6wc�[OO[OQ2o[OOUQ2oUO[OU2OQ*Q2UO[OU2OQ*Q2UO[OU2OQ*Q2PPP2P!)%fhP!9h)rrr}���r�r�r��
rr>r@rrrr�r�r|r�rr=r�r�)r.r+�level1�level2s&   r�test_parent_mode_deep_hierarchy�,MakedirTests.test_parent_mode_deep_hierarchy�s
���w�w�|�|�I�,�,�f�f�f�E��
�
!�
!�%�
(�
(��K�K��e��7��O�O�B�G�G�N�N�4�0�1��w�w�$�������i�&6�&6��?�������f�f�5��� � ������!8�!8�5�!@�%�H�� � ������!8�!8�5�!@�%�H�� � ������!6�!6��!>��F�)�
(�
(�
(�s�AF*�-C3F*�*F;	�3F;	c��[OO[OQ2o[OOUQ2o[O
]29^tt^2[OUQQQ5UO[OOU22[OQ6wcoUO[OU2OQ*Q2UO[OU2OQ*Q2PPP2P!)%fhP!9h)rr��r�r�r�r�r�s&  r�test_parent_mode_same_as_mode�*MakedirTests.test_parent_mode_same_as_mode�s��������i�.�.��7���w�w�|�|�F�F�+��
�
!�
!�%�
(�
(��K�K��e��7��O�O�B�G�G�N�N�4�0�1��w�w�$��� � ������!6�!6��!>��F�� � ������!8�!8�5�!@�%�H�
)�
(�
(�
(���.AE�A.E�E	�E	c��[OO[OQ2o[OOUQ2o[O
]29^tt^2[OUQQQ5UO[OOU22[OQ6wcoUO[OU2OQ*Q2UO[OU2OQ*Q2PPP2P!)%fhP!9h)rrr�r�r�r�)
rr>r@rrrr�r�r|r�rr=r�r�r�s&  r�$test_parent_mode_combined_with_umask�1MakedirTests.test_parent_mode_combined_with_umask�s��������i�.�.��7���w�w�|�|�F�F�+��
�
!�
!�%�
(�
(��K�K��e��7��O�O�B�G�G�M�M�$�/�0��w�w�$��� � ������!6�!6��!>��F�� � ������!8�!8�5�!@�%�H�)�
(�
(�
(�r�c�P�[OO[OQ2oQo[O
]2o[OV2UO[[OV2UO[[OVP
Q5[OUQP	Q5[OVP	Q5[O
U2[O[OOQ2P	Q5P!)rr���exist_ok�)rr��/)
rr>r@rrr�umaskr�r�rDr�)r.r>r�old_masks&   r� test_exist_ok_existing_directory�-MakedirTests.test_exist_ok_existing_directory�s���
�w�w�|�|�I�,�,�f�5�����8�8�E�?��
���D�����'�2�;�;��;����'�2�;�;��U��K�
���D�%�$�/�
���D�d�3�
�����	���B�G�G�O�O�C�(�4�8rc�(�[OO[OQ2o[
OoQo[O]2o[
O[O[O2O2o[O[OVR*2[O[O2OU*U6wc[OQ2g[OVU*2[OVP	Q5[OU[
O[OU2O2U&*2[OVU*P	Q5[OU2P![c[OQ2gh9h[OS2h9h)rr�zCannot set S_ISGID for dir.z No support for S_ISGID dir mode.r�)rr>r@rrrr��S_ISGIDr��S_IMODE�lstatr�r�r�r�SkipTestr�)r.r>r�rr��existing_testfn_modes&     r�test_exist_ok_s_isgid_directory�,MakedirTests.test_exist_ok_s_isgid_directory�sY��
�w�w�|�|�I�,�,�f�5���,�,�����8�8�E�?��	�#'�<�<��H�H�Y�-�-�.�6�6�$8� �
G�����)�)�+?�+I�J�����)�)�*�2�2�W�<��G��'�'�(J�K�K�
�K�K��W�n�-�
�K�K��T�2��H�H�T�4�<�<������(>�(>�?�7�(�J�K��K�K��W�n�t�<��H�H�X���#�
G��'�'�(E�F�F�
G��
�H�H�X��s2�AG9�+G�9G9�B;G9�	G6�G6�6G9�9Hc��[Oo[OO	[OQ2o[UQQQ59^tt^2oUO
Q2PPP2UO[[OU2UO[[OUP
Q5UO[[OUP	Q5[OU2P!)%fhK�9h)rr�r�r�r9r�)rrrrr>r@rxr�r�rDr�r�)r.r+r>r�s&   r�#test_exist_ok_existing_regular_file�0MakedirTests.test_exist_ok_existing_regular_file�s��������w�w�|�|�I�,�,�f�5��
�$��g�
.�
.�!�
�G�G�E�N�/����'�2�;�;��5����'�2�;�;��u��E����'�2�;�;��t��D�
�	�	�$��/�
.�s�C;�;D	�D	r�zrequires Windowsc���[Oo[OO	[OO[OQ22o[OUQQ5[OQUQ,QQ5o[OU2UO2OQ]2]*oUOUQ2P!)	r�r�)rz	cacls.exez/s�oemr�� z5"D:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;OW)")
rrrrr>r�r@rAr��check_outputr;r�rsplitr=)r.r+r>�outs&   r�test_win32_mkdir_700�!MakedirTests.test_win32_mkdir_700	s��������w�w���r�w�w�|�|�I�,<�,<�e�D�E��
����E�"��%�%�{�D�$�&?�%�P��
������i�i�k� � ��a�(��+������C�	
rc�P�[O[O2P!r!�rrQrrrts&rrM�MakedirTests.tearDown	s��	����)�)�*rr%)rhr[r\rirur�rrNrrOr�rQr7r8r�r�r�r�r�r�r�rrrr�rMrjrkrls@rrxrxLs#����#�
��_�_����!��I�	�I��_�_����0�0����6���_�_����	�!�A��
I�	�	�
I��_�_����0�0����6���_�_����	�!�A��
G�	�	�
G��_�_����0�0����6���_�_����	�!�A��
I�	�	�
I��_�_����0�0����6���_�_����	�!�A��I�	�	�I��_�_����!��9�	�9��_�_����!���	��6�������D��*<�=�

�>�

�+�+rrx�chownzrequires os.chown()c�$`�\sQsQsn\Q2sQs\O\	\
Q2Q2Q2s\\O\
\2]6�Q2Q22s\\O\
\2]6�Q	2Q
22s\Q2sQsUsP!)
�ChownFileTestsi	c�P�[O[O2P!r!rz��clss&r�
setUpClass�ChownFileTests.setUpClass	���
����!�!�"rc	��[O[O2oUOoUO
oQQ[OP2[OQ]21FDkoUO[[O[OVC2UO[[O[OV$2Jm	UO[OV#22UO[OPP22P!)r�g�y�����)rr�rrr�st_uid�st_gidrwrxr}r~r�r�r�r�)r.r��uid�gidr!s&    r�*test_chown_uid_gid_arguments_must_be_index�9ChownFileTests.test_chown_uid_gid_arguments_must_be_index	s����w�w�y�'�'�(���k�k���k�k���C�����!4�i�6H�6H��Q�6O�P�E����i����9�3C�3C�U�P����i����9�3C�3C�S�P�Q�	
���"�(�(�9�#3�#3�S�>�?����"�(�(�9�#3�#3�R��<�=r�	getgroupszneed os.getgroupsc�v�[O2o[U2]6cUOQ2UQ*vq#[O[
O2Oo[O[
OVB2[O[
O2OoUOVR2[O[
OVC2[O[
O2OoUOVS2P!)r{ztest needs at least 2 groups�Nr{N)rr�r9r�r�rrrr�r�r�r=)r.�groups�gid_1�gid_2r�r�s&     r�test_chown_gid�ChownFileTests.test_chown_gid(	s���������v�;��?��M�M�8�9��b�z����g�g�i�&�&�'�.�.��
����!�!�3�.��g�g�i�&�&�'�.�.������$�
����!�!�3�.��g�g�i�&�&�'�.�.������$rztest needs more than one userc��[Q*vq[O[O2O
o[O[OV2[O[O2OoUOVA2[O[OV#2[O[O2OoUOVB2P!�r�)	�	all_usersrr�rrrr�r�r�r=)r.�uid_1�uid_2r�r�s&    r�test_chown_with_root�#ChownFileTests.test_chown_with_root9	s���!��}����g�g�i�&�&�'�.�.��
����!�!�5�.��g�g�i�&�&�'�.�.������$�
����!�!�5�.��g�g�i�&�&�'�.�.������$rz!test needs and more than one userc��[Q*vq[O[O2O
oUO
[29^tt^2[O[OV2[O[OV#2PPP2P!)%fhP!9hr�)	r�rr�rrrr�r�r�r�)r.r�r�r�s&   r�test_chown_without_permission�,ChownFileTests.test_chown_without_permissionE	sq��!��}����g�g�i�&�&�'�.�.��
�
�
��
/�
/��H�H�Y�%�%�u�2��H�H�Y�%�%�u�2�0�
/�
/�
/�s�AB1�1C	�:C	c�P�[O[O2P!r!)rr;rrrr�s&r�
tearDownClass�ChownFileTests.tearDownClassN	r�rr%)rhr[r\ri�classmethodr�r�rrrrr�rr9r�r�rr�r�rjrkrls@rr�r�	s������#��#�>������[�1�3F�G�%�H�%� �
����Y��!�+�-L�M�%�N��%��
����Y��!�+�-P�Q�3�R��3��#��#rr�c�@`�\sQsQsnQsQsQsQsQsQs	Us
P!)�RemoveDirsTestsiS	c�P�[O[O2P!r!)rr�rrrrts&rru�RemoveDirsTests.setUpT	s��
���I�$�$�%rc�P�[O[O2P!r!r�rts&rrM�RemoveDirsTests.tearDownW	s������)�)�*rc�X�[OO[OQ2o[O
U2[OOUQ2o[O
U2[OU2UO[OOU22UO[OOU22UO[OO[O22P!)�dira�dirb)	rr>r@rrrrA�
removedirs�assertFalser��r.r�r�s&  r�test_remove_all�RemoveDirsTests.test_remove_allZ	s����w�w�|�|�I�,�,�f�5��
������w�w�|�|�D�&�)��
�����
�
�
�d�����������-�.����������-�.���������	�(8�(8�9�:rc��[OO[OQ2o[O
U2[OOUQ2o[O
U2[
[OOUQ22[OU2UO[OOU22UO[OOU22UO[OO[O22P!�r�r��file.txt)rr>r@rrrrAr
r�r�r�r|r�s&  r�test_remove_partial�#RemoveDirsTests.test_remove_partiald	s����w�w�|�|�I�,�,�f�5��
������w�w�|�|�D�&�)��
������B�G�G�L�L��z�2�3�
�
�
�d�����������-�.���������t�,�-���������y�'7�'7�8�9rc��[OO[OQ2o[O
U2[OOUQ2o[O
U2[
[OOUQ22UO[29^tt^2[OU2PPP2UO[OOU22UO[OOU22UO[OO[O22P!)%fhK�9hr�)rr>r@rrrrAr
r�rDr�r|r�r�s&  r�test_remove_nothing�#RemoveDirsTests.test_remove_nothingo	s����w�w�|�|�I�,�,�f�5��
������w�w�|�|�D�&�)��
������B�G�G�L�L��z�2�3�
�
�
�w�
'�
'��M�M�$��(���������t�,�-���������t�,�-���������y�'7�'7�8�9�	(�
'�s�E;�;F	�F	r%)rhr[r\rirurMr�r�rrjrkrls@rr�r�S	s#����&�+�;�	:�
:�
:rr�zWASI has no /dev/nullc�(`�\sQsQsnQsQsUsP!)�DevNullTestsi|	c��[[OQ]29^tt^2oUOQ2UO	2PPP2[[OQ29^tt^2oUOUO
2Q2PPP2P!)%fhK]9h)%fhP!9h)r��hellor�r)rxr�devnullr�r{r=r�rs& r�test_devnull�DevNullTests.test_devnull~	sy��
�"�*�*�d�A�
&�
&�!�
�G�G�H��
�G�G�I�'��"�*�*�d�
#�
#�q����Q�V�V�X�s�+�$�
#�'�
&��$�
#�
#�s#�"B�1!B/�B,	�%B,	�/C	�8C	r%)rhr[r\rirrjrkrls@rrr|	s����,�,rrc�:`�\sQsQsnQsQsQsQsQsUs	P!)�URandomTestsi�	c���UO[[O]22]2UO[[O]22]2UO[[O]
22]
2UO[[O]d22]d2UO[[OQ22Q2P!)rr4)r=r9r�urandomrts&r�test_urandom_length� URandomTests.test_urandom_length�	s�������R�Z�Z��]�+�Q�/�����R�Z�Z��]�+�Q�/�����R�Z�Z��^�,�b�1�����R�Z�Z��_�-�s�3�����R�Z�Z��-�.��5rc��[O]2oUOU[2[O]2oUO	V2P!��)rrr+rUrC�r.�data1�data2s&  r�test_urandom_value�URandomTests.test_urandom_value�	s:���
�
�2������e�U�+��
�
�2������E�)rc��QOQQU*QQ12o[QU2oU]*oUO[U2U2U!)�
zimport os, syszdata = os.urandom(%s)zsys.stdout.buffer.write(data)zsys.stdout.buffer.flush()r�)r@rr=r9)r.�countr�r�rWs&&   r�get_urandom_subprocess�#URandomTests.get_urandom_subprocess�	sV���y�y��#�e�+�+�'�	)�*��
�t�T�*���Q�������V��e�,��
rc�n�UO]2oUO]2oUOV2P!r)rrCrs&  r�test_urandom_subprocess�$URandomTests.test_urandom_subprocess�	s0���+�+�B�/���+�+�B�/�����E�)rr%)
rhr[r\rir
rrrrjrkrls@rr
r
�	s����6�*�	�*�*rr
�	getrandomzneed os.getrandom()c�P`�\sQsQsn\Q2sQsQsQsQs	Qs
QsUsP!)	�GetRandomTestsi�	c���[O]2P![c<oSO[O6Xc[
OQ2ggPo=hh9h)rzz%getrandom() syscall fails with ENOSYS)rrrDrErrr�)r�rPs& rr��GetRandomTests.setUpClass�	sI��	��L�L��O���	��y�y�E�L�L�(��'�'�(O�P�P���
	�s��	A!�A!�A�A�A!c��[O]2oUOU[2UO	[U2]2P!r)rrr+rUr=r9)r.r�s& r�test_getrandom_type�"GetRandomTests.test_getrandom_type�	s4���|�|�B������d�E�*�����T��B�'rc�X�[O]2oUOUQ2P!)rr)rrr=)r.�emptys& r�test_getrandom0�GetRandomTests.test_getrandom0�	s�����Q��������$rc�4�UO[Q2P!)�GRND_RANDOM)r6rrts&r�test_getrandom_random�$GetRandomTests.test_getrandom_random�	s�����2�}�-rc�x�[O][O2P![cP!h9hr_)rr�
GRND_NONBLOCKr�rts&r�test_getrandom_nonblock�&GetRandomTests.test_getrandom_nonblock�	s-��	��L�L��B�,�,�-���	��	�s�%*�	9�9�9c��[O]2o[O]2oUOV2P!r)rrrCrs&  r�test_getrandom_value�#GetRandomTests.test_getrandom_value�	s,�����R� �����R� �����E�)rr%)
rhr[r\rir�r�r%r)r-r1r4rjrkrls@rr!r!�	s5�����	��	�(�
%�.��*�*rr!�HAVE_GETENTROPY�HAVE_GETRANDOM�HAVE_GETRANDOM_SYSCALLz*os.random() does not use a file descriptorr3z$VxWorks can't set RLIMIT_NOFILE to 1c�``�\sQsQsn\O
\Q2Q2sQsQs	Qs
UsP!)�URandomFDTestsi�	z!test requires the resource modulec�$�Qo[QU2P!)a�if 1:
            import errno
            import os
            import resource

            soft_limit, hard_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
            resource.setrlimit(resource.RLIMIT_NOFILE, (1, hard_limit))
            try:
                os.urandom(16)
            except OSError as e:
                assert e.errno == errno.EMFILE, e.errno
            else:
                raise AssertionError("OSError not raised")
            r�r
r�s& r�test_urandom_failure�#URandomFDTests.test_urandom_failure�	s��
��	��t�$rc�*�Qo[QU2vq#oP!)aif 1:
            import os
            import sys
            import test.support
            os.urandom(4)
            with test.support.SuppressCrashReport():
                os.closerange(3, 256)
            sys.stdout.buffer.write(os.urandom(4))
            �-Scr
)r.r��rcr��errs&    r�test_urandom_fd_closed�%URandomFDTests.test_urandom_fd_closed�	s����(��t�4���rc���UO[O[O2[	[OQ2QO[OQ5o[
QU2vq#oUO[U2]2UOUQ*UQ*2[
QU2vq%oUO[U2]2UOVS2P!)�xa�if 1:
            import os
            import sys
            import test.support
            os.urandom(4)
            with test.support.SuppressCrashReport():
                for fd in range(3, 256):
                    try:
                        os.close(fd)
                    except OSError:
                        pass
                    else:
                        # Found the urandom fd (XXX hopefully)
                        break
                os.closerange(3, 256)
            with open({TESTFN!r}, 'rb') as f:
                new_fd = f.fileno()
                # Issue #26935: posix allows new_fd and fd to be equal but
                # some libc implementations have dup2 return an error in this
                # case.
                if new_fd != fd:
                    os.dup2(new_fd, fd)
                sys.stdout.buffer.write(os.urandom(4))
                sys.stdout.buffer.write(os.urandom(4))
            )rrr?:rr�N:r�rNsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
r�rrsrrr
�formatrr=r9rC)r.r�r@r�rA�out2�err2s&      r�test_urandom_fd_reopened�'URandomFDTests.test_urandom_fd_reopened
s���	
���	�(�(�)�*:�*:�;��I�$�$�j�1��0��i�.�.��/�1	
�2(��t�4��������S��1�%����C��H�c�#�h�/�)�%��6���$�����T��A�&����D�&rr%)rhr[r\rirr�resourcer<rBrIrjrkrls@rr:r:�	s7����
����#F�G�%�H�%�,5�$'�$'rr:c#�r` �,nU1QkoU1Qko[Oo[Oo[OoU[mU[mUdU[mRw�U[mU[mU[mP!W[mW[mW[mh9h3h)z�
Stubs out execv and execve functions when used as context manager.
Records exec calls. The mock execv and execve functions always raise an
exception as they would normally never return.
c�B:�ROQV12[Q2g)�execvzexecv called)r��RuntimeError�rr��callss&*�r�
mock_execv�#_execvpe_mockup.<locals>.mock_execv3
s���
���g�t�*�+��>�*�*rc�`:�ROQV12[[OQ2g)�execvez
execve called)r�rDrE�ENOTDIRrPs&*�r�mock_execve�$_execvpe_mockup.<locals>.mock_execve7
s%���
���h��+�,��e�m�m�_�5�5r)rrNrUr<)r<rRrW�
orig_execv�orig_execve�orig_defpathrQs&     @r�_execvpe_mockupr\(
s�����
�E�+�6�"��X�X�
��i�i���z�z�������	��� �B�J��������	�!��
�������	�!��
�s#�B7�A	B�B�.#B7�#B4�4B7rNzneed os.execv()c�`�\sQsQsn\O
\Q2Q2sQsQs	\O\\Q2Q2Q2s
Q	sQ
s\O
\O Q6HQ2\O\9%c\O$O'\2Q
2Q22s\O\O,Q6HQ2Q2sQsUsP!)�	ExecTestsiI
z4avoid triggering a linuxthreads bug: see issue #4970c�X�UO[[OQQ,P2P!)zno such app-)r�rDr�execvperts&r�test_execvpe_with_bad_program�'ExecTests.test_execvpe_with_bad_programL
s$��	
���'�2�:�:�~�)�*�D�	2rc�:�UO[[OQQ2UO[[OQ,2UO[[OQQ2UO[[OQP,2P!)�notepadr%r;)r�rrrNrts&r�test_execv_with_bad_arglist�%ExecTests.test_execv_with_bad_arglistR
sd�����*�b�h�h�	�2�>����*�b�h�h�	�2�>����*�b�h�h�	�5�A����*�b�h�h�	�B�4�@rc���UO[[OQ,P2UO[[OQ,-2UO[[OQP,-2P!)rd)r�rrr`rts&r�test_execvpe_with_bad_arglist�'ExecTests.test_execvpe_with_bad_arglistX
sR�����*�b�j�j�)�R��F����*�b�j�j�)�R��D����*�b�j�j�)�b�T�2�Fr�_execvpez)No internal os._execvpe function to test.c
��[OQ*oU[Ic>Qo[OO	[O
U2U2oSo,QNoLSQo,Q
No[OO	V#2o[OQ6wc[O
U2oLSoQQ-o[29^tt^2oUO[[OVF2UO[U2]2UOU]*QVF112PPP2[UQ59^tt^2oUO[[OV6UQ5UO[U2]2UOU]*Q	VVU112PPP2[29^tt^2oUO2o	U[IcV)Q
$LV)Q$UO[[OV6U	Q5UO[U2]2UOU]*Q	VVU	112PPP2P!)%fhCK,9h)%fhK�9h)%fhP!9h)�absolutepaths
executabler�r��spamr�rN)r<r5rUr7r4)sprogname�arg1�arg2)�prognamernro)rr?rUr>r@rlrr\r�rOrjr=r9rDr>r�)
r.�	test_type�program_path�program�fullpath�native_fullpath�	argumentsr.rQ�env_paths
&&        r�_test_internal_execvpe� ExecTests._test_internal_execvpe]
s����v�v��.�����#�G��w�w�|�|�B�K�K��$=�w�G�H�&�O�5�I�"�G�4�I��w�w�|�|�L�:�H��w�w�$��"$�+�+�h�"7��"*���w����
�
�%����l����X�
2����S��Z��+����U�1�X���<�'H�I�	��\�
2�
2�e����g����W�S�
�
:����S��Z��+��$�$�U�1�X��?��,<�=�
?�	3��
�
�%��x�x�z�H��E�!�$0��!�#/�� ����g����W�X�
�
?����S��Z��+��$�$�U�1�X��?��,A�B�
D��
�#�
�
��3�
2���
�
�s?�	AI	�A I�<I0�A(I0�	I	�I	�I-	�&I-	�0J	�9J	c��UO[2[OQ6wcUO[2P!P!)r�)rxr,rrrUrts&r�test_internal_execvpe_str�#ExecTests.test_internal_execvpe_str�
s.���#�#�C�(�
�7�7�d�?��'�'��.�rc��[OQQ,o[OO	2oQUQ$UO[29^tt^2[OU]*V2PPP2[OO	2oQUQ$UO[29^tt^2[OU]*V2PPP2[OO	2oQUQ$UO[29^tt^2[OU]*V2PPP2P!)%fhK�9h)%fhK�9h)%fhP!9h)r��pass�cabbage�FRUITVEGETABLE�orangeVEGETABLE=cabbage�FRUIT�lemon�FRUIT=ORANGE)r7r�rrAr�r�rrU)r.r��newenvs&  r�test_execve_invalid_env�!ExecTests.test_execve_invalid_env�
s�������f�-�������"��%.��!�"�
�
�
�z�
*�
*��I�I�d�1�g�t�,�+������"��5��w��
�
�
�z�
*�
*��I�I�d�1�g�t�,�+������"��!(��~��
�
�
�z�
*�
*��I�I�d�1�g�t�,�+�
*�+�
*��+�
*��+�
*�
*�s6�E�<E�#E2�E	�E	�E/	�(E/	�2F	�;F	r�zPOSIX-specific testrc���QoQO[UQ5o[OO	2TTt-tFD vq4UOQ2%fJV4aJ"	ooo[O29^tt^2oUO2UOU2[QU1-U@vqxoPPP2UO[UQ2W2P!ttooh)%fhK49h)zhello from execvea

        import os, sys

        class MyPath:
            def __fspath__(self):
                mutated.clear()
                return b"pwn"

        mutated = KEYS = VALUES = [MyPath()]

        class MyEnv:
            def __getitem__(self): raise RuntimeError("must not be called")
            def __len__(self): return 1
            def keys(self): return KEYS
            def values(self): return VALUES

        args = [{unix_shell!r}, '-c', 'echo "{message!s}"']
        os.execve(args[0], args, MyEnv())
        )r�message�LD_r��ascii)
rFrrrArr�rrYrrrrrU)	r.r�r��k�v�minimalr.rr�s	&        r�5test_execve_env_concurrent_mutation_with_fspath_posix�?ExecTests.test_execve_env_concurrent_mutation_with_fspath_posix�
s���&���$
�F�j�'�F�:�%	
�,%'�J�J�$4�$4�$6�N�$6�D�A�!�,�,�u�:M�4�1�4�$6��N�
�
*�
*�
,�
,���I�I�K��J�J�w��(��t�;�s�;�I�A�A�-�	
�
�
�e�G�W�-�s�3��O�
,�
,�s�C�C�3C"�"C2	�+C2	r�zWin32-specific testc��[OPQ,-2UOQ2P![c@oSO	SO
PI9%fSO
]6g2Po=P!Po=hh9h)r:�argzNo OSError raised)rrUr�rDr|�winerrorr*s& r�test_execve_with_empty_path�%ExecTests.test_execve_with_empty_path�
sd��	+��I�I�b�5�'�2�&�
�I�I�)�*���	C��O�O�A�J�J�$�.�A�A�!�*�*��/�B�B��	C�s�/�	A9�A9�A4�A4�4A9r%)rhr[r\rirrN�USING_LINUXTHREADSrarerhrrrrxr{r�rrr>r�r�r7r8r�rjrkrls@rr^r^I
s������_�_�'�K�M�2�M�2�A�G�
�����Z�0�D�F�-D�F�-D�^/�
-�.�_�_�R�W�W��_�&;�<�
����B�B������z�(B�*�,� 4�,�=� 4�D�������0�2G�H�+�I�+rr^z!Cannot create invalid FD on WASI.c�\`�\sQsQsn,QBNsQ.s\O2%f\QQ,*
s\QQ.*sQs\FDs	\\	2\
2Q\	*$J	QsQsQ	s
\O\\Q
2Q2Q2s\O\\Q
2Q2Q2s\O\\Q2Q2Q2s\O\\Q2Q2Q2s\O\\Q2Q2Q2s\O\\Q2Q2Q2s\O\\Q2Q2Q2s\O\\Q2Q2\O2\O42Q2Q22s\O\\Q2Q 2\O2\O42Q!2Q"22s\O:Q#PQC,2Q$2s\O\\Q%2Q&2Q'2s\O\\Q(2Q)2Q*2s \O\\Q+2Q,2Q-2s!\O\\Q.2Q/2Q02s"\O\\Q12Q22Q32s#\O\\Q42Q52Q62s$\O\\Q72Q82Q92s%\O\\Q:2Q;2Q<2s&\ON2Q=2s(\O\\Q>2Q?2Q@2s)QAs*Us+P!)D�
TestInvalidFDi�
�fchdir�	fdatasync�fsyncc�`�U1QkoU!)c��:�[[R2%cTUO[[R22RUO7c"UO[[R22P!P!P!r!)rrrVr`�singles_fildes�
check_boolrs&�r�helper�(TestInvalidFD.get_single.<locals>.helper�
sJ�����A����
�
�7�2�q�>�*���+�+�+��O�O�G�B��N�3�,�rr%)r�r�sf r�
get_single�TestInvalidFD.get_single�
s���	4�
�
r�test_c��U[O2,UN3-U@UOQU*2P![c6oSO	SO
[
O2Po=P!Po=hh9h)z5%r didn't raise an OSError with a bad file descriptor)r�make_bad_fdr�rDr=rEr/)r.r�r�r�r!s&&*, rrV�TestInvalidFD.check�
sh��	�
�i�#�#�%�7��7��7�
�I�I�M���
���	3����Q�W�W�e�k�k�2�2��	3�s� =�	A=�A=�*A8�8A=c�T�[O29^tt^2[OQ[2QFD6oUO	[29^tt^2UU,UN3-U@PPP2J8	PPP2P!)%fhJU9h)%fhP!9h)�errorrb)r@rA�simplefilter�RuntimeWarningr�)r.r�r�r�r�s&&*, rr��TestInvalidFD.check_bool�
sv��
�
$�
$�
&�
&��!�!�'�>�:�!���&�&�~�6�6��b�*�4�*�6�*�7�6�"�'�
&�7�6�6��'�
&�
&�s/�?B�B
�,B�B�B�
	B�B'	�B'	c��UO[OQQ5UO[OQQ5P!)r�r�)rVrr�r�rts&rr��TestInvalidFD.test_fdopen�
s*���
�
�2�9�9�w�
�/�����	�	�G��4r�isattyztest needs os.isatty()c�z�UO[O[O22P
2P!�F)r=rr�rr�rts&r�test_isatty�TestInvalidFD.test_isattys$��������9�#8�#8�#:�;�U�Crr�ztest needs os.closerange()c�X�[O2o[]
2FD o[OV*2L	W]6c[OQ2gUO[OVU*]*
2P2P![
cJ�h9h)rxz5Unable to acquire a range of invalid file descriptors)
rr�rrrTrDrr�r=r�)r.r�r s&  rr��TestInvalidFD.test_closeranges���
�
"�
"�
$���r��A����"�$����
�q�5��#�#�G�I�
I�������r��6�!�8�4�d�;���
��
�s�B�	B)�$B)�(B)�dup2ztest needs os.dup2()c�H�UO[O]2P!)�)rVrr�rts&r�	test_dup2�TestInvalidFD.test_dup2s���
�
�2�7�7�B�rc�l�[O[[O2oUO	[O
U2UPQ,o[OU]Q5FD�vq4V46wfJ
UOV4Q59^tt^2UO[29^tt^2o[OV42PPP2UOWOO[O2PPP2J�	P!)%fhKR9h)%fhJ�9h)rzrB)r��fd2i�)rrxrr�r�r{rErFr�r�rDr�r=r.rEr/)r.�valid_fd�fdsr�r�r0s&     r�test_dup2_negative_fd�#TestInvalidFD.test_dup2_negative_fds����7�7�8�R�[�[�1��������(�+����
��
!�(�(��Q�7�7�G�B��y��\�\�R�\�1�1��*�*�7�3�3�s�����(�4��$�$�S�]�]�%8�%8�%�+�+�F�2�1�8�4�3��2�1�1�s0�D"	�.D
�<D"	�D�D�D"	�"D3
�+D3
�fchmodztest needs os.fchmod()c�H�UO[O]2P!r�)rVrr�rts&r�test_fchmod�TestInvalidFD.test_fchmod+s���
�
�2�9�9�a� r�fchownztest needs os.fchown()c�J�UO[OPP2P!r_)rVrr�rts&r�test_fchown�TestInvalidFD.test_fchown/s���
�
�2�9�9�b�"�%r�	fpathconfztest needs os.fpathconf()c���UOQ[O2UO[OQ2UO[O
Q2P!��PC_NAME_MAX)rr�pathconf_namesr��pathconfr�rts&r�test_fpathconf�TestInvalidFD.test_fpathconf3s:���
�
�m�R�%6�%6�7�������]�3�������m�4rz@musl pathconf ignores the file descriptor and returns a constantc��UO[OQ2UO[OQ2P!r�)rVrr�r�rts&r�test_fpathconf_bad_fd�#TestInvalidFD.test_fpathconf_bad_fd9s(��	
�
�
�2�;�;�
�.��
�
�2�<�<��/rr�ztest needs os.pathconf()zAmusl fpathconf ignores the file descriptor and returns a constantc�x�[O[O7cUOQ2UO	[
29^tt^2o[OP]2PPP2UO
WOO[O2P!)%fhKF9h)zneeds fpathconf())
rr�r�r�r�rDr=r.rEr/)r.r0s& r�+test_pathconf_negative_fd_uses_fd_semantics�9TestInvalidFD.test_pathconf_negative_fd_uses_fd_semanticsBsn���;�;�b�n�n�,��M�M�-�.�
�
�
�w�
'�
'�3��K�K��A��(�������,�,�e�k�k�:�(�
'�s�B)�)B9	�2B9	r�c���[OU1,o[[Q2%c#UO[OU]12[O
[O7c"UO[O
U12[O[O7c#UO[OUQ12[[Q2%cG[O[O7c$UO[OU]]12[O[O7c"UO[OU12[O[O7c#UO[OUQ12[[Q2%cF[O[O7c#UO[OU]12[[Q2%cE[O[O7c"UO[OU12[[Q2%c�UO[OUQ12UO[OUQQ12UO[OUQ12UO[O U12[O"[O7c"UO[O"U12SFD�uq4UO%V4Q59^tt^2UO'[(29^tt^2oUUPPP2UO+WO,O.[.O02PPP2J�	[[Q	2%c�[O2[O7c�[4O6%c�UO'[(29^tt^2o[O2U[8O:Q
Q,[O<2PPP2UO?WO,O.[.O0[.O@12[4OB%c�]PH�oUOGUOIU22UOGUOKU22UOGUOMU22UOGUOOU22UOGUOQU22UOGUOSU22P!P!)%fhCK9h)%fhCJ�9h)%fhCK\9h)
r�r�r��truncater�setxattr�	user.testr�)�funcr�rUr�r~)rr)*rr�rr�r�rBr�r�r�r�rXr�r�getxattrr��removexattr�	listxattr�scandirr�r�rDr=r.rEr/rUrr�r7r�rAr�EINVAL�
MS_WINDOWSr�r��_path_exists�
_path_lexists�_path_isdir�_path_isfile�_path_islink�_path_isjunction)r.r��testsr�r�r0r�s&&     r�test_negative_fd_ebadf�$TestInvalidFD.test_negative_fd_ebadfOs����'�'�2�����2�w����L�L�"�(�(�B��*�+�
�8�8�r�~�~�%��L�L�"�(�(�B��(�
�8�8�r�~�~�%��L�L�"�(�(�B��.�/��2�w���B�H�H����$>��L�L�"�(�(�B��1�-�.�
�:�:����'��L�L�"�*�*�b�)�*�
�8�8�r�~�~�%��L�L�"�(�(�B��/�0��2�z�"�"�r�{�{�b�n�n�'D��L�L�"�+�+�r�1�-�.��2�y�!�!�b�j�j�B�N�N�&B��L�L�"�*�*�b�)�*��2�z�"�"��L�L�"�+�+�r�<�8�9��L�L�"�+�+�r�<��>�?��L�L�"�.�.�"�l�;�<��L�L�"�,�,��+�,�
�:�:����'��L�L�"�*�*�b�)�*� �K�D����4��3�3��&�&�w�/�/�3��$�K�0�� � ����!4�!4�e�k�k�B�4�3�!�
�B��!�!�b�i�i�2�>�>�&A��.�.�.��"�"�7�+�+�s��	�	�"�s�~�~�t�V�<�b�j�j�I�,��M�M�#�-�-�-�-����U�\�\�/J�K���������R�_�_�R�0�1����R�-�-�b�1�2����R�^�^�B�/�0����R�_�_�R�0�1����R�_�_�R�0�1����R�0�0��4�5��0�/�/��4�3�3��,�+�+�sB�3W	�V/
�<W	�
8W�/W�8W�:	W	�W
�W
�W)	�!W)	�	ftruncateztest needs os.ftruncate()c���UO[O]2UO[O]2UO	[O]2P!r�)rVrr�r�r�rts&r�test_ftruncate�TestInvalidFD.test_ftruncate�s8���
�
�2�;�;��"��
�
�2�<�<��#�������Q�'rr�ztest needs os.lseek()c�J�UO[O]]2P!r�)rVrr�rts&r�
test_lseek�TestInvalidFD.test_lseek�s���
�
�2�8�8�Q��"rr�ztest needs os.read()c�H�UO[O]2P!r_)rVrr�rts&rr��TestInvalidFD.test_read�s���
�
�2�7�7�A�rr�ztest needs os.readinto()c�Z�UO[O[]22P!r�)rVrr�r�rts&rr��TestInvalidFD.test_readinto�s���
�
�2�;�;�	�!��-r�readvztest needs os.readv()c�`�[]
2oUO[OU,2P!rw)r�rVrr�)r.r�s& r�
test_readv�TestInvalidFD.test_readv�s����m���
�
�2�8�8�c�U�#r�	tcsetpgrpztest needs os.tcsetpgrp()c�H�UO[O]2P!r�)rVrr�rts&r�test_tcsetpgrpt�TestInvalidFD.test_tcsetpgrpt�s���
�
�2�<�<��#rr�ztest needs os.write()c�H�UO[OQ2P!)� )rVrr�rts&rr��TestInvalidFD.test_write�s���
�
�2�8�8�T�"r�writevztest needs os.writev()c�J�UO[OQ,2P!)r8)rVrrrts&r�test_writev�TestInvalidFD.test_writev�s���
�
�2�9�9�v�h�'rc��UO[O2UO[OP	2P!�T)rVr�get_inheritable�set_inheritablerts&r�test_inheritable�TestInvalidFD.test_inheritable�s(���
�
�2�%�%�&��
�
�2�%�%�t�,rr�r�c��UO[O2UO[OP	2P!r)rVrr�r�rts&r�
test_blocking�TestInvalidFD.test_blocking�s&��	
�
�
�2�?�?�#��
�
�2�?�?�D�)rr%)r�r�rT�fstatvfs�	tcgetpgrp�ttyname���),rhr[r\ri�singlesr�r�!in_systemd_nspawn_sync_suppressedr�r��localsrVr�r�rrrrr�r�r�r�r�r�r�rN�linked_to_muslr�r��subTestsr�r�r�r�r�r�r�r�rr�r	rrjrkrls@rr�r��
s�����L�G��Z�N��4�4�6�6��K��)�)���;��0�0�����(��m���������+�5������X�.�0H�I�D�J�D������\�2�4P�Q�
<�R�
<������V�,�.D�E� �F� ������V�,�.D�E�
G�F�
G������X�.�0H�I�!�J�!������X�.�0H�I�&�J�&������[�1�3N�O�5�P�5�
�����[�1�3N�O�
�_�_���� �J�
�0�	
�P�
0������Z�0�2L�M�
�_�_���� �K�
�;�	
�N�
;�
���d�R��H�%�.6�&�.6�`�����[�1�3N�O�(�P�(�
�����W�-�/F�G�#�H�#������V�,�.D�E��F�������Z�0�2L�M�.�N�.������W�-�/F�G�$�H�$������[�1�3N�O�$�P�$������W�-�/F�G�#�H�#������X�.�0H�I�(�J�(�
� � �"�-�#�-������^�4�H�J�*�J�*rr�r�zrequires os.linkc�F`�\sQsQsnQsQsQsQsQsQs	Qs
UsP!)	�	LinkTestsi�c��[OUm[OO[OQ*2UmP!)r�)rrr�file1rr>r@�file2rts&rru�LinkTests.setUp�s.���%�%��
��W�W�\�\�)�"2�"2�S�"8�9��
rc���UOUO1FD@o[OO	U2%fJ*[O
U2JB	P!r!)rrrr>r�rs)r.�files& rrM�LinkTests.tearDown�s7���Z�Z����,�D��w�w�~�~�d�#�#��	�	�$��-rc��[U2[OV2[UQ29^tt^2o[UQ29^tt^2oUO
[OOUO2UO222PPP2PPP2P![c#oSO	QS*2Po=K�Po=hh9h)%fhKJ9h)%fhP!9h)�
os.link(): %sr�)
r
rr�r�r�rxr|r>�sameopenfiler�)r.rrr!rP�f2s&&&   r�
_test_link�LinkTests._test_link�s����E��	/��G�G�E�!��%��
�
�"�d�5�$�&7�&7�2��O�O�B�G�G�0�0�����b�i�i�k�J�K�'8�
�
���	/��M�M�/�A�-�.�.��	/��&7�&7��
�
�
�sM�B+�C.�
AC	�C.�+	C�5C�6C�C�C+
�$C+
�&C.�.C?	�7C?	c�T�UOUOUO2P!r!)r$rrrts&r�	test_link�LinkTests.test_link�s������
�
�D�J�J�/rc���UO[UO[O22[UO
[O222P!r!)r$rUrr7r�rrts&r�test_link_bytes�LinkTests.test_link_bytes�s<������d�j�j�#�*C�*C�*E�F��d�j�j�#�*C�*C�*E�F�	Hrc�.�[OQ2U9O
Q*
tmUO
Q*UmUOUO
UO2P![c[OQ2gh9h)�ñz#Unable to encode for this platform.r�)rrl�UnicodeErrorrr�rrr$rts&r�test_unicode_name�LinkTests.test_unicode_name�so��	K��K�K���	
�
�
�f��
��Z�Z�#�%��
�����
�
�D�J�J�/���	K��#�#�$I�J�J�	K�s�A2�2	B�<B)rr)rhr[r\rirurMr$r'r*r/rjrkrls@rrr�s*����:� �
L�0�H�0�0rrr�zPosix specific testsc�`�\sQsQsnQsQs\O\\	Q2Q2Q2s
\O\\	Q2Q2Q2s\O\\	Q2Q	2Q
2s\O\\	Q2Q2Q
2s
\O\\	Q2Q2Q2s\O\\	Q2Q2\O 2Q22s\O\\	Q2Q2\O 2Q22s\O\\	Q2Q2\O 2Q22sQsUsP!)�PosixUidGidTestsi��setuidztest needs os.setuid()c�.�[O2]6wc&UO[[O]2UO[
[OQ2UO[[OUO2P!�rz
not an int)r�getuidr�rDr3r��
OverflowError�UID_OVERFLOWrts&r�test_setuid�PosixUidGidTests.test_setuid�sX��
�9�9�;�!�����g�r�y�y�!�4����)�R�Y�Y��=����-����D�4E�4E�Fr�setgidztest needs os.setgid()c�F�[O2]6wc2[%f&UO[[O
]2UO[[O
Q2UO[[O
UO2P!r5)	rr6�HAVE_WHEEL_GROUPr�rDr;r�r7�GID_OVERFLOWrts&r�test_setgid�PosixUidGidTests.test_setgid�s^��
�9�9�;�!��$4�$4����g�r�y�y�!�4����)�R�Y�Y��=����-����D�4E�4E�Fr�seteuidztest needs os.seteuid()c�.�[O2]6wc&UO[[O]2UO[
[OQ2UO[[OUO2P!r5)	rr6r�rDrAr��setegidr7r8rts&r�test_seteuid�PosixUidGidTests.test_seteuid�sX��
�9�9�;�!�����g�r�z�z�1�5����)�R�Z�Z��>����-����T�5F�5F�GrrCztest needs os.setegid()c�F�[O2]6wc2[%f&UO[[O
]2UO[[O
Q2UO[[O
UO2P!r5)	rr6r=r�rDrCr�r7r>rts&r�test_setegid�PosixUidGidTests.test_setegid�s^��
�9�9�;�!��$4�$4����g�r�z�z�1�5����)�R�Z�Z��>����-����T�5F�5F�Gr�setreuidztest needs os.setreuid()c���[O2]6wc'UO[[O]]2UO[
[OQ]2UO[
[O]Q2UO[[OUO]2UO[[O]UO2P!r5)rr6r�rDrIr�r7r8rts&r�
test_setreuid�PosixUidGidTests.test_setreuid�s���
�9�9�;�!�����g�r�{�{�A�q�9����)�R�[�[�,��B����)�R�[�[�!�\�B����-����d�6G�6G��K����-����a��9J�9J�Krc�V�[O[OQQ,2P!)r�z,import os,sys;os.setreuid(-1,-1);sys.exit(0)�r�rBr7r�rts&r�test_setreuid_neg1�#PosixUidGidTests.test_setreuid_neg1�%��
	�������>�@�	Ar�setregidztest needs os.setregid()c��[O2]6wc3[%f'UO[[O
]]2UO[[O
Q]2UO[[O
]Q2UO[[O
UO]2UO[[O
]UO2P!r5)	rr6r=r�rDrRr�r7r>rts&r�
test_setregid�PosixUidGidTests.test_setregid	s����9�9�;�!��$4�$4����g�r�{�{�A�q�9����)�R�[�[�,��B����)�R�[�[�!�\�B����-����d�6G�6G��K����-����a��9J�9J�Krc�V�[O[OQQ,2P!)r�z,import os,sys;os.setregid(-1,-1);sys.exit(0)rNrts&r�test_setregid_neg1�#PosixUidGidTests.test_setregid_neg1rQrr%�)rhr[r\rir8r>rrrrr9r?rDrGrKrr�rOrTrWrjrkrls@rr2r2�s������L��L�
�����X�.�0H�I�G�J�G������X�.�0H�I�G�J�G������Y�/�1J�K�H�L�H������Y�/�1J�K�H�L�H������Z�0�2L�M�L�N�L������Z�0�2L�M�� � �"�A�#�N�A������Z�0�2L�M�� � �"�L�#�N�L������Z�0�2L�M�� � �"�A�#�N�Arr2c�`�\sQsQsnQsQsQsQs\O\
\Q2Q2Q2sQ	s
Q
sUsP!)�Pep383Testsic� `�[O%c[OUmLA[O%c[OUmL[OUm[
OUO2Um,nU1QkoU[O2[O%cU[O2[O%cU[O2R%fUOQ2[2Um[
OUO2RFD�o[O[
OOUOU22[
O U2oV O7c[#Q2gUOO%U2J�	P![&O(SO2g9h)c�~:�[OU2oROU2P![cP!h9hr!)rrlr�r�)�fn�bytesfns&�r�add_filename�'Pep383Tests.setUp.<locals>.add_filename(s7���
��[�[��_��
�N�N�2���&�
��
�s�-�	<�<�<z&couldn't create any non-ascii filenamezduplicate filename)r�TESTFN_UNENCODABLEr��TESTFN_NONASCIIrrrrl�bdir�TESTFN_UNICODEr�r��	unicodefnrA�create_empty_filer>r@rVr�addr#rQ)r.r`r^r_s&  @rru�Pep383Tests.setUpsL����'�'�'� �3�3�D�H�
�
&�
&�
&� �0�0�D�H� �'�'�D�H��K�K����)��	���	�	�Y�-�-�.��'�'�'���5�5�6��$�$�$���2�2�3���M�M�B�C�����
�������		����+�+�B�G�G�L�L����B�,G�H��[�[��_�����'�$�%9�:�:����"�"�2�&���	��M�M�$�(�(�#��s�A)G*�>*G*�*#H
c�H�[OUO2P!r!)r#rQr�rts&rrM�Pep383Tests.tearDownCs���
�
�d�h�h�rc��UOo[[OUO22oUOV!2[O2o[OUO2UO[[O22U2[OU2P![OS2h9hr!)rfr�rr�r�r=r*rB)r.rN�found�current_directorys&   r�test_listdir�Pep383Tests.test_listdirFs����>�>���B�J�J�t�x�x�(�)������)��I�I�K��	(�
�H�H�T�X�X�����S�����.��9��H�H�&�'��B�H�H�&�'�s
�AC�Cc��UOFDGo[[OO	UO
U2Q2oUO
2JI	P!�r�)rfrxrr>r@r�r{)r.r^r�s&  r�	test_open�Pep383Tests.test_openTs8���.�.�B��R�W�W�\�\�$�(�(�B�/��6�A�
�G�G�I�!rrr%c��UOFDCo[OOUOU2o[O
U2JE	P!r!)rfrr>r@r�r)r.r^�fullnames&  r�test_statvfs�Pep383Tests.test_statvfsYs6���.�.�B��w�w�|�|�D�H�H�b�1�H��J�J�x� �!rc��UOFDAo[O[OO	UO
U22JC	P!r!)rfrr�r>r@r�)r.r^s& r�	test_stat�Pep383Tests.test_statbs/���.�.�B��G�G�B�G�G�L�L����2�.�/�!r)rdr�rf)rhr[r\rirurMrorsrrrrrwrzrjrkrls@rr[r[sO����#�J �(��
�����Y�/�/�1�!�1�!�0�0rr[�readlinkzneeds os.readlink()c�(`�\sQsQsnQs\OO\2s	\O\2s\O\	2sQs
QsQsQs\O$Q2s\O$Q2s\O$Q	2sQ
sUsP!)�
ReadlinkTestsig�readlinktestc�2�[OOU2o[OOU2o[OQ6Xc2QoUU2%c
UQ*oUU2%c
UQ*oUOV2P!)r�c�^�SO[U[2%cQ2!Q2!)s\\?\�\\?\)r�r�rU)r�s&rr8�/ReadlinkTests.assertPathEqual.<locals>.<lambda>ts&��1�<�<�(��E�2�2�
�$C�8A�$Crr�)rr>�normcaser7r8r=)r.�left�right�
has_prefixs&&& r�assertPathEqual�ReadlinkTests.assertPathEqualnst���w�w����%����� � ��'���<�<�7�"�C�J��$����B�x���%� � ��b�	������%rc���UO[OOUO22UO[OOUO
22UO
[OOUO22UO
[OOUO22P!r!)	r|rr>r��filelink_target�filelinkb_targetr��filelink�	filelinkbrts&rru�ReadlinkTests.setUp|s~����������t�';�';�<�=���������t�'<�'<�=�>����������
�
�6�7������������7�8rc���[UO2oUO[[O
UO2UO[[O
U2P!r!)rr�r�rDrr|)r.r�s& r�test_not_symlink�ReadlinkTests.test_not_symlink�sD��"�4�#7�#7�8�����'�2�;�;��0D�0D�E����'�2�;�;��@rc��UO[[OQ2UO[[O[	Q22P!)zmissing-link)r�rCrr|rrts&r�test_missing_link�ReadlinkTests.test_missing_link�s8�����+�R�[�[�.�I����+�R�[�[�"�>�2�	4rc�<�[OUOUO2UO	[
OUO2[UO2oUO[OU2UO2P!r!)
rrr�r�r�rrsrr�r|)r.r�s& r�
test_pathlike�ReadlinkTests.test_pathlike�s_��
�
�
�4�'�'����7����	�(�(�$�-�-�8��D�M�M�*�����R�[�[��2�D�4H�4H�Irc�f�[OUOUO2UO	[
OUO2[O[UO22oUOVO2UOU[2P!r!)rrr�r�r�rrsr|rr�r+rU�r.r>s& r�test_pathlike_bytes�!ReadlinkTests.test_pathlike_bytes�sm��
�
�
�4�(�(�$�.�.�9����	�(�(�$�.�.�9��{�{�8�D�N�N�3�4�����T�#8�#8�9����d�E�*rc�T�[OUOUO2UO	[
OUO2[OUO2oUOVO2UOU[2P!r!)rrr�r�r�rrsr|r�r+rUr�s& r�
test_bytes�ReadlinkTests.test_bytes�sh��
�
�
�4�(�(�$�.�.�9����	�(�(�$�.�.�9��{�{�4�>�>�*�����T�#8�#8�9����d�E�*rr%)rhr[r\rir�rr>r�rr�rlr�r�r�rur�r�r�skip_unless_symlinkr�r�r�rjrkrls@rr~r~gs������H��g�g�o�o�h�/�O����H�%�I��{�{�?�3��&�9�A�
4�
�"�"�J�#�J��"�"�+�#�+��"�"�+�#�+rr~c�4`�\sQsQsnQsQsQsQsUsP!)�NonLocalSymlinkTestsi�c�4�[OQ2P!)z-
Create this structure:

base
 \___ some_dir
z
base/some_dir)rr�rts&rru�NonLocalSymlinkTests.setUp�s��	���O�$rc�4�[OQ2P!)r+)r#rQrts&rrM�NonLocalSymlinkTests.tearDown�s���
�
�f�rc���[OOQQ2o[OQU2[OO	U2%fPgP!)ay
The symlink target should resolve relative to the link, not relative
to the current directory.

Then, link base/some_link -> base/some_dir and ensure that some_link
is resolved as a directory.

In issue13772, it was discovered that directory detection failed if
the symlink target was not specified relative to the current
directory, which was a defect in the implementation.
r+�	some_link�some_dir)rr>r@rr�)r.rs& r�test_directory_link_nonlocal�1NonLocalSymlinkTests.test_directory_link_nonlocal�s?���g�g�l�l�6�;�/��
�
�
�:�s�#��w�w�}�}�S�!�!�!�!rr%)	rhr[r\rirurMr�rjrkrls@rr�r��s����%��"�"rr�c�.`�\sQsQsnQsQsQsUsP!)�FSEncodingTestsi�c��UO[OQ2Q2UO[OQ2Q2P!)sabc�uabcŁ)r=rrlrVrts&r�test_nop�FSEncodingTests.test_nop�s4��������Z�0�*�=�������[�1�;�?rc��QFD@o[OU2oUO[OU2U2JB	P![cJTh9h)�	unicodeŁ)r�ulatinér�)rrlr�r=rV)r.r^r_s&  r�
test_identity�FSEncodingTests.test_identity�sM��9�B�
��+�+�b�/��
���R�[�[��1�2�6�:��&�
��
�s�A�	A�A�Ar%)rhr[r\rir�r�rjrkrls@rr�r��s����@�7�7rr�c�,`�\sQsQsnQs\O\O]29%cR\	2%(9%c>\
OOQ29%f\
\Q29%c
\
\Q2Q2Q2sQsUsP!)	�DeviceEncodingTestsi�c�R�UO[OQ22P!)i@�)r�r�device_encodingrts&r�test_bad_fd�DeviceEncodingTests.test_bad_fd�s�����"�,�,�V�4�5r�win�nl_langinfo�CODESETz>test requires a tty and either Windows or nl_langinfo(CODESET)c��[O]2oUOU2UO[O
U22P!r�)rr��assertIsNotNoner|�codecs�lookup)r.r�s& r�test_device_encoding�(DeviceEncodingTests.test_device_encoding�s7���%�%�a�(�����X�&�����
�
�h�/�0rr%)rhr[r\rir�rrrr�r	r7r8r�r�localer�rjrkrls@rr�r��s�����6�������1��M�M�l�n�*<�M�M�#�,�,�BY�BY�Z_�B`�CL�CL�
�V�]�
+�
J�
J���	�0J�L�N�1�N�1rr�c�x`�\sQsQsn\O
\\Q2Q2Q2s\	O2QQk2sQsQs
\O
\OQ6HQ	2Q
2s\O
\OQ6HQ	2Q2s\O
\\Q2Q
2Q2sQsUsP!)�PidTestsi��getppidztest needs os.getppidc�8�[O[OQQ,[O[OQ5oUO2vq#UO
UQ2UO
[U2[O22P!)r�zimport os; print(os.getppid()))rW�stderrr)
r��Popenr7�_base_executabler]�communicater=r�r�getpid)r.r�rWr�s&   r�test_getppid�PidTests.test_getppid�sl�����c�2�2�D�>�@�$.�O�O�$.�O�O�
5���
�
��
�������$�����V��b�i�i�k�2rc��[OQ6XcQ[OQ0QQUQ0,oL[OQU,o[O[O
[OU2oUd	UU2[OU]2vqgUO[OU2U2UOVe2P!)r��"r�)	r7r8r�rr�P_NOWAIT�waitpidr=�waitstatus_to_exitcode)r.r��exitcode�callbackr��pid�pid2�statuss&&&&    r�
check_waitpid�PidTests.check_waitpid�s����<�<�7�"�����'�q�)�4�1�T�F�!��=�D��N�N�D�$�/�D��i�i����S�^�^�T�:�����S�M��z�z�#�q�)�������2�2�6�:�H�E�����#rc�.�UOQ]Q5P!)r~)r�r��r�rts&r�test_waitpid�PidTests.test_waitpid
s��������3rc���]oQUQ0oUOV!Q5UO[29^tt^2[OQ2PPP2P!)%fhP!9h)�zimport sys; sys.exit(�)�r��)r�r�r�rr�)r.r�r�s&  r�test_waitstatus_to_exitcode�$PidTests.test_waitstatus_to_exitcode
sT����&�x�j��2�����4��3�
�
�
�y�
)�
)��%�%�c�*�*�
)�
)�
)�s�A�A+	�#A+	r��win32-specific testc�<�QoQUQ0oUOV!Q5P!)l:z$import _winapi; _winapi.ExitProcess(r�r�r�)r.�STATUS_CONTROL_C_EXITr�s&  r�test_waitpid_windows�PidTests.test_waitpid_windows
s+��!+��5�6K�5L�A�N�����4��@rc���Qo]]]U1FD0oUO[OU]*2U2J2	UO[29^tt^2[OU]*]*2PPP2UO[
29^tt^2[OP2PPP2P!)%fhKN9h)%fhP!9h)r{r5)r=rr�r�rr7)r.�max_exitcoder�s&  r�#test_waitstatus_to_exitcode_windows�,PidTests.test_waitstatus_to_exitcode_windows
s���"���A�q�,�/�H����R�6�6�x�1�}�E�%�
'�0�
�
�
�z�
*�
*��%�%�|�a�'7�A�&=�>�+�
�
�
�}�
-�
-��%�%�b�)�.�
-�+�
*��
-�
-�
-�s$�%C�&C�C	�C	�C+	�#C+	�SIGKILLzneed signal.SIGKILLc�`�Q[OQ0o[OnU1QkoUO	UR'UQ5P!)zimport time; time.sleep(r�c�8:�[OUR2P!r!)r�kill)r��signums&�r�kill_process�?PidTests.test_waitstatus_to_exitcode_kill.<locals>.kill_process)
s����G�G�C�� r)r�r�)r�LONG_TIMEOUT�signalr�r�)r.r�r�r�s&  @r� test_waitstatus_to_exitcode_kill�)PidTests.test_waitstatus_to_exitcode_kill$
s?���)�'�*>�*>�)?�q�A������	!�	
���4�6�'�L��Irr%r!)rhr[r\rirrrrr�r�*ignore_fork_in_thread_deprecation_warningsr�r�r�r7r8r�r�r�r�rjrkrls@rr�r��s�����
�����Y�/�1H�I�3�J�3��?�?�A�$�B�$�$4�+��������0�2G�H�A�I�A��������0�2G�H�
*�I�
*�������3�5J�K�J�L�Jrr�c�`�\sQsQsn\Q2sQP
QP
-Qks\O2\	Q2Q22s
\O2\	Q2Q	22s\O2\	Q
2Q22s\O2\	Q2Q
22s
\O2\	Q2Q22s\O2\	Q2Q22s\O2\	Q2Q22s\O2\	Q2Q22s\O2\	Q2Q22s\O2\	Q2Q22s\O2\	Q2Q22s\O2\	Q2Q22s\O2\	Q2Q22s\O2\	Q2Q22s\Q2sQs\O2\	Q2Q22s\O2\	Q2Q22sQ sUsP!)!�
SpawnTestsi/
c��[OQ6wcU!STt,tFD oQUO27cQUQ0LSMJ"	to!ttoh)r�r�r�)rrr)r�r�s& r�
quote_args�SpawnTests.quote_args1
sF���7�7�d�?��K�EI�J�T�c�c�S�Y�Y�[�0�!�C�5��
�c�9�T�J�J��Js
�A�A�with_env�	use_bytesc	���]Um[OoUO[OU2U%fQUO*oL�[[O2Um[[O22UmUOUOUO$QUO8QUO8Q0o[UQQQ59^tt^2oUOU2PPP2[O oUO#Vc,2oU%c�[O$U2oSTt,tFDo[O$U2MJ	ooUOO'2T	T
t-tFD0vq�[O$U	2[O$U
2aJ2	to
o	UmVg1!)%fhK�9httohtto
o	h)�zimport sys; sys.exit(%s)z#import sys, os; magic = os.environ[z]; sys.exit(r�r�r�r�)r�rrrr�rsr�rrAr.r,�uuid�uuid4rrxr�r7r�r�rlr)r.rrr�r�r�rsr�r6r�r�s&$$        r�create_args�SpawnTests.create_args9
sP����
��#�#�����	�(�(�(�3��-��
�
�=�D��B�J�J�'�D�H��4�:�:�<�(�D�H�!%���D�H�H�T�X�X���x�x����0�D��(�C�'�
2�
2�b��H�H�T�N�3��.�.������2�3����k�k�'�*�G�,0�1�D�q�B�K�K��N�D�D�1�$(�H�H�N�N�$4�6�$4�D�A����A�����A��6�$4�6�D�H��}��3�
2��2��6s�.G�!G!�
8G&�G	�G	�spawnlc��UO2vq[O[OU,UN3oUO	V0O
2P!r!)rrr	�P_WAITr=r��r.rsr�r�s&   r�test_spawnl�SpawnTests.test_spawnlW
s?���(�(�*�
���9�9�R�Y�Y��7�$�7������=�=�1r�spawnlec���UOP	Q5vq[O[OU,UNUOM3oUOV0O2P!�T)r)rrrrr.r=r�rs&   r�test_spawnle�SpawnTests.test_spawnle^
sM���(�(�$�(�7�
���:�:�b�i�i��B�4�B����B������=�=�1r�spawnlpc��UO2vq[O[OU,UN3oUO	V0O
2P!r!)rrrrr=r�rs&   r�test_spawnlp�SpawnTests.test_spawnlpe
s?���(�(�*�
���:�:�b�i�i��8�4�8������=�=�1r�spawnlpec���UOP	Q5vq[O[OU,UNUOM3oUOV0O2P!r)rrrrr.r=r�rs&   r�
test_spawnlpe�SpawnTests.test_spawnlpel
sM���(�(�$�(�7�
���;�;�r�y�y�'�C�D�C�$�(�(�C������=�=�1rrc�@�UO2vq[O[OV2oUO	V0O
2[O[O[
U2U2oUO	V0O
2P!r!)rrrrr=r�rrs&   r�test_spawnv�SpawnTests.test_spawnvs
si���(�(�*�
���9�9�R�Y�Y��6������=�=�1��9�9�R�Y�Y���(9�4�@������=�=�1r�spawnvec���UOP	Q5vq[O[OVUO2oUOV0O2P!r�rrrrr.r=r�rs&   r�test_spawnve�SpawnTests.test_spawnve~
sE���(�(�$�(�7�
���:�:�b�i�i�����A������=�=�1r�spawnvpc��UO2vq[O[OV2oUO	V0O
2P!r!)rrr$rr=r�rs&   r�test_spawnvp�SpawnTests.test_spawnvp�
s:���(�(�*�
���:�:�b�i�i��7������=�=�1r�spawnvpec���UOP	Q5vq[O[OVUO2oUOV0O2P!r)rrr(rr.r=r�rs&   r�
test_spawnvpe�SpawnTests.test_spawnvpe�
sE���(�(�$�(�7�
���;�;�r�y�y�'����B������=�=�1rc��UO2vq[O[OV2o[O
V0OQ5P!)r�)rrrr�r�wait_processr�)r.rsr�r�s&   r�test_nowait�SpawnTests.test_nowait�
s:���(�(�*�
���i�i����W�3�����S�=�=�9rc���UOP	P	Q5vq[O[OVUO2oUOV0O2P!)T)rrr!rs&   r�test_spawnve_bytes�SpawnTests.test_spawnve_bytes�
sG���(�(�$�$�(�G�
���:�:�b�i�i�����A������=�=�1rc��UO2vqUO[[O[O
U2UO[[O[O
UP2P!r;)rr�rrr	r��r.rs�__s&  r�test_spawnl_noargs�SpawnTests.test_spawnl_noargs�
sN���&�&�(������*�b�i�i����g�F����*�b�i�i����g�r�Jrc��UO2vqUO[[O[O
U-2UO[[O[O
UP-2P!r;)rr�rrrr�r4s&  r�test_spawnle_noargs�SpawnTests.test_spawnle_noargs�
sR���&�&�(������*�b�j�j�"�+�+�w��K����*�b�j�j�"�+�+�w��B�Orc���UO2vqUO[[O[O
UQ2UO[[O[O
U,2UO[[O[O
UQ2UO[[O[O
UP,2P!�r:r%r;)rr�rrrr�r4s&  r�test_spawnv_noargs�SpawnTests.test_spawnv_noargs�
s����&�&�(������*�b�i�i����g�r�J����*�b�i�i����g�r�J����*�b�i�i����g�u�M����*�b�i�i����g��t�Lrc���UO2vqUO[[O[O
UQ-2UO[[O[O
U,-2UO[[O[O
UQ-2UO[[O[O
UP,-2P!r<)rr�rrrr�r4s&  r�test_spawnve_noargs�SpawnTests.test_spawnve_noargs�
s����&�&�(������*�b�j�j�"�+�+�w��B�O����*�b�j�j�"�+�+�w��B�O����*�b�j�j�"�+�+�w��r�R����*�b�j�j�"�+�+�w���b�Qrc	��UO[Q29^tt^2[O[O[
O[
O]{,2PPP2UO[29^tt^2[O[O[
O[
OQ,2PPP2QQ2oUO[Q29^tt^2[O[O[
O[
OU2,2PPP2P!)%fhK�9h)%fhK�9h)%fhP!9h)zmust contain only stringsz
embeddednullc�(`�\sQsQsnQsQsUsP!)�ASpawnTests.test_spawnv_arg_conversion_errors.<locals>.RaisingPathi�
c��[Q2g)�gotcha)rOrts&r�
__fspath__�LSpawnTests.test_spawnv_arg_conversion_errors.<locals>.RaisingPath.__fspath__�
s
��"�8�,�,rr%�rhr[r\rirGrjrkrls@r�RaisingPathrD�
s����
-�
-rrJrF)
r
r�rrr�r7r�r�rrO)r.rJs& r�!test_spawnv_arg_conversion_errors�,SpawnTests.test_spawnv_arg_conversion_errors�
s����
#�
#�I�/J�
K�
K��I�I�b�k�k�3�>�>�C�N�N�C�3H�I�L��
�
�z�
*�
*��I�I�b�k�k�3�>�>��~�~�'7�8�
:�+�	-�	-��
#�
#�L�(�
;�
;��I�I�b�k�k�3�>�>��~�~�{�}�5�
7�<�
;�L�
K��+�
*��<�
;�
;�s8�AE�
AE&�?A
E9�E#	�E#	�&E6	�/E6	�9F
	�F
	c�2�[OoUOUQQ,2o[OO2oQUQ$U[OV#U2oUOU]2[OO2oQUQ$U[OV#U2oUOU]2[OO2oQUQ$U[OV#U2oUOU]2[OoUO[OU2[UQQ	Q
59^tt^2oUOQ2PPP2UOV&,2o[OO2oQUQ$U[OV#U2oUOU]2P![cCKkh9h[cCK/h9h[cK�h9h)%fhK�9h)
r�r~rr�r�r�r�r�r�r�r�zPimport sys, os
if os.getenv("FRUIT") != "orange=lemon":
    raise AssertionErrorzorange=lemon)r7r�r�rrAr�rr=rrrrr�rsrxr�)r.�spawnrsr�r�r�r�r�s&&      r�_test_invalid_env�SpawnTests._test_invalid_env�
s����.�.�������v�6�7�������"��%.��!�"�	,��R�Y�Y��v�>�H�
���X�s�+������"��5��w��	,��R�Y�Y��v�>�H�
���X�s�+������"��!(��~��	,��R�Y�Y��v�>�H�
���X�s�+��#�#�����	�(�(�(�3�
�(�C�'�
2�
2�b��H�H�0�
1�3�
����2�3�������"��(��w������G�6�:������1�%��K�	��	���	��	���	��	��3�
2�sZ�
G�G#�&G5�H�	G �G �G �#	G2�-G2�1G2�5	H�?H�H�H	�H	c�F�UO[O2P!r!)rOrrrts&r�test_spawnve_invalid_env�#SpawnTests.test_spawnve_invalid_envs��	
���r�z�z�*rc�F�UO[O2P!r!)rOrr(rts&r�test_spawnvpe_invalid_env�$SpawnTests.test_spawnvpe_invalid_env
s��	
���r�{�{�+r)r.r�r)rhr[r\rir�r�rrr�rr
rrrrr"r&r*r.r1r6r9r=r@�requires_native_spawnvrKrOrRrUrjrkrls@rr�r�/
s������K��K��e��u��<�?�?�A��h��2� �B�2�
�?�?�A��i� �2�!�B�2�
�?�?�A��i� �2�!�B�2�
�?�?�A��j�!�2�"�B�2�
�?�?�A��h��2� �B�2��?�?�A��i� �2�!�B�2�
�?�?�A��i� �2�!�B�2�
�?�?�A��j�!�2�"�B�2�
�?�?�A��h��:� �B�:�
�?�?�A��i� �2�!�B�2��?�?�A��h��K� �B�K�
�?�?�A��i� �P�!�B�P�
�?�?�A��h��M� �B�M��?�?�A��i� �R�!�B�R��7��7�$.&�`�?�?�A��i� �+�!�B�+��?�?�A��j�!�,�"�B�,rr��getloginztest needs os.getloginc�(`�\sQsQsnQsQsUsP!)�
LoginTestsic�L�[O2oUO[W2]2P![cdoSO[O[O
[O17c SO[S22Po=K�gPo=hh9hr!)rrXrDrE�ENXIO�ENOENT�ENOTTYr�r,rCr9)r.�	user_namerPs&  r�
test_getlogin�LoginTests.test_getloginso��	����
�I�	
���C�	�N�A�.��
�	��y�y�U�[�[�%�,�,����E�E��
�
�c�#�h�'�'���	�s&�5�	B#�B#�=B�>B�B�B#r%)rhr[r\rir`rjrkrls@rrZrZs����	/�	/rrZ�getpriority�setpriorityz'needs os.getpriority and os.setpriorityc�,`�\sQsQsnQsQsQsUsP!)�ProgramPriorityTestsiz0Tests for os.getpriority() and os.setpriority().c�<�[O[O[O22oQUQ0o[	QU2vq4o[U2oU]6�c$VQ6:c[OQU*2gUOVQ]*2P!)zMif 1:
        import os
        os.setpriority(os.PRIO_PROCESS, os.getpid(), zJ + 1)
        print(os.getpriority(os.PRIO_PROCESS, os.getpid()))
        r�z?unable to reliably test setpriority at current nice level of %s)	rrb�PRIO_PROCESSr�rr�rr�r=)r.r+r�rr��new_prios&     r�test_set_get_priority�*ProgramPriorityTests.test_set_get_priority#s����~�~�b�o�o�r�y�y�{�;��6�6:�V�<	���%�T�4�0�	����s�8���2�:�(�*��#�#�%B�DH�%I�J�
J�
���X�a�x�0rr%)rhr[r\rir�rirjrkrls@rreres����;�1�1rre�sendfileztest needs os.sendfile()c�`�\sQsQsnQQ*s\OOQ2%(s\	O\Q2s\	O\OQ6Q2s
\Q2s\Q2s\Q2sQsQ	sQ
s\Q2s\Q2sQ
sQsQsQsQsQs\Q2s\Q2s\\
Q22s \\
Q22s!\\	O\"\#Q2Q2Q22s$Qs%Us&P!)�TestSendfilei6�z%requires headers and trailers supportz(test is only meaningful on 32-bit buildsc�P�[[OUO2P!r!)r
rrr�DATAr�s&rr��TestSendfile.setUpClassAs���I�$�$�c�h�h�/rc�P�[O[O2P!r!)rrsrrr�s&rr��TestSendfile.tearDownClassEs������)�)�*rc� �UO2%f!UO2EPiw�K
3w�	J6P!K3hr!)�at_eofr�)�readers&r�chunks�TestSendfile.chunksIs*����-�-�/�/����
�%�%�%�"�%�s�>�>�<�>c	��� �QOUOU2Tt,tPiw�K
p3MJKBLttohto2SmSO2SOO2P!3h)r)r@rw�
server_bufferr{�server)r.rv�writerrns&&& r�handle_new_client�TestSendfile.handle_new_clientNsO��� �X�X����F�8K�&L�8K�&L�&L�1�q�&L��&L�M�������������s&�A3�6�4
�2�4
�6�4
�6�>A3c�� �QUm[OUO[O
2EPiw�K
UmUOO]*O2o[O2Um
UOOP
2[O2OUOU2EPiw�K
UOO2Um[!["O$Q2UmUO&O2UmP!CKKf3h)rr�)rzr"�start_serverr}r�HOSTv4r{�sockets�getsockname�socket�client�setblocking�get_running_loop�sock_connectr��socknorxrrrr)r.�server_names& r�
asyncSetUp�TestSendfile.asyncSetUpSs���� ���#�0�0��1G�1G�1>�1E�1E�G�G�G����k�k�)�)�!�,�8�8�:���m�m�o���������&��&�&�(�5�5�d�k�k�;�O�O�O��k�k�(�(�*�����)�)�4�0��	��i�i�&�&�(���G�
	P�s#�<E�E�BE�E�A%E�Ec��� �UOO2UOO2UOO	2EPiw�K
P!K3hr!)rr{r�r{�wait_closedrts&r�
asyncTearDown�TestSendfile.asyncTearDown_s9����	�	�����������k�k�%�%�'�'�'�s�AA �A�A c��v �[O[O,UN3-U@EPiw�K
!K3hr!)r"�	to_threadrrk)r�r�s*,r�async_sendfile�TestSendfile.async_sendfilees-����&�&�r�{�{�D�T�D�V�D�D�D�D�D�s�/9�7�9c��( �[OU-U@EPiw�K
!K[c\oSO[O6XcgSO[O
[O17cPo=J�gPo=hh9h3h)zVA higher level wrapper representing how an application is
supposed to use sendfile().
)rmr�rDrE�
ECONNRESET�EAGAIN�EBUSY)r�r�rAs*, r�sendfile_wrapper�TestSendfile.sendfile_wrapperisq���
�

�)�8�8�$�I�&�I�I�I�I�I���
��9�9�� 0� 0�0���Y�Y�5�<�<����"=�=����
�sG�B�)�'�)�B�)�	B�B�B
�/B
�B�	B
�
B�Bc�� �]o]oQoU[UO26cpUOUOUOV#2EPiw�K
oU]6XcL6V$*
oV*
oUOVC6*2UO
V!2J�UO
U[UO22UOO[O2UOO2UOO2EPiw�K
UO
[UO2[UO22UO
UOUO2P!CK/Kg3h�r�)r9rpr�r�r�r|r=r��shutdownr��	SHUT_RDWRr{r{r�rz)r.�
total_sent�offset�nbytes�sents&    r�test_send_whole_file�!TestSendfile.test_send_whole_file{s����
������3�t�y�y�>�)��.�.�t�{�{�D�K�K�/5�?�?�?�D��q�y���N�F���J��O�O�D�N�+����V�0�����S����^�4������V�-�-�.��������k�k�%�%�'�'�'�����T�/�/�0�#�d�i�i�.�A�����+�+�T�Y�Y�7�?�	(�s0�!F�+F�E?�F�B=F�F�A&F�Fc��D �]o[UO2]*o[UO2U*
oQoV6c_UOUOUOV$2EPiw�K
oU]6XcL%V%*
oV*
oUOVT6*2JdUOO[O2UOO2UOO2EPiw�K
UO[UO2]*PoUOU[U22UO[UO2[U22UOUOU2P!CK)K�3hr�)r9rpr�r�r�r|r�r�r�r�r{r{r�r=rz)r.r�r��	must_sendr�r�rNs&      r�test_send_at_certain_offset�(TestSendfile.test_send_at_certain_offset�s8����
��T�Y�Y��1�$����	�	�N�V�+�	����$��.�.�t�{�{�D�K�K�/5�?�?�?�D��q�y���N�F���J��O�O�D�N�+������V�-�-�.��������k�k�%�%�'�'�'��9�9�S����^�q�0�1�2������S��]�3�����T�/�/�0�#�h�-�@�����+�+�X�6�?�	(�s2�AF �+F �1F�2F �>BF �F�BF �F c��P �[UO2Q*oUOUOUOUQ2EPiw�K
oUOU]2UOO[O2UOO2UOO2EPiw�K
UOUO Q2P!K�[c+oSO[O6wcgPo=K�Po=hh9hK\3h)r�r)r9rpr�r�r�r=rDrEr�r�r�r�r�r{r{r�rz)r.r�r�r!s&   r�test_offset_overflow�!TestSendfile.test_offset_overflow�s�����T�Y�Y��$�&��	&��,�,�T�[�[�$�+�+�-3�T�;�;�;�D�
���T�1�%������V�-�-�.��������k�k�%�%�'�'�'�����+�+�S�1�;���	��w�w�%�,�,�&��'��	��	(�sY�D&�,C,�
C*�C,�A3D&�D$�#D&�*C,�,	D!�6D!�7D�D�D&�D!�!D&c��R �UO[29^tt^2oUOUOUOPQ2EPiw�K
PPP2UOWOO[O2P!KB)%fhKH9h3h)rzr��	r�rDr�r�r�r=r.rEr��r.r�s& r�test_invalid_offset� TestSendfile.test_invalid_offset�sk���
�
�
�w�
'�
'�2��%�%�d�k�k�4�;�;��D�I�I�I�(�������+�+�U�\�\�:�
J�(�
'�s4�B'�-B�B
�B�>B'�B�B$	�B$	�B'c	��� �UO[QQ59^tt^2UOUOUO]PQ5EPiw�K
PPP2P!K)%fhP!9h3h)zcount cannot be negative)r_)r�r)r�rr�r�r�rts&r�test_invalid_count�TestSendfile.test_invalid_count�sd���
�
�
�z�/I�
�
J�
J��'�'����T�[�[��.0�(�2�
2�
2�K�
J�
2�K�
J�
J�s4�!A7�.A#�A!
�A#�
A7�!A#�#A4	�,A4	�.	A7c
�� �UOUOUO]QQ5EPiw�K
UO%c9UOUOUO]QQQ]Q5EPiw�K
P!P!KPK
3h)rr�)rrr�r)rrr�r�headers�trailersr�r%)r�r�r��SUPPORT_HEADERS_TRAILERSrts&r�
test_keywords�TestSendfile.test_keywords�s�����!�!����D�K�K�)*�$�"�8�	8�	8��(�(�(��%�%�T�[�[����-.�d�.0�2�Q�&�H�
H�
H�)�	8�
H�s'�/B�B�B�	0B�9B�:
B�Bc�� �]oQUOPP*oUOUOUO]QQQ,Q5EPiw�K
oUO	UQ2V*
oQoU[U26cy[
[U2U*
Q2oUOUOUOVE2EPiw�K
oU]6XcL#UO	V52V*
oVC*
oJ�UOU[U22UOO2UOO2EPiw�K
UO[UO2[U22P!CK2K�K93h)rr��r�sxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyysxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyi)rpr�r�r��assertLessEqualr9�minr�r=r�r{r{r��hashrz)r.r��
expected_datar�r�r�s&     r�test_headers�TestSendfile.test_headers�sT����
�/�$�)�)�C�R�.�@�
��(�(����d�k�k�1�d�2<�j�1I�)�K�K�K�����T�#3�4���
����3�}�-�-���]�+�j�8�$�?�F��.�.�t�{�{�D�K�K�/5�?�?�?�D��q�y��� � ��.���J��N�F�����S��%7�8��������k�k�%�%�'�'�'�����d�0�0�1�4�
�3F�G�%K�?�	(�sD�A
F�E?�
0F�>AF�F�F�A7F�	F�
6F�F�Fc
��* �[OQ*oQoUO[OU2[	V2[UQ29^tt^2oUO
UOUO2]]QQ,Q5EPiw�K
UOO2UOO2EPiw�K
UOUOQ2PPP2P!KhK,)%fhP!9h3h)r�sabcdefr�s123456s789�r�sabcde123456789)rrrr�rsr
rxr�r�r�r�r{r{r�r=rz)r.r��	file_datar�s&   r�
test_trailers�TestSendfile.test_trailers�s�����"�"�S�(���	����	�(�(�'�2��G�'�
�'�4�
 �
 �A��%�%�d�k�k�1�8�8�:�q�!�09�6�/B�&�D�
D�
D��K�K�����+�+�)�)�+�+�+����T�/�/�1B�C�!�
 �
D�
,�	!�
 �
 �sH�AD�5C?�C;
�=C?�C=
�!C?�1
D�;C?�=C?�?D	�D	�
	Dc
��t �UO[29^tt^2oUOUOUO]]QQ*,Q*Q5EPiw�K
PPP2UOWOO[O2P!KB)%fhKH9h3h)rrEr��rdr�r�s& r�test_headers_overflow_32bits�)TestSendfile.test_headers_overflow_32bits�s�����
�
�w�
'�
'�2��%�%�d�k�k�4�;�;��1�/3�e�|�n�u�.D�&�F�
F�
F�(�	
������+�+�U�\�\�:�
F�(�
'��4�B8�>B%�B#
� B%�%>B8�#B%�%B5	�.B5	�0B8c
��t �UO[29^tt^2oUOUOUO]]QQ*,Q*Q5EPiw�K
PPP2UOWOO[O2P!KB)%fhKH9h3h)rrEr�r�rdr�r�s& r�test_trailers_overflow_32bits�*TestSendfile.test_trailers_overflow_32bits�s�����
�
�w�
'�
'�2��%�%�d�k�k�4�;�;��1�04�u��~��/E�&�G�
G�
G�(�	
������+�+�U�\�\�:�
G�(�
'�r��SF_NODISKIOztest needs os.SF_NODISKIOc��, �UOUOUO]Q[OQ5EPiw�K
P!K[
c<oSO[O[O17cgPo=P!Po=hh9h3h)rr��r�)	r�r�r�rr�rDrEr�r�)r.rAs& r�
test_flags�TestSendfile.test_flagssn���	��%�%�d�k�k�4�;�;��4�,.�N�N�&�<�
<�
<���	��y�y����e�l�l� ;�;��<��	�sL�B�<A�A	�A�B�	A�	B�B�.B�B�B�B�B)r�rr�r{rzr�s�12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde12345abcde)�linuxr��solaris�sunosrY)'rhr[r\rirpr7r8r�r�rr�requires_headers_trailers�maxsize�requires_32br�r�r�r�rwr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�rjrkrls@rrmrm6s�������$�D��L�L�#�#�$L�M�M�� (� 3� 3�4L�3�!5���&�&�s�{�{�U�':�6�8�L��0��0��+��+��&��&��

)�(��E��E�����"8�,7�.2�";�
2�
H��H��H�.�D��D���;���;���;���;��
�����]�3�4�6��6��rrmc��[[Q2%fP
![[OQ]29^tt^2o[O
UO
2QQ2PPP2[O[O2P	![c1PPP2[O[O2P
!h9h)%fhKt9h[O[O2h9h)r��xbr�r)	rrrxrrrr�r�rDrs)r�s r�supports_extended_attributesr�s����2�z�"�"��+�
�)�"�"�D�!�
,�
,��
����B�I�I�K��s�;�-�	����)�)�*����
��	-�	����)�)�*�
��-�
,��	����)�)�*�sR�#C&�C�&B�'C&�	C�C� C�!C&�C�C�C#	�C#	�C&�&&Dz(no non-broken extended attribute supportc�@`�\sQsQsnQsQsQsQsQsQs	Us
P!)�ExtendedAttributeTestsi!c���[OoUO[OU2[	U2UO[29^tt^2oUVqQ21-U@PPP2UOWOO[O2UU2o	UOU	[2UVqQ2Q1-U@[U	2o
U
OQ2UO[UU22U
2UOUUQ1-U@Q2UVqQ2Q[O 1-U@UOUUQ1-U@Q2UO[29^tt^2oUVqQ2Q[O"1-U@PPP2UOUOO[O$2UO[29^tt^2oUVqQ2Q[O 1-U@PPP2UOUOO[O2UVqQ2Q[O"1-U@U
OQ2UO[UU22U
2UVqQ21-U@UO[29^tt^2oUVqQ21-U@PPP2UOUOO[O2U
O'Q2UO[UU22U
2UOUVqQ21-U@Q2UVqQ2Q	1-U@UOUVqQ21-U@Q	2UVqQ21-U@[)Q[+] 222oSFDoUV|Q1-U@J	UO[UU22[U	2[U2*2P!)%fhCK�9h)%fhCK�9h)%fhCK79h)%fhCK9h)
�	user.testrr�rsbyez
user.test2�fooc3�P�SF �DoQOU2w�	J	P!3h)zuser.test{})rF)r�r s& rr��;ExtendedAttributeTests._check_xattrs_str.<locals>.<genexpr>Rs��y���y�!�m�*�*�1�-�-�y�s�&rEsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)rrrr�rsr
r�rDr=r.rE�ENODATAr+r�r�rhr�
XATTR_REPLACE�XATTR_CREATE�EEXISTr�r2r)
r.r�r�r�r�r�r�r^r��
init_xattr�xattr�many�things
&&&&&&,      r�_check_xattrs_str�(ExtendedAttributeTests._check_xattrs_str'ss��
�
�
�����	�(�(�"�-��B��
�
�
�w�
'�
'�2��R��;��2�6�2�(�������+�+�U�]�]�;��r�]�
����j�$�/���Q�{�^�S�3�F�3��J���
�	�	�+������Y�r�]�+�U�3�����"�l�=�f�=�s�C���Q�{�^�X�r�/?�/?�J�6�J�����"�l�=�f�=�x�H�
�
�
�w�
'�
'�2��R��;������K�F�K�(�������+�+�U�\�\�:�
�
�
�w�
'�
'�2��R��<��&�"�2B�2B�M�f�M�(�������+�+�U�]�]�;���Q�|�_�f�b�o�o�H��H�
�	�	�,������Y�r�]�+�U�3��B��+��1�&�1�
�
�
�w�
'�
'�2��R��;��2�6�2�(�������+�+�U�]�]�;�
���[�!�����Y�r�]�+�U�3�����"�a��o�@��@�&�I���Q�{�^�X�8��8�����"�a��n�?��?��J��B��+��1�&�1��A�u�R�y�A�A���E��R��/��/������Y�r�]�+�S��_�s�4�y�-H�I�S(�
'�
'��(�
'�
'��(�
'�
'��(�
'�
'�sH�P'�!P;�!Q�Q#�'P8	�0P8	�;Q	�Q	�Q 	�Q 	�#Q4	�,Q4	c��UO[,UN3-U@[O[O2UO[
O,UN3-U@[O[O2P!r!)r�r,rrsrrrrlr?s&*,r�
_check_xattrs�$ExtendedAttributeTests._check_xattrsWs^�����s�4�T�4�V�4�����)�)�*����r�{�{�<�T�<�V�<�����)�)�*rc��UO[O[O[O[O
2P!r!�r�rr�r�r�r�rts&r�test_simple�"ExtendedAttributeTests.test_simple^s)�����2�;�;����R�^�^��<�<�	)rc��UO[O[O[O[O
P
Q5P!)Fr�r�rts&r�
test_lpath�!ExtendedAttributeTests.test_lpathbs1�����2�;�;����R�^�^��<�<��	�	@rc�D�QoQoQoQoUOVV42P!)c��[UQ29^tt^2o[OUO2,UN3ttPPP2!)%fhP!9hrr)rxrr�r��r>r�r�s&* rr��1ExtendedAttributeTests.test_fds.<locals>.getxattrgs7���d�D�!�!�R��{�{�2�9�9�;�6��6�"�!�!�!���'A�A	�A	c��[UQ]29^tt^2o[OUO2,UN3PPP2P!)%fhP!9h�r�)rxrr�r�r�s&* rr��1ExtendedAttributeTests.test_fds.<locals>.setxattrjs9���d�D�!�$�$�����B�I�I�K�/�$�/�%�$�$�$���(A	�	A	�A	c��[UQ]29^tt^2o[OUO2,UN3PPP2P!)%fhP!9hr�)rxrr�r�r�s&* rr��4ExtendedAttributeTests.test_fds.<locals>.removexattrms9���d�D�!�$�$�����r�y�y�{�2�T�2�%�$�$�$�rc��[UQ29^tt^2o[OUO2,UN3ttPPP2!)%fhP!9hrr)rxrr�r�r�s&* rr��2ExtendedAttributeTests.test_fds.<locals>.listxattrps7���d�D�!�!�R��|�|�B�I�I�K�7�$�7�"�!�!�!�r�)r�)r.r�r�r�r�s&    r�test_fds�ExtendedAttributeTests.test_fdsfs(��	7�	0�	3�	8�	
���8�{�Frr%)rhr[r\rir�r�r�r�rrjrkrls@rr�r�!s(����.J�`+�)�@�
G�
Grr��get_terminal_sizezrequires os.get_terminal_sizec�`�\sQsQsnQs\O2Q2s\O\
OQ6HQ2Q2sQs
UsP!)�
TermsizeTestsivc�v�[O2oUOUO]2UOUO]2P![c\o[OQ6Xf0SO
[
O[
O17cSOQ2gPo=hh9h)z�Check if get_terminal_size() returns a meaningful value.

There's no easy portable way to actually check the size of the
terminal, so let's check if it returns something sensible instead.
r��failed to query terminal size)rrrDr7r8rEr�r^r��assertGreaterEqual�columns�lines)r.r�r!s&  r�test_does_not_crash�!TermsizeTests.test_does_not_crashxs���	��'�'�)�D�	
������a�0�����
�
�A�.���	��|�|�w�&�!�'�'�e�l�l�E�L�L�5Q�*Q��
�
�=�>���	�s)�A�	B8�B8�B3�2.B3�!B3�3B8c��[OQQ,[OP	Q5O2o[W]*2[U]*21o[O[OO22oUO'V#2P![[O
[1cSOQ2K�h9h[c\o[OQ6Xf0SO [ O"[ O$17cSOQ2gPo=hh9h)z�Check if stty returns the same results

stty actually tests stdin, so get_terminal_size is invoked on
stdin explicitly. If stty succeeded, then get_terminal_size()
should work too.
�sttyr�)r�rXzstty invocation failedr�r)r�r��DEVNULLr�rC�CalledProcessErrorr�r�r�rrr7�	__stdin__r�rDr8rEr�r^r=)r.r�rNr�r!s&    r�test_stty_match�TermsizeTests.test_stty_match�s���	4��'�'��V�$�Z�-?�-?�d���%�'�
���Q��L�#�d�1�g�,�/��	��)�)�#�-�-�*>�*>�*@�A�F�	
����*��"�:�#@�#@��!�	4��M�M�2�3�	4���	��|�|�w�&�!�'�'�e�l�l�E�L�L�5Q�*Q��
�
�=�>���	�sA�7B$�2C�$C�C�C�	E�%E�&D<�;.D<�*D<�<Er�zWindows specific testc�j�[QQ2oW9^tt^2[OUO22oPPP2UO
WO]2UO
UO]2P![cSOQ2K�h9h)%fhKl9h)zBCheck if get_terminal_size() returns a meaningful value in Windowszconout$r�zfailed to open conout$)	rxrDr�rrr�r
rr)r.�conoutr�s&  r�test_windows_fd�TermsizeTests.test_windows_fd�s���	4��)�S�)�F��V��'�'��
�
��8�D��	
������a�0�����
�
�A�.��
�	4��M�M�2�3�	4��
�V�s(�B�%B"�	B�
B�B�"B2	�+B2	r%)rhr[r\rirrr�rrrr7r8rrjrkrls@rr
r
vsS����/�$
� � �"�+�#�+�8�������0�2I�J�
/�K�
/rr
�memfd_createzrequires os.memfd_createc�(`�\sQsQsnQsQsUsP!)�MemfdCreateTestsi�c�|�[OQ[O2oUOUP2UO	[O
U2UO
[OU22[UQP
Q59^tt^2oUOQ2UOUO2]2PPP2[OQ2oUO	[O
U2UO
[OU22P!)%fhKm9h)�Hir�)�closefdsmemfd_create)rr�MFD_CLOEXECrCr�r{r�rrxr�r=�tell)r.r�r�r�s&   r�test_memfd_create�"MemfdCreateTests.test_memfd_create�s���
�_�_�T�2�>�>�
2�����B��#�������"�%�����+�+�B�/�0�
�"�d�E�
*�
*�a�
�G�G�O�$����Q�V�V�X�r�*�+��o�o�d�#��������#�&�����+�+�C�0�1�
+�
*�s�2D+�+D;	�4D;	r%)rhr[r\rir%rjrkrls@rrr�s����2�2rr�eventfdzrequires os.eventfdc�4`�\sQsQsnQsQsQsQsUsP!)�EventfdTestsi�c�R�Qo]o]*o[OU2oUOUP2UO[OU2UO[OU22[OVB2oUOVQU22[OVA]22[OVB2oUOVQ]22[OVA](22[OVA]22[OVB2oUOVQ]*22[OU]2[OU]2[OU2oUOU]2P!)c�2�[OQU2!)z$Pack as native uint64_t
            z@Q)�struct�pack)r!s&rr-�/EventfdTests.test_eventfd_initval.<locals>.pack�s���;�;�t�U�+�+r)rr'rCr�r{r�rr�r=r��
eventfd_write�eventfd_read)r.r-r��initvalr��ress&     r�test_eventfd_initval�!EventfdTests.test_eventfd_initval�s:��	,�����
�Z�Z��
 �����B��#�������"�%�����+�+�B�/�0��g�g�b�������d�7�m�,�
����T�"�X���g�g�b�������d�2�h�'�
����T�"�X��
����T�!�W���g�g�b�������d�2�h�'�	����R� �
����Q���o�o�b�!������b�!rc��]o[O[O*[O*o[OV2oUOUP2UO
[OU2[OU2oUOU]2[OU2oUOU]2UO[29^tt^2[OU2PPP2UO[29^tt^2[OU]2PPP2[OU]2[OU2oUOU]2UO[29^tt^2[OU2PPP2P!)%fhK�9h)%fhK�9h)%fhP!9h)r{)r�EFD_CLOEXEC�
EFD_SEMAPHORE�EFD_NONBLOCKr'rCr�r{r0r=r�r�r�r/)r.r1r�r�r2s&    r�test_eventfd_semaphore�#EventfdTests.test_eventfd_semaphore�sH��������!1�!1�1�B�O�O�C��
�Z�Z��
'�����B��#�������"�%��o�o�b�!������a� ��o�o�b�!������a� �
�
�
��
/�
/��O�O�B��0�
�
�
��
/�
/��G�G�B��N�0�	����Q���o�o�b�!������a� �
�
�
��
/�
/��O�O�B��0�
/�0�
/��
/�
/��0�
/�
/�s6�3G�/G�+G2�G	�G	�G/	�(G/	�2H	�;H	c��[O[O*o[O]U2oUO	UP2UO[OU2[OU,U,U,]2vq4oUOV4U1,U,,12[OU]2[OU,U,U,]2vq4oUOV4U1U,U,,12UO[OU2]2[OUQ2[OU,U,U,]2vq4oUOV4U1U,,,12[OU2P!)rl����)rr6r8r'rCr�r{�selectr=r/r0)r.r�r��rfd�wfd�xfds&     r�test_eventfd_select� EventfdTests.test_eventfd_selectsB��������0��
�Z�Z��5�
!�����B��#�������"�%��
�
�r�d�R�D�2�$��:�
��#����#�C��2��t�R�.�9�	����R� ��
�
�r�d�R�D�2�$��:�
��#����#�C��B�4�"��r�*:�;��������,�b�1�	����[�)��
�
�r�d�R�D�2�$��:�
��#����#�C��B�4��R�.�9�
����rr%)	rhr[r\rir3r9r@rjrkrls@rr)r)�s����"�> �4�rr)�timerfd_createzrequires os.timerfd_creater�z#gh-124873: Test is flaky on Androidc�`�\sQsQsn]s]
\'*s]
]	\*
*sQsQsQs	Qs
\O\
OOQ2Q2Q2sQ	sQ
sQsQsQ
sQsQsQsQsQsQsUsP!)�TimerfdTestsic���[OU-U@oUOU]2UO[OU22UO[OU2U!r�)rrBr
r�rr�r{)r.r�r�r�s&*, rrB�TimerfdTests.timerfd_create!sW��
�
�
��
/��
/������A�&�����+�+�B�/�0�������"�%��	rc�|�[OU]2o[OU[O
Q5!)r)�	byteorder)rr�r��
from_bytesr7rH)r.r�r�s&& r�read_count_signaled� TimerfdTests.read_count_signaled(s(���w�w�r�1�~���~�~�d�c�m�m�~�<�<rc�F�UO[O2oQoQo[OVUQ5vqEUOUQUOQ5UOUQUOQ5[OVUQ5vqEUOVSUOQ5UOVBUOQ5[OU2vqEUOVSUOQ5UOVBUOQ5P!)��?��?��initial�intervalr���places)rBr��CLOCK_REALTIMEr�timerfd_settimera�CLOCK_RES_PLACES�timerfd_gettime)r.r��initial_expirationrQ�next_expiration�	interval2s&     r�test_timerfd_initval�!TimerfdTests.test_timerfd_initval-s��
�
 �
 ��!4�!4�
5��!����&(�%7�%7��ai�%j�"�����y�#�d�6K�6K��L������D�<Q�<Q��R�&(�%7�%7��ai�%j�"�����y�4�;P�;P��Q�����4�K`�K`��a�&(�%7�%7��%;�"�����y�4�;P�;P��Q�����4�K`�K`��arc��UO[O[OQ5oQo[O
V]Q5UO
[29^tt^2oUOU2PPP2UOWOO[O2[OUQ*2UOUOU2]2P!)%fhK�9h)r�g�������?rO)rBr�rTr�TFD_NONBLOCKrUr�rDrJr=r.rEr��sleep)r.r�rXr0s&   r�test_timerfd_non_blocking�&TimerfdTests.test_timerfd_non_blockingBs���
�
 �
 ��!4�!4�B�O�O�
 �
L��!��
���2�A�F��
�
�w�
'�
'�3��$�$�R�(�(�������,�,�e�l�l�;�	
�
�
�%��+�,�	
����1�1�"�5�q�9�(�
'�s�(C6�6D	�?D	�netbsdzIgh-131263: Skip on NetBSD due to system freeze with negative timer valuesc��QoUO[O2o][O,o[[Q2%c5UO
[O[O*2QFCD<vqESFCD.oUOVdUQ59^tt^2UO[29^tt^2o[OV&VEQ5PPP2UOWOO[O2UO[29^tt^2o[!V*2o[!V*2o	[O"V&V�Q5PPP2UOUOO[O2PPP2CJ1	CJ?	P!)%fhK�9h)%fhKk9h)%fhCJr9h)rx�TFD_TIMER_CANCEL_ON_SET�r�rPrQr|))���r)rzrf)rfrf)皙������r)rzrg)rgrg)rBr�rTr�TFD_TIMER_ABSTIMErr�rdr�r�rDrUr=r.rEr�r��timerfd_settime_ns)
r.�one_sec_in_nsecr�r�rPrQr��context�
initial_ns�interval_nss
&         r�test_timerfd_negative�"TimerfdTests.test_timerfd_negativeTs^�� ��
�
 �
 ��!4�!4�
5����-�-�.�
��2�0�1�1����b�2�2�R�5O�5O�O�P�"d��G�#���\�\���\�R�R��*�*�7�3�3�w��*�*�2�G�_�4��$�$�W�%6�%6�%<�%<�e�l�l�K��*�*�7�3�3�w�%(�/�*C�%E�
�&)�?�+E�&G���-�-�b�z�h�4��$�$�W�%6�%6�%<�%<�e�l�l�K�S�R�$�"d�4�3��4�3��S�R�R�sO�*G+
�G�!AG+
�:;G�5<G+
�G�G�G+
�G(�!G(�#G+
�+G=�4G=c���UO[O2o]oQo[OVUQ5[O
U2vqEUO
VSUOQ5UO
VBUOQ5]o[O2o[U2FD$oUOUOU2]2J&	[O2U*
oV#U]*
**o	UOVyUO*
2[OUQ*U*2UOUOU2U2P!)rz��?rOrR)rBr�rTrrUrWrarV�perf_counterrr=rJrc�	CLOCK_RESr_)
r.r�rXrQrYrZr�tr�
total_times
&         r�test_timerfd_interval�"TimerfdTests.test_timerfd_intervalms%��
�
 �
 ��!4�!4�
5������
���2�H�M�&(�%7�%7��%;�"�����y�4�;P�;P��Q�����4�K`�K`��a���������u��A����T�5�5�b�9�1�=������!�#��'�e�a�i�*@�@�
����1�4�>�>�9�:�	
�
�
�U�3�Y�(�*�+�����1�1�"�5�u�=rc��UO[O2o[O[O2o]oV#*o]o[O
U[OVEQ5[OU2vqgUOVuUOQ5UOVcUOQ5[O2oUOU2o	[O2U*
oUOU	]2UOV�UO*
2P!)rzrerR)rBr�rT�
clock_gettimerrUrhrWrarVrrrJr=rcrs)
r.r�r�r�rXrQrYrZrt�count_signaleds
&         r�test_timerfd_TFD_TIMER_ABSTIME�+TimerfdTests.test_timerfd_TFD_TIMER_ABSTIME�s���
�
 �
 ��!4�!4�
5��� � ��!4�!4�5���� �\����
���2�R�%9�%9�CU�i�&(�%7�%7��%;�"�����y�4�;P�;P��Q�����t�?T�?T��U�������1�1�"�5������!�#�������+����1�t�~�~�5�6rc	���UO[O[OQ5o[
O
U,U,U,]2vq#oUO
V#U1,,,12QoQo[OVUQ5]o[O2o[U2FDao	[
O
U,U,U,VV*2vq#oUO
V#U1U,,,12UO
UOU2]2Jc	[O2U*
oVVU]*
**o
UOV�UO*
2P!)r�rMrNrO)
rBr�rTrr^r<r=rUrrrrJrcrs)r.r�r=r>r?rXrQrrtrrus&          r�test_timerfd_select� TimerfdTests.test_timerfd_select�s-��
�
 �
 ��!4�!4�B�O�O�
 �
L���
�
�r�d�R�D�2�$��:�
��#����#�C��2�r�2�,�7�"����
���2�H�M���������u��A�"�M�M�2�$���r�d�<N�<Y�Z�M�C�c����c��_��t�R��n�=����T�5�5�b�9�1�=��
����!�#��'�e�a�i�*@�@�
����1�4�>�>�9�:rc��UO[O[OQ5o[
O2oUOU[
O2UOUO2QoU]*oU]*oU%c[OUUUQ5L%[OUVT*Vd*Q5]oU%c[O2oL[O2o[U2FD�o	So
U	]6XcVV*U
*oLVj*oUO!V�*2oUO#[%U2]U2U]*]*o
UO#U
[
O2UO#UO'U2]2J�	VVU]*
**oU%c@[O2U*
oUO)V�UO**
2LE[O2U*
oUO)V�U*UO,*
2UO/U2P!)r�rOr|)rBr�rTrr^�	selectors�DefaultSelector�register�
EVENT_READr�r{rirU�perf_counter_nsrrrr<r=r9rJrc�CLOCK_RES_NSrs�
unregister)r.�nanosecondsr��selector�sec_to_nsec�initial_expiration_nsrmrrtr �timeout_margin_ns�
timeout_ns�ready�eventru�dts&&              r�check_timerfd_poll�TimerfdTests.check_timerfd_poll�s���
�
 �
 ��!4�!4�B�O�O�
 �
L���,�,�.�����"�i�2�2�3�������'��� +�q� 0��!�Q�&����!�!�"�*?�+6�
8�
���r�'<�'J�(3�(A�
C�����$�$�&�A��!�!�#�A��u��A� +���A�v�2�@�CT�T�
�(�<�
��O�O�J�$<�=�E����S��Z��E�2��!�H�Q�K�E����U�I�$8�$8�9����T�5�5�b�9�1�=��+�E�A�I�-F�F�
���%�%�'�!�+�B����r��0A�0A�#A�B��"�"�$�q�(�B����r��#;�d�n�n�#L�M����B�rc�*�UOP
2P!r��r�rts&r�test_timerfd_poll�TimerfdTests.test_timerfd_poll�s������&rc�*�UOP	2P!rr�rts&r�test_timerfd_ns_poll�!TimerfdTests.test_timerfd_ns_poll�s������%rc��QoUQ*oUO[O2o]oUQ*o[OV4UQ5vqgUOU]2UOU]2[OV4UQ5vqgUOVu2UOVd2[OU2vqgUOVu2UOVd2UOVdUQ5P!)rxr4rOr]r|)	rBr�rTrrir=�timerfd_gettime_nsr�ra)r.rj�limit_errorr�r�rm�next_expiration_ns�interval_ns2s&       r�test_timerfd_ns_initval�$TimerfdTests.test_timerfd_ns_initval�s�����%��.��
�
 �
 ��!4�!4�
5��!"��%��-��,.�,A�,A�"�ny�,z�(������q�)����+�Q�/�,.�+@�+@��mx�+y�(������3����+�C�,.�+@�+@��+D�(������3����/�G����1�P[��\rc���QoUQ*oUO[O2oSoU]*o[OV4UQ5[O
U2vqgUO
Vu2UOVd2]o[O2o	[U2FD$o
UO
UOU2]2J&	[O2U	*
o	VEU]*
**oUOV�UO*
2[OUQ*U*U*2UO
UOU2U2P!)rxrOrqr|r4)rBr�rTrrir�r=r�r�rrJrcr�r_)r.rjr�r�r�rmr�r�rrtr�
total_time_nss&           r�test_timerfd_ns_interval�%TimerfdTests.test_timerfd_ns_intervals,����%��.��
�
 �
 ��!4�!4�
5��!0��%��*��
���b�+�V�,.�+@�+@��+D�(������3����/�G���� � �"���u��A����T�5�5�b�9�1�=��� � �"�Q�&��-�u�q�y�0I�I�
����1�d�.?�.?�?�@�	
�
�
�U�3�Y�+�-��?�@�����1�1�"�5�u�=rc��QoUQ*oUO[O2o[O[O2oSoVE*o]o[O
U[OVgQ5[OU2vq�UO[V�*
2U2UO[V�*
2U2[O2o
UOU2o[O2U
*
o
UOU]2UOV�UO*
2P!)rxrer|r4)rBr�rT�clock_gettime_nsrrirhr��
assertLess�absr�rJr=rcr�)r.rjr�r��now_ns�	offset_nsr�rmr�r�rtrzs&           r�!test_timerfd_ns_TFD_TIMER_ABSTIME�.TimerfdTests.test_timerfd_ns_TFD_TIMER_ABSTIME*s����%��.��
�
 �
 ��!4�!4�
5���&�&�t�':�':�;��$�	� &� 2����
���b��(<�(<�F[�r�,.�+@�+@��+D�(������L�6�7�+�F�����.�:�;�k�J�� � �"���1�1�"�5��� � �"�Q�&�������+����1�$�*;�*;�;�<rc	���QoUO[O[OQ5o[
O
U,U,U,]2vq4oUO
V4U1,,,12U]*oU]*o[OV&UQ5]o[O2o	[U2FDho
[
O
U,U,U,Vg*Q*2vq4oUO
V4U1U,,,12UO
UOU2]2Jj	[O2U	*
o	VgU]*
**oUOV�UO*
2P!)rxr�rOge��Ar|)
rBr�rTrr^r<r=rir�rrJrcr�)r.rjr�r=r>r?r�rmrrtrr�s&           r�test_timerfd_ns_select�#TimerfdTests.test_timerfd_ns_selectFsD����
�
 �
 ��!4�!4�B�O�O�
 �
L���
�
�r�d�R�D�2�$��:�
��#����#�C��2�r�2�,�7�!0�1� 4��%��*��
���b�+�V���� � �"���u��A�"�M�M�2�$���r�d�=R�=`�dg�<g�i�M�C�c����c��_��t�R��n�=����T�5�5�b�9�1�=��
� � �"�Q�&��-�u�q�y�0I�I�
����1�d�.?�.?�?�@rr%)rhr[r\rirVrsr�rBrJr[r`rrNr7r8r�rnrvr{r~r�r�r�r�r�r�r�rjrkrls@rrDrDs�����
���'�'�'�I��!�.�.�/�L��=�
b�*:�$�_�_�S�\�\�,�,�X�6�2�3�L�3�L�,>�87�4;�00 �d'�&�]�0>�>=�8A�ArrDc�4`�\sQsQsnQsQsQsQsUsP!)�OSErrorTestsi`c�(�QQ[2o,Um,Um[Od[OoL[O
oUOO
U2UOO
UU22[Od[OoL$[O[O
2oUOO
U2UOUO*Um
P!)c��\sQsQsQsP!)�OSErrorTests.setUp.<locals>.Stribr%�rhr[r\rirjr%rr�Strr�b���rr�)r,�bytes_filenames�unicode_filenamesrrbrrr��TESTFN_UNDECODABLErrl�	filenames)r.r��decoded�encodeds&   rru�OSErrorTests.setUpas���	�#�	� "���!#����'�'�3��2�2�G��&�&�G����%�%�g�.����%�%�c�'�l�3��'�'�3��2�2�G��k�k�)�"2�"2�3�G����#�#�G�,��-�-��0F�0F�F��rc�	�UO[O1UO[O1UO[O[O
1UO[O1UO[O1UO[O1UO[O1UO[OQ1UO[OQ1UO[OP1,
o[O2%c-UOUO[O Q12[#[Q2%c.UOUO[O$]]12[#[Q2%c.UOUO[O&]]12[#[Q2%c-UOUO[O(]12[#[Q2%c-UOUO[O*]12[#[Q2%c-UOUO[O,]12[#[Q2%c,UOUO[O.12[#[Q2%c-UOUO[O0Q12[#[Q	2%c�UO3UO[O41UO[O6Q
1UO[O8Q
Q1UO[O:Q
112[#[Q2%c-UOUO[O<Q12[#[Q
2%c,UOUO[O>12SFD/uq#oSFD#oUU,UN3UOAQU02J%	J1	P![Bc2oSOESOFS[IS22Po=JdPo=h[JcJuh9h)r	r�r��lchownr��chflags�lchflags�chrootr�r�r�suser�lchmodr|zNo exception thrown by )&r�rrBr�rxr�r;r�rsr�r�r�rXr�	can_chmodr�r�rr�r�r�r�r�r�r�r$r�r�r�r�r�r|r�rDrmr�r,�UnicodeDecodeError)r.�funcsr�r��	func_argsrrAs&      r�test_oserror_filename�"OSErrorTests.test_oserror_filenameus,��
�^�^�R�X�X�'�
�^�^�R�X�X�'�
�^�^�R�W�W�b�k�k�2�
�^�^�R�X�X�'�
�^�^�R�W�W�&�
�^�^�R�Y�Y�(�
�^�^�R�Z�Z�)�
�^�^�R�Y�Y��.�
�^�^�R�Z�Z��/�
�^�^�R�X�X�t�,�
����� � ��L�L�$�.�.�"�(�(�E�:�;��2�w����L�L�$�.�.�"�(�(�A�q�9�:��2�x� � ��L�L�$�.�.�"�)�)�Q��:�;��2�z�"�"��L�L�$�.�.�"�+�+�q�9�:��2�y�!�!��L�L�$�.�.�"�*�*�a�8�9��2�z�"�"��L�L�$�.�.�"�+�+�q�9�:��2�x� � ��L�L�$�.�.�"�)�)�5�6��2�v����L�L�$�.�.�"�'�'�5�9�:��2�{�#�#��L�L�������/�������k�:�������k�7�C��������=�	�
��2�x� � ��L�L�$�.�.�"�)�)�U�;�<��2�z�"�"��L�L�$�.�.�"�+�+�7�8�+0�'�I�i�!��@���*�	�*��I�I� 7��v�>�?�"�,1���A��M�M�#�,�,��c�$�i�@�@��)����s*�#R�	S�S�&S�S�S�Sc��[Oo[OO	UQ2oUO[[OU2UO[OU2[U2UO[[OU2UO[[1[OU2P!)�subdir)
rrrrr>r@r�rCrAr�rsr
�FileExistsErrorr)r.r�r�s&  r�
test_mkdir�OSErrorTests.test_mkdir�s����#�#�������h��1�����+�R�X�X�v�>����	�(�(�(�3��H�����/�2�8�8�X�>����-�/@�A��(�(�F�	,r)r�r�r�)	rhr[r\rirur�r�rjrkrls@rr�r�`s����G�(2@�h
,�
,rr�c�t`�\sQsQsnQsQsQs\O\	\
Q2Q2Q2sQsUs
P!)	�
CPUCountTestsi�c��UeUOQ2UOU[2UOU]2P!)N�&Could not determine the number of CPUs)r�r+r�rc�r.�cpuss&&r�check_cpu_count�CPUCountTests.check_cpu_count�s4���<��M�M�B�C����d�C�(����4��#rc�T�[O2oUOU2P!r!)r�	cpu_countr�r�s& r�test_cpu_count�CPUCountTests.test_cpu_count�s���|�|�~�����T�"rc��[O2oUOU[O22UO	U2P!r!)r�process_cpu_countr�r�r�r�s& r�test_process_cpu_count�$CPUCountTests.test_process_cpu_count�s4���#�#�%�����T�2�<�<�>�2����T�"r�sched_setaffinityz!don't have sched affinity supportc���[O2oUeUOQ2[O]2o[	U2]6:cUOQ[U202UO
[O][U22UO2[O]U2[O2oUOV1]*
2P!)Nr�z.sched_getaffinity() returns less than 2 CPUs: )rr�r��sched_getaffinityr9r2r�r�r�rZr=)r.�	affinity1r��	affinity2s&   r�test_process_cpu_count_affinity�-CPUCountTests.test_process_cpu_count_affinity�s����(�(�*�	����M�M�B�C��#�#�A�&���t�9��>��M�M�%�%+�D�\�N�4�
5�����,�,�a��d��<����
�
���Q��%��(�(�*�	������M�2rr%)rhr[r\rir�r�r�rrrrr�rjrkrls@rr�r��s@����$�#�#�
�����%8�9�<�>�3�>�3rr�c�`�\sQsQsnQs\O\PIQ2Q2s\O\PIQ2Q2s	\O\\Q2Q2Q2s
Q	sQ
s\O\\Q2Q2Q
2sQsQs\O\O(Q6HQ2Q2s\O\\Q2Q2Q2sQsUsP!)�FDInheritanceTestsi�c�`�[O[[O2oUO	[O
U2UO
[OU2P
2[OUP	2UO
[OU2P	2P!r�)	rrxrr�r�r{r=rrr�s& r�test_get_set_inheritable�+FDInheritanceTests.test_get_set_inheritable�sn��
�W�W�X�r�{�{�
+��������"�%�����+�+�B�/��7�
���2�t�$�����+�+�B�/��6rz
need fcntlc��[O[[O2oUO	[O
U2UO
[OU2P
2[OU[O2oU[O&*o[OU[OU2UO
[OU2P	2P!r�)rrxrr�r�r{r=r�fcntl�F_GETFD�
FD_CLOEXEC�F_SETFD)r.r�r�s&  r�test_get_inheritable_cloexec�/FDInheritanceTests.test_get_inheritable_cloexec�s���
�W�W�X�r�{�{�
+��������"�%�����+�+�B�/��7����B��
�
�.��
�%�"�"�"�"��
���B��
�
�u�-�����+�+�B�/��6rc��[O[[O2oUO	[O
U2UO
[OU[O2[O*[O2[OUP	2UO
[OU[O2[O*]2P!r)rrxrr�r�r{r=r�r�r�rr�s& r�test_set_inheritable_cloexec�/FDInheritanceTests.test_set_inheritable_cloexec�s���
�W�W�X�r�{�{�
+��������"�%�������R����7�%�:J�:J�J��)�)�	+�	���2�t�$�������R����7�%�:J�:J�J��	r�O_PATHzneed os.O_PATHc���[O[[O2oUO	[O
U2UO
[OU2P
2[OUP	2UO
[OU2P	2[OUP
2UO
[OU2P
2P!r�)	rrxrr�r�r{r=rrr�s& r�test_get_set_inheritable_o_path�2FDInheritanceTests.test_get_set_inheritable_o_path�s���
�W�W�X�r�y�y�
)��������"�%�����+�+�B�/��7�
���2�t�$�����+�+�B�/��6�
���2�u�%�����+�+�B�/��7rc�J�[O2oUO[29^tt^2o[O
U2PPP2UO
WOO[O2UO[29^tt^2o[OUP	2PPP2UO
UOO[O2UO[29^tt^2o[OUP
2PPP2UO
UOO[O2P!)%fhCK)9h)%fhK�9h)%fhKm9hr!)rr�r�rDrrr=r.rEr/r)r.r�r0s&  r�test_get_set_inheritable_badf�0FDInheritanceTests.test_get_set_inheritable_badfs���
�
"�
"�
$��
�
�
�w�
'�
'�3����r�"�(�������,�,�e�k�k�:�
�
�
�w�
'�
'�3����r�4�(�(�������,�,�e�k�k�:�
�
�
�w�
'�
'�3����r�5�)�(�������,�,�e�k�k�:�(�
'�
'��(�
'��(�
'�s5�E+�$E?�F�+E<	�4E<	�?F	�F	�F"	�F"	c���[O[[O2oUO	[O
U2UO
[OU2P
2P!r�)rrxrr�r�r{r=rr�s& rrs�FDInheritanceTests.test_opensC��
�W�W�X�r�{�{�
+��������"�%�����+�+�B�/��7rr�zneed os.pipe()c�N�[O2vqUO[OU2UO[OU2UO	[O
U2P
2UO	[O
U2P
2P!r�)rr�r�r{r=r)r.r=r>s&  r�	test_pipe�FDInheritanceTests.test_pipesi���7�7�9���������#�&�������#�&�����+�+�C�0�%�8�����+�+�C�0�%�8rc�R�[O[[O2oUO	[O
U2[OU2oUO	[O
U2UO[OU2P
2P!r�)	rrxrr�r�r{r�r=r�r.�fd1r�s&  r�test_dup�FDInheritanceTests.test_dup'sb���g�g�h����,��������#�&��f�f�S�k��������#�&�����+�+�C�0�%�8rc��[O]2oUO[OU2UO	U]2P!r_)rr�r�r{rcr�s& r�test_dup_standard_stream�+FDInheritanceTests.test_dup_standard_stream/s1��
�V�V�A�Y��������"�%����2�q�!rr�r�c�H�[OQ[O2oUO[OU2[O
U2oUO[OU2UO
[OU22P!)�NUL)rrxr�r�r{r�r�rr	s&  r�test_dup_nul�FDInheritanceTests.test_dup_nul4sb���g�g�e�R�[�[�)��������#�&��f�f�S�k��������#�&�����+�+�C�0�1rr�zneed os.dup2()c���[O[[O2oUO	[O
U2[O[[O2oUO	[O
U2UO
[OV2U2UO[OU22[O[[O2oUO	[O
U2UO
[OVP
Q5U2UO[OU22P!)F)�inheritable)rrxrr�r�r{r=r�r|rr�)r.r�r��fd3s&   rr��FDInheritanceTests.test_dup2=s���
�W�W�X�r�{�{�
+��������"�%��g�g�h����,��������#�&��������)�3�/�����*�*�3�/�0��g�g�h����,��������#�&��������e�<�c�B�����+�+�C�0�1rr%)rhr[r\rir�rrNr�r�r�rrrr�r�rsr	r	r	r7r8r	r�rjrkrls@rr�r��s����7��_�_�U�d�]�L�1�
7�2�
7��_�_�U�d�]�L�1��2�������X�.�0@�A�	8�B�	8�
;�8�
�����V�,�.>�?�9�@�9�9�"�
�������0�2G�H�2�I�2������V�,�.>�?�2�@�2rr��openptyzneed os.openpty()c��`�\sQsQsnQsQs\O\\	Q2Q2\O\\	Q2Q2\O\\	Q2Q	2Q
222s
\O\\	Q2Q2\O\\	Q
2Q2\O\\	Q2Q2\O\\	Q2Q2\O\\	Q2Q2\O\\	Q2Q	2Q222222s\O2\O\\	Q2Q2\O2Q222sQsUsP!)�PseudoterminalTestsiNc��[O2vqUO[OU2UO[OU2V1!)z/Open a pty fd-pair, and schedule cleanup for it)rr	r�r{�r.�main_fd�	second_fds&  r�open_pty�PseudoterminalTests.open_ptyPs=���Z�Z�\���������'�*�������)�,��!�!rc���UO2vqUO[OU2P
2UO[OU2P
2P!r�)r	r=rrr	s&  r�test_openpty� PseudoterminalTests.test_openptyWsF��!�]�]�_�������+�+�G�4�e�<�����+�+�I�6��>r�ptsnamezneed os.ptsname()rzzneed os.O_RDWR�O_NOCTTYzneed os.O_NOCTTYc��UO2vq[OU2o[OU[O[O
*2oUO
[OU2[OUQ2UO[OU]2Q2P!)r�)r	rr	rxrzr	r�r{r�r=r�)r.r	r	�second_path�reopened_second_fds&    r�test_open_via_ptsname�)PseudoterminalTests.test_open_via_ptsname\s{��"�]�]�_����j�j��)���W�W�[�"�)�)�B�K�K�2G�H��������"4�5�
���#�V�,��������!�,�f�5r�posix_openptzneed os.posix_openpt()�grantptzneed os.grantpt()�unlockptzneed os.unlockpt()c�n�[O[O[O*2oUO	[O
U2[OU2[OU2[OU2o[OU[O[O*2oUO	[O
U2[OOQ2%Cc!]PH6oQoQo[O
[OQ[O[O*22P	oUO V5Q2UO V5Q2U%f�[O"]2[O$26Xcl[&O&[&O([&O*2oUO V62[&O&[&O(U2UO-[OU2[O.U22P![cP
oCKh9h[&O&[&O(S2h9h)r�iSiqtz/dev/ttysptemsldterm)rr%	rzr	r�r{r&	r'	r	rxr7r8r�r�r�rD�ioctl�getsidr�r��SIGHUP�SIG_IGNr=r)	r.�	mother_fd�son_path�son_fdr��I_PUSH�	TIOCNOTTY�had_ctty�old_handlers	&        r�test_posix_pty_functions�,PseudoterminalTests.test_posix_pty_functionsgs����O�O�B�I�I�b�k�k�$9�:�	�������)�,�
�
�
�9��
���I���:�:�i�(������2�9�9�R�[�[�#8�9��������&�)��<�<�"�"�7�+�+���F��I�
!��������R�[�[����-D�E�F���
�K�K��	�2��K�K���4���	�	�!���	�	�� ;�%�m�m�F�M�M�6�>�>�J��>��K�K��2��M�M�&�-�-��=�������I�.��
�
�6�0B�C���
!� ��
!���M�M�&�-�-��=�s%�&AI9�J
�9	J
�J
�	J
�
'J4r	zneed os.spawnl()c���[O2vqUO[OU2UO[OU2[O
QUQ02o[OoUO[O[O2[UQ29^tt^2o[V5PQ5PPP2[OoVd,o[OQ6XcQU]*7cQU]*Q0U]$[O[OU,UN3oUO!U]2P!)%fhK�9h)z�
            import errno
            import os
            import test.support
            try:
                import msvcrt
            except ImportError:
                msvcrt = None

            fd = aA

            with test.support.SuppressCrashReport():
                if msvcrt is not None:
                    try:
                        handle = msvcrt.get_osfhandle(fd)
                    except OSError as exc:
                        if exc.errno != errno.EBADF:
                            raise
                        # get_osfhandle(fd) failed with EBADF as expected
                    else:
                        raise Exception("get_osfhandle() must fail")

                try:
                    fd3 = os.dup(fd)
                except OSError as exc:
                    if exc.errno != errno.EBADF:
                        raise
                    # os.dup(fd) failed with EBADF as expected
                else:
                    os.close(fd3)
                    raise Exception("dup must fail")
        r�)r�endr�r�r�)rr�r�r{�textwrap�dedentrrrrsrxrIr7r�rr	rr=)	r.r�r�r�r�r�r��cmdr�s	&        r�test_pipe_spawnl�$PseudoterminalTests.test_pipe_spawnl�s���'�'�)���������"�%�������#�&����	$���	� �
��B�#�#�����	�(�(�)�*:�*:�;�
�(�C�
 �
 �B��$�R�(�!��^�^�
��$��
�7�7�d�?�s�c�!�f�}���Q����]�C��F��9�9�R�Y�Y�
�9�S�9������1�%�!�
 �s�E�E-	�&E-	r%)rhr[r\rir	r	rrrrr#	r4	rr�rr�r;	rjrkrls@rr	r	Ns�����"�?�
�����Y�/�1D�E�
�����X�.�0@�A�
�����Z�0�2D�E�6�F�B�F�6������^�4�6N�O�
�����Y�/�1D�E�
�����Z�0�2F�G�
�����Y�/�1D�E�
�����X�.�0@�A�
�����Z�0�2D�E�D�F�B�F�H�F�P�D�@�?�?�A�
�����X�.�0B�C�� � �"�7&�#�D�B�7&rr	c
�`�\sQsQsnQQ	QP
\O
1P1Q
QQP
\O1\\QP21,sQs	Qs
QsUsP!)�PathTConverterTestsi�r}rxr{c
��[Oo[OQ6XcP9q#L/[O[O2o[U2o[O[U2[O[O*2oUO[O[O2UO[OU2[U2o[U2oUOFCDvqxq�UOUQ59^tt^2[[U2oVUU1FDCoUeJ	UOV|Q59^tt^2UU,U	N3o
U
d	U
U
2PPP2JE	UO!["Q29^tt^2UU,U	N3PPP2U%cUU,U	N3o
U
d	U
U
2L2UO!["Q29^tt^2UU,U	N3PPP2PPP2CJ	P![cPPP2CJ*h9h)%fhCJ9h)%fhK�9h)%fhKb9h)%fhCJ{9h)r�r)rr>zto return str or byteszos.PathLike)rrrrrrlrrxr�ryr�rsr{�	functionsr�r`r�r
r�)r.�str_filename�bytes_fspath�bytes_filenamer��
int_fspath�
str_fspathr�allow_fd�
extra_args�
cleanup_fnr^r>rbs&             r�test_path_t_converter�)PathTConverterTests.test_path_t_converter�s��� �'�'��
�7�7�d�?�,0�0�L�>��[�[��)9�)9�:�N�#�N�3�L�
�W�W�X�l�+�R�[�[����-C�
D�����	�(�(�)�*:�*:�;�������"�%��b�\�
��l�+�
�6:�n�n�2�D�J����4��(�(�� ��T�*�B�*�:�)�+�D��|� ����4��;�;�!#�D�!6�:�!6��%�1�&�v�.�<�;�	+��+�+�!�#;�=�=��z�/�J�/�=����0�Z�0�F�!�-�"�6�*���/�/�%�)�+�+��2�+�
�+�+�1)�(�7E��&���	)�(���<�;�;��
=�=��+�+��1)�(�(�s��/I7	�1H!�I7	�I7	�*H<�:H<�*I7	�,I
�8I7	�I7	�'I7	�>I$
�
I7	�!	H9�+H9�,I7	�8H9�9I7	�<I�I�
I7	�I!�I!�I7	�$I4�-I4�/I7	�7J	
�J	
c�^�QoUO[UQ*29^tt^2[O[	]22PPP2UO[UQ*29^tt^2[O[	Q22PPP2UO[UQ*29^tt^2[O[	[222PPP2P!)%fhK�9h)%fhKz9h)%fhP!9h)z-__fspath__\(\) to return str or bytes, not %sr�r�g���Q�@�object)r
r�rr�rrL	)r.r_s& r�&test_path_t_converter_and_custom_class�:PathTConverterTests.test_path_t_converter_and_custom_classs���>��
�
#�
#�I�s�V�|�
<�
<��G�G�H�Q�K� �=�
�
#�
#�I�s�X�~�
>�
>��G�G�H�T�N�#�?�
�
#�
#�I�s�Y��
?�
?��G�G�H�V�X�&�'�@�
?�	=�
<��
>�
>��
?�
?�
?�s5� C5�6 D�(D�5D	�>D	�D	�D	�D,	�$D,	r%)r�Tr%N)r�Fr%N)r�Fr�N)r�Fr�N)
rhr[r\rir�F_OKr�r`r@	rI	rM	rjrkrls@rr>	r>	�sW����	!�"�	�5�2�7�7�*�d�+�&�'�	��������G�T�(B�C�
�I�*,�X(�(rr>	r�r�zCannot unset blocking flagz'Windows only supports blocking on pipesc�(`�\sQsQsnQsQsUsP!)�
BlockingTestsic���[O[[O2oUO	[O
U2UO
[OU2P	2[OUP
2UO
[OU2P
2[OUP	2UO
[OU2P	2P!r)	rrxrr�r�r{r=r�r�r�s& rr�BlockingTests.test_blockings���
�W�W�X�r�{�{�
+��������"�%��������,�d�3�
����E�"��������,�e�4�
����D�!��������,�d�3rr%)rhr[r\rirrjrkrls@rrQ	rQ	s����
	4�	4rrQ	c�(`�\sQsQsnQsQsUsP!)�ExportsTestsic��UOQ[O2UOQ[O2P!)rxr�)rr�__all__rts&r�test_os_all�ExportsTests.test_os_alls&���
�
�f�b�j�j�)��
�
�f�b�j�j�)rr%)rhr[r\rirX	rjrkrls@rrU	rU	s����*�*rrU	c�4`�\sQsQsnQsQsQsQsUsP!)�TestDirEntryi$c��[OO[O2UmUO[OUO2[OUO2P!r!)rr>�realpathrrrr�rQrArts&rru�TestDirEntry.setUp%sF���G�G�$�$�Y�%5�%5�6��	����	�(�(�$�)�)�4�
������rc�P�UO[[O2P!r!)r�r�r�DirEntryrts&r�test_uninstantiable� TestDirEntry.test_uninstantiable*s�����)�R�[�[�1rc��[[OOUOQ2Q2o[OUO2Tt,tFDp"MJ	toO2oUO
U[O2UOUOQ2]PH*oUO[UOV!2P!ttoh)r��python)r
rr>r@r�rZr+r`	r=rr�r�r�r�)r.r��entryr�s&   r�test_unpickable�TestDirEntry.test_unpickable-s����r�w�w�|�|�D�I�I�z�B�I�N��$&�J�J�t�y�y�$9�:�$9�5��$9�:�>�>�@�����e�R�[�[�1�������Z�0�����)�V�\�\�5�C��	;s�C)r>)	rhr[r\rirura	rf	rjrkrls@rr[	r[	$s�����
2�D�Drr[	c�`�\sQsQsn\O
sQsQ&QksQsQs	Qs
QsQsQ	s
\O\O"Q
6gQ2Q2sQ
sQ&QksQs\O\O"Q
6gQ2Q2sQsQsQsQsQsQsQsQs\O>\ OB\ OD7Q2Q2s#\O\$OJQ2Q2s&Qs'Qs(Q s)Q!s*Q"s+Q#s,Q$s-Q%s.Us/P!)'�TestScandiri6c�J�[OO[O2Um[O
UO2UmUO[OUO2[OUO2P!r!)
rr>r]	rrrrl�
bytes_pathr�rQrArts&rru�TestScandir.setUp9sZ���G�G�$�$�Y�%5�%5�6��	��+�+�d�i�i�0������	�(�(�$�)�)�4�
������rc��[U[2%c
UOLUOo[OOV!2o[
UQ2U!)rd	)r�rUrk	r>rr@r
)r.rr>r�s&&  rr
�TestScandir.create_file?s>��",�T�5�"9�"9�t���t�y�y���7�7�<�<��+���H�i�(��rc��[Q[OUO222oUO	[UO
22U2U!)c3�J�SF �DoUOU1w�	J	P!3hr!r�r�re	s& rr��*TestScandir.get_entries.<locals>.<genexpr>Fs��$9���$9�5��
�
�E�*�$9�s�#)r�rr�r>r=r2�keys)r.rc�entriess&& r�get_entries�TestScandir.get_entriesEsF���;�$&�J�J�t�y�y�$9�;�;����������/��7��rc	��U%c_[U2FDLoUOQ2%fJUQ7cJ%UO[V2[V$2VU12JN	P!UOV2P!)r�)�st_dev�st_ino�st_nlinkrv�st_ctime_ns)r�r�r=r`)r.�stat1�stat2�skip_fieldsr�s&&&& r�assert_stat_equal�TestScandir.assert_stat_equalKsj����E�
�����u�-�-���+�+��� � ���!5�!(��!5�"'��!5�7�
#�
���U�*rc��[OUO2oUO[[U22UO
2P!r!)rr�r>r�r�r�r{)r.�scandir_iters& rra	�TestScandir.test_uninstantiableYs5���z�z�$�)�)�,�����)�T�,�%7�8����rc���UOQ2o[OUO2o]PHoUO[UOV!2UO2P!�r�)	r
rr�r>r�r�r�r�r{)r.r�r�	r�s&   rrf	�TestScandir.test_unpickable^sI���#�#�J�/���z�z�$�)�)�,������)�V�\�\�<�J����rc��UOU[O2UOUOU2UOUO
[O
O
UO
U22UOUO2[OUO
P
Q5O2[OUO
2oUOUO2[OUO22UOUO2[OUO22UOUO2[O
O!UO
22[OUO
P
Q5oUOUOP
Q5[OUO22UOUOP
Q5[OUO22UOUO#2[O
O%UO
22SO'UO2S[OQ6H9%cU%(2UO'UOP
Q5U[OQ6H2P!)Fr�r�)r+rr`	r=rr>r@�inoder�ry	�is_dir�S_ISDIRr��is_file�S_ISREG�
is_symlink�islink�is_junction�
isjunctionr	)r.re	rr�	r�	r�	�
entry_stat�entry_lstats&&&&&&  r�check_entry�TestScandir.check_entryes	�����e�R�[�[�1�������T�*�������R�W�W�\�\�$�)�)�T�%B�C��������������U�C�J�J�	L��W�W�U�Z�Z�(�
�����������j�&8�&8�9�	;�����������j�&8�&8�9�	;�����)�)�+�������
�
�3�	5��g�g�e�j�j�%�@��������e��<����k�&9�&9�:�	<�������u��=����k�&9�&9�:�	<�	
����*�*�,�b�g�g�.@�.@����.L�M����u�z�z�|�)�!�w�w�$��A�A�z�>�	C�	
���u�z�z�%�z�@�*�!�w�w�$��	0rc���[O2o[O2o[OOUOQ2o[OU2UOQ2oU%cA[OU[OOUOQ22U%c�[OU[OOUOQ2P	Q5[OU[OOUOQ22QQ,oU%cUOQ2U%cUOQ2UOU2oUQ*oUOUQP	P
P
2UQ*oUOUQP
P	P
2U%cUQ*oUOUQP
P	P
2U%c?UQ*oUOUQP	P
P	2UQ*oUOUQP
P	P	2P!P![c$oSOQS*2Po=CK�Po=hh9h)r�r�z
link_file.txtr!�symlink_dir)r
�symlink_file.txt)r�	r�	)r�can_hardlinkr�rr>r@rAr
r�r�r�rr�r$ru	r�	)	r.r�rrLr�r!rcrt	re	s	&        r�test_attributes�TestScandir.test_attributes�s����%�%�'���'�'�)���'�'�,�,�t�y�y�%�0��
������#�#�J�/���
3�����"�'�'�,�,�t�y�y�/�"J�K���J�J�w������T�Y�Y�
� F�+/�
1��J�J�x������d�i�i�9K�!L�M��
�#����L�L��)���L�L�<�=��"�"�5�)�����������t�U�E�:��
�#������
�E�4��?���O�,�E����U�O�U�D�%�H���M�*�E����U�M�4���E��.�/�E����U�$6��t�T�J���1#�
3��
�
�o��1�2�2��
3�s�?H>�>	I,�I,�	I'�'I,r�z/Can only test junctions with creation on win32.c��[OOUOQ2o[OU2]PHoUOU[OOUOQ22UOQQ,2oUOUQ*O2P	2UOUQ*O2P
2P![c[OQ2gh9h)�tgtdir�srcjuncz!creating the test junction failed)rr>r@rA�_winapi�CreateJunctionrDrr�ru	r=r�	)r.rLr�	rt	s&   r�test_attributes_junctions�%TestScandir.test_attributes_junctions�s����'�'�,�,�t�y�y�(�3��
������	I��"�"�7�B�G�G�L�L����I�,N�O��"�"�I�x�#8�9�������+�7�7�9�4�@������*�6�6�8�%�@���	I��#�#�$G�H�H�	I�s�:C$�$	D�.Dc�"�[U[2%c
UOLUOo[	[
OU22oUO[U2]2U]*oUOUOU2U!r_)
r�rUrk	r>r�rr�r=r9r)r.rr>rt	re	s&&   r�	get_entry�TestScandir.get_entry�sf��",�T�5�"9�"9�t���t�y�y���r�z�z�$�'�(������W��q�)���
��������T�*��rc��UOUQ5oUO[OO	U22!)r)r
r�	rr>�basename)r.rr�s&& r�create_file_entry�TestScandir.create_file_entry�s3���#�#��#�.���~�~�b�g�g�.�.�x�8�9�9rc���UO2o[O2o[OUO2[Q[O222oUO[UO22[OOU2,2[OU2P![OS2h9h)c3�H�SF �DpOU1w�	J	P!3hr!rrq	s& rr��5TestScandir.test_current_directory.<locals>.<genexpr>�s��L���L�5�J�J��.�L�s�")r
rr*rBr>r�r�r=r2rs	r�	)r.r��old_dirrt	s&   r�test_current_directory�"TestScandir.test_current_directory�s����#�#�%���)�)�+��		��H�H�T�Y�Y���I�B�J�J�L�I�I�G����V�G�L�L�N�3� �g�g�.�.�x�8�9�
;�
�H�H�W���B�H�H�W��s�BC�C#zWin32 specific testc	�p�]PHoUOQ2oUOQ*oUO[OOU22[OU2[UQ*Q29^tt^2oUOUO2Q2PPP2UO[OU2Q,2[OU29^tt^2oSOSTt,tFDpfOMJ	toQ,2PPP2[UOU2O22oSOSTt,tFDpfOMJ	toQ,2=QU*oUO![OOU22UO#[$[OU2UO#[$[OU2P!)%fhCKe9httoh)%fhCK9httoh)rr�r�r�rd	r�)�pathlibr
r>r|rr�r�rxr=r�r�r�rr��Path�iterdirr�r�rC)	r.r�	r�r>rrt	re	�pathlib_entries�
extended_paths	&        r� test_windows_trailing_space_path�,TestScandir.test_windows_trailing_space_path�s�����#�#�J�/���y�y�3�����������t�,�-�
����
�
�(�S�.�$�
'�
'�4����T�Y�Y�[�)�4�(�	
������D�)�J�<�8�
�Z�Z��
�
�����g�>�g�U�j�j�g�>���M���w�|�|�D�1�9�9�;�<�����/�B�/��*�*�/�B�Z�L�Q��!�D�(�
���������
�6�7����+�R�Z�Z��G����+�R�Z�Z��G�(�
'�
'��
?��
�
��Cs<�	!H�7H�H�	H�#H3�H	�H	�H�H0	�(H0	c�^�UO2oUO[U2Q2P!)z<DirEntry 'file.txt'>)r�	r=r-�r.re	s& r�	test_repr�TestScandir.test_repr�s%���&�&�(������e��&=�>rc���UO2oUO[OU2[OOUOQ22P!r�	)r�	r=r�fspathr>r@r�	s& r�test_fspath_protocol� TestScandir.test_fspath_protocol�s<���&�&�(��������5�)�2�7�7�<�<��	�	�:�+N�Orc�L�[OQ2oUOUQ5o[OU2oUO	U[
2UO
U[OO[OUO2U22P!)z
bytesfile.txtr)	rrlr�	r�	r+rUr=r>r@)r.rC	�bytes_entryr�	s&   r�test_fspath_protocol_bytes�&TestScandir.test_fspath_protocol_bytes�sq�����_�5���,�,�.�,�A�����;�'�����f�e�,����������b�k�k�$�)�)�&<�^�L�	Nrc�0�[OOUOQ2o[OU2UO	Q2o[O
U2[OQ6Xc UOUO22UOUO22UOUO22[OQ6XcEUO[UO2UO2UOP
Q5P!UO!UO2]2UO[UO2UO[UOP
Q5P!)r�r�r�)rr>r@rAr�	r;rr|r�	r�r�	r�	r�rCr�	r�rc)r.r>re	s&  r�test_removed_dir�TestScandir.test_removed_dir�s���w�w�|�|�D�I�I�u�-��
��������u�%��
������7�7�d�?��O�O�E�L�L�N�+��������)�����)�)�+�,�
�7�7�d�?����/����=��J�J�L��J�J�u�J�-����u�{�{�}�a�0����/����<����/����U��Src���UO2o[OUO2UO	UO22[OQ6Xc UOUO22UO	UO22[OQ6XcEUO[UO2UO2UOP
Q5P!UOUO2]2UO[UO2UO[UOP
Q5P!)r�r�)r�	rrsr>r�r�	rr|r�	r�	r�rCr�	r�rcr�	s& r�test_removed_file�TestScandir.test_removed_files����&�&�(��
�	�	�%�*�*���������(�
�7�7�d�?��O�O�E�M�M�O�,�����)�)�+�,�
�7�7�d�?����/����=��J�J�L��J�J�u�J�-����u�{�{�}�a�0����/����<����/����U��Src�F�[O2%fUOQ2!UOQ2o[O
U[OOUOQ22UOQQ,2oUQ*o[OU2UOUO2]2UOUO22UOUO22UOUOP
Q52UOUOP
Q52UOUO!22UO#[$UO&2UO'P
Q5P!)zcannot create symbolic linkr�zsymlink.txtr�)rr�r�r
rrr>r@ru	rsrcr�	r�r�	r�	r|r�	r�rCr�)r.r�rt	re	s&   r�test_broken_symlink�TestScandir.test_broken_symlink's(���$�$�&�&��=�=�!>�?�?��#�#�J�/��
�
�
�8��7�7�<�<��	�	�=�9�	;��"�"�J�
�#>�?���
�&��
�	�	�(�����5�;�;�=�!�,��������(��������)�������e��<�=�������u��=�>�����(�(�*�+����+�U�Z�Z�8�
�
�
�5�
�)rc	���UOQ2[OUO2o[	[O
U22oUO
[U2]U2U]*oUO
UOQ2UO
UO[O[OOUOQ222P!)r�sfile.txt)
r
rrlr>r�r�r=r9rr@)r.�
path_bytesrt	re	s&   rr��TestScandir.test_bytes<s�������$��[�[����+�
��r�z�z�*�-�.������W��q�'�2���
��������[�1����������R�W�W�\�\�$�)�)�Z�%H�I�	Krc	�>�UOQ2[[1FDeoU[OUO
22oUO
[29^tt^2[OU2PPP2Jg	P!)%fhJ|9hr�	)	r
r�r�rrlr>r�r�r�)r.r�r�	s&  r�test_bytes_like�TestScandir.test_bytes_likeHse������$��j�(�C��R�[�[����3�4�J��"�"�9�-�-��
�
�:�&�.�-�)�-�-�-�s�&B	�B
�B
z.fd support for listdir required for this test.c
��UO[O[O2UO	Q2Q,o[
O2%cQ[OQ[OOUOQ22UOQ2[
OUO29^tt^2o[OU29^tt^2o[U2oPPP2WTt,tFDpUOMJ	ooUO[U2U2UOU[O U22SFCD3oUOUOUO2UO[O"U2UO2UOUO%2UOQ6H2[O&[O(7fJ�[O&UOUQ5oUOUO'2U2[O&UOUP
Q5oUOUO'P
Q5U2CJ6	PPP2P!)%fhCK�9httoh)%fhP!9h)r�r�r�)rr�r�)rrr�r�r
rr�rr>r@r�r�r�rr=r2r�r�	r�	r�r�)r.�expected_namesr�rrt	re	rcrTs&       r�test_fd�TestScandir.test_fdPs���	
�
�
�b�j�j�"�.�.�1�����$�$���� � �"�"��J�J�z�2�7�7�<�<��	�	�6�#B�C��!�!�&�)�
�
"�
"�4�9�9�
-�
-�����B���2��r�(�� �-4�5�W�E�Z�Z�W�E�5����V�E�]�N�;����U�B�J�J�r�N�3� ��� � ����U�Z�Z�8�� � ����5�!1�5�:�:�>�� � ��!1�!1�!3�U�Z�Z�6�5I�J��7�7�b�0�0�0�������B�7�B��$�$�U�Z�Z�\�2�6�������B��N�B��$�$�U�Z�Z��Z�%F��K�!�
.�
-�����5�.�
-�
-�sD�K�6J+	�K�
J?�#C-K�BK�+J<
�4J<
�6K�K	�
K	zWASI maps '' to cwdc�R�UO[[OP2P!r;)r�rCrr�rts&r�test_empty_path�TestScandir.test_empty_pathjs�����+�R�Z�Z��<rc��UOQ2[OUO2o[	U2oUO[
U2]U2[	U2oUO[
U2]U2P!r�	)r
rr�r>r�r=r9)r.rvrt	�entries2s&   r�test_consume_iterator_twice�'TestScandir.test_consume_iterator_twicensb������$��:�:�d�i�i�(���x�.������W��q�'�2���>������X���8�4rc�l�Q-,1FD(oUO[[OU2J*	P!)gX9��v��?)r�r�rr�)r.r]s& r�test_bad_path_type�TestScandir.test_bad_path_typeys(���2�r�?�C����i����S�9�#rc�N�UOQ2UOQ2[OUO2o[	U2UO2UO2UO
29^tt^2=PPP2P!)%fhP!9h�r�z	file2.txt)r
rr�r>rr{�check_no_resource_warning�r.rvs& r�
test_close�TestScandir.test_close}sl������$�����%��:�:�d�i�i�(���X����������
�
+�
+�
-�
-��.�
-�
-�
-�s�B�B$	�B$	c�V�UOQ2UOQ2[OUO29^tt^2o[	U2PPP2UO29^tt^2=PPP2P!)%fhK49h)%fhP!9hr�	)r
rr�r>rr�	r�	s& r�test_context_manager� TestScandir.test_context_manager�sl������$�����%�
�Z�Z��	�	�
"�
"�h���N�#�
�
+�
+�
-�
-��.�
-�#�
"��
-�
-�
-�s$�B�8B�B	�
B	�B(	� B(	c��UOQ2UOQ2[OUO29^tt^2o[	U2UO2PPP2P!)%fhP!9hr�	)r
rr�r>rr{r�	s& r�test_context_manager_close�&TestScandir.test_context_manager_close�sS������$�����%�
�Z�Z��	�	�
"�
"�h���N��N�N��#�
"�
"�
"�s�A2�2B	�;B	c	���UOQ2UOQ2UO[29^tt^2[OUO
29^tt^2o[
U2]]*PPP2PPP2UO29^tt^2=PPP2P!)%fhK<9h)%fhKG9h)%fhP!9hr�	)r
r��ZeroDivisionErrorrr�r>rr�	r�	s& r�test_context_manager_exception�*TestScandir.test_context_manager_exception�s�������$�����%�
�
�
�0�
1�
1����D�I�I�&�&�(��X���!��'�2��
+�
+�
-�
-��.�
-�'�&��2�
1��.�
-�
-�sB�)C�*B3	�?C�'C�3C
�<C
�>C�C	�C	�C*	�"C*	c��UOQ2UOQ2[OUO2o[	U2UO[29^tt^2=[O2PPP2[OUO2o[U2UO29^tt^2=PPP2P!)%fhK_9h)%fhP!9hr�	)r
rr�r>r�assertWarns�ResourceWarningr�
gc_collectr�r�	r�	s& r�test_resource_warning�!TestScandir.test_resource_warning�s�������$�����%��:�:�d�i�i�(���X��
�
�
�o�
.�
.����� �/��:�:�d�i�i�(���X��
�
+�
+�
-�
-��.�
-�
/�
.��.�
-�
-�s$�,C�C-�C*	�#C*	�-C>	�6C>	)rk	r>r�	)0rhr[r\rirr�	rur
ru	r	ra	rf	r�	r�	rrNr7r8r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�r�	rrr�r�r�	rrOr�	r�	r�	r�	r�	r�	r�	r�	rjrkrls@rri	ri	6sP���� /� I� I�����+��
�0�<'K�R�_�_�S�\�\�W�,�._�`�A�a�A��:���_�_�S�\�\�W�,�.C�D�H�E�H�.?�P�N�T�,T�&*�*
K�'�������r�~�~�5�I�K�L�K�L�0�_�_�W�_�_�&;�<�=�=�=�	5�:�	�����rri	c�`�\sQsQsn\\O2sQsQsQs	Qs
QsQsQs
Q	sQ
sQsQsQ
sUsP!)�
TestPEP519i�c�\�QFD#oUOVOU22J%	P!)r)rsgoodbyessome/path/and/file�r=r�	)r.r�s& r�test_return_bytes�TestPEP519.test_return_bytes�s"��<�A����Q���A��/�=rc�\�QFD#oUOVOU22J%	P!)�hello)r�	�goodbyezsome/path/and/filer�	)r.r�s& r�test_return_string�TestPEP519.test_return_string�s"��9�A����Q���A��/�:rc�
�QFDzo[U2oUOVOU22UOQ[OU22UOQ[O
U22J|	P!)�path/like/object�path/like/object)r
r
)rr=r�	rrlrV)r.r��pathlikes&  r�test_fsencode_fsdecode�!TestPEP519.test_fsencode_fsdecode�s`��8�A���{�H����Q���H� 5�6����0�"�+�+�h�2G�H����/����X�1F�G�9rc��UOQUO[Q222UO[[O
2UO
[Q2[O
2P!)z#feelthegilrn)r=r�	r�assertIsSubclassr�PathLiker+rts&rr��TestPEP519.test_pathlike�sL���������H�]�4K�(L�M����h����4����h�s�m�R�[�[�9rc��[QQ-2o[[[U21FD$oUO[UO
U2J&	P!)�blahr%)r�r�rr�r�r�	)r.�vapor�os&  r�test_garbage_in_exception_out�(TestPEP519.test_garbage_in_exception_out�s;���V�R��$���d�B���'�A����i����a�8�(rc�H�UO[UO2P!r!)r�r�r�	rts&r�test_argument_required�!TestPEP519.test_argument_required�s�����)�T�[�[�1rc�4�UO[UO[]*22[	QQ-2o]UmUO[UOU22UO[UO[[
222P!)�*�foor%)r�r�r�	rr�rGr�	)r.�cs& r�test_bad_pathlike�TestPEP519.test_bad_pathlike�sl�����)�T�[�[�(�2�,�?����B���������)�T�[�[�!�#�6����+�T�[�[�"�#4�#6�7�	9rc��QQ[O2oUO[U2UO	[[O2P!)c��\sQsQsQsP!)�0TestPEP519.test_pathlike_subclasshook.<locals>.Ai�r%r�r%rr�Ar
�r�rr
)rr	
�assertNotIsSubclassrr
�r.r
s& r�test_pathlike_subclasshook�%TestPEP519.test_pathlike_subclasshook�s6��	����	�� � ��1�-����h����4rc�z�UO[O[*[O
2P!r!)r+rr	
rU�types�GenericAliasrts&r�test_pathlike_class_getitem�&TestPEP519.test_pathlike_class_getitem�s!�����b�k�k�%�0�%�2D�2D�Erc�h�QQ[O2oUOU2Q2P!)c�,`�\sQsQsnQsQsQsUsP!)�2TestPEP519.test_pathlike_subclass_slots.<locals>.Ai�c��P!r;r%rts&rrG�=TestPEP519.test_pathlike_subclass_slots.<locals>.A.__fspath__�s��rr%)rhr[r\ri�	__slots__rGrjrkrls@rr
r)
�s�����I�
�
rr
�__dict__)rr	
�assertNotHasAttrr
s& r�test_pathlike_subclass_slots�'TestPEP519.test_pathlike_subclass_slots�s&��	����	�	
���a�c�:�.rc���QQ2oQQ2oQQU2oQOoUO[UQ229^tt^2UOU22PPP2UO	UOU22Q2UO[UQ229^tt^2UOU22PPP2UO[UQ229^tt^2[U22PPP2UO[UQ229^tt^2[U22PPP2QOoUO[UQ229^tt^2[OU2Q	2PPP2UO[UQ229^tt^2[OU2Q
2PPP2P!)%fhCK�9h)%fhCK?9h)%fhCK9h)%fhK�9h)%fhK�9h)%fhP!9h)c��\sQsQsPsQsP!)�/TestPEP519.test_fspath_set_to_None.<locals>.Fooi�r%�rhr[r\rirGrjr%rr�Foor3
�����Jrr5
c�(`�\sQsQsnQsQsUsP!)�/TestPEP519.test_fspath_set_to_None.<locals>.Bari�c��Q!)�barr%rts&rrG�:TestPEP519.test_fspath_set_to_None.<locals>.Bar.__fspath__�s��rr%rIrls@r�Barr8
�s����
�
rr<
c��\sQsQsPsQsP!)�/TestPEP519.test_fspath_set_to_None.<locals>.Bazi�r%r4
r%rr�Bazr>
�r6
rr?
z1expected str, bytes or os.PathLike object, not {}r:
z.should be string, bytes or os.PathLike, not {}�foooo�bazzz)rFr
r�r�	r=rxrr�)r.r5
r<
r?
�good_error_msg�other_good_error_msgs&     r�test_fspath_set_to_None�"TestPEP519.test_fspath_set_to_None�s���	�	�	�	�	�#�	�
A�G�G�	��
#�
#�I�~�e�/D�
E�
E��K�K����F�	
������S�U�+�U�3�
�
#�
#�I�~�e�/D�
E�
E��K�K����F��
#�
#�I�~�e�/D�
E�
E����K�F��
#�
#�I�~�e�/D�
E�
E����K�F�
>�D�D�	��
#�
#�I�/C�E�/J�
K�
K��I�I�c�e�W�%�L��
#�
#�I�/C�E�/J�
K�
K��I�I�c�e�W�%�L�
K�+F�
E�
E��
F�
E�
E��F�
E�
E��F�
E��L�
K��L�
K�
K�sl�G3�:H�=H�:H/�I�I�3H	�<H	�H	�H	�H,	�$H,	�/H?	�8H?	�I	�I	�I&	�I&	r%)rhr[r\rir�rr�	r�	r�	r
r�r
r
r
r 
r%
r/
rD
rjrkrls@rr�	r�	�sS�����"�)�)�
$�F�0�0�H�:�
9�
2�	9�5�F�/�%&�%&rr�	c�(`�\sQsQsnQsQsUsP!)�
TimesTestsic��[O2oUOU[O2QFD$o[	V2oUOU[
2J&	[OQ6XcWUOUO]2UOUO]2UOUO]2P!P!)�userr�)rI
�system�
children_user�children_system�elapsed)rr�r+r`r`r�rr=rK
rL
rM
)r.r��fieldr!s&   r�
test_times�TimesTests.test_timess������
�����e�R�_�_�5�!�E��E�)�E��!�!�%��/�!�
�7�7�d�?����U�0�0�!�4����U�2�2�A�6����U�]�]�A�.�rr%)rhr[r\rirO
rjrkrls@rrG
rG
s����/�/rrG
c�`�\sQsQsnQs\O\OQ7Q2\O\
PIQ2Q22sQsQs
UsP!)	�	ForkTestsi'c��Qo[QU2[O%c[QUQQ5P![QUQQ5P!)z�if 1:
            import os
            from test import support
            pid = os.fork()
            if pid != 0:
                support.wait_process(pid, exitcode=0)
        r��mimalloc_debug)�PYTHONMALLOC�malloc_debug)rr�Py_GIL_DISABLEDr�s& r�	test_fork�ForkTests.test_fork)s:����	��t�$��"�"�"��T�4�6F�G��T�4�n�Erz'Only Linux and macOS detect this today.zrequires _testcapic��Qo[QUQQ5vq#oUOUOQ2P2UOUOQ2P2P!)aif 1:
            import os, threading, warnings
            from _testcapi import _spawn_pthread_waiter, _end_spawned_pthread
            _spawn_pthread_waiter()
            try:
                with warnings.catch_warnings(record=True) as ws:
                    warnings.filterwarnings(
                            "always", category=DeprecationWarning)
                    if os.fork() == 0:
                        assert not ws, f"unexpected warnings in child: {ws}"
                        os._exit(0)  # child
                    else:
                        assert ws[0].category == DeprecationWarning, ws[0]
                        assert 'fork' in str(ws[0].message), ws[0]
                        # Waiting allows an error in the child to hit stderr.
                        exitcode = os.wait()[1]
                        assert exitcode == 0, f"child exited {exitcode}"
                assert threading.active_count() == 1, threading.enumerate()
            finally:
                _end_spawned_pthread()
        r��0)�PYTHONOPTIMIZEr�)rr=rN�r.r�rr�rAs&    r�-test_fork_warns_when_non_python_thread_exists�7ForkTests.test_fork_warns_when_non_python_thread_exists9sO����*'�t�T�#�F����������G�,�b�1�������G�,�b�1rc�r�Qo[QU2vq#oUOQU2UOQU2P!)aNif 1:
            import atexit
            import os

            class AtFinalization:
                def __del__(self):
                    print("OK")
                    pid = os.fork()
                    if pid != 0:
                        print("shouldn't be printed")
            at_finalization = AtFinalization()
        r�sOK
s"can't fork at interpreter shutdown)rr=rr]
s&    r�test_fork_at_finalization�#ForkTests.test_fork_at_finalizationVs:����'�t�T�2��������#�&��
�
�;�S�Arr%)r�r��darwin)rhr[r\rirX
rrr7r8rN�	_testcapir^
ra
rjrkrls@rrR
rR
's`����F� ������)G�G�B�D�
�_�_�Y�$�&�(<�=�2�>�D�2�4B�BrrR
�_fspathc�@�\sQsQsQs\\O2sQs	P!)�TestPEP519PurePythonikz>Explicitly test the pure Python implementation of os.fspath().r%)
rhr[r\rir�r�rre
r�	rjr%rrrg
rg
ks��L��b�j�j�)�rrg
�__main__r!)�r"r��
contextlibrwrEr}rEr�rr�r<r�r#r�r�r�r,r�r7�	sysconfigr:r8	r�r#
rrr@r�r�test.supportrrrrrrr8r	�utilsr
rK�ImportErrorr��pwd�getpwall�pw_uidr�r�rd
rrr��mmap�test.support.script_helperrr�test.support.os_helperrrr�versionr�r��getgidr=rrr�r`�BuiltinFunctionTyperWrNrSr&�TestCaser(rorUrNr��BasicTestMappingProtocolr�r�r:rirsrxr�r�rOrr
r!�get_config_var�OS_URANDOM_DONT_USE_FDr:�contextmanagerr\r^r�rr2r[r~r�r�r�r�r�r�r�rZre�IsolatedAsyncioTestCasermr��requires_linux_versionr�r
rr)rDr�r�r�r	r>	rQrQ	rU	r[	ri	r�	rG
�
requires_forkrR
rg
rh�main)�us0r�<module>r�
s�
��
�
������
�	�
�
��
�
�
��
��
����������"�&�+�+�/�(�!��������#&�<�<�>�2�>�a���>�2�I�+��1�
��8�#�+��3�
���3�?�?�#:�#:�#:����0�0�;�;�N�K�����<�<�*�*�9�5�J�J�"�)�)�+��:J��K�"�,�,��w�r�8�T�*�E�,E�,E�F�%�'�� ���s�|�|�'>�'>�u�'E�'N�P��0�PP��!�!�PP�hF8��!�!�F8�TI7��*�*�I7�X^A��"�"�^A�B	�d=�=�9�9�d=�Nr(��!�!�r(�j	
���W�R��)�+B�C�Z%��Z%�D�Z%�z6�Y�6�
���W�R��)�+B�C�	6�j�	6�D�	6�H+�8�$�$�H+�V
���W�R��)�+@�A�8#�X�&�&�8#�B�8#�v&:�h�'�'�&:�R
������"9�:�,�8�$�$�,�;�,�*�8�$�$�*�>
���W�R��-�/D�E�'*�X�&�&�'*�F�'*�Z���.�/�1�4�?�?���� 0�1�Q�6�?�?���� 8�9�Q�>��

���'�=�?�	�������*�7�9�J'�X�&�&�J'�9�?�J'�Z���"��"�@
���W�R��)�&�(�L+��!�!�L+�(�L+�^
������"E�F�Q*�H�%�%�Q*�G�Q*�h
���W�R��(�*<�=�#0��!�!�#0�>�#0�J
�������(�*@�A�DA�x�(�(�DA�B�DA�L
�������(�*@�A�G0�(�#�#�G0�B�G0�T
���W�R��,�.C�D�9+�H�%�%�9+�E�9+�x���"�8�,�,�"��"�>7�h�'�'�7� 1�(�+�+�1�	����HJ�x� � �HJ��HJ�V	����],��"�"�],��],�@
���W�R��,�.F�G�
/��"�"�
/�H�
/�
���W�R��/�N�N�G�B�
�4N�>�@�1�8�,�,�1�@�1�,
���W�R��,�.H�I�W�8�3�3�W�J�W�t
� 
���1�3�?�A�	����1�b�)�NG�X�.�.�NG�*�A�NG�b
���W�R�!4�5�7V�W�;/�H�%�%�;/�X�;/�|
���W�R��0�2L�M�����2�&�2�x�(�(�2�'�N�2�
���W�R��+�-B�C�����1�b�)�N�8�$�$�N�*�D�N�`
���W�R�!1�2�4P�Q�	�������*�,Q�R�����1�b�)�CA�8�$�$�CA�*�S�R�CA�J
S,�8�$�$�S,�l#3�H�%�%�#3�N	����n2��*�*�n2��n2�`
���W�R��+�-@�A�x&�(�+�+�x&�B�x&�v?(�(�+�+�?(�D
���W�R��0�D�F�	����&�&�(D�E�	�������(�*S�T�
4�H�%�%�
4�U�F�F�
4�*�8�$�$�*�D�8�$�$�D�$w�(�#�#�w�te&��"�"�e&�N
/��"�"�
/� 	����=B��!�!�=B��=B�D�2�y���*�z�*��z���M�M�O���Mj���H������E���3���^�$���I���
�+��I�"�{�{�*�G�n�+�����D��s��%h&�*h6�/i�i�i�i�,i;�&h3�,h3�2h3�6i�<i�i�i�i�i�i�i8�#i8�7i8�;j�j�j

Youez - 2016 - github.com/yon3zu
LinuXploit