Your IP : 3.145.112.33


Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/pyfakefs/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/pyfakefs/__pycache__/fake_file.cpython-311.pyc

�

��bgd����dZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZmZmZmZmZmZmZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%erddl&m'Z'ed	Z(ed
Z)Gd�de*��Z+Gd
�d��Z,Gd�de,��Z-Gd�de,��Z.Gd�de,��Z/Gd�de/��Z0Gd�d��Z1Gd�d��Z2Gd�d��Z3Gd�d��Z4dS)z1Fake implementations for different file objects.
�N)�S_IFREG�S_IFDIR)�
TracebackType)
�List�Optional�Callable�Union�Any�Dict�cast�AnyStr�NoReturn�Iterator�TextIO�Type�
TYPE_CHECKING)�helpers)
�FakeStatResult�BinaryBufferIO�TextBufferIO�is_int_type�is_unicode_string�	to_string�matching_string�
real_encoding�AnyPath�	AnyString)�FakeFilesystem)�FakeFileWrapper�FakeDirWrapper�StandardStreamWrapper�FakePipeWrapper)�FakeFile�
FakeDirectoryc�,��eZdZdZdeddf�fd�Z�xZS)�FakeLargeFileIoExceptionz|Exception thrown on unsupported operations for fake large files.
    Fake large files have a size with no real content.
    �	file_path�returnNc�^��tt|���d|z��dS)Nz?Read and write operations not supported for fake large file: %s)�superr&�__init__)�selfr'�	__class__s  ��c/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pyfakefs/fake_file.pyr+z!FakeLargeFileIoException.__init__Js=���
�&��-�-�6�6�
"�$-�
.�	
�	
�	
�	
�	
�)�__name__�
__module__�__qualname__�__doc__�strr+�
__classcell__�r-s@r.r&r&EsU���������
�#�
�$�
�
�
�
�
�
�
�
�
�
r/r&c�&��eZdZdZdZeejzdddddfdede	de
ede
dd	e
ed
e
ede
edgdffd�Z
ed
e
efd���Zed
e
efd���Zed
efd���Zejded
dfd���Zed
efd���Zejded
dfd���Zed
efd���Zejded
dfd���Zde	d
dfd�Zde	d
dfd�Zd
efd�Zdeeedfd
e
efd�Zded
efd�Zd*ded	e
ed
efd�Zed
e	fd���Zejde	d
dfd ���Zed
efd!���Z e!j"d"kred
efd#���Z#d$ed
e$f�fd%�Z%d&ed'e$d
df�fd(�Z&d
efd)�Z'�xZ(S)+r#a�Provides the appearance of a real file.

    Attributes currently faked out:
      * `st_mode`: user-specified, otherwise S_IFREG
      * `st_ctime`: the time.time() timestamp of the file change time (updated
        each time a file's attributes is modified).
      * `st_atime`: the time.time() timestamp when the file was last accessed.
      * `st_mtime`: the time.time() timestamp when the file was last modified.
      * `st_size`: the size of the file
      * `st_nlink`: the number of hard links to the file
      * `st_ino`: the inode number - a unique number identifying the file
      * `st_dev`: a unique number identifying the (fake) file system device
        the file belongs to
      * `st_uid`: always set to USER_ID, which can be changed globally using
            `set_uid`
      * `st_gid`: always set to GROUP_ID, which can be changed globally using
            `set_gid`

    .. note:: The resolution for `st_ctime`, `st_mtime` and `st_atime` in the
        real file system depends on the used file system (for example it is
        only 1s for HFS+ and older Linux file systems, but much higher for
        ext4 and NTFS). This is currently ignored by pyfakefs, which uses
        the resolution of `time.time()`.

        Under Windows, `st_atime` is not updated for performance reasons by
        default. pyfakefs never updates `st_atime` under Windows, assuming
        the default setting.
    )
�st_mode�st_ino�st_dev�st_nlink�st_uid�st_gid�st_size�st_atime�st_mtime�st_ctime�st_atime_ns�st_mtime_ns�st_ctime_nsN�namer8�contents�
filesystemr�encoding�errors�side_effectc�0�|�td���||_||_||_t	|jt
j��t
j��t
j	����|_
|dz	dkr
|tz}||j
_d|_
t|��|_|pd|_|�|��|_|j�t'|j��nd|j
_
d|_d|_i|_d|_dS)a
        Args:
            name: Name of the file/directory, without parent path information
            st_mode: The stat.S_IF* constant representing the file type (i.e.
                stat.S_IFREG, stat.S_IFDIR), and the file permissions.
                If no file type is set (e.g. permission flags only), a
                regular file type is assumed.
            contents: The contents of the filesystem object; should be a string
                or byte object for regular files, and a dict of other
                FakeFile or FakeDirectory objects wih the file names as
                keys for FakeDirectory objects
            filesystem: The fake filesystem where the file is created.
            encoding: If contents is a unicode string, the encoding used
                for serialization.
            errors: The error mode used for encoding/decoding errors.
            side_effect: function handle that is executed when file is written,
                must accept the file object as an argument.
        Nzfilesystem shall not be None�r�strict�)�
ValueErrorrG�_side_effectrEr�
is_windows_fsr�get_uid�get_gid�now�stat_resultrr8r>rrHrI�_encode_contents�_byte_contents�len�epoch�
parent_dir�xattr�	opened_as)r,rEr8rFrGrHrIrJs        r.r+zFakeFile.__init__s��:���;�<�<�<�,6���0;��� ��	�)��$��O����O����K�M�M�	
�
����b�=�A����w��G�#*��� ����'4�X�'>�'>��
�!�-�X���/3�/D�/D�X�/N�/N���(,�(;�(G�C��#�$�$�$�Q�	
�� ���
�37�����
�$&����r/r(c��|jS)z&Return the contents as raw byte array.�rW�r,s r.�
byte_contentszFakeFile.byte_contents�s
���"�"r/c��t|jt��r:|j�|jptjd��|j���SdS)z9Return the contents as string with the original encoding.F)rIN)�
isinstancer`�bytes�decoderH�locale�getpreferredencodingrIr_s r.rFzFakeFile.contents�sZ���d�(�%�0�0�	��%�,�,��
�C��!<�U�!C�!C��{�-���
��tr/c��|jjS)z*Return the creation time of the fake file.�rUrAr_s r.rAzFakeFile.st_ctime������(�(r/�valc��||j_dS)z'Set the creation time of the fake file.Nrh�r,rjs  r.rAzFakeFile.st_ctime����%(���!�!�!r/c��|jjS)z(Return the access time of the fake file.�rUr?r_s r.r?zFakeFile.st_atime�rir/c��||j_dS)z%Set the access time of the fake file.Nrorls  r.r?zFakeFile.st_atime�rmr/c��|jjS)z.Return the modification time of the fake file.�rUr@r_s r.r@zFakeFile.st_mtime�rir/c��||j_dS)z+Set the modification time of the fake file.Nrrrls  r.r@zFakeFile.st_mtime�rmr/r>c���|�|��|jrd|_|jr&|j�||j|j��||_d|_dS)aSets the self.st_size attribute and replaces self.content with None.

        Provided specifically to simulate very large files without regards
        to their content (which wouldn't fit in memory).
        Note that read/write operations with such a file raise
            :py:class:`FakeLargeFileIoException`.

        Args:
          st_size: (int) The desired file size

        Raises:
          OSError: if the st_size is not a non-negative integer,
                   or if st_size exceeds the available file system space
        rN)�_check_positive_intr>�sizerG�change_disk_usagerEr:rW�r,r>s  r.�set_large_file_sizezFakeFile.set_large_file_size�sg��	
� � ��)�)�)��<�	��D�I��?�	O��O�-�-�g�t�y�$�+�N�N�N����"����r/rvc��t|��r|dkr,|j�tj|j��dSdS�Nr)rrG�raise_os_error�errno�ENOSPCrE)r,rvs  r.ruzFakeFile._check_positive_int�sD���4� � �	D�D�1�H�H��O�*�*�5�<���C�C�C�C�C�%-�Hr/c��|jduS)zVReturn `True` if this file was initialized with size
        but no contents.
        Nr^r_s r.�
is_large_filezFakeFile.is_large_files���"�d�*�*r/c���t|��rBttt|��|jptjd��|j��}tt|��S�NF)rrcrr4rHrerfrI�r,rFs  r.rVzFakeFile._encode_contentssZ���X�&�&�	���S�(�#�#��
�C��!<�U�!C�!C�����H�
�E�8�$�$�$r/c��|�|��}|j|k}|rt|��nd}|jpd}|j�||z
|j|j��||_||_|xjdz
c_|S)a�Sets the file contents and size.
           Called internally after initial file creation.

        Args:
            contents: string, new content of file.

        Returns:
            True if the contents have been changed.

        Raises:
              OSError: if the st_size is not a non-negative integer,
                   or if st_size exceeds the available file system space
        r�)	rVrWrXr>rGrwrEr:rY)r,rFr`�changedr>�current_sizes      r.�set_initial_contentszFakeFile.set_initial_contentss����-�-�h�7�7�
��%��6��(5�<�#�m�$�$�$�1���|�(�q����)�)��l�"�D�I�t�{�	
�	
�	
�,�������
�
�a��
�
��r/c��t|��|_|�|��}|j�|�|��|S)ahSets the file contents and size and increases the modification time.
        Also executes the side_effects if available.

        Args:
          contents: (str, bytes) new content of file.
          encoding: (str) the encoding to be used for writing the contents
                    if they are a unicode string.
                    If not given, the locale preferred encoding is used.

        Returns:
            True if the contents have been changed.

        Raises:
          OSError: if `st_size` is not a non-negative integer,
                   or if it exceeds the available file system space.
        )rrHr�rP)r,rFrHr�s    r.�set_contentszFakeFile.set_contents*sH��"&�h�/�/��
��+�+�H�5�5����(����d�#�#�#��r/c��|jS)z.Return the size in bytes of the file contents.)r>r_s r.rvz
FakeFile.sizeAs���|�r/c�2�|�|��|jpd}|j�||z
|j|j��|jr1||kr|jd|�|_n|xjd||z
zz
c_||_|xjdz
c_dS)a:Resizes file content, padding with nulls if new size exceeds the
        old size.

        Args:
          st_size: The desired size for the file.

        Raises:
          OSError: if the st_size arg is not a non-negative integer
                   or if st_size exceeds the available file system space
        rN�r�)rur>rGrwrEr:rWrY)r,r>r�s   r.rvz
FakeFile.sizeFs���	
� � ��)�)�)��|�(�q����)�)��l�"�D�I�t�{�	
�	
�	
���	H���%�%�&*�&9�(�7�(�&C��#�#��#�#�u��,�0F�'G�G�#�#�����
�
�a��
�
�
�
r/c���g}|}|r7|�dt|j|j����|j}|�7|j�|d��}|d|krR|�d��|�|��}|j�|��d}|s||z}n|�|��}|j�	|��S)z+Return the full path of the current object.r)
�insertrrErZrG�get_path_separator�pop�join�
splitdrive�absnormpath)r,�names�obj�sep�dir_path�drives      r.�pathz
FakeFile.path`s���!��"&���	!��L�L��O�D�I�s�x�@�@�A�A�A��.�C��	!��o�0�0��q��:�:����8�s�?�?��I�I�a�L�L�L��x�x����H��O�.�.�x�8�8��;�E��
*���>����x�x����H���*�*�8�4�4�4r/)�rLc�@�|j�|j��S�N)rG�
isjunctionr�r_s r.�is_junctionzFakeFile.is_junctionws���?�-�-�d�i�8�8�8r/�itemc���||jvrt|j|��St���|��S�z'Forward some properties to stat_result.)�
stat_types�getattrrUr*�__getattribute__)r,r�r-s  �r.�__getattr__zFakeFile.__getattr__{s;����4�?�"�"��4�+�T�2�2�2��w�w�'�'��-�-�-r/�key�valuec���||jvrt|j||��St���||��Sr�)r��setattrrUr*�__setattr__)r,r�r�r-s   �r.r�zFakeFile.__setattr__�s?����$�/�!�!��4�+�S�%�8�8�8��w�w�"�"�3��.�.�.r/c�$�d|j|jfzS)Nz%r(%o))rEr8r_s r.�__str__zFakeFile.__str__�s���4�9�d�l�3�3�3r/r�))r0r1r2r3r�rr�
PERM_DEF_FILEr
�intrr4rr+�propertyrcr`rF�floatrA�setterr?r@ryru�boolr�r	rVr�r�rvr��sys�version_infor�r
r�r�r�r5r6s@r.r#r#QsB���������:�J�&��!6�6�%)�15�"&� $�>B�6'�6'��6'��6'��6�"�	6'�
�-�.�6'��3�-�
6'���
�6'��h�
�|�T�'9�:�;�6'�6'�6'�6'�p�#�x���#�#�#��X�#���(�3�-�����X���)�%�)�)�)��X�)��_�(�E�(�d�(�(�(��_�(��)�%�)�)�)��X�)��_�(�E�(�d�(�(�(��_�(��)�%�)�)�)��X�)��_�(�E�(�d�(�(�(��_�(�#�3�#�4�#�#�#�#�.D��D��D�D�D�D�
+�t�+�+�+�+�%��s�E�4�/?�)@�%�X�e�_�%�%�%�%��V�������6��V��x��}��PT�����.��c�����X��
�[��C��D�����[��2�5�f�5�5�5��X�5�(��7�"�"�	�	9��	9�	9�	9�
��	9�.��.��.�.�.�.�.�.�/�s�/�3�/�4�/�/�/�/�/�/�4��4�4�4�4�4�4�4�4r/r#c�L��eZdZd	�fd�Zedefd���Zdedefd�Z	�xZ
S)
�FakeNullFilerGrr(Nc�t��|jrdnd}tt|���||d���dS)N�nulz	/dev/nullrN)rGrF)rQr*r�r+)r,rG�devnullr-s   �r.r+zFakeNullFile.__init__�s@���%�3�D�%�%���
�l�D�!�!�*�*�7�z�TV�*�W�W�W�W�Wr/c��dS)Nr/�r_s r.r`zFakeNullFile.byte_contents�s���sr/rFc��dSr�r�r�s  r.r�z!FakeNullFile.set_initial_contents�s���ur/)rGrr(N)r0r1r2r+r�rcr`r
r�r�r5r6s@r.r�r��s��������X�X�X�X�X�X���u�����X���V����������r/r�c	�~��eZdZdZ	ddedddeeddf�fd�
Zedee	fd	���Z
d�fd
�	Zd�Z�xZ
S)
�FakeFileFromRealFileztRepresents a fake file copied from the real file system.

    The contents of the file are read on demand only.
    Nr'rGrrJr(c���t���tj�|��||���d|_dS)a3
        Args:
            file_path: Path to the existing file.
            filesystem: The fake filesystem where the file is created.

        Raises:
            OSError: if the file does not exist in the real file system.
            OSError: if the file already exists in the fake file system.
        )rErGrJFN)r*r+�osr��basename�
contents_read)r,r'rGrJr-s    �r.r+zFakeFileFromRealFile.__init__�sO���	�������!�!�)�,�,�!�#�	�	
�	
�	
�
#����r/c��|jsRd|_tj|jd��5}|���|_ddd��n#1swxYwYt
j|j��j|_|jS)NT�rb)	r��io�openr'�readrWr��statr?)r,�fs  r.r`z"FakeFileFromRealFile.byte_contents�s����!�	/�!%�D�������.�.�
/�!�&'�f�f�h�h��#�
/�
/�
/�
/�
/�
/�
/�
/�
/�
/�
/����
/�
/�
/�
/�����/�/�8��
��"�"s�A�A�Ac�h��d|_tt|���||��dS�NT)r�r*r�r�)r,rFrHr-s   �r.r�z!FakeFileFromRealFile.set_contents�s2���!���
�"�D�)�)�6�6�x��J�J�J�J�Jr/c��dS)zThe contents are never faked.Fr�r_s r.r�z"FakeFileFromRealFile.is_large_file�����ur/r�)r0r1r2r3r4rrr+r�rcr`r�r�r5r6s@r.r�r��s����������+/�	#�#��#�%�#��h�'�	#�

�#�#�#�#�#�#�,�#�x���#�#�#��X�#�K�K�K�K�K�K�������r/r�c�j��eZdZdZejdfdedededfd�Z	dde
d	eed
efd�Ze
d
eeeffd���Ze
d
eefd
���Zded
dfd�Zded
efd�Zded
efd�Zddeded
dfd�Ze
d
efd���Zejded
dfd���Zddd
efd�Zd
ef�fd�Z�xZS)r$z,Provides the appearance of a real directory.NrE�	perm_bitsrGrc��t�||t|zd|���|xjdz
c_i|_dS)a
        Args:
            name:  name of the file/directory, without parent path information
            perm_bits: permission bits. defaults to 0o777.
            filesystem: if set, the fake filesystem where the directory
                is created
        rN)rGr�N)r#r+rr;�_entries)r,rEr�rGs    r.r+zFakeDirectory.__init__�sE��	���$��g�	�&9�2�*��U�U�U�	
�
�
���
�
�,.��
�
�
r/rFrHr(c�V�|j�tj|j���r��rGr|r}�EISDIRr�)r,rFrHs   r.r�zFakeDirectory.set_contents�s���o�,�,�U�\�4�9�E�E�Er/c��|jS)z/Return the list of contained directory entries.)r�r_s r.�entrieszFakeDirectory.entries�s���}�r/c�h�d�t|j���d����D��S)z^Return the list of contained directory entry names ordered by
        creation order.
        c��g|]
}|d��S�rr���.0r�s  r.�
<listcomp>z.FakeDirectory.ordered_dirs.<locals>.<listcomp>�s,��
�
�
��
��G�
�
�
r/c��|djS)Nr�)r9)�entrys r.�<lambda>z,FakeDirectory.ordered_dirs.<locals>.<lambda>�s���a���r/)r�)�sortedr��itemsr_s r.�ordered_dirszFakeDirectory.ordered_dirs�sB��

�
��t�}�2�2�4�4�:W�:W�X�X�X�
�
�
�	
r/�path_objectc�~�tj��s@|jtjzs,|jjs t
tjd|j	���t|j��}||jvr*|j�
tj|j	��||j|<||_|j�&|jxjdz
c_|jj|_|xjdz
c_|xjdz
c_|j|_|jdkr-|j�|j|j|j��dSdS)a5Adds a child FakeFile to this directory.

        Args:
            path_object: FakeFile instance to add as a child of this directory.

        Raises:
            OSError: if the directory has no write permission (Posix only)
            OSError: if the file or directory to be added already exists
        zPermission DeniedNr�)r�is_rootr8�
PERM_WRITErGrQ�OSErrorr}�EACCESr�rrEr�r|�EEXISTr�rZr9�last_inor;r:rwrv)r,r��path_object_names   r.�	add_entryzFakeDirectory.add_entry�sC����!�!�	H��L�7�#5�5�	H��O�1�	H�
�%�,�(;�T�Y�G�G�G� )�+�*:� ;� ;���t�|�+�+��O�*�*�5�<���C�C�C�*5��
�&�'�!%�����%��O�$�$��)�$�$�!%��!9�K���
�
���
�
�����!���!�[�����1�$�$��O�-�-�� �+�"2�D�K�
�
�
�
�
�%�$r/�
pathname_namec�`�|�|��}|jt|��S)a)Retrieves the specified child file or directory entry.

        Args:
            pathname_name: The basename of the child object to retrieve.

        Returns:
            The fake file or directory object.

        Raises:
            KeyError: if no child exists by the specified name.
        )�_normalized_entrynamer�r)r,r�s  r.�	get_entryzFakeDirectory.get_entrys,���2�2�=�A�A�
��|�I�m�4�4�5�5r/c�Z��|jjs�fd�|jD��}|r|d��S)Nc�h��g|].}|�������k�,|��/Sr�)�lower)r�rEr�s  �r.r�z7FakeDirectory._normalized_entryname.<locals>.<listcomp>"s>�������������AT�AT�AV�AV�1V�1V��1V�1V�1Vr/r)rG�is_case_sensitiver�)r,r��matching_namess ` r.r�z#FakeDirectory._normalized_entryname sT�����0�	2�����!%�����N��
2� .�q� 1�
��r/T�	recursivec���|�|��}|�|��}|jjr}|jt
jzdkr%|j�tj	|��|j�
|��r%|j�tj	|��nttj��sa|jt
jt
jzzt
jt
jzkr%|j�tj	|��|rQt|t��r<|jr4|�t#|j��d��|j�4n2|jdkr'|j�|j||j��|xjdzc_|xjdzc_|jdksJ�|jt-|��=dS)a&Removes the specified child file or directory.

        Args:
            pathname_name: Basename of the child object to remove.
            recursive: If True (default), the entries in contained directories
                are deleted first. Used to propagate removal errors
                (e.g. permission problems) from contained entries.

        Raises:
            KeyError: if no child exists by the specified name.
            OSError: if user lacks permission to delete the file,
                or (Windows only) the file is open.
        rr�N)r�r�rGrQr8rr�r|r}r��
has_open_filer��PERM_EXErbr$r��remove_entry�listr;rwrvr:r)r,r�r�r�s    r.r�zFakeDirectory.remove_entry)s����2�2�=�A�A�
����}�-�-���?�(�
	L��}�w�1�1�Q�6�6���.�.�u�|�]�K�K�K���,�,�U�3�3�
L���.�.�u�|�]�K�K�K���?�$�$�
L���� 2�W�5E� E�F��%��(8�8�9�9���.�.�u�|�]�K�K�K��	X��E�=�9�9�	X��-�
;��"�"�4��
�#6�#6�q�#9�:�:�:��-�
;��
�^�q�
 �
 ��O�-�-�u�z�k�=�%�,�W�W�W��
�
���
�
�
���!�����~��"�"�"�"��L��=�1�1�2�2�2r/c�b�td�|j���D����S)zUReturn the total size of all files contained
        in this directory tree.
        c�(�g|]}|dj��S)r�)rvr�s  r.r�z&FakeDirectory.size.<locals>.<listcomp>Vs��B�B�B�T�D��G�L�B�B�Br/)�sumr�r�r_s r.rvzFakeDirectory.sizeQs/��
�B�B�T�\�-?�-?�-A�-A�B�B�B�C�C�Cr/r>c�V�|j�tj|j���)z-Setting the size is an error for a directory.r�rxs  r.rvzFakeDirectory.sizeXs ���o�,�,�U�\�4�9�E�E�Er/�
dir_objectc�0�|}|r||krdS|j}|�dS)zmReturn `True` if dir_object is a direct or indirect parent
        directory, or if both are the same object.TF)rZ)r,rr�s   r.�has_parent_objectzFakeDirectory.has_parent_object]s9��(,���	!��j� � ��t��.�C��	!��ur/c���tt|�����dz}|jD]F}|j|���}|�d��D]}|r|dz|zdz}��G|S)Nz:
�
z  )r*r$r�r��split)r,�descriptionr��	item_desc�liner-s     �r.r�zFakeDirectory.__str__gs�����M�4�0�0�8�8�:�:�U�B���L�	C�	C�D���T�*�2�2�4�4�I�!����-�-�
C�
C���C�"-��"4�t�";�d�"B�K��
C��r/r�)T)r0r1r2r3r�PERM_DEFr4r�rr+r
r�r�r�rr#r�rr�r��AnyFiler�r�r�rvr�rr�r5r6s@r.r$r$�s@�������6�6�
!�)�15�	/�/��/��/��-�.�	/�/�/�/�&F�F�V�F�x��}�F�PT�F�F�F�F����c�8�m�,�����X���
�d�3�i�
�
�
��X�
� �X� �$� � � � �D
6�s�
6�w�
6�
6�
6�
6��3��3�����&3�&3�#�&3�$�&3�$�&3�&3�&3�&3�P�D�c�D�D�D��X�D�
�[�F�C�F�D�F�F�F��[�F��O������������������r/r$c
���eZdZdZ	ddedddedeef�fd�
Zed	e	e
effd
���Zed	e
f�fd���Zejde
d	dfd
���Z�xZS)�FakeDirectoryFromRealDirectoryz~Represents a fake directory copied from the real file system.

    The contents of the directory are read on demand only.
    N�source_pathrGr�	read_only�target_pathc���|p|}tj|��}tt|���ttj�|��d��|j|���|j	|_	|j
|_
|j|_|j|_|j
|_
||_||_d|_dS)ao
        Args:
            source_path: Full directory path.
            filesystem: The fake filesystem where the directory is created.
            read_only: If set, all files under the directory are treated
                as read-only, e.g. a write access raises an exception;
                otherwise, writing to the files changes the fake files
                only as usually.
            target_path: If given, the target path of the directory,
                otherwise the target is the same as `source_path`.

        Raises:
            OSError: if the directory does not exist in the real file system
        r�)rEr�rGFN)r�r�r*r
r+rr�rr8rAr?r@r=r<rrr�)r,rrGrr�	real_statr-s      �r.r+z'FakeDirectoryFromRealDirectory.__init__ws����*"�0�[���G�K�(�(�	�
�,�d�3�3�<�<��2�7�=�=��5�5�a�8�9�9��'�!�	=�	
�	
�	
�"�*��
�!�*��
�!�*��
��&����&���&���"���"����r/r(c�<�|j�sd|_|j}tj|j��D]�}tj�|j|��}tj�||��}tj�|��r|j�||����tj�	|��r#|j�
||j|�����|j�||j|�����|j
S)z[Return the list of contained directory entries, loading them
        if not already loaded.T)r)r�r�r��listdirrr��islinkrG�add_real_symlink�isdir�add_real_directoryr�
add_real_filer�)r,�baser�rrs     r.r�z&FakeDirectoryFromRealDirectory.entries�s���!�	�!%�D���9�D���D�$4�5�5�
�
�� �g�l�l�4�+;�U�C�C�� �g�l�l�4��7�7���7�>�>�+�.�.�	��O�4�4�[�+�N�N�N�N��W�]�]�;�/�/���O�6�6�#�T�^��7������O�1�1�#�T�^��2������}�r/c�J��|jsdStt|��jSr{)r�r*r
rv)r,r-s �r.rvz#FakeDirectoryFromRealDirectory.size�s)����!�	��1��3�T�:�:�?�?r/r>c�V�|j�tj|j���r�r�rxs  r.rvz#FakeDirectoryFromRealDirectory.size�s���o�,�,�U�\�4�9�E�E�Er/r�)r0r1r2r3rr�rr+r�rr4r#r�r�rvr�r5r6s@r.r
r
qs���������*.�$#�$#��$#�%�$#��	$#�
�g�&�$#�$#�$#�$#�$#�$#�L���c�8�m�,�����X��*�@�c�@�@�@�@�@��X�@�
�[�F�C�F�D�F�F�F��[�F�F�F�F�Fr/r
c�J�eZdZdZ	d=dedededededed	d
deeded
edeedeede	dedefd�Z
d>d�Zdeee
dee
deeddfd�Zdedefd�Zdefd�Zde	fd�Zd?d�Zedefd ���Zd!e	ddfd"�Zd?d#�Zd?d$�Zd?d%�Zd@d'e	d(e	ddfd)�Zde	fd*�Zd?d+�Zd,eddfd-�Zd.ede fd/�Z!d.ede fd0�Z"d.ede fd1�Z#d2e	ddfd3�Z$de fd4�Z%de	fd5�Z&d.ede'fd6�Z(de fd7�Z)de fd8�Z*defd9�Z+d?d:�Z,de-e.ee.effd;�Z/d<�Z0dS)Arz�Wrapper for a stream object for use by a FakeFile object.

    If the wrapper has any data written to it, it will propagate to
    the FakeFile object on close() or flush().
    F�file_objectr'�updater��append�delete_on_closerGr�newline�binary�closefdrHrI�	buffering�raw_io�	is_streamc�R�||_||_||_||_||_|
|_|j|_||_|	|_	||_
d|_|
|_|jdkr|	std���|jdks|	stj|_|	o|
dk|_|j}|pt%jd��|_|pd}|	rt+|��nt-||||���|_d|_d|_d|_|rpt7|��|_|rZ|s|j�d��n=|j�|j��|j���|_|r|s
Jd���||_||_|j |_!d|_"dS)	NFrzcan't have unbuffered text I/O���r�rM)rHr"rIz(delete_on_close=True requires filesystem)#rr'�_append�_read�allow_update�_closefdrY�_file_epochr&�_binaryr'�_changed�_buffer_sizerOr��DEFAULT_BUFFER_SIZE�_use_line_bufferr`rerf�	_encodingrr�_io�_read_whence�
_read_seek�
_flush_posrX�seek�tell�_filesystemr!r\rE�filedes)r,rr'rr�r r!rGr"r#r$rHrIr%r&r'rFs                 r.r+zFakeFileWrapper.__init__�s���$'���"��������
�"�����
�&�,���������"�����
�%������!�!�&�!��=�>�>�>�
�
�"�
$�
$�F�
$� "� 6�D��$*�
� =�y�A�~����,��!�G�V�%@��%G�%G����#�8���
�N�8�$�$�$���8�W�V����	
������������	6�!�(�m�m�D�O��
6��6��H�M�M�!�$�$�$�$��H�M�M�$�/�2�2�2�&*�h�m�m�o�o�D�O��	J��I�I�I�I�I�:�%���.��� �)��	�&*����r/r(c��|S)�=To support usage of this fake file with the 'with' statement.r�r_s r.�	__enter__zFakeFileWrapper.__enter__
����r/�exc_type�exc_val�exc_tbNc�.�|���dS)r>N��close�r,rArBrCs    r.�__exit__zFakeFileWrapper.__exit__���	
�
�
�����r/�messagec��|jr*|j�tj|j��t
j|���r�)r&r;r|r}�EBADFr'r��UnsupportedOperation)r,rJs  r.�_raisezFakeFileWrapper._raises;���;�	I���+�+�E�K���H�H�H��%�g�.�.�.r/c��|jS)zTReturn the FakeFile object that is wrapped
        by the current instance.
        �rr_s r.�
get_objectzFakeFileWrapper.get_objects
����r/c�R�|j�|jSttjd����z.Return the file descriptor of the file object.N�Invalid file descriptor�r<r�r}rLr_s r.�filenozFakeFileWrapper.fileno"�%���<�#��<���e�k�#<�=�=�=r/c�
�|���sdS|jrK|jsD|���|jjr$|jrtj��|j	_
|j�J�|jr |j�
|j��n0|jj|j}|�J�|�|��|jr3|j�|���j��dSdS)zClose the file.N)�_is_openr,r&�flushr;rQr0rrTrr@r<r-�_close_open_file�
open_files�remover!�
remove_objectrQr��r,r\s  r.rFzFakeFileWrapper.close(s���}�}���	��F���	:�T�[�	:��J�J�L�L�L���-�
:�$�-�
:�,3�K�M�M�� �)��|�'�'�'��=�	$���-�-�d�l�;�;�;�;��)�4�T�\�B�J��)�)�)����d�#�#�#���	���*�*����!�!�&�
�
�
�
�
�	�	r/c�,�|���S)z(Simulate the `closed` attribute on file.)rYr_s r.�closedzFakeFileWrapper.closed@s���=�=�?�?�"�"r/�old_posc���|j}	|���dS#t$r<|j�|��|j���||_�wxYw)z0Try to flush and reset the position if it fails.N)r8rZr�r5r9�truncate)r,rb�	flush_poss   r.�
_try_flushzFakeFileWrapper._try_flushEsl���O�	�	��J�J�L�L�L�L�L���	�	�	��H�M�M�'�"�"�"��H������'�D�O��	���s
��AA%c��|���|j�r0|j�s*|j���}|jrL|���|jj}|�J�|||j	d�z}|�
|��n|j���|j�||j
��}|���|r?|jjrd|_n+t%j��}||j_||j_|jj|_|js|���dSdSdSdS)zFlush file contents to 'disk'.NT)�_check_open_filer,r'r5�getvaluer*�_sync_iorr`r8�_set_stream_contentsrZr�r4�update_flush_posr;rQr0rrTrAr@rYr.�_flush_related_files)r,rF�old_contentsr��current_times     r.rZzFakeFileWrapper.flushQsc����������	,�T�^�	,��x�(�(�*�*�H��|�
!��
�
����#�/�=��#�/�/�/�'�(�4�?�3D�3D�*E�E���)�)�(�3�3�3�3����� � � ��&�3�3�H�d�n�M�M�G��!�!�#�#�#��
=��#�1�=�$(�D�M�M�#*�;�=�=�L�0<�D�$�-�0<�D�$�-�#�/�5�D���>�
,��)�)�+�+�+�+�+�-	,�	,�	,�	,�*
,�
,r/c�B�|j���|_dSr�)r5r:r8r_s r.rlz FakeFileWrapper.update_flush_posls���(�-�-�/�/����r/c���|jjdd�D]M}|�I|D]F}||ur@t|t��r+|j|jkr|js|����G�NdS�Nr�)r;r\rbrrr*rj)r,r\�	open_files   r.rmz$FakeFileWrapper._flush_related_filesos����*�5�a�b�b�9�		-�		-�J��%�!+�-�-�I�!��-�-�&�y�/�B�B�.� �,�	�0E�E�E� )� 1�F�"�*�*�,�,�,���		-�		-r/r�offset�whencec���|���|js|j�||��n||_||_|js|���dSdS)z"Move read/write pointer in 'file'.N)rhr*r5r9r7r6r'rZ)r,rtrus   r.r9zFakeFileWrapper.seek{sk���������|�	'��H�M�M�&�&�)�)�)�)�$�D�O� &�D���~�	��J�J�L�L�L�L�L�	�	r/c��|���|js|���|js|j���S|jr}|j���}|j�|j|j��|j���|_d|_|j�|��|jS)zoReturn the file's current position.

        Returns:
          int, file's current position in bytes.
        r)	rhr'rZr*r5r:r6r9r7)r,�
write_seeks  r.r:zFakeFileWrapper.tell�s���	
�������~�	��J�J�L�L�L��|�	#��8�=�=�?�?�"���	&�������J��H�M�M�$�/�4�+<�=�=�=�"�h�m�m�o�o�D�O� !�D���H�M�M�*�%�%�%���r/c��|j|jjkrdS|jj}|�J�|�|��|jj|_dS)z;Update the stream with changes to the file object contents.N)r.rrYr`rkr�s  r.rjzFakeFileWrapper._sync_io�sZ����t�/�5�5�5��F��#�1���#�#�#��!�!�(�+�+�+��+�1����r/rFc��|j���}|j�d��|j���|j�|��|js|j�|��dSdSr{)r5r:r9rd�putvaluer*)r,rFrus   r.rkz$FakeFileWrapper._set_stream_contents�s}�����������
�
�a���������������(�#�#�#��|�	"��H�M�M�&�!�!�!�!�!�	"�	"r/rEc�@���t�j|�����fd�}|S)a_Wrap a stream attribute in a read wrapper.

        Returns a read_wrapper which tracks our own read pointer since the
        stream object has no concept of a different read and write pointer.

        Args:
            name: The name of the attribute to wrap. Should be a read call.

        Returns:
            The read_wrapper function.
        c�����j��j�j���|i|��}�j����_d�_�j�dd��|S)a�Wrap all read calls to the stream object.

            We do this to track the read pointer separate from the write
            pointer.  Anything that wants to read from the stream object
            while we're in append mode goes through this.

            Args:
                *args: pass through args
                **kwargs: pass through kwargs
            Returns:
                Wrapped stream object method
            r�)r5r9r7r6r:)�args�kwargs�	ret_value�io_attrr,s   ��r.�read_wrapperz4FakeFileWrapper._read_wrappers.<locals>.read_wrapper�si���
�H�M�M�$�/�4�+<�=�=�=����0��0�0�I�"�h�m�m�o�o�D�O� !�D���H�M�M�!�Q�����r/�r�r5)r,rEr�r�s`  @r.�_read_wrapperszFakeFileWrapper._read_wrappers�s=�����$�(�D�)�)��	�	�	�	�	�	�(�r/c�@���t�j|�����fd�}|S)z�Wrap a stream attribute in an other_wrapper.

        Args:
          name: the name of the stream attribute to wrap.

        Returns:
          other_wrapper which is described below.
        c�����j���}�|i|��}|�j���kr%�j����_d�_|S)�Wrap all other calls to the stream Object.

            We do this to track changes to the write pointer.  Anything that
            moves the write pointer in a file open for appending should move
            the read pointer as well.

            Args:
                *args: Pass through args.
                **kwargs: Pass through kwargs.

            Returns:
                Wrapped stream object method.
            r)r5r:r7r6)rr�rxr�r�r,s    ��r.�
other_wrapperz5FakeFileWrapper._other_wrapper.<locals>.other_wrapper�s\���������J����0��0�0�I��T�X�]�]�_�_�,�,�"&�(�-�-�/�/���$%��!��r/r�)r,rEr�r�s`  @r.�_other_wrapperzFakeFileWrapper._other_wrapper�s=�����$�(�D�)�)��	�	�	�	�	�	�,�r/c�@���t�j|�����fd�}|S)z�Wrap a stream attribute in a write_wrapper.

        Args:
          name: the name of the stream attribute to wrap.

        Returns:
          write_wrapper which is described below.
        c�����j���}�|i|��}�j���}�jo	d|dv}|�jz
�jks|rd||z
�jkp|}|s3�j�|���j�����|��|s�|i|��}�jr%�j����_	d�_
|S)r�rr)r5r:r3r8r1r9rdrfr*r7r6)	rr�rbr��new_pos�use_line_buf�	flush_allr�r,s	       ��r.�
write_wrapperz5FakeFileWrapper._write_wrapper.<locals>.write_wrapper�s����h�m�m�o�o�G����0��0�0�I��h�m�m�o�o�G� �0�D�T�T�!�W�_�L����(�4�+<�<�<��<�#�g�-��0A�A�Q�\�	�!�(��H�M�M�'�*�*�*��H�%�%�'�'�'�����(�(�(� �9� '��� 8�� 8� 8�I��|�
&�"&�(�-�-�/�/���$%��!��r/r�)r,rEr�r�s`  @r.�_write_wrapperzFakeFileWrapper._write_wrapper�s>�����$�(�D�)�)��"	�"	�"	�"	�"	�"	�H�r/rvc���|jjdd�D]\}|�X|D]U}||urOt|t��r:|j|jkr*tt|��jr|xj|z
c_�V�]dSrr)r;r\rbrrrr*r7)r,rvr\rss    r.�_adapt_size_for_related_filesz-FakeFileWrapper._adapt_size_for_related_files$s����*�5�a�b�b�9�		5�		5�J��%�!+�5�5�I�!��-�-�&�y�/�B�B�.� �,�	�0E�E�E� ��)�<�<�D�F�"�,�,��4�,�,���		5�		5r/c�.����jj���fd�}|S)zwWrap truncate() to allow flush after truncate.

        Returns:
            Wrapper which is described below.
        c�^���jr%�j��j�j���|i|��}�����js�|�j_t�j�
����}||kr��j�|���j�d||z
z���j��j�
���j
��|�_��||z
������|S)z0Wrap truncate call to call flush after truncate.r�)r*r5r9r7r6rZr'rrvrXrir{r�r4r8r�)rr�rv�buffer_sizer�r,s    ��r.�truncate_wrapperz;FakeFileWrapper._truncate_wrapper.<locals>.truncate_wrapper8s����|�
B���
�
�d�o�t�/@�A�A�A��7�D�+�F�+�+�D��J�J�L�L�L��>�
K�(,�� �%�!�$�(�"3�"3�"5�"5�6�6����%�%��H�M�M�+�.�.�.��H�%�%�e�t�k�/A�&B�C�C�C��$�1�1�$�(�2C�2C�2E�2E�t�~�V�V�V�&*�D�O��6�6�t�k�7I�J�J�J��J�J�L�L�L��Kr/)r5rd)r,r�r�s` @r.�_truncate_wrapperz!FakeFileWrapper._truncate_wrapper0s6�����(�#��	�	�	�	�	�	�& �r/c��|jjS)z5Return the content size in bytes of the wrapped file.)rr>r_s r.rvzFakeFileWrapper.sizeMs����'�'r/c��|j���rt|j���|�d��p|dk}|dk}|�d��p|}|s|r|���|js|r|���S|js|r|�	��S|rX|�
��|js|���|j
jstj��|j_|r|���S|jr.|r|�|��S|s|�|��S|r|�|��St/|j|��S)Nr��nextrd�write)rr�r&r'�
startswithrhr+�_read_errorr,�_write_errorrjr'rZr;rQrrTr?r�r*r�r�r�r�r5)r,rE�readingrd�writings     r.r�zFakeFileWrapper.__getattr__Qs�����)�)�+�+�	;�*�4�>�:�:�:��/�/�&�)�)�;�T�V�^���:�%���/�/�'�*�*�6�h���	$�g�	$��!�!�#�#�#��z�	&�g�	&��#�#�%�%�%�� �	'�W�	'��$�$�&�&�&��	:��M�M�O�O�O��>�
��
�
�����#�1�
:�,3�K�M�M�� �)��	,��)�)�+�+�+��<�	1��
1��*�*�4�0�0�0��
1��*�*�4�0�0�0��	-��&�&�t�,�,�,��t�x��&�&�&r/c����fd�}|S)Nc���|r*|ddkr�jjr�jr�jrdndS��d��dS)z+Throw an error unless the argument is zero.rr/rNzFile is not open for reading.N)r;rQr&r/rN�rr�r,s  �r.�
read_errorz/FakeFileWrapper._read_error.<locals>.read_errorssX����
7��Q��1����#�1�7�d�k�7�"&�,�6�3�3�B�6��K�K�7�8�8�8�8�8r/r�)r,r�s` r.r�zFakeFileWrapper._read_errorrs$���	9�	9�	9�	9�	9��r/c����fd�}|S)Nc����jr)�jjr|rt|d��dkrdS��d��dS)zThrow an error.rzFile is not open for writing.N)r&r;rQrXrNr�s  �r.�write_errorz1FakeFileWrapper._write_error.<locals>.write_error}sT����{�
��#�1��d��s�4��7�|�|�q�?P�?P��1��K�K�7�8�8�8�8�8r/r�)r,r�s` r.r�zFakeFileWrapper._write_error|s$���	9�	9�	9�	9�	9��r/c��|j�A|jt|jj��kr|jj|j}|�||vrdSdS)NTF)r<rXr;r\r_s  r.rYzFakeFileWrapper._is_open�sP���<�#���s�4�;K�;V�7W�7W�(W�(W��)�4�T�\�B�J��%�$�*�*<�*<��t��ur/c�^�|js#|���std���dSdS)NzI/O operation on closed file)r'rYrOr_s r.rhz FakeFileWrapper._check_open_file�s>���~�	=�d�m�m�o�o�	=��;�<�<�<�	=�	=�	=�	=r/c�l�|js|�d��|j���S�NzFile is not open for reading)r+rNr5�__iter__r_s r.r�zFakeFileWrapper.__iter__�s3���z�	8��K�K�6�7�7�7��x� � �"�"�"r/c�b�|js|�d��t|j��Sr�)r+rNr�r5r_s r.�__next__zFakeFileWrapper.__next__�s-���z�	8��K�K�6�7�7�7��D�H�~�~�r/)F)r(r�r(Nr�)1r0r1r2r3r#r
r�rr4r�r+r?r�
BaseExceptionrrHrrNrQrVrFr�rarfrZrlrmr9r:rjrcrkrr�r�r�r�r�rvr
r�r�r�rYrhr	rr�r�r�r/r.rr�sH��������, �!B+�B+��B+��B+��	B+�
�B+��
B+��B+�%�B+��#��B+��B+��B+��3�-�B+���
�B+��B+��B+� �!B+�B+�B+�B+�H������4�
�.�/���-�(����'�	�

�����/�c�/�h�/�/�/�/�
 �H� � � � �>��>�>�>�>�����0�#��#�#�#��X�#�
�#�
�$�
�
�
�
�,�,�,�,�6*�*�*�*�
-�
-�
-�
-�	�	�3�	��	�D�	�	�	�	��c�����(2�2�2�2�"�U�"�t�"�"�"�"�"�3�"�8�"�"�"�"�H!�3�!�8�!�!�!�!�F/�3�/�8�/�/�/�/�b
5�#�
5�$�
5�
5�
5�
5� �8� � � � �:(�c�(�(�(�(�'��'��'�'�'�'�B�X������h������$�����=�=�=�=�#�%���
�x��� >�?�#�#�#�#�
����r/rc�\�eZdZdZdefd�Zdefd�Zdefd�Zd
dede	fd	�Z
dd�Zdefd�Z
d
S)r!zCWrapper for a system standard stream to be used in open files list.�
stream_objectc�"�||_d|_dSr�)�_stream_objectr<)r,r�s  r.r+zStandardStreamWrapper.__init__�s��+���&*����r/r(c��|jSr�)r�r_s r.rQz StandardStreamWrapper.get_object�s���"�"r/c�R�|j�|jSttjd���)z:Return the file descriptor of the wrapped standard stream.NrTrUr_s r.rVzStandardStreamWrapper.fileno�rWr/r)�nc�Z�tt|j�����Sr�)rrcr�r�)r,r�s  r.r�zStandardStreamWrapper.read�s!���E�4�.�3�3�5�5�6�6�6r/Nc��dS)z+We do not support closing standard streams.Nr�r_s r.rFzStandardStreamWrapper.close�����r/c��dSr�r�r_s r.r'zStandardStreamWrapper.is_stream�s���tr/�r)r�)r0r1r2r3rr+rQr�rVrcr�rFr�r'r�r/r.r!r!�s�������M�M�+�f�+�+�+�+�#�F�#�#�#�#�>��>�>�>�>�7�7�c�7�5�7�7�7�7�:�:�:�:��4������r/r!c�F�eZdZdZdededdfd�Zdefd�Zdefd	�Z	dd�Z
d
S)
r zAWrapper for a FakeDirectory object to be used in open files list.rr'rGrc�>�||_||_||_d|_dSr�)rr'r;r<)r,rr'rGs    r.r+zFakeDirWrapper.__init__�s&��'���"���%���&*����r/r(c��|jS)zKReturn the FakeFile object that is wrapped by the current
        instance.rPr_s r.rQzFakeDirWrapper.get_object�s
����r/c�R�|j�|jSttjd���rSrUr_s r.rVzFakeDirWrapper.fileno�rWr/Nc�V�|j�J�|j�|j��dS)zClose the directory.N)r<r;r[r_s r.rFzFakeDirWrapper.close�s/���|�'�'�'���)�)�$�,�7�7�7�7�7r/r�)r0r1r2r3r$rr+rQr�rVrFr�r/r.r r �s�������K�K�	+�"�	+��	+�%�		+�	+�	+�	+� �M� � � � �
>��>�>�>�>�8�8�8�8�8�8r/r c	���eZdZdZ	ddddededefd�Zdd
�Zde	e
ede	ed
e	ed	dfd�Z
dd�Zd	efd�Zdded	efd�Zdd�Zded	efd�Zdd�Zd	efd�Zd	efd�Zd	efd�ZdS) r"zdWrapper for a read or write descriptor of a real pipe object to be
    used in open files list.
    rNrGr�fd�	can_write�modec��||_||_||_d|_d|_d|_|rt
||��|_dSdSr�)r;r�r�rr<�	real_filer�)r,rGr�r�r�s     r.r+zFakePipeWrapper.__init__�sU��&������"������&*�������	,�!�"�d�^�^�D�N�N�N�	,�	,r/r(c��|S)�=To support usage of this fake pipe with the 'with' statement.r�r_s r.r?zFakePipeWrapper.__enter__�r@r/rArBrCNc�.�|���dS)r�NrErGs    r.rHzFakePipeWrapper.__exit__�rIr/c��|jSr�rPr_s r.rQzFakePipeWrapper.get_object�s����r/c�R�|j�|jSttjd���)z3Return the fake file descriptor of the pipe object.NrTrUr_s r.rVzFakePipeWrapper.fileno�rWr/r)�numBytesc�x�|jr|j�|��Stj|j|��S)zRead from the real pipe.)r�r�r�r�)r,r�s  r.r�zFakePipeWrapper.reads6���>�	1��>�&�&�x�0�0�0��w�t�w��)�)�)r/c��dS)zFlush the real pipe?Nr�r_s r.rZzFakePipeWrapper.flushr�r/rFc�x�|jr|j�|��Stj|j|��S)zWrite to the real pipe.)r�r�r�r�r�s  r.r�zFakePipeWrapper.write	s6���>�	2��>�'�'��1�1�1��x����*�*�*r/c���|j�J�|jj|j}|�J�|�|��|jr|j���dSt
j|j��dS)zClose the pipe descriptor.N)r<r;r\r]r�rFr�r�r_s  r.rFzFakePipeWrapper.closes~���|�'�'�'��%�0���>�
��%�%�%����$�����>�	��N� � �"�"�"�"�"��H�T�W�����r/c��|jS�z0The pipe end can either be readable or writable.�r�r_s r.�readablezFakePipeWrapper.readables
���>�!�!r/c��|jSr�r�r_s r.�writablezFakePipeWrapper.writables
���~�r/c��dS)zA pipe is not seekable.Fr�r_s r.�seekablezFakePipeWrapper.seekable"r�r/)rN)r(r"r�r�)r0r1r2r3r�r�r4r+r?rrr�rrHrQrVrcr�rZr�rFr�r�r�r�r/r.r"r"�s����������,�,�$�,�
�,��	,�
�,�,�,�,� ������4�
�.�/���-�(����'�	�

����� � � � �>��>�>�>�>�*�*�S�*�%�*�*�*�*�#�#�#�#�+�e�+��+�+�+�+�	�	�	�	�"�$�"�"�"�"��$������$������r/r")5r3r}r�rer�r�r�rr�typesr�typingrrrr	r
rrr
rrrrr�pyfakefsr�pyfakefs.helpersrrrrrrrrrr�pyfakefs.fake_filesystemr�AnyFileWrapperr�	Exceptionr&r#r�r�r$r
rr!r r"r�r/r.�<module>r�s���������	�	�	�	�
�
�
�
�	�	�	�	�
�
�
�
��������� ������������������������������������ �������������������������������8�7�7�7�7�7�7������+�
,��	
�	
�	
�	
�	
�y�	
�	
�	
�w4�w4�w4�w4�w4�w4�w4�w4�t	
�
�
�
�
�8�
�
�
�,�,�,�,�,�8�,�,�,�^g�g�g�g�g�H�g�g�g�TKF�KF�KF�KF�KF�]�KF�KF�KF�\Z�Z�Z�Z�Z�Z�Z�Z�z��������48�8�8�8�8�8�8�8�>O�O�O�O�O�O�O�O�O�Or/

?>