HEX
Server: Apache
System: Linux sg2plmcpnl492417.prod.sin2.secureserver.net 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User: nyiet8349bzl (9207396)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/pyfakefs/__pycache__/fake_path.cpython-311.pyc
�

�|oiQQ���dZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZmZmZmZmZddlmZmZmZmZmZerddlmZddlm Z d	e
d
e
fd�Z!Gd�d
��Z"ej#dkr
Gd�d��Z$ded
efd�Z%ej&e"ej'��D]5\Z(Z)e)j*�+d��se,e"e(e%e)�����6dS)zHFaked ``os.path`` module replacement. See ``fake_filesystem`` for usage.�N)�S_IFDIR�S_IFMT)�
ModuleType)�Callable�List�Optional�Union�Any�Dict�Tuple�AnyStr�overload�ClassVar�
TYPE_CHECKING)�is_called_from_skipped_module�make_string_path�	to_string�matching_string�to_bytes)�FakeFilesystem)�FakeOsModule�old�returnc��tj�|jd��}t	|j��}|�|tj|j<|S)z)Recompiles and creates new module object.N)�sys�modules�pop�__name__�
__import__)r�saved�news   �d/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pyfakefs/fake_path.py�_copy_moduler#6sA���K�O�O�C�L�$�/�/�E�
�S�\�
"�
"�C���$)���C�L�!��J�c��eZdZUdZeej��Zee	d<dZ
eee	d<dZ
eee	d<dZeeee	d<dZeee	d<dZeee	d	<ed
eefd���Zd;d�Zed<d���Zded
efd�Zded
efd�Zdefd�Zded
efd�Zded
efd�Zded
efd�Zded
efd�Z e!j"dkrded
efd�Z#defd�Z$e!j"dkrd�Z%ded
e&fd�Z'ded
e&fd �Z(ded
e&fd!�Z)ded
efd"�Z*d#ed
efd$�Z+ded
e,eeffd%�Z-ded
e,eeffd&�Z.ded
efd'�Z/ded
efd(�Z0d=ded)eed
efd*�Z1d=d+ed,eed
efd-�Z2d.ed/ed
efd0�Z3e4ded1ed2e5eeefd
e,eeffd3���Z6e4de7d1e7d2e5e7ee7fd
e,e7effd4���Z6ded1ed2e5eeefd
e,eeffd5�Z6ded
efd6�Z8ded
efd7�Z9ded
efd8�Z:d9ed
efd:�Z;dS)>�FakePathModulez�Faked os.path module replacement.

    `FakePathModule` should *only* be instantiated by `FakeOsModule`.  See the
    :py:class:`FakeDirectory<pyfakefs.fake_os.FakeOsModule>` docstring for details.
    �
_OS_PATH_COPY��devnull�sepN�altsep�linesep�pathseprc�<�gd�}tjdkr|ddgz
}|S)zqReturn the list of patched function names. Used for patching
        functions imported from the module.
        )�abspath�dirname�exists�
expanduser�getatime�getctime�getmtime�getsize�isabs�isdir�isfile�islink�ismount�join�lexists�normcase�normpath�realpath�relpath�split�
splitdrive�samefile����
isjunction�	splitroot�r�version_info)�dir_lists r"�dirzFakePathModule.dirNs7��

�
�
��0��w�&�&���{�3�3�H��r$�
filesystemr�	os_modulerc�|�||_|j|_|x|j_|_|�|��dS)zlInit.

        Args:
            filesystem: FakeFilesystem used to provide file system information
        N)rNr'�_os_path�os�reset)�selfrNrOs   r"�__init__zFakePathModule.__init__os>��%����*��
�%.�.��
��4�7��
�
�:�����r$c�~�|j|_|j|_|j|_|j|_|j|_dS�N)�path_separatorr*�alternative_path_separatorr+�line_separatorr,r)r-)�clsrNs  r"rSzFakePathModule.resetzs8���+����:��
� �/��� �(��� �(����r$�pathc�6�|j�|��S)z�Determine whether the file object exists within the fake filesystem.

        Args:
            path: The path to the file object.

        Returns:
            (bool) `True` if the file exists.
        �rNr1�rTr\s  r"r1zFakePathModule.exists�s����%�%�d�+�+�+r$c�:�|j�|d���S)z�Test whether a path exists.  Returns `True` for broken symbolic links.

        Args:
          path:  path to the symlink object.

        Returns:
          bool (if file exists).
        T)�
check_linkr^r_s  r"r=zFakePathModule.lexists�s����%�%�d�t�%�<�<�<r$c��|j�|��}|j�|��rBt|j��t
kr%|j�tj|��|j	S)z�Return the file object size in bytes.

        Args:
          path:  path to the file object.

        Returns:
          file size in bytes.
        )
rN�resolve�ends_with_path_separatorr�st_moder�raise_os_error�errno�ENOTDIR�st_size�rTr\�file_objs   r"r6zFakePathModule.getsize�sk���?�*�*�4�0�0���O�4�4�T�:�:�	@��x�'�(�(�G�3�3��O�*�*�5�=�$�?�?�?���r$c��t|d��}|jjr|�|��\}}n|}t	|��}|j�|��sdS|jjrtjdkr||kSdS)z.Return `True` if path is an absolute pathname.r(F�rF�
T)rrN�
is_windows_fsrCr�starts_with_seprrK)rTr\�empty�drives    r"r7zFakePathModule.isabs�s�����b�)�)���?�(�	��/�/�$�/�/�K�E�4�4��E���%�%����.�.�t�4�4�	��5��?�(�	"�S�-=��-H�-H��E�>�!��tr$c�6�|j�|��S)z)Determine if path identifies a directory.�rNr8r_s  r"r8zFakePathModule.isdir�s����$�$�T�*�*�*r$c�6�|j�|��S)z,Determine if path identifies a regular file.�rNr9r_s  r"r9zFakePathModule.isfile�s����%�%�d�+�+�+r$c�6�|j�|��S)z�Determine if path identifies a symbolic link.

        Args:
            path: Path to filesystem object.

        Returns:
            `True` if path points to a symbolic link.

        Raises:
            TypeError: if path is `None`.
        �rNr:r_s  r"r:zFakePathModule.islink�s����%�%�d�+�+�+r$rEc�6�|j�|��S)z+Returns `False`. Junctions are never faked.)rNrHr_s  r"rHzFakePathModule.isjunction�s���?�-�-�d�3�3�3r$c�6�|j�|��S)ztSplit a pathname into drive, root and tail.
            Implementation taken from ntpath and posixpath.
            )rNrIr_s  r"rIzFakePathModule.splitroot�s���?�,�,�T�2�2�2r$rmc�l�|jjstd���|j�|��S)Nz)module 'os' has no attribute 'isreserved')rNro�AttributeError�
isreservedr_s  r"r}zFakePathModule.isreserved�s5���?�0�
R�$�%P�Q�Q�Q��?�-�-�d�3�3�3r$c��	|j�|��}|jS#t$r*|j�t
jd���YdSwxYw)aCReturns the modification time of the fake file.

        Args:
            path: the path to fake file.

        Returns:
            (int, float) the modification time of the fake file
                         in number of seconds since the epoch.

        Raises:
            OSError: if the file does not exist.
        rF)�winerrorN)rNrc�st_mtime�OSErrorrfrg�ENOENTrjs   r"r5zFakePathModule.getmtime�su��	���.�.�t�4�4�H��$�$���	�	�	��O�*�*���q�
+�
�
�
�
�
�
�	���s� #�0A�Ac��	|j�|��}n4#t$r'|j�tj��YnwxYw|jS)a�Returns the last access time of the fake file.

        Note: Access time is not set automatically in fake filesystem
            on access.

        Args:
            path: the path to fake file.

        Returns:
            (int, float) the access time of the fake file in number of seconds
                since the epoch.

        Raises:
            OSError: if the file does not exist.
        )rNrcr�rfrgr��st_atimerjs   r"r3zFakePathModule.getatime�s`�� 	9���.�.�t�4�4�H�H���	9�	9�	9��O�*�*�5�<�8�8�8�8�8�	9����� � ���.A�
Ac��	|j�|��}n4#t$r'|j�tj��YnwxYw|jS)a2Returns the creation time of the fake file.

        Args:
            path: the path to fake file.

        Returns:
            (int, float) the creation time of the fake file in number of
                seconds since the epoch.

        Raises:
            OSError: if the file does not exist.
        )rNrcr�rfrgr��st_ctimerjs   r"r4zFakePathModule.getctimes`��	9���.�.�t�4�4�H�H���	9�	9�	9��O�*�*�5�<�8�8�8�8�8�	9����� � r�c������fd�}t���������s��|������nh�jjr\�j����rB|��}�j�|��r��|dd����������S)z&Return the absolute version of a path.c���t�t��r�j���S�j���S)z%Return the current working directory.)�
isinstance�bytesrR�getcwdb�getcwd)r\rTs��r"r�z&FakePathModule.abspath.<locals>.getcwd$s;����$��&�&�
(��w���(�(�(��w�~�~�'�'�'r$N�)rr7r<rNrorp�starts_with_drive_letterr?)rTr\r��cwds``  r"r/zFakePathModule.abspath!s�����	(�	(�	(�	(�	(�	(� ��%�%���z�z�$���	0��9�9�V�V�X�X�t�,�,�D�D�
�_�
*�	0�t��/N�/N�t�/T�/T�	0��&�(�(�C���7�7��<�<�
0��y�y��R�a�R��$�/�/���}�}�T�"�"�"r$�pc� �|jj|�S)z8Return the completed path with a separator of the parts.)rN�	joinpaths)rTr�s  r"r<zFakePathModule.join5s��(�t��(�!�,�,r$c�6�|j�|��S)z?Split the path into the directory and the filename of the path.)rN�	splitpathr_s  r"rBzFakePathModule.split9s����(�(��.�.�.r$c�6�|j�|��S)zRSplit the path into the drive part and the rest of the path, if
        supported.)rNrCr_s  r"rCzFakePathModule.splitdrive=s����)�)�$�/�/�/r$c�6�|j�|��S)z0Normalize path, eliminating double slashes, etc.)rNr?r_s  r"r?zFakePathModule.normpathBs����'�'��-�-�-r$c�z�|j�|��}|jjr|���}|S)zPConvert to lower case under windows, replaces additional path
        separator.)rNr>ro�lowerr_s  r"r>zFakePathModule.normcaseFs8����'�'��-�-���?�(�	 ��:�:�<�<�D��r$�startc���|std���t|��}|j�|��}t	||jj��}|�t|��}nt	||jj��}|j�|��}t	||jj��}|jj	�Ft	||jj	��}|�
||��}|�
||��}|�
||��}|�
||��}|j�||��}|�
||��S)zQWe mostly rely on the native implementation and adapt the
        path separator.zno path specified)�
ValueErrorrrN�replace_windows_rootrrXr�rQr*rY�replacerA)rTr\r�r*�
system_sepr+s      r"rAzFakePathModule.relpathNs9���	2��0�1�1�1���%�%����3�3�D�9�9���d�D�O�$B�C�C����$�U�+�+�E�E�#�D�$�/�*=�>�>�E���4�4�U�;�;��$�T�4�=�+<�=�=�
��?�5�A�$�T�4�?�+U�V�V�F��<�<��
�3�3�D��M�M�&�*�5�5�E��|�|�C��,�,���
�
�c�:�.�.���}�$�$�T�5�1�1���|�|�J��,�,�,r$�filename�strictc���ttjd��}|�!tjdkr|std���|r|tjjkrt}n|rd}nt}	|j	�
|��n#|$rYnwxYw|j	jr|�|��St|��}|�|dd�|i��\}}|�|��}|S)z}Return the canonical path of the specified filename, eliminating any
        symbolic links encountered in the path.
        �
ALLOW_MISSINGN)rF�
z6realpath() got an unexpected keyword argument 'strict'�r)�hasattrrRr\rrK�	TypeErrorr��FileNotFoundErrorr�rNrcror/r�_join_real_path)rTr�r��has_allow_missing�
ignored_errorr\�oks       r"r@zFakePathModule.realpathes��$�B�G�_�=�=����#�"2�W�"<�"<�EV�"<��T�U�U�U��	$��2�7�+@�!@�!@�!2�M�M�
�	$��M�M�$�M�	��O�#�#�H�-�-�-�-���	�	�	��D�	�����?�(�	*��<�<��)�)�)�#�H�-�-���'�'���!���h��C�C���b��|�|�D�!�!���s�*B�B
�B
�path1�path2c��|j�|��}|j�|��}|j|jko|j|jkS)a/Return whether path1 and path2 point to the same file.

        Args:
            path1: first file path or path object
            path2: second file path or path object

        Raises:
            OSError: if one of the paths does not point to an existing
                file system object.
        )rN�stat�st_ino�st_dev)rTr�r��stat1�stat2s     r"rDzFakePathModule.samefile�sK����$�$�U�+�+����$�$�U�+�+���|�u�|�+�L�����0L�Lr$�rest�seenc��dSrWr��rTr\r�r�s    r"r�zFakePathModule._join_real_path�s	���3r$c��dSrWr�r�s    r"r�zFakePathModule._join_real_path�s	��!�Sr$c	�D�t|d��}t|d��}|j�|��}|�|��r|dd�}|}|�r?|�|��\}}}|r||kr�%||krE|r@|j�|��\}}||kr|j�|||��}n|}�p|j�||��}	|j�|	��s|	}��|	|vr*||	}
|
�|
}��|j�|	|��dfSd||	<|�|t||j�	|	����|��\}}|s|j�||��dfS|||	<|��?|dfS)z�Join two paths, normalizing and eliminating any symbolic links
        encountered in the second path.
        Taken from Python source and adapted.
        �.z..�NFT)
rrN�get_path_separatorr7�	partitionr�r�r:r��readlink)rTr\r�r��curdir�pardirr*�name�_�newpath�	seen_pathr�s            r"r�zFakePathModule._join_real_path�s���!��s�+�+�� ��t�,�,���o�0�0��6�6���:�:�d���	�����8�D��D��%	!� �N�N�3�/�/�M�D�!�T��
�4�6�>�>���v�~�~��"�!%��!:�!:�4�!@�!@�J�D�$��v�~�~�#��8�8��v�v�N�N���!�D���o�/�/��d�;�;�G��?�)�)�'�2�2�
�����$��� ��M�	��(�$�D����0�0��$�?�?��F�F� �D��M��+�+����d�o�&>�&>�w�&G�&G�H�H����H�D�"�
�
D���0�0��t�<�<�e�C�C� �D��M�K�%	!�L�T�z�r$c�8�|�|��dS)z2Returns the first part of the result of `split()`.r)rBr_s  r"r0zFakePathModule.dirname�s���z�z�$����"�"r$c��|j�|��}|�t||jj��t||j����S)ztReturn the argument with an initial component of ~ or ~user
        replaced by that user's home directory.
        )rQr2r�rr*r_s  r"r2zFakePathModule.expanduser�sP���}�'�'��-�-���|�|��D�$�-�"3�4�4��D�$�(�+�+�
�
�	
r$c��|sdStt|����}|j�|��}|jj}|jjrV|jj�||jjf}n|f}|j�|��\}}|r|dd�|vr|p||vS||vrdS|jjD]K}t|���	|��t|���	|��krdS�LdS)aRReturn true if the given path is a mount point.

        Args:
            path: Path to filesystem object to be checked

        Returns:
            `True` if path is a mount point added to the fake file system.
            Under Windows also returns `True` for drive and UNC roots
            (independent of their existence).
        FNr�T)
rrrN�absnormpathrXrorYrC�mount_points�rstrip)	rTr\�path_str�normed_pathr*�	path_sepsrrr��mount_points	         r"r;zFakePathModule.ismount�s)���	��5��-�d�3�3�4�4���o�1�1�(�;�;���o�,���?�(�
	���9�E� �$�/�"L�M�	�	� �F�	��/�4�4�[�A�A�K�E�4��
9��r��r��i�/�/� ��8�d�i�&7�8��y� � ��t��?�7�	�	�K���%�%�,�,�S�1�1�Y�{�5K�5K�5R�5R�SV�5W�5W�W�W��t�t�X��ur$r�c�,�t|j|��S)z1Forwards any non-faked calls to the real os.path.)�getattrrQ�rTr�s  r"�__getattr__zFakePathModule.__getattr__s���t�}�d�+�+�+r$)rNrrOr)rNrrNrW)<r�
__module__�__qualname__�__doc__r#rRr\r'r
�__annotations__r)r�strr*r+rr,r-�staticmethodrrMrU�classmethodrSr
�boolr1r=r6r7r8r9r:rrKrHrIr}�floatr5r3r4r/r<rrBrCr?r>rAr@rDrrr�r�r0r2r;r�r�r$r"r&r&?s����������&��b�g�.�.�M�3�.�.�.��G�X�c�]�����C��#�����&*�F�H�X�c�]�#�*�*�*��G�X�c�]�����G�X�c�]�������c������\��@	�	�	�	��)�)�)��[�)�	,�6�	,�d�	,�	,�	,�	,�	=�F�	=�t�	=�	=�	=�	=� �F� � � � �"�&��T����� +�&�+�T�+�+�+�+�,�6�,�d�,�,�,�,�,�6�,�d�,�,�,�,���7�"�"�	4�6�	4�d�	4�	4�	4�	4�	3�&�	3�	3�	3�	3���7�"�"�	4�	4�	4��V�������*!�V�!��!�!�!�!�,!�V�!��!�!�!�!�&#�F�#�v�#�#�#�#�(-�v�-�&�-�-�-�-�/�&�/�U�6�6�>�%:�/�/�/�/�0�v�0�%����*?�0�0�0�0�
.�V�.��.�.�.�.��V�������-�-�F�-�8�F�+;�-�v�-�-�-�-�.�����$���6�����<
M�f�
M�V�
M��
M�
M�
M�
M�����"��*.�s�H�S�M�/A�*B��	�s�D�y�	�����X���!��!�!&�!�.2�5�(�5�/�3I�.J�!�	�u�d�{�	�!�!�!��X�!�5��5�"(�5�04�V�X�f�=M�5M�0N�5�	�v�t�|�	�5�5�5�5�n#�F�#�v�#�#�#�#�
�v�
�&�
�
�
�
��F��t�����@,��,��,�,�,�,�,�,r$r&�win32c��eZdZdZed���Zdd�Zdefd�Zde	fd�Z
ejd	kr!d
e
defd�Zd
e
defd�Zd
e
defd
�Zd
e
defd�Znd
e
defd�Zdedefd�ZdS)�FakeNtModulez�Under windows, a few function of `os.path` are taken from the `nt` module
        for performance reasons. These are patched here.
        c�0�tjdkrgd�SdgS)NrE)�_path_exists�_path_isfile�_path_isdir�_path_islink�_isdirrJr�r$r"rMzFakeNtModule.dir
s$����7�*�*�V�V�V�V� �z�!r$rNrc�*�ddl}||_||_dS)zxInit.

            Args:
                filesystem: FakeFilesystem used to provide file system information
            rN)�ntrN�	nt_module)rTrNr�s   r"rUzFakeNtModule.__init__s��
�I�I�I�(�D�O�"$�D�N�N�Nr$rc�4�t|jj��S)z!Return current working directory.)rrNr��rTs r"r�zFakeNtModule.getcwds���T�_�0�1�1�1r$c�4�t|jj��S)z*Return current working directory as bytes.)rrNr�r�s r"r�zFakeNtModule.getcwdb#s���D�O�/�0�0�0r$rEr\c�6�|j�|��SrWrtr_s  r"r�zFakeNtModule._path_isdir)�����,�,�T�2�2�2r$c�6�|j�|��SrWrvr_s  r"r�zFakeNtModule._path_isfile,�����-�-�d�3�3�3r$c�6�|j�|��SrWrxr_s  r"r�zFakeNtModule._path_islink/r�r$c�6�|j�|��SrWr^r_s  r"r�zFakeNtModule._path_exists2r�r$c�6�|j�|��SrWrtr_s  r"r�zFakeNtModule._isdir7r�r$r�c�,�t|j|��S)z3Forwards any non-faked calls to the real nt module.)r�r�r�s  r"r�zFakeNtModule.__getattr__:s���4�>�4�0�0�0r$N)rNr)rr�r�r�r�rMrUr�r�r�r�rrKr
r�r�r�r�r�r�r
r�r�r$r"r�r�sd������	�	�
�	"�	"�
��	"�		%�		%�		%�		%�	2�C�	2�	2�	2�	2�	1�U�	1�	1�	1�	1���w�&�&�
3��
3�4�
3�
3�
3�
3�
4��
4�D�
4�
4�
4�
4�
4��
4�D�
4�
4�
4�
4�
4��
4�D�
4�
4�
4�
4�
4�

3�6�
3�d�
3�
3�
3�
3�	1�C�	1�C�	1�	1�	1�	1�	1�	1r$r��fc�F��tj����fd���}|S)z�Decorator used for real pathlib Path methods to ensure that
    real os functions instead of faked ones are used.
    Applied to all non-private methods of `FakePathModule`.c�T��|r�|d}|jj}|s:|jjr.|jjj}t||jj���rd}|rL|r%t|dt��r
|dd�}ttj
�j��|i|��S�|i|��S)Nr)�
skip_names�case_sensitiveTr�)rR�use_originalrN�patcherr�r�is_case_sensitiver�r&r�r\r)�args�kwargsrT�should_use_originalr�r�s     �r"�wrappedz%handle_original_call.<locals>.wrappedDs�����	E���7�D�"&�'�"6��&�
/�4�?�+B�
/�!�_�4�?�
�0�)�#'�?�#D����/�+/�'�"�
E��$�J�t�A�w��?�?�$�����8�D�3�w�r�w��
�3�3�T�D�V�D�D�D��q�$�!�&�!�!�!r$)�	functools�wraps)r�r�s` r"�handle_original_callr?s:���
�_�Q���"�"�"�"���"�(�Nr$r�)-r�rgr�inspectrRrr�rr�typesr�typingrrrr	r
rrr
rrr�pyfakefs.helpersrrrrr�pyfakefs.fake_filesystemr�pyfakefs.fake_osrr#r&�platformr�r�
getmembers�
isfunctionr��fnr�
startswith�setattrr�r$r"�<module>rs���O�N�������������	�	�	�	�
�
�
�
��������������������������������������������������������.�7�7�7�7�7�7�-�-�-�-�-�-��j��Z�����D,�D,�D,�D,�D,�D,�D,�D,�N�<�7���41�41�41�41�41�41�41�41�n�H�������:#��"�>�7�3E�F�F�@�@�H�D�"�
�;�!�!�#�&�&�@�����&:�&:�2�&>�&>�?�?�?��@�@r$