HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //opt/alt/python312/lib64/python3.12/test/__pycache__/test_glob.cpython-312.opt-2.pyc
�

~h�e�?����ddlZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
Gd�dej�ZeGd�dej��Z
edk(rej�yy)�N)�TESTFN�skip_unless_symlink�can_symlink�create_empty_file�
change_cwdc�F�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zed��Zed��Zej,ej0dk(d�d��Zd�Zd�Zej,ej0dk(d�d��Zd�Zd�Zd�Zd�Z d�Z!y)�	GlobTestsNc��tjjtjj|jg|����S�N)�os�path�normpath�join�tempdir)�self�partss  �5/opt/alt/python312/lib64/python3.12/test/test_glob.py�normzGlobTests.norms-���w�w��������T�\�\� B�E� B�C�C�c�|�|D�cgc],}tjj|jg|�����.c}Scc}wr)rr
rr)r�tuplesrs   r�joinszGlobTests.joinss,��@F�G�u������T�\�\�2�E�2�G�G��Gs�19c���|j|�}tjj|�\}}tjj	|�stj
|�t
|�yr)rrr
�split�exists�makedirsr)rr�filename�base�files     r�mktempzGlobTests.mktempsL���4�9�9�e�$���W�W�]�]�8�,�
��d��w�w�~�~�d�#��K�K����(�#rc��tdz|_|jdd�|jdd�|jdd�|jdd	�|jdd
�|jdd�|jd
�|jd�|jddd�|jdddd�t�r�t	j
|j
d�|j
d��t	j
d|j
d��t	j
tjjdd�|j
d��tjtjhtjkretjtjvrEt	j|jtjtjz�|_yd|_y)N�_dir�a�D�aab�F�.aa�G�.bb�H�.J�aaa�zzzF�ZZZ�EF�bcd�efg�ha�broken�sym1�sym2�sym3)rrr rr�symlinkrr
r�open�stat�supports_dir_fd�scandir�supports_fd�O_RDONLY�O_DIRECTORY�dir_fd�rs r�setUpzGlobTests.setUpsQ����������C������E�3�����E�3�����E�3�����E�4� ����E�6�"����E�����D�����C���%����C���t�,��=��J�J�t�y�y��*�D�I�I�f�,=�>��J�J�x����6�!2�3��J�J�r�w�w�|�|�C��/����6�1B�C��G�G�R�W�W���!3�!3�3��
�
�b�n�n�8T��'�'�$�,�,����b�n�n�0L�M�D�K��D�Krc��|j�tj|j�tj|j
�yr)r?r�close�shutil�rmtreerr@s r�tearDownzGlobTests.tearDown0s,���;�;�"��H�H�T�[�[�!��
�
�d�l�l�#rc
�	�t|�dk(r|d}ntjj|�}tjj|j|�}tj
|fi|��}tj|fi|��}|jtj|fi|��|�|D�cgc]}tj|���}}|jtj
tj|�fi|��|�|jtjtj|�fi|��|�t|j�5tj
|fi|��}|D]1}|jtjj|�|��3|dk(s|dtjzk(r|dd}	n|}	|j|D�cgc],}tjj|j|���.c}|	�|jtj|fi|��|�tj|�}
|D�cgc]}tj|���}}|jtj
|
fi|��|�|jtj|
fi|��|�ddd�|jtj
|fd|ji|��|�|jtj|fd|ji|��|�tj|j�}|jtj

fd|i|���|jtj|
fd|i|��|�|j��|jtj
|fd|ji|��|�|jtj|fd|ji|��|�|jtj
|
fd|ji|��|�|jtj|
fd|ji|��|�|Scc}wcc}wcc}w#1swY���xYw)N�r�**�root_dirr?)�lenrr
rr�glob�iglob�assertCountEqual�fsencoder�assertFalse�isabs�sepr?)
rr�kwargs�pattern�p�res�res2�x�bres�expected�bpattern�bres2�btempdirs
             rrLzGlobTests.glob5s����u�:��?��A�h�G��g�g�l�l�E�*�G��G�G�L�L����w�/���i�i��$�V�$���z�z�!�&�v�&�����d�j�j��5�f�5�s�;�(+�,�1����A��,��,����d�i�i����A��A�&�A�4�H����d�j�j����Q��B�6�B�D�I�
����
%�	I��9�9�W�/��/�D��
6��� � ������q�!1�1�5�
6��$��'�T�B�F�F�]�":��q�r�7�����!�!�$�"O�Q�2�7�7�<�<����a�#@�"O�"*�
,��!�!�$�*�*�W�"?��"?��F��{�{�7�+�H�-1�2��R�[�[��^�2�E�2��!�!�$�)�)�H�"?��"?��G��!�!�$�*�*�X�"@��"@�%�H�	I� 	
���d�i�i��Q�$�,�,�Q�&�Q�SW�X����d�j�j��R�4�<�<�R�6�R�TX�Y��;�;�t�|�|�,������I�I�h�<��<�V�<�e�	E�����J�J�x�=�(�=�f�=�u�	F��;�;�"��!�!��	�	�'�@�$�+�+�@��@�$�
H��!�!��
�
�7�A�4�;�;�A�&�A�4�
I��!�!��	�	�(�A�4�;�;�A�&�A�5�
J��!�!��
�
�8�B�D�K�K�B�6�B�E�
K��
��M-��#P��3�	I�	I�s3�1Q(�A?Q7�1Q-
�AQ7�
Q2�)AQ7�-
Q7�7Rc��t|�}t|�}|jt|�t|��|jt|�t|��yr)�list�assertEqual�set�sorted)r�l1�l2s   r�assertSequencesEqual_noorderz&GlobTests.assertSequencesEqual_noordergsD��
�"�X��
�"�X������R��#�b�'�*�������V�B�Z�0rc�V�|j}||jd�|jd�g�||jdd�|jdd�g�||jd�|jd�g�||jd�g�tjd�}|j|D�chc]
}t	|���c}t
h�tjtjjtjd��}|j|D�chc]
}t	|���c}t
h�tjd�}|j|D�chc]
}t	|���c}th�tjtjjt
jtj�d��}|j|D�chc]
}t	|���c}th�ycc}wcc}wcc}wcc}w)Nr#r$r%�zymurgy�*�*)rerLrr`�type�strrr
r�curdir�bytesrO)r�eqrV�rs    r�test_glob_literalzGlobTests.test_glob_literalmsx��
�
.�
.��
�4�9�9�S�>�D�I�I�c�N�+�,�
�4�9�9�S�#�����3��!4� 5�6�
�4�9�9�U��d�i�i��.�/�0�
�4�9�9�Y���$��i�i��n�����3�/�a�$�q�'�/�#��7��i�i������R�Y�Y��4�5�����3�/�a�$�q�'�/�#��7��i�i��o�����3�/�a�$�q�'�/�%��9��i�i������R�[�[����%;�T�B�C�����3�/�a�$�q�'�/�%��9��0��/��0��/s�H�2H�5H!�7H&c�F�|jtjd�g�|jtjd�g�|jtjd|j��g�|jtjdtj|j���g�|jtjd|j
��g�|jtjd|j
��g�y)N�r)rJ)r?)r`rLrrrOr?r@s r�test_glob_empty_patternz!GlobTests.test_glob_empty_pattern~s���������2���+�������3���,�������2����=�r�B�������3����T�\�\�1J�K�R�P�������2�d�k�k�:�B�?�������3�t�{�{�;�R�@rc�r�|j}||jd�t|jgd���||jd�t|jddg��||jd�t|jddg��||jd	�t|jdg��||jd
�t|jddg��||jd�t|jddg��||jd
�g�y)Nza*)r#r%r,�*ar#r,z.*r'r)�?aazaa?r%zaa[ab]z*q)rerL�mapr�rrns  r�test_glob_one_directoryz!GlobTests.test_glob_one_directory�s���
�
.�
.��
�4�9�9�T�?�C��	�	�+>�?�@�
�4�9�9�T�?�C��	�	�C��<�8�9�
�4�9�9�T�?�C��	�	�E�5�>�:�;�
�4�9�9�U��S����U�G�4�5�
�4�9�9�U��S����U�E�N�;�<�
�4�9�9�X���D�I�I��u�~� >�?�
�4�9�9�T�?�B�rc	��|j}tjjd�dk(r-||j	ddd�|jddd�g�n>||j	ddd�|jddd�|jddd�g�||j	ddd�|jddd�g�y)N�abCDr#r0zE*r/r1z*g)rerr
�normcaserLrrxs  r�test_glob_nested_directoryz$GlobTests.test_glob_nested_directory�s���
�
.�
.��
�7�7���F�#�v�-��t�y�y��e�T�*�T�Y�Y�s�E�4�-H�,I�J�
�t�y�y��e�T�*�T�Y�Y�s�E�4�-H�-1�Y�Y�s�E�5�-I�-K�
L�
�4�9�9�S�%��&����3��u�)E�(F�Grc	�t�|j}||jdd�|jdd�g�||jdd�g�||jdddd�|jdddd�g�||jdd	�|jd
d�|jdd
�g�y)Nrhr$r#rur0r1r2z?a?�*Fr,r-r%r&�rerLrrxs  r�test_glob_directory_namesz#GlobTests.test_glob_directory_names�s���
�
.�
.��
�4�9�9�S�#�����3��!4� 5�6�
�4�9�9�S�$���$�
�4�9�9�S�#�s�D�)��I�I�c�5�%��.�/�	1�
�4�9�9�U�D�!�D�I�I�e�V�$<�$(�I�I�e�S�$9�$;�	<rc��tj|jd�tjz�}|j	|g�tj|jd�tjz�}|j	|g�tj|jd�tjz�}|j	t|�d�|j
t|�|jd�|jd�h|jd�tjz|jd�tjzhg�y�NzZ*Zr.zaa*�r,r%)rLrrrRr`rK�assertInra�rrVs  r�'test_glob_directory_with_trailing_slashz1GlobTests.test_glob_directory_with_trailing_slash�s����i�i��	�	�%�(�2�6�6�1�2������b�!��i�i��	�	�%�(�2�6�6�1�2������b�!��i�i��	�	�%�(�2�6�6�1�2������S��1�%��
�
�c�#�h��y�y��'����5�)9�:��y�y��'�"�&�&�0�$�)�)�E�2B�R�V�V�2K�L�!�	rc
���tjtj|jd�tjz��}|j|g�tjtj|jd�tjz��}|j|g�tjtj|jd�tjz��}|jt
|�d�|jt|�tj|jd��tj|jd��htj|jd�tjz�tj|jd�tjz�hg�yr�)	rLrrOrrRr`rKr�rar�s  r�-test_glob_bytes_directory_with_trailing_slashz7GlobTests.test_glob_bytes_directory_with_trailing_slash�s:���i�i����D�I�I�e�$4�r�v�v�$=�>�?������b�!��i�i����D�I�I�e�$4�r�v�v�$=�>�?������b�!��i�i����D�I�I�e�$4�r�v�v�$=�>�?������S��1�%��
�
�c�#�h��{�{�4�9�9�U�#3�4��{�{�4�9�9�U�#3�4�6��{�{�4�9�9�U�#3�b�f�f�#<�=��{�{�4�9�9�U�#3�b�f�f�#<�=�?�!�	rc	�D�|j}||jd�|jd�g�||jdd�|jdd�|jdd�g�|j|jdtj
z�|jd�g|jd�tj
zgg�||jdd�|jdd�|jdd	�|jdd�g�y)
Nr6rhr/r1rr,r-r%r&)rerLrr�rrRrxs  r�test_glob_symlinkszGlobTests.test_glob_symlinks�s���
�
.�
.��
�4�9�9�V��t�y�y��0�1�2�
�4�9�9�V�S�!�D�I�I�f�d�$;�$(�I�I�f�e�$<�$>�	?��
�
�d�i�i������0��	�	�&�)�*�T�Y�Y�v�->����-G�,H�I�	K�
�4�9�9�S�$���I�I�e�V�$��I�I�e�S�!�4�9�9�V�T�#:�<�	=rc�L�|j}||jd�|jd�|jd�|jd�g�||jd�|jd�g�||jd�|jd�g�y)Nzsym*r4r5r6r�rxs  r�test_glob_broken_symlinksz#GlobTests.test_glob_broken_symlinks�s���
�
.�
.��
�4�9�9�V��t�y�y��0�$�)�)�F�2C�#�y�y��0�2�	3�
�4�9�9�V��t�y�y��0�1�2�
�4�9�9�V��t�y�y��0�1�2r�win32zWin32 specific testc���|j}|tjd�g�|tjd�g�|tjd�g�|tjd�g�|tjd�dg�|tjd�dg�|tjd�g�|tjd�g�y)	Nz*:s*:z?:s?:z\\?\c:\s\\?\c:\z\\*\*\s\\*\*\)rerLrxs  r�test_glob_magic_in_drivez"GlobTests.test_glob_magic_in_drive�s���
�
.�
.��
�4�9�9�T�?�B��
�4�9�9�U��R� �
�4�9�9�T�?�B��
�4�9�9�U��R� �
�4�9�9�]�#�m�_�5�
�4�9�9�^�$�~�&6�7�
�4�9�9�\�"�B�'�
�4�9�9�]�#�R�(rc���|jtj|�|�|jtjtj|��tj|��yr)r`rL�escaperrO)r�argrZs   r�check_escapezGlobTests.check_escape�sF��������S�)�8�4�������R�[�[��%5�6����H�8M�Nrc��|j}|dd�|dd�|dd�|dd�|dd	�|d
d�y)N�abc�[z[[]�?z[?]rhz[*]z[[_/*?*/_]]z[[][[]_/[*][?][*]/_]]z
/[[_/*?*/_]]/z/[[][[]_/[*][?][*]/_]]/�r��r�checks  r�test_escapezGlobTests.test_escape�sK���!�!��
�e�U��
�c�5��
�c�5��
�c�5��
�m�4�5�
�o�8�9rc��|j}|dd�|dd�|dd�|dd�|d	d
�|dd�y)
Nz?:?z?:[?]z*:*z*:[*]z\\?\c:\?z
\\?\c:\[?]z\\*\*\*z	\\*\*\[*]z//?/c:/?z
//?/c:/[?]z//*/*/*z	//*/*/[*]r�r�s  r�test_escape_windowszGlobTests.test_escape_windows�sI���!�!��
�e�W��
�e�W��
�k�=�)�
�j�,�'�
�j�,�'�
�i��%rc�*�|j|ddi|��S)N�	recursiveT�rL�rrrSs   r�rglobzGlobTests.rglob�s���t�y�y�%�:�4�:�6�:�:rc�*�|j|ddi|��S)N�include_hiddenTr�r�s   r�hglobzGlobTests.hglob�s���t�y�y�%�?��?��?�?rc�
�|j}ddg}||jd�|j|��||jd�|j|��dg}||jdd�|j|��y)N�r,�r'rvz*aa�r'r(rIr()rer�r)rrn�lrds    r�test_hidden_globzGlobTests.test_hidden_globsw��
�
.�
.��
�x� ��
�4�:�:�e��j�d�j�j�!�n�-�
�4�:�:�e��j�d�j�j�!�n�-��^��
�4�:�:�d�C� �*�$�*�*�b�/�2rc�&
�|j}gd�}t�r|gd�z
}||jd�|jdg|����||jtj
d�|jtj
dfgd�|D�����gd�}t�r|dd	gz
}||jdd�|jdg|����||jd
d�|jddd
ddd��||jd�|jddd��ddg}t�r|dgz
}||jdd�|j|��gd�}t�r|dgz
}||jdd�|j|��||jddd�g�||jddd�|jdd��||jd
dd�|jd
��t
|j�5tjj}|tjdd��|D�cgc]}||���	c}�|tj|dd�d��|D�cgc]}||���	c}�|tj|dd�d��|D�cgc]}||���	c}�|tj|tj
d�d��|tj
d�g|D�cgc]}|tj
g|�����c}z�|tj|tj
dd�d��|tj
d�g|D�cgc]}|tj
g|�����c}z�|tj|tj
dd�d��|D�cgc]}|tj
g|�����c}�|tj|dd�d��|dd �g�|tjd!d��g�|d
dd�dg}t�r
||d"d�gz
}|tj|dd�d��|�gd#�}|tjddd�$�||zD�cgc]}||���	c}�ddd�ycc}wcc}wcc}wcc}wcc}wcc}wcc}w#1swYyxYw)%N)�r/)r.�r#�r#r$�r#r0�r#r0r/�r#r0r1�r#r0r1r2r��r,r-�r%�r%r&))r4)r5)r6�r6r/)r6r1)r6r1r2rI)rrrrc3�DK�|]}tjf|z���y�wr)rrl)�.0�is  r�	<genexpr>z0GlobTests.test_recursive_glob.<locals>.<genexpr>s����)I�q�2�9�9�,��*:�)I�s� )�r#rr)r#r0rr)r#r0r1rr)r,rr)r%rr)r6rr)r6r1rrr#r�r�r�r�r�r�za**r�r�r�r�r�r/)r�r�r�r�rr0rhT�r�zzz*Fr,r-z**zz*Fr6))r)r*)r)r+r�r�)r))r�r�)rerr�rrrlrrr
rrL)rrn�full�dirs�expectrr��recs        r�test_recursive_globzGlobTests.test_recursive_glob
sO��
�
.�
.�����=���
�D�	�4�:�:�d��Z�T�Z�Z��5��5�6�
�4�:�:�b�i�i��&��D�J�J��	�	�2��J�)I�D�)I�J�	L�*���=��\�#6�7�7�D�
�4�:�:�d�B������E�!9�D�!9�:�
�4�:�:�c�4� �$�*�*��z�<�1C��!:�#<�	=�	�4�:�:�e��d�j�j���8�D�E�$�g�.���=��~�&�&�F�
�4�:�:�d�D�!�:�4�:�:�v�#6�7�M���=��~�&�&�F�
�4�:�:�d�D�!�:�4�:�:�v�#6�7�
�4�:�:�d�D�"�%�r�*�
�4�:�:�d�E�3�'����� 3�*5�	6�
�4�:�:�c�4��'����L�)A�B�
����
%�	-��7�7�<�<�D��t�y�y���.�4�0H�a��q��0H�I��t�y�y��d�B��4�8�#'�(�a��q��(�
*��t�y�y��d�C��D�9�#'�(�a��q��(�
*��t�y�y��b�i�i��.�$�?��b�i�i��$�%�d�(K���b�i�i�)<�!�)<�(K�K�
M��t�y�y��b�i�i��r�2�d�C��b�i�i��$�%�d�(K���b�i�i�)<�!�)<�(K�K�
M��t�y�y��b�i�i��s�3�t�D�.2�3���b�i�i�$�!�$�3�
5��t�y�y��d�6�*�d�;��e�V�$�%�
'��t�y�y��T�2�B�7��3��t�,�d�3�F��}��4���-�.�.���t�y�y��d�D�)�T�:�F�C�N�C��t�y�y���d�C�"&�s�(�+�Q��a��+�
-�-	-�	-��0H��(��(��(K��(K��3��,�/	-�	-�si�%7T�S$�(*T�S)�*T�S.�AT�#S3�AT�S8�1;T�,S=�
B>T�T�T�$#T�Tc��d}tjj|jd�}tjj|gdg|z���}tj|�tjj|gdg|z���}td�D�cgc]}t
j|d����}}|D]}|jt|�|��tjj|dd�}td�D�cgc]}t
j|d����}}|}t|�D]D}tjj|d�}|D]}|jt|�|���Fycc}wcc}w)	N��deep�drh�dTr�rI)
rr
rrr�rangerLrMr`�next)	r�depthrrUrT�j�iters�itr�s	         r�test_glob_many_open_filesz#GlobTests.test_glob_many_open_filesOs<�����w�w�|�|�D�L�L�&�1���G�G�L�L��.�#��u��.��
���A���'�'�,�,�t�4��u�U�{�4��>C�C�j�I�����G�t�4�I��I��	*�B����T�"�X�q�)�	*��'�'�,�,�t�T�3�/��>C�C�j�I�����G�t�4�I��I����u��	.�A������Q��$�A��
.��� � ��b��1�-�
.�	.��
J��Js�E<�F)"�__name__�
__module__�__qualname__r?rrr rArFrLrerprsryr}r�r�r�rr�r��unittest�
skipUnless�sys�platformr�r�r�r�r�r�r�r�r��rrr	r	s���
�F�D�H�$��*$�
0�d1�:�"A� �	H�<�� �"�	=��	=��3��3��X�������0�2G�H�	)�I�	)�O�:��X�������0�2G�H�&�I�&�;�@�3�C-�J.rr	c��eZdZd�Zy)�SymlinkLoopGlobTestsc	��tdz}tj|�|jtj
|�t
|�5tjd�ttjjdd��tjtjtjjdd��tjdd��}|jt|�tt|���t|�}d}|r�tjjdgdg|zz�}|j!||�|j#|�|snKtjj|d�}|j!||�|j#|�|d	z
}|r��tjtjjdd�d��}|jt|�tt|���t|�}d}|rStjjdgdg|zzdgz�}|j!||�|j#|�|d	z
}|r�Stjtjjdd
�d��}|jt|�tt|���t|�}d}|rStjjdgdg|zzd
gz�}|j!||�|j#|�|d	z
}|r�Sddd�y#1swYyxYw)Nr"�dirr�linkrITr�rrHrr)rrr�
addCleanuprDrErrr
rr7rlrLr`rKrar��remove)rr�resultsr�r
s     r�
test_selflinkz"SymlinkLoopGlobTests.test_selflinkds����6�/��
���G������
�
�w�/�
��
 �&	��K�K����b�g�g�l�l�5�&�9�:��J�J�r�y�y�"�'�'�,�,�u�f�"=�>��i�i���5�G����S��\�3�s�7�|�+<�=��'�l�G��E���w�w�|�|�u�g���5�0@�&@�B���
�
�d�G�,����t�$����w�w�|�|�D�&�1���
�
�d�G�,����t�$���
����i�i������T�6� :�d�K�G����S��\�3�s�7�|�+<�=��'�l�G��E���w�w�|�|�u�g���5�0@�&@�F�8�&K�M���
�
�d�G�,����t�$���
��	��i�i������T�2� 6�$�G�G����S��\�3�s�7�|�+<�=��'�l�G��E���w�w�|�|�u�g���5�0@�&@�B�4�&G�I���
�
�d�G�,����t�$���
��	�E&	�&	�&	�s�
E(M�3CM�7CM�M
N)r�r�r�r�r�rrr�r�as��*rr��__main__)rLrrDr�r��test.support.os_helperrrrrr�TestCaser	r�r��mainr�rr�<module>r�sq���	�
�
��P�P�S.��!�!�S.�l
�,�8�,�,�,��,�^�z���H�M�M�O�r