+
    Bi<                        R t ^ RIt^ RIt^ RIt^ RIt^RIHt ^RIH	t	H
t
 ^RIHtHt ]'       d   ^ RIHtHt ^ RIHt M^ RIHtHt ^ RIHt  ! R R4      t ! R	 R
]]P,                  4      t ! R R]]P,                  4      t]'       g   ^ RIHt  ! R R]]P,                  4      t]R8X  d   ]P:                  ! 4        R# R# )z'
Tests for pathlib.types._ReadablePath
N)is_pypi)ReadableLocalPathLocalPathGround)ReadableZipPathZipPathGround)PathInfo_ReadablePath)
magic_openc                   R  a  ] tR t^t o R tR tR tR t]P                  ! ]
! ]P                  R^ 4      '       * R4      R 4       tR tR	 tR
 t]P                  ! ]
! ]P                  R^ 4      '       * R4      R 4       tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )ReadTestBasec                    V P                   P                  4       V n        V P                   P                  V P                  4       R # N)groundsetuprootcreate_hierarchyselfs   &2/usr/lib/python3.14/test/test_pathlib/test_read.pysetUpReadTestBase.setUp   s,    KK%%'	$$TYY/    c                P    V P                   P                  V P                  4       R # r   )r   teardownr   r   s   &r   tearDownReadTestBase.tearDown   s    TYY'r   c                F    V P                  V P                  \        4       R # r   )assertIsInstancer   r   r   s   &r   test_is_readableReadTestBase.test_is_readable   s    dii7r   c                   V P                   R ,          p\        VRRR7      ;_uu_ 4       pV P                  V\        P                  4       V P                  VP                  4       R4       RRR4       R#   + '       g   i     R# ; i)fileArutf-8encodingthis is file A
N)r   r	   r   io
TextIOBaseassertEqualreadr   pfs   &  r   test_open_rReadTestBase.test_open_r!   s[    II311Q!!!R]]3QVVX'9: 2111s   AA55B	warn_default_encodingzRequires warn_default_encodingc           	     @   V P                   R ,          pV P                  \        4      ;_uu_ 4       p\        VR4      ;_uu_ 4         RRR4       RRR4       V P	                  XP
                  \        4       R#   + '       g   i     L:; i  + '       g   i     LE; i)r!   r"   N)r   assertWarnsEncodingWarningr	   r)   filename__file__r   r,   wcs   &  r   test_open_r_encoding_warning)ReadTestBase.test_open_r_encoding_warning'   sg    
 IIo.."As## $ / 	h/ $# /.s#   BA:	B:B
BB	c                   V P                   R ,          p\        VR4      ;_uu_ 4       pV P                  VP                  4       R4       RRR4       V P	                  \
        \        VRRR7       V P	                  \
        \        VRRR7       V P	                  \
        \        VRRR	7       R#   + '       g   i     Ll; i)
r!   rb   this is file A
Nutf8r$   strict)errors )newline)r   r	   r)   r*   assertRaises
ValueErrorr+   s   &  r   test_open_rbReadTestBase.test_open_rb2   s    II4  AQVVX':; !*j!TFK*j!T(K*j!T2F	 ! s   !B--B=	c                l    V P                   R ,          pV P                  VP                  4       R4       R# )r!   r<   N)r   r)   
read_bytesr   r,   s   & r   test_read_bytesReadTestBase.test_read_bytes:   s'    II)<=r   c                X   V P                   R ,          pV P                  VP                  RR7      R4       V P                   R,          pV P                  P	                  VR4       V P                  VP                  RR7      R4       V P                  VP                  RRR	7      R
4       R# )r!   r#   r$   r&   abcs   bcdefgzlatin-1u   äbcdefgignore)r%   r?   bcdefgN)r   r)   	read_textr   create_file)r   r,   qs   &  r   test_read_textReadTestBase.test_read_text>   s    IIg68JKII=1i8*EghGRr   c                    V P                   R ,          pV P                  \        4      ;_uu_ 4       pVP                  4        RRR4       V P	                  XP
                  \        4       R#   + '       g   i     L2; ir!   N)r   r2   r3   rO   r)   r4   r5   r6   s   &  r   test_read_text_encoding_warning,ReadTestBase.test_read_text_encoding_warningF   sP    
 IIo.."KKM /h/ /.s   A,,A<	c                6   V P                   R ,          pV P                  P                  VR4       V P                  VP	                  RRR7      R4       V P                  VP	                  RRR7      R4       V P                  VP	                  RRR7      R4       R# )	rL   s   abcde
fghlk
mnopqr#   
)r%   rA   zabcde
fghlk
mnopqz
N)r   r   rP   r)   rO   rH   s   & r   test_read_text_with_newlines)ReadTestBase.test_read_text_with_newlinesP   s    II#=>gtDF_`gtDF_`gvFHabr   c                    . ROpV P                   P                  '       d   V. RO,          pV Uu0 uF  q P                  P                  V4      kK  	  pp\	        V P                  P                  4       4      pV P                  W14       R# u upi )dirAN)r^   dirBdirCr!   )linkAlinkB
brokenLinkbrokenLinkLoop)r   can_symlinkr   joinpathsetiterdirr)   )r   expectednameactuals   &   r   test_iterdirReadTestBase.test_iterdirZ   sn    4;;"""JJH9ABII&&t,BTYY&&()* Cs   #Bc                l    V P                   R ,          pV P                  \        VP                  4       R# rU   )r   rB   OSErrorrh   rH   s   & r   test_iterdir_nodirReadTestBase.test_iterdir_nodirb   s$    II'199-r   c                    V P                   P                  4        FN  pV P                  VP                  \        4       V P                  VP                  P                  R R7      4       KP  	  R# )Ffollow_symlinksN)r   rh   r   infor   
assertTrueexists)r   childs   & r   test_iterdir_infoReadTestBase.test_iterdir_infof   sK    YY&&(E!!%**h7OOEJJ--e-DE )r   c                  a aaa S P                   P                  '       g   S P                  R 4       S P                  oS P                  P                  P
                  oS P                  P                  P                  oVVV V3R lpSP                  R4      pS P                  V\        P                  P                  4       S P                  \        V4      SP                  R4      .4       V! R. R(O4       V! R. R(O4       V! RRR.4       V! RRR.4       V! RR.4       V! RR.4       V! R	. R)O4       V! R. R*O4       V! R. R+O4       V! RR.4       V! RRR.4       V! R. R,O4       V! R. R-O4       V! R. R.O4       V! R. R/O4       V! RRR.4       V! RRR.4       V! RRR.4       V! RR.4       V! RR.4       V! RRR.4       V! R . 4       V! R!. 4       V! R". R0O4       V! R#. R0O4       V! R$RR.4       V! R$RR.4       V! R%. R1O4       S P                  \         R&4      ;_uu_ 4        \        SP                  R
4      4       R'R'R'4       R'#   + '       g   i     R'# ; i)2zrequires symlinksc                   < S'       d!   V Uu0 uF  q"P                  SS4      kK  	  ppV Uu0 uF  pSP                  V4      kK  	  pp\        SP                  V R R7      4      pSP	                  W14       R# u upi u upi )T)recurse_symlinksN)replacerf   rg   globr)   )patternri   rj   rk   altsepr,   r   seps   &&  r   check%ReadTestBase.test_glob.<locals>.checkr   sn    BJK($LL5(K5=>XT

4(XH>$?@FV. L>s
   A9A>r!   z*Az*B/*
dirB/fileBlinkB/fileBrc   rd   z**/r@   dirA/linkC/
dirC/dirD/z**/*/z*/z
*/dirD/**/z	*/dirD/**dirC/dirD/fileDzdir*/**
dirC/fileCzdir*/**/z
dir*/**/..dirA/linkC/..dirC/dirD/..z	dir*/*/**z
dir*/*/**/zdir*/*/**/..z	dir*/*/..zdir*/*/../dirD/**/zdirC/dirD/../dirD/zdir*/**/fileCz
dir*/file*z
**/*/fileAfileBz
**/*/fileBz**/fileBz*/fileBz**/file*zUnacceptable patternN)r^   r!   ra   )r@   dirA/r   dirB/dirC/r   linkB/)r   r   r   r   r   r   )r   r   r   r   )
r   z
dirA/linkCdirA/linkC/fileBr   r   r   r   z	dirC/dirDr   zdirC/novel.txt)r   r   r   r   r   )zdirA/..r   zdirB/..zdirC/..r   )r   r   r   r   )r   r   r   )r!   r   r   r   r   r   )r   re   skipTestr   parserr   r   r   r   collectionsrL   Iteratorr)   listrf   assertRaisesRegexrC   )r   r   itr   r,   r   s   f  @@@r   	test_globReadTestBase.test_globk   sH   {{&&&MM-.IIii""!!((	/ 	/ VVG_b+//":":;bAJJw$7#89d./d./f|]34f|]34l\N+!1 23e[\gYZd9:l\N+kL*;<=i Z 	[jRSl^_k_`l]L9:n?@kNO<="%9$:;o~.l\<89lBgrlMNjKLi,67i,67j	 ##J0FGG HGGGs   6II,	c                   V P                   P                  4       p\        V4      w  r#pVP                  4        VP                  4        V P	                  W P                   4       V P	                  V. RO4       T P	                  TV P
                  P                  '       d   . ROMR.4       \        V4      w  r#pV P	                  W P                   R ,          4       V P	                  V. 4       T P	                  Y@P
                  P                  '       d   R.M. 4       \        V4      w  r#pV P	                  W P                   R,          4       V P	                  V. 4       V P	                  VR.4       \        V4      w  r#pVP                  4        V P	                  W P                   R,          4       V P	                  VR.4       V P	                  VRR.4       \        V4      w  r#pV P	                  W P                   R,          R,          4       V P	                  V. 4       V P	                  VR	.4       V P                  \        \        V4       R
# )r^   r_   r`   r!   linkCr   dirDfileC	novel.txtfileDNr^   r_   r`   rc   rd   r!   ra   rb   )	r   walknextsortr)   r   re   rB   StopIteration)r   r   pathdirnames	filenamess   &    r   test_walk_top_downReadTestBase.test_walk_top_down   s   YY^^$(H!	yy)#;<'+{{'>'>'> %`ELI	O %)H!	yy6122&1H1H1HWIbQ$(H!	yy6122&WI.$(H!	yy612F8,Wk$:;$(H!	yy61F:;2&WI.-r2r   c                   V P                   V P                   R ,          V P                   R,          V P                   R,          R,          0p\        4       pV P                   P                  4        F:  w  r4pVP                  V4       W0P                   8X  g   K)  VP	                  R4       K<  	  V P                  W!4       R# )r^   r`   r   r_   N)r   rg   r   addremover)   )r   ri   rk   r   r   r   s   &     r   test_walk_pruneReadTestBase.test_walk_prune   s    IItyy61499v3EtyySYGY\bGbc)-)9%DIJJtyy ' *: 	*r   c                   R ;p;p;p;rEV P                   P                  R R7       EF  w  rgpW`P                   8X  d   V P                  V4       V P                  V4       V P                  V4       V P                  V4       V P	                  \        V4      . RO4       T P	                  \        V4      V P                  P                  '       d   . ROMR.4       RpK  W`P                   R,          8X  dj   V P                  V4       V P                  V4       V P	                  V. 4       T P	                  YP                  P                  '       d   R.M. 4       RpEK8  W`P                   R,          8X  dM   V P                  V4       V P                  V4       V P	                  V. 4       V P	                  VR.4       RpEK  W`P                   R,          8X  di   V P                  V4       V P                  V4       V P                  V4       V P	                  VR	.4       V P	                  \        V4      R
R.4       RpEK  W`P                   R,          R	,          8X  d^   V P                  V4       V P                  V4       V P                  V4       V P	                  V. 4       V P	                  VR.4       RpEK  \        RV 24      h	  V P                  V4       R# )F)top_downr^   r_   r`   r!   Tr   r   r   r   r   r   zUnexpected path: Nr   r   )	r   r   assertFalserv   r)   sortedr   re   AssertionError)	r   	seen_root	seen_dira	seen_dirb	seen_dirc	seen_dirdr   r   r   s	   &        r   test_walk_bottom_up ReadTestBase.test_walk_bottom_up   sf   DII	III	II)-)G%DIyy   +	*	*	*  !13KL  	!2$(KK$;$;$; "]BIL !	V++  +  +  2.  9P9P9PWIVXY 	V++  +  +  2.  WI6 	V++  +  +	*  F84  	!2Wk4JK 	V+f44  +  +  +  2.  WI6 	$'8%?@@M *HN 		"r   c                   V P                   pV P                  VP                  P                  4       4       V P                  VR ,          P                  P                  4       4       V P                  VR ,          P                  P                  RR7      4       V P                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P
                  P                  '       Ed   V P                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  RR7      4       V P                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  RR7      4       V P	                  VR	,          P                  P                  4       4       V P                  VR	,          P                  P                  RR7      4       V P	                  VR
,          P                  P                  4       4       V P	                  VR
,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       R# )r^   Frs   r!   non-existingra   rb   Trc   rd      fileAfileA N)r   rv   ru   rw   r   r   re   rH   s   & r   test_info_existsReadTestBase.test_info_exists   s   II(V))0023V))000GHW**1134W**11%1HI!n,2299;<!n,2299%9PQ;;"""OOQ[..5578OOQ[..55e5LMOOQ[..5578OOQ[..55d5KLa,.44;;=>OOQ-33::5:QRa"2288??ABOOQ!1177>>u>UV!m+1188:;!m+11888OP!k///6689!k///66u6MNr   c                <   V P                   pV P                  VR ,          P                  P                  4       4       V P                  VR ,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P
                  P                  '       Ed   V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P	                  VR	,          P                  P                  4       4       V P	                  VR	,          P                  P                  RR7      4       V P	                  VR
,          P                  P                  4       4       V P	                  VR
,          P                  P                  RR7      4       R# )r^   Frs   r!   r   ra   rb   rc   rd   u   dirAzdirA N)r   rv   ru   is_dirr   r   re   rH   s   & r   test_info_is_dirReadTestBase.test_info_is_dir  s   IIV))0023V))000GH!g+++2245!g+++2252IJ!n,2299;<!n,2299%9PQ;;"""a'k//6689a'k//66u6MNOOQ[..5578a'k//66u6MNa,.44;;=>a,.44;;E;RSa"2288??ABa"2288??PU?VW!l*00779:!l*00777NO!j...5578!j...55e5LMr   c                <   V P                   pV P                  VR ,          P                  P                  4       4       V P                  VR ,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P
                  P                  '       Ed   V P                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P	                  VR,          P                  P                  4       4       V P	                  VR,          P                  P                  RR7      4       V P	                  VR	,          P                  P                  4       4       V P	                  VR	,          P                  P                  RR7      4       V P	                  VR
,          P                  P                  4       4       V P	                  VR
,          P                  P                  RR7      4       R# )r!   Frs   r^   r   ra   rb   rc   rd   r   r   N)r   rv   ru   is_filer   r   re   rH   s   & r   test_info_is_fileReadTestBase.test_info_is_file!  s   IIW**2245W**2252IJ!f***2245!f***2252IJ!n,22::<=!n,22::5:QR;;"""OOQ[..6689a'k//777NOa'k//779:a'k//777NOa,.44<<>?a,.44<<U<STa"2288@@BCa"2288@@QV@WX!m+1199;<!m+1199%9PQ!k///779:!k///777NOr   c                x   V P                   pV P                  VR ,          P                  P                  4       4       V P                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  4       4       V P                  P
                  '       Ed!   V P                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  4       4       V P                  VR,          P                  P                  4       4       V P                  VR	,          P                  P                  4       4       V P                  VR
,          P                  P                  4       4       R# )r!   r^   r   ra   rb   rc   u   linkAzlinkA rd   r   r   N)r   r   ru   
is_symlinkr   re   rv   rH   s   & r   test_info_is_symlink!ReadTestBase.test_info_is_symlink7  s   II!g+++6689!f***5578!n,22==?@;;"""OOQ[..99;<OOQ[..99;<OOQ-33>>@Aa-/55@@BCa+o33>>@AOOQ!1177BBDE!m+11<<>?!k///::<=r   )r   N) __name__
__module____qualname____firstlineno__r   r   r   r.   unittestskipIfgetattrsysflagsr8   rD   rI   rR   rV   r[   rl   rp   ry   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     0(8; __CII6::(0	0G>S __CII6::(0	0c+.F
1f 3D+)#VO.N,P,> >r   r   c                   &    ] tR tRt]! ]4      tRtR# )ZipPathReadTestiG   N)r   r   r   r   r   r   r   r   r   r   r   r   r   G  s    ?+Fr   r   c                   &    ] tR tRt]! ]4      tRtR# )LocalPathReadTestiK  r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   K  s    ./Fr   r   )Pathc                   &    ] tR tRt]! ]4      tRtR# )PathReadTestiR  r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   R  s     &r   r   __main__)__doc__collections.abcr   r'   r   r   supportr   support.local_pathr   r   support.zip_pathr   r   pathlib_abcr   r   pathlib_abc._osr	   pathlib.typespathlib._osr   TestCaser   r   pathlibr   r   r   mainr   r   r   <module>r      s     	 
   B <
3*5&n> n>b	,lH$5$5 ,0h&7&7 0 '|X%6%6 ' zMMO r   