� !A?h����2�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z mZmZddlmZddlmZmZmZmZmZmZmZddlmZgd�ZdZd Zd Z e e eefZ!eee fZ"d �Z#d �Z$Gd �de%��Z&Gd�de&��Z'Gd�de&��Z(e'��Z)e(��Z*d�Z+e,ed��rej-��e+��Z+Gd�d��Z.Gd�d��Z/Gd�de.��Z0Gd�de.��Z1Gd�de.��Z2Gd�d e ��Z3Gd!�d"e%��Z4ej5�6e4��Gd#�d$e4��Z7Gd%�d&e4��Z8Gd'�d(e4��Z9Gd)�d*e9e7��Z:Gd+�d,e9e8��Z;dS)-�N)�Sequence)�ENOENT�ENOTDIR�EBADF�ELOOP)� attrgetter)�S_ISDIR�S_ISLNK�S_ISREG�S_ISSOCK�S_ISBLK�S_ISCHR�S_ISFIFO)�quote_from_bytes)�PurePath� PurePosixPath�PureWindowsPath�Path� PosixPath� WindowsPath��{i�c�b�t|dd��tvpt|dd��tvS)N�errno�winerror)�getattr�_IGNORED_ERRNOS�_IGNORED_WINERRORS)� exceptions �4/opt/alt/python-internal/lib64/python3.11/pathlib.py� _ignore_errorr!&s7�� �I�w�� -� -�� @� G� �I�z�4� 0� 0�4F� F�H�c��d|vpd|vpd|vS)N�*�?�[�)�pats r �_is_wildcard_patternr)+s �� �#�:� 1���� 1�s�c�z�1r"c�$�eZdZdZd�Zd�Zd�ZdS)�_FlavourzPA flavour implements a particular (platform-specific) set of path semantics.c�(�|jj|_dS�N)�sep�join��selfs r �__init__z_Flavour.__init__5s���H�M�� � � r"c���g}|j}|j}dx}}t|��}|D�]}|s�|r|�||��}|�|��\}}} || vrUt| �|����D]1} | r-| dkr'|�tj| �����2n/| r-| dkr'|�tj| ����|s|rC|s?|D]<}|s�|r|�||��}|�|��d}|rn�=n��|s|r|�||z��|� ��|||fS)N��.r) r.�altsep�reversed�replace� splitroot�split�append�sys�intern�reverse) r1�parts�parsedr.r6�drv�root�it�part�rel�xs r � parse_partsz_Flavour.parse_parts8s������h��������d� �e�_�_��� � �D�� ��� 1��|�|�F�C�0�0��!�^�^�D�1�1�N�C��s��c�z�z�!�#�)�)�C�.�.�1�1�5�5�A��5�Q�#�X�X�� � �c�j��m�m�4�4�4��5��3�3�#�:�:��M�M�#�*�S�/�/�2�2�2�� �d� �� "�!#�"�"��#�%�$�!�=�#'�<�<���#<�#<�D�"�n�n�T�2�2�1�5���"�!�E�"��� � � &�$� &� �M�M�#��*� %� %� %��������D�&� � r"c���|r|s|r||||zg|dd�zfSnM|rC||ks,|�|��|�|��kr||||dd�zfSn||||zfS|||fS)z� Join the two paths represented by the respective (drive, root, parts) tuples. Return a new (drive, root, parts) tuple. �N)�casefold)r1rArBr?�drv2�root2�parts2s r �join_parsed_partsz_Flavour.join_parsed_parts^s��� � -�� >�C� >��E�C�%�K�=�6�!�"�"�:�#=�=�=�� � -��s�{�{�d�m�m�D�1�1�T�]�]�3�5G�5G�G�G��D�%�&����*�"4�4�4�H� ��e�f�n�,� ,��U�F�"�"r"N)�__name__� __module__� __qualname__�__doc__r2rGrNr'r"r r+r+1sL��������"�"�"�$!�$!�$!�L#�#�#�#�#r"r+c��eZdZdZdZdZeZej dkZ e d��Z dZ hd�d�d D��zd �d D��zZefd �Zd �Zd �Zd�Ze fd�Zd�Zd�ZdS)�_WindowsFlavour�\�/T�nt�4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\>�CONIN$�CONOUT$�AUX�CON�NUL�PRNc��h|]}d|z��S)zCOM%sr'��.0�cs r � z_WindowsFlavour.����6�6�6���1��6�6�6r"u123456789¹²³c��h|]}d|z��S)zLPT%sr'r`s r rcz_WindowsFlavour.�rdr"c��|dd�}|dd�}||kr3||kr-|�|��\}}|dd�}|dd�}nd}|dd�}||kr�||kr�||kr�|�|d��}|dkrl|�||dz��}||dzkrJ|dkrt|��}|r||d|�z|||dzd�fS|d|�|||dzd�fSdx} } |dkr||jvr|dd�} |dd�}|}||kr|} |�|��}|| z| |fS)NrrI�r4�������:)�_split_extended_path�find�len� drive_letters�lstrip) r1rDr.�first�second�prefix�third�index�index2rArBs r r9z_WindowsFlavour.splitroot�s����Q�q�S� ���a��c��� �c�M�M�e�s�l�l� �4�4�T�:�:�L�F�D���1��I�E��!�A�#�Y�F�F��F��Q�q�S� �� �c�M�M�e�s�l�l�u��|�|� �I�I�c�1�%�%�E���{�{����3��� �2�2���U�Q�Y�&�&���|�|�!$�T�����C�%��Q�v�X��6��T�&��(�)�)�_�L�L�#�G�V�G�}�c�4��q�� � �?�B�B����d� �S�=�=�U�d�&8�8�8��r��r�(�C�����8�D��E� �C�<�<��D��;�;�s�#�#�D���|�T�4�'�'r"c�*�|���Sr-��lower�r1�ss r rJz_WindowsFlavour.casefold�s���w�w�y�y�r"c��d�|D��S)Nc�6�g|]}|�����Sr'rw)ra�ps r � z2_WindowsFlavour.casefold_parts..�s ��)�)�)�a���� � �)�)�)r"r'�r1r?s r �casefold_partsz_WindowsFlavour.casefold_parts�s��)�)�5�)�)�)�)r"c�n�tjtj|��tj��jSr-)�re�compile�fnmatch� translate� IGNORECASE� fullmatch�r1�patterns r �compile_patternz_WindowsFlavour.compile_pattern�s$���z�'�+�G�4�4�b�m�D�D�N�Nr"c��d}|�|��rC|dd�}|dd�}|�d��r||dd�z }d|dd�z}||fS)Nr4�zUNC\rhrU)� startswith)r1rz� ext_prefixrrs r rkz$_WindowsFlavour._split_extended_path�su���� �<�<� � #� #� !��r��r�U�F��!�"�"��A��|�|�G�$�$� !��!�B�Q�B�%����1�Q�R�R�5�L���q�y�r"c��|sdS|d�d��rdS|d�d��d�d��d�d��}|���|jvS)NFrz\\rir5rj� )r�� partition�rstrip�upper�reserved_names)r1r?�names r � is_reservedz_WindowsFlavour.is_reserved�s��� � ��5� ��8� � �v� &� &� ��5��R�y�"�"�3�'�'��*�4�4�S�9�9�!�<�C�C�C�H�H���z�z�|�|�t�2�2�2r"c�j�|j}t|��dkrc|ddkrW|���dd��d��}d|�dt |�d������Sdt |����d����zS)NrgrIrjrVzfile:///zutf-8zfile:)�driverm�as_posixro�urlquote_from_bytes�encode)r1�pathr��rests r �make_uriz_WindowsFlavour.make_uri�s���� �� �u�:�:��?�?�u�Q�x�3����=�=�?�?�1�2�2�&�-�-�c�2�2�D�D����*�4�;�;�w�+?�+?�@�@�@�B� B��0������1G�1G��1P�1P�Q�Q�Q� Qr"N)rOrPrQr.r6�has_drv�ntpath�pathmod�osr�� is_supported�setrn�ext_namespace_prefixr�r9rJr�r�rkr�r�r'r"r rTrTps������ �C� �F��G��G��G�t�O�L��C�N�O�O�M�$�� :�9�9�6�6�5�6�6�6� 7�6�6�5�6�6�6� 7��*#&�%(�%(�%(�%(�N���*�*�*�O�O�O�2F����� 3� 3� 3� R� R� R� R� Rr"rTc�\�eZdZdZdZdZeZej dkZ efd�Z d�Z d�Z d�Zd �Zd �Zd S) � _PosixFlavourrVr4FrWc��|rQ|d|krE|�|��}t|��t|��z dkrd|dz|fSd||fSdd|fS)Nrrgr4)rorm)r1rDr.� stripped_parts r r9z_PosixFlavour.splitroot�sq�� � �D��G�s�N�N� �K�K��,�,�M� �4�y�y�3�}�-�-�-��2�2��3��7�M�1�1��3� �-�-��r�4�<� r"c��|Sr-r'rys r rJz_PosixFlavour.casefold�s���r"c��|Sr-r'rs r r�z_PosixFlavour.casefold_partss��� r"c�X�tjtj|����jSr-)r�r�r�r�r�r�s r r�z_PosixFlavour.compile_patterns ���z�'�+�G�4�4�5�5�?�?r"c��dS)NFr'rs r r�z_PosixFlavour.is_reserveds���ur"c�D�t|��}dt|��zS)Nzfile://)�bytesr�)r1r��bpaths r r�z_PosixFlavour.make_uri s#���d� � ���.�u�5�5�5�5r"N)rOrPrQr.r6r�� posixpathr�r�r�r�r9rJr�r�r�r�r'r"r r�r��s������� �C� �F��G��G��G�t�O�L�"%�  �  �  �  �������@�@�@����6�6�6�6�6r"r�c���|d}|dd�}|st��S|dkrt}n1d|vrtd���t|��rt}nt }||||��S)NrrI�**z:Invalid pattern: '**' can only be an entire path component)�_TerminatingSelector�_RecursiveWildcardSelector� ValueErrorr)�_WildcardSelector�_PreciseSelector)� pattern_parts�flavourr(� child_parts�clss r �_make_selectorr�s��� �� �C�����#�K� �&�#�%�%�%� �d�{�{�(��� �����U�V�V�V� �c� "� "������� �3�s�K�� )� )�)r"� lru_cachec��eZdZdZd�Zd�ZdS)� _SelectorzYA selector matches a specific glob pattern part against the children of a given path.c��||_|rt||��|_d|_dSt ��|_d|_dS)NTF)r�r�� successor�dironlyr�)r1r�r�s r r2z_Selector.__init__0sF��&��� � !�+�K��A�A�D�N��D�L�L�L�1�3�3�D�N� �D�L�L�Lr"c��t|��}|j}|j}|j}||��st g��S|�||||��S)zuIterate over all child paths of `parent_path` matched by this selector. This can contain parent_path itself.)�type�is_dir�exists�_scandir�iter� _select_from)r1� parent_path�path_clsr�r��scandirs r � select_fromz_Selector.select_from9s^��� �$�$���������#���v�k�"�"� ���8�8�O�� � ��f�f�g�F�F�Fr"N)rOrPrQrRr2r�r'r"r r�r�,sA��������!�!�!� G� G� G� G� Gr"r�c��eZdZd�ZdS)r�c#�K�|V�dSr-r')r1r�r�r�r�s r r�z!_TerminatingSelector._select_fromGs���������r"N)rOrPrQr�r'r"r r�r�Es#����������r"r�c��eZdZd�Zd�ZdS)r�c�L�||_t�|||��dSr-)r�r�r2)r1r�r�r�s r r2z_PreciseSelector.__init__Ms'���� ����4��g�6�6�6�6�6r"c#��K� |�|j��}|jr|n||��r$|j�||||��D]}|V��dSdS#t $rYdSwxYwr-)�_make_child_relpathr�r�r�r��PermissionError)r1r�r�r�r�r�r}s r r�z_PreciseSelector._select_fromQs����� ��2�2�4�9�=�=�D�2�$�,�2���F�D�9�9� ���4�4�T�6�6�7�S�S���A��G�G�G�G� � ����� � � � �F�F� ���s�AA� A(�'A(N�rOrPrQr2r�r'r"r r�r�Ks2������7�7�7�����r"r�c��eZdZd�Zd�ZdS)r�c�r�|�|��|_t�|||��dSr-)r��matchr�r2�r1r(r�r�s r r2z_WildcardSelector.__init__]s5���,�,�S�1�1�� ����4��g�6�6�6�6�6r"c#��K� ||��5}t|��}ddd��n #1swxYwY|D]�}|jr> |���s�n'#t$r}t |��s�Yd}~�?d}~wwxYw|j} |�| ��r9|�| ��} |j� | |||��D]} | V����dS#t$rYdSwxYwr-) �listr�r��OSErrorr!r�r�r�r�r�r�) r1r�r�r�r�� scandir_it�entries�entry�er�r�r}s r r�z_WildcardSelector._select_fromas~���� ����%�%� +���z�*�*�� +� +� +� +� +� +� +� +� +� +� +���� +� +� +� +� � � ���<� !� !� %�|�|�~�~�%�$�%��"�!�!�!�,�Q�/�/�"�!� ���������!�����z���:�:�d�#�#� �&�:�:�4�@�@�D�!�^�8�8��v�v�w�W�W� � ��������! � ��"� � � � �F�F� ���sW� C�+� C�/�C�/�C�A�C� A<�"A7�2C�7A<��t�|||��dSr-)r�r2r�s r r2z#_RecursiveWildcardSelector.__init__|s �����4��g�6�6�6�6�6r"c#�K�|V� ||��5}t|��}ddd��n #1swxYwY|D]}}d} |�d���}n'#t$r}t|��s�Yd}~nd}~wwxYw|r8|�|j��} |�| ||��D]} | V���~dS#t$rYdSwxYw)NF��follow_symlinks)r�r�r�r!r�r��_iterate_directoriesr�) r1r�r�r�r�r�r�� entry_is_dirr�r�r}s r r�z/_RecursiveWildcardSelector._iterate_directoriessy�������� ����%�%� +���z�*�*�� +� +� +� +� +� +� +� +� +� +� +���� +� +� +� +� � � ��$� ��#(�<�<��<�#F�#F�L�L������(��+�+���������������� � �&�:�:�5�:�F�F�D�!�6�6�t�V�W�M�M� � �������� � ��� � � � �F�F� ���sV� B<�/� B<�3�B<�3� B<�A�B<� A<�"A7�2B<�7A<�<>B<�< C � C c#�PK� t��} |jj}|�|||��D]0}|||||��D]}||vr|V�|�|��� �1 |���dS#|���wxYw#t $rYdSwxYwr-)r�r�r�r��add�clearr�) r1r�r�r�r��yielded�successor_select�starting_pointr}s r r�z'_RecursiveWildcardSelector._select_from�s����� ��e�e�G� �#'�>�#>� �&*�&?�&?� �V�U\�&]�&]�+�+�N�-�-�n�f�f�g�V�V�+�+���G�+�+�"#�G�G�G�#�K�K��N�N�N��+�+� � � �������� � ���������� � � � �F�F� ���s)�B�AA>�(B�>B�B� B%�$B%N)rOrPrQr2r�r�r'r"r r�r�zsA������7�7�7����& � � � � r"r�c�.�eZdZdZdZd�Zd�Zd�Zd�ZdS)� _PathParentszvThis object provides sequence-like access to the logical ancestors of a path. Don't try to construct it yourself.)�_pathcls�_drv�_root�_partsc�v�t|��|_|j|_|j|_|j|_dSr-)r�r�r�r�r�)r1r�s r r2z_PathParents.__init__�s.���T� � �� ��I�� ��Z�� ��k�� � � r"c�t�|js|jrt|j��dz St|j��S�NrI)r�r�rmr�r0s r �__len__z_PathParents.__len__�s:�� �9� $�� � $��t�{�#�#�a�'� '��t�{�#�#� #r"c ���t|t��rBt�fd�t|�t ������D����S|t ���ks|t ��� krt |���|dkr|t ���z }�j��j �j �j d| dz ���S)Nc3�(�K�|] }�|V�� dSr-r')ra�ir1s �r � z+_PathParents.__getitem__..�s'�����I�I�Q��a��I�I�I�I�I�Ir"rrI) � isinstance�slice�tuple�range�indicesrm� IndexErrorr��_from_parsed_partsr�r�r�)r1�idxs` r � __getitem__z_PathParents.__getitem__�s���� �c�5� !� !� J��I�I�I�I�%����S��Y�Y�1G�1G�*H�I�I�I�I�I� I� �#�d�)�)� � �s�c�$�i�i�Z�/�/��S�/�/� !� ��7�7� �3�t�9�9� �C��}�/�/�� �4�:�04� �I�c�T�A�X�I�0F�H�H� Hr"c�@�d�|jj��S)Nz <{}.parents>)�formatr�rOr0s r �__repr__z_PathParents.__repr__�s���$�$�T�]�%;�<�<�A � A c� �t|��Sr-)rr0s r � __fspath__zPurePath.__fspath__"s���4�y�y�r"c�`�|j}t|���|jd��S)zNReturn the string representation of the path with forward (/) slashes.rV)rrr8r.�r1�fs r r�zPurePath.as_posix%s)�� �M���4�y�y� � ����,�,�,r"c�*�tj|��S)zaReturn the bytes representation of the path. This is only recommended to use under Unix.)r��fsencoder0s r � __bytes__zPurePath.__bytes__+s���{�4� � � r"c�f�d�|jj|�����S)Nz{}({!r}))rrrOr�r0s r rzPurePath.__repr__0s%��� � ���!8�$�-�-�/�/�J�J�Jr"c�|�|���std���|j�|��S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI)� is_absoluter�rr�r0s r �as_urizPurePath.as_uri3s<�����!�!� O��M�N�N� N��}�%�%�d�+�+�+r"c�� |jS#t$r.|j�|j��|_|jcYSwxYwr-)rr%rr�r�r0s r �_cpartszPurePath._cparts9sT�� '��&� &��� '� '� '�"&�-�">�">�t�{�"K�"K�D� ��&� &� &� &� '���s� �5A�Ac�v�t|t��stS|j|jko |j|juSr-)r�r�NotImplementedr4r�r1�others r �__eq__zPurePath.__eq__Bs7���%��*�*� "�!� !��|�u�}�,�P���%�.�1P�Pr"c�� |jS#t$r0tt|j����|_|jcYSwxYwr-)r r%�hashr�r4r0s r �__hash__zPurePath.__hash__GsQ�� ��:� ��� � � ��e�D�L�1�1�2�2�D�J��:� � � � ���s� �7A�Ac�v�t|t��r|j|jurtS|j|jkSr-�r�rrr6r4r7s r �__lt__zPurePath.__lt__N�7���%��*�*� "�d�m�5�>�.Q�.Q�!� !��|�e�m�+�+r"c�v�t|t��r|j|jurtS|j|jkSr-r>r7s r �__le__zPurePath.__le__S�7���%��*�*� "�d�m�5�>�.Q�.Q�!� !��|�u�}�,�,r"c�v�t|t��r|j|jurtS|j|jkSr-r>r7s r �__gt__zPurePath.__gt__Xr@r"c�v�t|t��r|j|jurtS|j|jkSr-r>r7s r �__ge__zPurePath.__ge__]rCr"r�z.The drive prefix (letter or UNC path), if any.)�docr�zThe root of the path, if any.c�$�|j|jz}|S)z/The concatenation of the drive and root, or ''.)r�r�)r1�anchors r rJzPurePath.anchorhs����T�Z�'��� r"c�j�|j}t|��|js|jrdndkrdS|dS)z!The final path component, if any.rIrr4ri)r�rmr�r�rs r r�z PurePath.namens=��� �� �u�:�:�� �?�T�Z�?�!�!�a� @� @��2��R�y�r"c��|j}|�d��}d|cxkrt|��dz kr nn ||d�SdS)z{ The final component's last suffix, if any. This includes the leading period. For example: '.txt' r5rrINr4�r��rfindrm�r1r�r�s r �suffixzPurePath.suffixvsX���y�� �J�J�s�O�O�� �q� � � � �3�t�9�9�q�=� � � � � �����8�O��2r"c��|j}|�d��rgS|�d��}d�|�d��dd�D��S)z� A list of the final component's suffixes, if any. These include the leading periods. For example: ['.tar', '.gz'] r5c��g|]}d|z��S)r5r')rarPs r r~z%PurePath.suffixes..�s��?�?�?���f� �?�?�?r"rIN)r��endswithror:�r1r�s r �suffixeszPurePath.suffixes�s\���y�� �=�=�� � � ��I��{�{�3����?�?�4�:�:�c�?�?�1�2�2�+>�?�?�?�?r"c��|j}|�d��}d|cxkrt|��dz kr nn |d|�S|S)z0The final path component, minus its last suffix.r5rrINrMrOs r �stemz PurePath.stem�sX���y�� �J�J�s�O�O�� �q� � � � �3�t�9�9�q�=� � � � � �����8�O��Kr"c�l�|jst|�d����|j�|f��\}}}|r7|d|jj|jjfvs|s|st |��dkrtd|z���|�|j|j |j dd�|gz��S)z-Return a new path with the file name changed.� has an empty namerirIzInvalid name %rN) r�r�rrGr.r6rmrr�r�r�)r1r�rArBr?s r � with_namezPurePath.with_name�s����y� ?��t�t�t�=�>�>� >��=�4�4�d�W�=�=���T�5�� 9��R��T�]�%6�� �8L�$M�M�M��N��N�!�%�j�j�A�o�o��.�$�7�8�8� 8��&�&�t�y�$�*�'+�{�3�B�3�'7�4�&�'@�B�B� Br"c�<�|�||jz��S)z(Return a new path with the stem changed.)rZrP)r1rWs r � with_stemzPurePath.with_stem�s���~�~�d�T�[�0�1�1�1r"c��|j}|j|vs|jr|j|vrtd|�����|r|�d��r|dkrtd|z���|j}|st|�d����|j}|s||z}n|dt|�� �|z}|�|j |j |j dd�|gz��S)z�Return a new path with the file suffix changed. If the path has no suffix, add given suffix. If the given suffix is an empty string, remove the suffix from the path. zInvalid suffix r5zInvalid suffix %rrYNri) rr.r6r�r�r�rPrmrr�r�r�)r1rPr+r�� old_suffixs r � with_suffixzPurePath.with_suffix�s �� �M�� �5�F�?�?�a�h�?�1�8�v�+=�+=��*�F�F�<�=�=� =� � =�&�+�+�C�0�0� =�F�c�M�M��0�F�;�<�<� <��y��� ?��t�t�t�=�>�>� >��[� �� 4��&�=�D�D��)�#�j�/�/�)�)�*�V�3�D��&�&�t�y�$�*�'+�{�3�B�3�'7�4�&�'@�B�B� Br"c�R�|std���|j}|j}|j}|r||g|dd�z}n|}|�|��\}}}|r||g|dd�z} n|} t | ��} |jj} | dkr|s|run | |d| ���| | ��krT|�|||��} td� t|��t| �������|� d| dkr|nd|| d���S)z�Return the relative path to another path identified by the passed arguments. If the operation is not possible (because this is not a subpath of the other path), raise ValueError. zneed at least one argumentrINrzU{!r} is not in the subpath of {!r} OR one path is relative and the other is absolute.r4) rr�r�r�rrmrr�r!r�rrr) r1r8r?rArB� abs_parts�to_drv�to_root�to_parts� to_abs_parts�n�cf� formatteds r � relative_tozPurePath.relative_to�sf��� :��8�9�9� 9�� ���i���z�� � ��d� �e�A�B�B�i�/�I�I��I�$(�$4�$4�U�$;�$;�!���� � $�"�G�,�x����|�;�L�L�#�L� � � � �� �]� )����F�F�D�F�C�F����9�R�a�R�=�(9�(9�R�R� �=M�=M�(M�(M��1�1�&�'�8�L�L�I��J�$�f�S��Y�Y��I���?�?�A�A� A��&�&�r�1��6�6�4�4�r�'0����}�6�6� 6r"c�>� |j|�dS#t$rYdSwxYw)zFReturn True if the path is relative to another path or False. TF)rir�r7s r �is_relative_tozPurePath.is_relative_to�s>�� � �D� �e� $� $��4��� � � ��5�5� ���s � � �c�r� |jS#t$r#t|j��|_|jcYSwxYw)zZAn object providing sequence-like access to the components in the filesystem path.)r r%r�r�r0s r r?zPurePath.parts�sI��  ��<� ��� � � � ���-�-�D�L��<� � � � ���s � �*6�6c�,�|�|��S)z�Combine this path with one or several arguments, and return a new path representing either a subpath (if all arguments are relative paths) or a totally different path (if one of the arguments is anchored). )r#)r1rs r �joinpathzPurePath.joinpath�s�� ����%�%�%r"c�^� |�|f��S#t$r tcYSwxYwr-)r#rr6�r1�keys r � __truediv__zPurePath.__truediv__�sD�� "��#�#�S�F�+�+� +��� "� "� "�!� !� !� !� "���s ��,�,c�n� |�|g|jz��S#t$r tcYSwxYwr-)rr�rr6rps r � __rtruediv__zPurePath.__rtruediv__sK�� "��#�#�S�E�D�K�$7�8�8� 8��� "� "� "�!� !� !� !� "���s � �4�4c��|j}|j}|j}t|��dkr|s|r|S|�|||dd���S)zThe logical parent of the path.rINri)r�r�r�rmr)r1rArBr?s r �parentzPurePath.parent sU���i���z��� �� �u�:�:��?�?��?�t�?��K��&�&�s�D�%����*�=�=�=r"c� �t|��S)z*A sequence of this path's logical parents.)r�r0s r �parentszPurePath.parentss���D�!�!�!r"c�V�|jsdS|jj pt|j��S)zSTrue if the path is absolute (has both a root and, if applicable, a drive).F)r�rr��boolr�r0s r r1zPurePath.is_absolutes.���z� ��5��=�(�(�;�D���O�O�;r"c�@�|j�|j��S)zaReturn True if the path contains one of the special names reserved by the system, if any.)rr�r�r0s r r�zPurePath.is_reserveds���}�(�(���5�5�5r"c�8�|jj}||��}|j�|f��\}}}|std���|r|||j��krdS|r|||j��krdS|j}|s|r-t|��t|��krdS|dd�}n"t|��t|��krdStt|��t|����D]\}}tj ||��sdS�dS)zE Return True if this path matches the given pattern. z empty patternFrINT) rrJrGr�r�r�r4rm�zipr7r�� fnmatchcase) r1� path_patternrgrArB� pat_partsr?rDr(s r r�zPurePath.match$sA���]� #���r�,�'�'� �#�}�8�8�,��I�I���T�9�� .��_�-�-� -� � �3�"�"�T�Y�-�-�'�'��5� � �D�B�B�t�z�N�N�*�*��5�� �� � �$� ��9�~�~��U���+�+��u�!�!�"�"� �I�I� ��^�^�c�%�j�j� (� (��5��X�e�_�_�h�y�.A�.A�B�B� � �I�D�#��&�t�S�1�1� ��u�u� ��tr"N)1rOrPrQrRr rr� classmethodrrrr!r#r&r(r�r.rr2�propertyr4r9r<r?rBrErGrr�rBrJr�rPrUrWrZr\r_rirkr?rnrrrtrvrxr1r�r�r'r"r rr�sk���������I� %�%�%�4�4�4� �/�/��[�/�&����[������[���,�,��[�,� 9�9�9� ������-�-�-� !�!�!� K�K�K�,�,�,� �'�'��X�'�Q�Q�Q� ���,�,�,� -�-�-� ,�,�,� -�-�-� �H�Z�Z��'�'�M� O� O� O�E� �8�J�J�w�'�'�;� =� =� =�D�����X�� ����X��� � ��X� �� @� @��X� @�����X�� B� B� B�2�2�2�B�B�B�*6�6�6�B����  �  ��X�  �&�&�&�"�"�"� "�"�"� �>�>��X�>��"�"��X�"�<�<�<�6�6�6� ����r"rc��eZdZdZeZdZdS)rz�PurePath subclass for non-Windows systems. On a POSIX system, instantiating a PurePath should return this object. However, you can also instantiate it directly on any system. r'N)rOrPrQrR�_posix_flavourrr r'r"r rrBs$�������� �H��I�I�Ir"rc��eZdZdZeZdZdS)rz�PurePath subclass for Windows systems. On a Windows system, instantiating a PurePath should return this object. However, you can also instantiate it directly on any system. r'N)rOrPrQrR�_windows_flavourrr r'r"r rrLs$��������  �H��I�I�Ir"rc�^�eZdZdZdZd�Zd�Zd�Zd�Ze d���Z e d���Z d �Z d �Z d �Zd �Zd �Zd�Zd7d�Zdd�d�Zd�Zd�Z d8d�Zd�Zd9d�Zd�Zd:d�Zd�Zd;d �Zd�tjdtd���|S)Nz}pathlib.Path.__enter__() is deprecated and scheduled for removal in Python 3.13; Path objects as a context manager is a no-oprg�� stacklevel)�warnings�warn�DeprecationWarningr0s r � __enter__zPath.__enter__ss0�� � �+�)�Q� 8� 8� 8� 8�� r"c��dSr-r')r1�t�v�tbs r �__exit__z Path.__exit__�s�� �r"c�:�|tj����S)zjReturn a new path pointing to the current working directory (as returned by os.getcwd()). )r��getcwd�r�s r �cwdzPath.cwd�s�� �s�2�9�;�;���r"c�<�|d�����S)zrReturn a new path pointing to the user's home directory (as returned by os.path.expanduser('~')). �~)� expanduserr�s r �homez Path.home�s�� �s�3�x�x�"�"�$�$�$r"c��|���} |���}n7#t$r*|�|�����}YnwxYwtj�||��S)zoReturn whether other_path is the same or not as this file (as returned by os.path.samefile()). )�statr%rr�r��samestat)r1� other_path�st�other_sts r �samefilez Path.samefile�s{���Y�Y�[�[�� 9�!���(�(�H�H��� 9� 9� 9��~�~�j�1�1�6�6�8�8�H�H�H� 9�����w����H�-�-�-s�+�1A�Ac#�fK�tj|��D]}|�|��V��dS)zyIterate over the files in this directory. Does not yield any result for the special paths '.' and '..'. N)r��listdirr�rTs r �iterdirz Path.iterdir�sH�����J�t�$�$� 1� 1�D��*�*�4�0�0� 0� 0� 0� 0� 1� 1r"c�*�tj|��Sr-)r�r�r0s r r�z Path._scandir�s���z�$���r"c#��K�tjd||��|s"td�|�����|j�|f��\}}}|s|rt d���|d|jj|jjfvr|� d��tt|��|j��}|� |��D]}|V��dS)z�Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern. zpathlib.Path.globzUnacceptable pattern: {!r}�%Non-relative patterns are unsupportedrir4N) r<�auditr�rrrGr�r.r6r;r�r�r��r1r�rArBr��selectorr}s r �globz Path.glob�s����� � �%�t�W�5�5�5�� K��9�@�@��I�I�J�J� J�#'�=�#<�#<�g�Z�#H�#H� ��T�=� � O�$� O�%�&M�N�N� N� �2�;�4�=�,�d�m�.B�C� C� C� � � �� $� $� $�!�%� �"6�"6�� �F�F���%�%�d�+�+� � �A��G�G�G�G� � r"c#�K�tjd||��|j�|f��\}}}|s|rt d���|r5|d|jj|jjfvr|�d��tdt|��z|j��}|� |��D]}|V��dS)z�Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree. zpathlib.Path.rglobr�rir4)r�N) r<r�rrGr�r.r6r;r�r�r�r�s r �rglobz Path.rglob�s����� � �&��g�6�6�6�#'�=�#<�#<�g�Z�#H�#H� ��T�=� � O�$� O�%�&M�N�N� N� � %�w�r�{�t�}�'8�$�-�:N�&O�O�O� � � �� $� $� $�!�'�E�-�,@�,@�"@�$�-�P�P���%�%�d�+�+� � �A��G�G�G�G� � r"c��|���r|S|�|���g|jz��S)z�Return an absolute version of this path by prepending the current working directory. No normalization or symlink resolution is performed. Use resolve() to get the canonical path to a file. )r1rr�r�r0s r �absolutez Path.absolute�sB�� � � � � � ��K��������� �t�{� :�;�;�;r"Fc�.�d�} tj�||���}n#t$r}||���d}~wwxYw|�|f��}|s8 |���n"#t$r}||��Yd}~nd}~wwxYw|S)zl Make the path absolute, resolving all symlinks on the way and also normalizing it. c��t|dd��}|jtks |tkrt d|jz���dS)NrrzSymlink loop from %r)rrr�_WINERROR_CANT_RESOLVE_FILENAME� RuntimeError�filename)r�rs r � check_eloopz!Path.resolve..check_eloop�sJ���q�*�a�0�0�H��w�%���8�/N�#N�#N�"�#9�A�J�#F�G�G�G�$O�#Nr")�strictN)r�r��realpathr�rr�)r1r�r�rzr�r}s r �resolvez Path.resolve�s���  H� H� H�  ��� � ��f� �5�5�A�A��� � � � �K��N�N�N� ����� ���� � � �a�T� "� "��� � ���������� � � �� �A������������� �����s*�!'� A� =�A�A3�3 B�= B � BTr�c�.�tj||���S)zh Return the result of the stat() system call on this path, like os.stat() does. r�)r�r�)r1r�s r r�z Path.stat�s�� �w�t�_�=�=�=�=r"c�� ddl}|�|���j��jS#t $rt d���wxYw)z: Return the login name of the file owner. rNz*Path.owner() is unsupported on this system)�pwd�getpwuidr��st_uid�pw_name� ImportErrorr�)r1r�s r �ownerz Path.owner�s_�� T� �J�J�J��<�<�� � � � � 2�3�3�;� ;��� T� T� T�%�&R�S�S� S� T���� �47�Ac�� ddl}|�|���j��jS#t $rt d���wxYw)z8 Return the group name of the file gid. rNz*Path.group() is unsupported on this system)�grp�getgrgidr��st_gid�gr_namer�r�)r1r�s r �groupz Path.groups_��  T� �J�J�J��<�<�� � � � � 2�3�3�;� ;��� T� T� T�%�&R�S�S� S� T���r��rriNc�d�d|vrtj|��}tj||||||��S)z| Open the file pointed by this path and return a file object, as the built-in open() function does. �b)�io� text_encoding�open)r1�mode� buffering�encoding�errors�newlines r r�z Path.open s7�� �d�?�?��'��1�1�H��w�t�T�9�h���H�H�Hr"c��|�d���5}|���cddd��S#1swxYwYdS)zK Open the file in bytes mode, read it, and close the file. �rb�r�N)r��readr*s r � read_byteszPath.read_bytess����Y�Y�D�Y� !� !� �Q��6�6�8�8� � � � � � � � � � � � ���� � � � � � s �8�<�<c��tj|��}|�d||���5}|���cddd��S#1swxYwYdS)zJ Open the file in text mode, read it, and close the file. r�)r�r�r�N)r�r�r�r�)r1r�r�r+s r � read_textzPath.read_texts����#�H�-�-�� �Y�Y�C�(�6�Y� B� B� �a��6�6�8�8� � � � � � � � � � � � ���� � � � � � s�A�A�Ac��t|��}|�d���5}|�|��cddd��S#1swxYwYdS)zO Open the file in bytes mode, write to it, and close the file. �wbr�N)� memoryviewr��write)r1�data�viewr+s r � write_byteszPath.write_bytes%s��� �$���� �Y�Y�D�Y� !� !� !�Q��7�7�4�=�=� !� !� !� !� !� !� !� !� !� !� !� !���� !� !� !� !� !� !s�A�A �A c��t|t��std|jjz���t j|��}|�d|||���5}|�|��cddd��S#1swxYwYdS)zN Open the file in text mode, write to it, and close the file. zdata must be str, not %s�w)r�r�r�r�N) r�rrrrOr�r�r�r�)r1r�r�r�r�r+s r � write_textzPath.write_text.s����$��$�$� 5��6� �N�3�4�5�5� 5��#�H�-�-�� �Y�Y�C�(�6�7�Y� S� S� !�WX��7�7�4�=�=� !� !� !� !� !� !� !� !� !� !� !� !���� !� !� !� !� !� !s�B�B�Bc��ttd��std���|�tj|��f��S)zD Return the path to which the symbolic link points. �readlinkz*os.readlink() not available on this system)�hasattrr�r�rr�r0s r r�z Path.readlink9sG���r�:�&�&� T�%�&R�S�S� S������T�!2�!2� 4�5�5�5r"�c��|r( tj|d��dS#t$rYnwxYwtjtjz}|s|tjz}tj|||��}tj|��dS)zS Create this file with the given access mode, if it doesn't exist. N)r��utimer��O_CREAT�O_WRONLY�O_EXCLr��close)r1r��exist_ok�flags�fds r �touchz Path.touchAs��� � � ����t�$�$�$� ��� � � � ��� ���� � �R�[�(��� � �R�Y� �E� �W�T�5�$� '� '�� ��� � � � � s �� (�(��c�� tj||��dS#t$rF|r |j|kr�|j�dd���|�|d|���YdSt$r|r|���s�YdSwxYw)z< Create a new directory at this given path. T)rxr�FN)r��mkdir�FileNotFoundErrorrvr�r�)r1r�rxr�s r r�z Path.mkdirWs��� � �H�T�4� � � � � �� � ?� ?� ?�� �d�k�T�1�1�� �K� � �d�T� � :� :� :� �J�J�t�U�X�J� >� >� >� >� >� >�� � � �� �4�;�;�=�=� �� � � � ���s��A B �( B � B c�4�tj|||���dS)zF Change the permissions of the path, like os.chmod(). r�N)r��chmod)r1r�r�s r r�z Path.chmodhs!�� ���t�_�=�=�=�=�=�=r"c�4�|�|d���dS)z� Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. Fr�N)r�)r1r�s r �lchmodz Path.lchmodns �� � � �4�� �/�/�/�/�/r"c�X� tj|��dS#t$r|s�YdSwxYw)zd Remove this file or link. If the path is a directory, use rmdir() instead. N)r��unlinkr�)r1� missing_oks r rz Path.unlinkusM��  � �I�d�O�O�O�O�O�� � � � �� �� � � � ���s �� )�)c�.�tj|��dS)zF Remove this directory. The directory must be empty. N)r��rmdirr0s r rz Path.rmdir�s�� �������r"c�.�|�d���S)z� Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's. Fr�)r�r0s r �lstatz Path.lstat�s�� �y�y��y�/�/�/r"c�V�tj||��|�|��S)a2 Rename this path to the target path. The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the Path object. Returns the new Path instance pointing to the target path. )r��renamer�r1�targets r rz Path.rename�s(�� � �$������~�~�f�%�%�%r"c�V�tj||��|�|��S)aS Rename this path to the target path, overwriting if that path exists. The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the Path object. Returns the new Path instance pointing to the target path. )r�r8rrs r r8z Path.replace�s(�� � �4�� � � ��~�~�f�%�%�%r"c�z�ttd��std���tj|||��dS)z� Make this path a symlink pointing to the target path. Note the order of arguments (link, target) is the reverse of os.symlink. �symlinkz)os.symlink() not available on this systemN)r�r�r�r )r1r �target_is_directorys r � symlink_tozPath.symlink_to�sA�� �r�9�%�%� S�%�&Q�R�R� R� � �6�4�!4�5�5�5�5�5r"c�x�ttd��std���tj||��dS)z� Make this path a hard link pointing to the same file as *target*. Note the order of arguments (self, target) is the reverse of os.link's. �linkz&os.link() not available on this systemN)r�r�r�rrs r � hardlink_tozPath.hardlink_to�s>�� �r�6�"�"� P�%�&N�O�O� O� ��������r"c��tjdtd���|�|���|��dS)a� Make the target path a hard link pointing to this path. Note this function does not make this path a hard link to *target*, despite the implication of the function and argument names. The order of arguments (target, link) is the reverse of Path.symlink_to, but matches that of os.link. Deprecated since Python 3.10 and scheduled for removal in Python 3.12. Use `hardlink_to()` instead. zypathlib.Path.link_to() is deprecated and is scheduled for removal in Python 3.12. Use pathlib.Path.hardlink_to() instead.rgr�N)r�r�r�rrrs r �link_toz Path.link_to�sR�� � �@�)�Q� 8� 8� 8� 8� ���v���*�*�4�0�0�0�0�0r"c�� |���n4#t$r}t|��s�Yd}~dSd}~wt$rYdSwxYwdS)z+ Whether this path exists. NFT)r�r�r!r��r1r�s r r�z Path.exists�su�� � �I�I�K�K�K�K��� � � � ��#�#� ���5�5�5�5�5������ � � ��5�5� �����ts�� A�7� A�Ac�� t|���j��S#t$r}t |��s�Yd}~dSd}~wt $rYdSwxYw)z3 Whether this path is a directory. NF)r r��st_moder�r!r�rs r r�z Path.is_dir��z�� ��4�9�9�;�;�.�/�/� /��� � � � ��#�#� ���5�5�5�5�5������ � � ��5�5� �����%(� A�A� A�Ac�� t|���j��S#t$r}t |��s�Yd}~dSd}~wt $rYdSwxYw)zq Whether this path is a regular file (also True for symlinks pointing to regular files). NF)r r�rr�r!r�rs r �is_filez Path.is_file�sz�� ��4�9�9�;�;�.�/�/� /��� � � � ��#�#� ���5�5�5�5�5������ � � ��5�5� ���rc�t�|���r|���sdS |j���j}n#t $rYdSwxYw|���j}||krdS|���j}|j���j}||kS)z; Check if this path is a POSIX mount point FT)r�r�rvr��st_devr��st_ino)r1� parent_dev�dev�ino� parent_inos r �is_mountz Path.is_mount�s��� �{�{�}�}� �D�K�K�M�M� ��5� ���)�)�+�+�2�J�J��� � � ��5�5� �����i�i�k�k� �� �*� � ��4��i�i�k�k� ���[�%�%�'�'�.� ��j� � s�A � A�Ac�� t|���j��S#t$r}t |��s�Yd}~dSd}~wt $rYdSwxYw)z7 Whether this path is a symbolic link. NF)r rrr�r!r�rs r � is_symlinkzPath.is_symlinksx�� ��4�:�:�<�<�/�0�0� 0��� � � � ��#�#� ���5�5�5�5�5������ � � ��5�5� ���rc�� t|���j��S#t$r}t |��s�Yd}~dSd}~wt $rYdSwxYw)z6 Whether this path is a block device. NF)r r�rr�r!r�rs r �is_block_devicezPath.is_block_device!rrc�� t|���j��S#t$r}t |��s�Yd}~dSd}~wt $rYdSwxYw)z: Whether this path is a character device. NF)rr�rr�r!r�rs r �is_char_devicezPath.is_char_device1rrc�� t|���j��S#t$r}t |��s�Yd}~dSd}~wt $rYdSwxYw)z. Whether this path is a FIFO. NF)rr�rr�r!r�rs r �is_fifoz Path.is_fifoA�z�� ��D�I�I�K�K�/�0�0� 0��� � � � ��#�#� ���5�5�5�5�5������ � � ��5�5� ���rc�� t|���j��S#t$r}t |��s�Yd}~dSd}~wt $rYdSwxYw)z0 Whether this path is a socket. NF)r r�rr�r!r�rs r � is_socketzPath.is_socketQr,rc�<�|js�|js�|jr�|jddd�dkrmtj�|jd��}|dd�dkrt d���|�|g|jdd�z��S|S)zl Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser) rNrIr�z#Could not determine home directory.)r�r�r�r�r�r�r�r)r1�homedirs r r�zPath.expanduseras����� A�d�j� A� �K� A� �K��N�2�A�2�.�#�5�5��g�(�(���Q��8�8�G��r��r�{�c�!�!�"�#H�I�I�I��#�#�W�I�� �A�B�B��$?�@�@� @�� r")F)r�riNNN)NN)NNN)r�T)r�FF)2rOrPrQrRr rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr8rrrr�r�rr#r%r'r)r+r.r�r'r"r rrYs,���������I����E�E�E� � � � � � � � � ��[� � �%�%��[�%� .� .� .�1�1�1� � � � ��� � � �<�<�<�����6'+�>�>�>�>�>�T�T�T� T� T� T�59�"&�I�I�I�I��������!�!�!� !� !� !� !�6�6�6�����,����".2�>�>�>�>�>� 0�0�0� � � � ���� 0�0�0� &� &� &� &� &� &�6�6�6�6����1�1�1�( � � ���� ���"!�!�!�( � � ���� ��� ��� ��� � � � � r"rc��eZdZdZdZdS)rzsPath subclass for non-Windows systems. On a POSIX system, instantiating a Path should return this object. r'N)rOrPrQrRr r'r"r rros���������I�I�Ir"rc��eZdZdZdZd�ZdS)rzqPath subclass for Windows systems. On a Windows system, instantiating a Path should return this object. r'c� �td���)Nz-Path.is_mount() is unsupported on this system)r�r0s r r#zWindowsPath.is_mount}s��!�"Q�R�R�Rr"N)rOrPrQrRr r#r'r"r rrvs9���������I�S�S�S�S�Sr"r)r=s����������� � � � � � � � � � � � ����� � � � � � � � �����%�%�%�%�%�%�/�/�/�/�/�/�/�/�/�/�/�/�������P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�@�@�@�@�@�@� � � ������"&���7�E�5�1����#�%�� H�H�H� 2�2�2� <#�<#�<#�<#�<#�v�<#�<#�<#�~tR�tR�tR�tR�tR�h�tR�tR�tR�n'6�'6�'6�'6�'6�H�'6�'6�'6�T#�?�$�$������� *� *� *� �7�9�k�"�"�;�*�(�Y�(�*�*�>�:�:�N�G�G�G�G�G�G�G�G�2�������� � � � � �y� � � � ����� ����>%�%�%�%�%��%�%�%�X=�=�=�=�=�8�=�=�=�Bt�t�t�t�t�v�t�t�t�p � ���X���������H���������h����S�S�S�S�S�8�S�S�S�l������m����S�S�S�S�S�$��S�S�S�S�Sr"