+
    Bi                     0   R t ^ RIt^RIHt ^RIHt ]'       d   ^ RIHt ^ RIH	t	H
t
Ht RtRtM9^ RIH	t	H
t
Ht ^ RIHt ]P                  ! 4       t]P"                  t]P                  t ! R	 R
4      t ! R R]	4      t ! R R]
]4      t ! R R]]4      tR# )z
Implementations of ReadablePath and WritablePath for local paths, for use in
pathlib tests.

LocalPathGround is also defined here. It helps establish the "ground truth"
about local paths in tests.
N)is_pypi)LexicalPathrmtree)PathInfo_ReadablePath_WritablePathTTESTFN)	os_helperc                   .  a  ] tR t^t o ]tR tRR ltR tRR ltR t	R t
R t]! ]P                  P                  4      t]! ]P                  P                   4      t]! ]P                  P"                  4      t]! ]P$                  4      tR tR	 tR
tV tR# )LocalPathGroundc                    Wn         R # Npath_cls)selfr   s   &&;/usr/lib/python3.14/test/test_pathlib/support/local_path.py__init__LocalPathGround.__init__   s         c                j    V P                  \        V,           4      p\        P                  ! V4       V# r   )r   testfnosmkdir)r   local_suffixroots   && r   setupLocalPathGround.setup!   s%    }}Vl23
r   c                    \        V4       R # r   r   )r   r   s   &&r   teardownLocalPathGround.teardown&   s	    tr   c                    \        VR 4      ;_uu_ 4       pVP                  V4       RRR4       R#   + '       g   i     R# ; i)wbN)openwrite)r   pdatafs   &&& r   create_fileLocalPathGround.create_file)   s&    !T]]aGGDM ]]]s	   1A	c                2    \         P                  ! V4       R # r   r   r   )r   r%   s   &&r   
create_dirLocalPathGround.create_dir-   s    
r   c                2    \         P                  ! W!4       R # r   r   symlink)r   r%   targets   &&&r   create_symlinkLocalPathGround.create_symlink0   s    


6r   c                   \         P                  ! \         P                  P                  VR 4      4       \         P                  ! \         P                  P                  VR4      4       \         P                  ! \         P                  P                  VR4      4       \         P                  ! \         P                  P                  VRR4      4       \	        \         P                  P                  VR4      R4      ;_uu_ 4       pVP                  R4       RRR4       \	        \         P                  P                  VRR4      R4      ;_uu_ 4       pVP                  R	4       RRR4       \	        \         P                  P                  VRR
4      R4      ;_uu_ 4       pVP                  R4       RRR4       \	        \         P                  P                  VRR4      R4      ;_uu_ 4       pVP                  R4       RRR4       \	        \         P                  P                  VRRR4      R4      ;_uu_ 4       pVP                  R4       RRR4       V P                  '       Ed/   \         P                  ! R\         P                  P                  VR4      4       \         P                  ! R\         P                  P                  VR4      4       \         P                  ! R\         P                  P                  VR4      RR7       \         P                  ! \         P                  P                  RR4      \         P                  P                  VR R4      RR7       \         P                  ! R\         P                  P                  VR4      4       R# R#   + '       g   i     EL; i  + '       g   i     ELP; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i)dirAdirBdirCdirDfileAr"   s   this is file A
NfileBs   this is file B
fileCs   this is file C
z	novel.txts   this is a novel
fileDs   this is file D
linkAznon-existing
brokenLinklinkBT)target_is_directoryz..linkCbrokenLinkLoop)r   r   pathjoinr#   r$   can_symlinkr0   r   r%   r'   s   && r   create_hierarchy LocalPathGround.create_hierarchy3   sd   
a()
a()
a()
a01"'',,q'*D11QGG'( 2"'',,q&'2D99QGG'( :"'',,q&'2D99QGG'( :"'',,q&+6==GG() >"'',,q&&':DAAQGG'( BJJwQ 89JJ~rww||A|'DEJJvww||Aw/+/1 JJrww||D&1ww||Avw7+/1 JJ'a9I)JK  211999999===AAAs<   NN*N>+O9O&N'	*N;	>O	O#	&O7	c                    \        VR RR7      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)rzutf-8)encodingNr#   readrF   s   && r   readtextLocalPathGround.readtextT   s+    !S7++q668 ,+++s	   2A	c                    \        VR 4      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)rbNrL   rF   s   && r   	readbytesLocalPathGround.readbytesX   s$    !T]]a668 ]]]s	   0A	r   N) )r   )__name__
__module____qualname____firstlineno__rE   r   r   r   r(   r,   r2   rG   staticmethodr   rC   isdirisfileislinkreadlinkrN   rR   __static_attributes____classdictcell____classdict__s   @r   r   r      s     K!
L8 'E"''..)F"''..)FBKK(H r   r   c                   ^   a  ] tR t^]t o RtRtR tRR/R ltRR/R ltRR/R lt	R t
R	tV tR
# )LocalPathInfoz4
Simple implementation of PathInfo for a local path
c                ^    \        V4      V n        R V n        R V n        R V n        R V n        R # r   )str_path_exists_is_dir_is_file_is_symlink)r   rC   s   &&r   r   LocalPathInfo.__init__c   s*    Y
r   follow_symlinksTc                   V'       g   V P                  4       '       d   R# V P                  f/   \        P                  P	                  V P
                  4      V n        V P                  # )zWhether this path exists.T)
is_symlinkrg   r   rC   existsrf   r   rl   s   &$r   ro   LocalPathInfo.existsj   s@    4??#4#4<<77>>$**5DL||r   c                   V'       g   V P                  4       '       d   R# V P                  f/   \        P                  P	                  V P
                  4      V n        V P                  # )z!Whether this path is a directory.F)rn   rh   r   rC   rZ   rf   rp   s   &$r   is_dirLocalPathInfo.is_dirr   s@    4??#4#4<<77==4DL||r   c                   V'       g   V P                  4       '       d   R# V P                  f/   \        P                  P	                  V P
                  4      V n        V P                  # )z$Whether this path is a regular file.F)rn   ri   r   rC   r[   rf   rp   s   &$r   is_fileLocalPathInfo.is_filez   s@    4??#4#4== GGNN4::6DM}}r   c                    V P                   f/   \        P                  P                  V P                  4      V n         V P                   # )z%Whether this path is a symbolic link.)rj   r   rC   r\   rf   r   s   &r   rn   LocalPathInfo.is_symlink   s3    #!ww~~djj9Dr   )rg   rh   ri   rj   rf   N)rf   rg   rh   ri   rj   )rU   rV   rW   rX   __doc__	__slots__r   ro   rs   rv   rn   r^   r_   r`   s   @r   rc   rc   ]   sE      KI       r   rc   c                   V   a a ] tR t^t oRtRtV 3R ltR tRR ltR t	R t
RtVtV ;t# )	ReadableLocalPathzK
Simple implementation of a ReadablePath class for local filesystem paths.
c                D   < \         SV `  ! V!   \        V 4      V n        R # r   )superr   rc   info)r   pathsegments	__class__s   &*r   r   ReadableLocalPath.__init__   s    ,'!$'	r   c                    \        V 4      # r   re   ry   s   &r   
__fspath__ReadableLocalPath.__fspath__       4yr   c                    \        V R 4      # )rQ   r#   r   	bufferings   &&r   __open_rb__ReadableLocalPath.__open_rb__       D$r   c                D   a  V 3R  l\         P                  ! S 4       4       # )c              3   6   <"   T F  pSV,          x  K  	  R # 5ir    ).0namer   s   & r   	<genexpr>,ReadableLocalPath.iterdir.<locals>.<genexpr>   s     9(8t(8s   )r   listdirry   s   fr   iterdirReadableLocalPath.iterdir   s    9

4(899r   c                L    V P                  \        P                  ! V 4      4      # r   )with_segmentsr   r]   ry   s   &r   r]   ReadableLocalPath.readlink   s    !!"++d"344r   )r   )rU   rV   rW   rX   r{   r|   r   r   r   r   r]   r^   r_   __classcell__)r   ra   s   @@r   r~   r~      s/      I( :5 5r   r~   c                   L   a  ] tR t^t o RtRtR tRR ltR	R ltR
R lt	Rt
V tR# )WritableLocalPathzK
Simple implementation of a WritablePath class for local filesystem paths.
c                    \        V 4      # r   r   ry   s   &r   r   WritableLocalPath.__fspath__   r   r   c                    \        V R 4      # )r"   r   r   s   &&r   __open_wb__WritableLocalPath.__open_wb__   r   r   c                2    \         P                  ! W4       R # r   r+   )r   modes   &&r   r   WritableLocalPath.mkdir   s    
r   c                4    \         P                  ! WV4       R # r   r/   )r   r1   r@   s   &&&r   
symlink_toWritableLocalPath.symlink_to   s    


6!45r   r   Nr   )i  )F)rU   rV   rW   rX   r{   r|   r   r   r   r   r^   r_   r`   s   @r   r   r      s*      I 6 6r   r   )r{   r   rT   r   lexical_pathr   shutilr   pathlib_abcr   r   r   rE   r   pathlib.typestest.supportr
   r	   r   rc   r~   r   r   r   r   <module>r      s    
  %
BBKFDD&'')KFF? ?D) H ) X5{ 5.6{ 6r   