HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/test/test_tools/__pycache__/test_pathfix.cpython-311.opt-2.pyc
�

��Vc:���ddlZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
e
��Gd�dej��Ze
dkrej��dSdS)�N)�support)�	os_helper)�
scriptsdir�skip_if_missingc�t�eZdZej�ed��Zd�Z		dd�Z	d�Z
d�Zd�Zd	�Z
d
�ZdS)
�TestPathfixFunctionalz
pathfix.pyc�Z�|�tjtj��dS)N)�
addCleanupr�unlink�TESTFN��selfs �0D:\Python311\Lib\test\test_tools\test_pathfix.py�setUpzTestPathfixFunctional.setUps"�����	�(�)�*:�;�;�;�;�;�r�c�h�|r#tj�|d��}|}ntj}|}t|dd���5}	|	�|�d�dz��ddd��n#1swxYwYtj��}
tj
tj|jg|�d�|�itj
�d|
i�d	�
��}|dkr|jdkr|�d
�}|�|j||��|�|j�|
��|�dtj��|��|�|j�|
��|�dtj��|��t|dd���5}	|	���}ddd��n#1swxYwY|�d��}
|�|
dd�ddg��|
d}|jdkr|�||��|S)Nz
script-A_1.py�w�utf8)�encoding�
zprint("Hello world")
z-n�PYTHONIOENCODINGT)�env�capture_outputrrz: updating
�r�zprint("Hello world"))�os�path�joinrr�open�write�sys�getfilesystemencoding�
subprocess�run�
executable�script�environ�
returncode�assertEqual�stdout�decode�replace�linesep�stderr�read�split)r�shebang�
pathfix_flags�exitcoder+r/�	directory�filename�pathfix_arg�fr�proc�output�lines�new_shebangs               r�pathfixzTestPathfixFunctional.pathfixs����	#��w�|�|�I��?�?�H�#�K�K� �'�H�"�K�
�(�C�&�
1�
1�
1�	?�Q�
�G�G�w�N�N�N�%=�=�>�>�>�	?�	?�	?�	?�	?�	?�	?�	?�	?�	?�	?����	?�	?�	?�	?��,�.�.���~�
�^�T�[�
0��
0�!�
0�#.�
0�<�2�:�<�1�8�<�<��	!�!�!���R�<�	/�D�O�q�0�	/� �.�.�.�F������(�D�9�9�9������+�+�H�5�5�v�~�~�d�B�J�7W�7W�Y]�^�^�^������+�+�H�5�5�v�~�~�d�B�J�7W�7W�Y]�^�^�^�
�(�C�&�
1�
1�
1�	�Q��V�V�X�X�F�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	����T�"�"������q�r�r��%;�R�$@�A�A�A��A�h���?�a��	3����W�k�2�2�2��s$�A.�.A2�5A2�(G	�	G
�G
c�0�tjdz}|�tj|��t	j|��dtj�|���d�}|�|�	dddg||���d��dS)	Nz.dz
recursedown('z')
�#! /usr/bin/env python�-i�/usr/bin/python3)r5r/�#! /usr/bin/python3)
rrr
�rmtreer�mkdirr�basenamer*r=)r�tmpdir�expected_stderrs   r�test_recursivez$TestPathfixFunctional.test_recursive;s����!�D�(�����	�(�&�1�1�1�
������H�"�'�*:�*:�6�*B�*B�H�H�H������L�L�(��)�*� �&�	
�
(�
(�

"�
	#�	#�	#�	#�	#rc��|�|�dddg��d��|�|�dddg��d��dS)Nr?r@rArB�#! /usr/bin/env python -R�r*r=r
s r�test_pathfixz"TestPathfixFunctional.test_pathfixHs�������L�L�(��)�*�
,�
,�
"�		#�	#�	#�
	
����L�L�+��)�*�
,�
,�
"�		#�	#�	#�	#�	#rc��|�|�dgd���d��|�|�dgd���d��dS)NrJ)r@rA�-kz#! /usr/bin/python3 -Rr?rBrKr
s r�test_pathfix_keeping_flagsz0TestPathfixFunctional.test_pathfix_keeping_flagsTs�������L�L�+�0�0�0�
2�
2�
%�		&�	&�	&�
	
����L�L�(�0�0�0�
2�
2�
"�		#�	#�	#�	#�	#rc��|�|�dgd���d��|�|�dgd���d��|�|�dgd���d��|�|�dgd���d	��|�|�d
gd���d��dS)
Nr?)r@rA�-a�sz#! /usr/bin/python3 -sz#! /usr/bin/env python -Sz#! /usr/bin/env python -V)r@rArQ�vrNz#! /usr/bin/python3 -vV)r@rArQ�Rsz#! /usr/bin/python3 -Rsz!#! /usr/bin/env python -W default)r@rArQrRrNz#! /usr/bin/python3 -sW defaultrKr
s r�test_pathfix_adding_flagz.TestPathfixFunctional.test_pathfix_adding_flag`s6������L�L�(�5�5�5�
7�
7�
%�		&�	&�	&�
	
����L�L�+�5�5�5�
7�
7�
%�		&�	&�	&�
	
����L�L�+�;�;�;�
=�
=�
&�		'�	'�	'�
	
����L�L�(�6�6�6�
8�
8�
&�		'�	'�	'�
	
����L�L�3�;�;�;�
=�
=�
.�		/�	/�	/�	/�	/rc�<�|�dgd�dd���dS)Nz#! /usr/bin/env python -E)r@rArQz	W defaultrN�z%-a option doesn't support whitespaces)r4r/)r=r
s r�test_pathfix_adding_errorsz0TestPathfixFunctional.test_pathfix_adding_errors{s9�����'�?�?�?��:�		�	<�	<�	<�	<�	<rN)rrrr)�__name__�
__module__�__qualname__rrrrr'rr=rHrLrOrUrX�rrrrs�������
�W�\�\�*�l�
3�
3�F�<�<�<�MO��%�%�%�%�N#�#�#�
#�
#�
#�
#�
#�
#�/�/�/�6<�<�<�<�<rr�__main__)rr$r"�unittest�testr�test.supportr�test.test_toolsrr�TestCaserrY�mainr\rr�<module>rds���	�	�	�	�����
�
�
�
�����������"�"�"�"�"�"�7�7�7�7�7�7�7�7������r<�r<�r<�r<�r<�H�-�r<�r<�r<�j�z����H�M�O�O�O�O�O��r