+
    BiU                        ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t^ RI
HtHt ^RIHt ^RIHt ^RIHtHt  ! R R4      tR R	 ltR
 t]P.                  ! ]4      ]P.                  ! ]! ]P0                  P2                  P4                  ]4      4      .t]! R.]4      t ! R R]P:                  4      t ! R R]P>                  4      t R# )    N)FakePathtemp_dir)compose)Counter)Invokedparameterizec                   *    ] tR t^t ! R R4      tRtR# )jaracoc                       ] tR t^t]tRtR# )jaraco.itertools N)__name__
__module____qualname____firstlineno__r   __static_attributes__r       8/usr/lib/python3.14/test/test_zipfile/_path/test_path.py	itertoolsr      s    r   r   r   N)r   r   r   r   r   r   r   r   r   r
   r
      s     r   r
   c                8    V ^8  d   QhR\         P                  /# )   info)zipfileZipInfo)formats   "r   __annotate__r      s     - -W__ -r   c                 b    V ;P                   \        P                  ^,          ,          un         R# )   N)external_attrstatS_IFLNK)r   s   &r   
_make_linkr"      s    $,,",,r   c                    \         P                  ! 4       p \        P                  ! V R4      pVP	                  RR4       VP	                  RR4       VP	                  RR4       VP	                  RR	4       VP	                  R
R4       VP	                  RR4       VP	                  RR4       VP	                  RR4       VP	                  RR4       \        VP                  4       R,          4       RVn        V# )u  
Create a zip file with this structure:

.
├── a.txt
├── n.txt (-> a.txt)
├── b
│   ├── c.txt
│   ├── d
│   │   └── e.txt
│   └── f.txt
├── g
│   └── h
│       └── i.txt
└── j
    ├── k.bin
    ├── l.baz
    └── m.bar

This fixture has the following key characteristics:

- a file at the root (a)
- a file two levels deep (b/d/e)
- multiple files in a directory (b/c, b/f)
- a directory containing only a directory (g/h)
- a directory with files of different extensions (j/klm)
- a symlink (n) pointing to (a)

"alpha" because it uses alphabet
"rep" because it's a representative example
wa.txt   content of ab/c.txts   content of cz	b/d/e.txts   content of eb/f.txts   content of f	g/h/i.txts   content of ij/k.bins   content of kj/l.bazs   content of lzj/m.bars   content of mn.txts   a.txtalpharep.zip)ioBytesIOr   ZipFilewritestrr"   infolistfilename)datazfs     r   build_alpharep_fixturer7      s    @ ::<D	s	#BKK)KK	?+KK_-KK	?+KK_-KK	?+KK	?+KK	?+KK"r{{}R ! BKIr   alpharepc            	         a  ] tR t^Ut o R tR t]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       tR tR	 t]P                  ! ]! ]P$                  R
^ 4      '       * R4      ]R 4       4       tR t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t ]R 4       t!R@t"R t#R t$]R 4       t%]R 4       t&]R 4       t']R  4       t(]R! 4       t)]R" 4       t*]R# 4       t+]R$ 4       t,]R% 4       t-]R& 4       t.]R' 4       t/]R( 4       t0]R) 4       t1]R* 4       t2]R+ 4       t3]R, 4       t4]R- 4       t5]R. 4       t6]R/ 4       t7R0 t8]R1 4       t9]R2 4       t:]R3 4       t;]R4 4       t<]=! . RAO]>P~                  ! ]@]A]B.R5R6.4      4      R7 4       tC]R8 4       tD]R9 4       tER: tFR; tGR< tH]R= 4       tIR>tJV tKR?# )BTestPathc                    \         P                  ! 4       V n        V P                  V P                  P                  4       R # N)
contextlib	ExitStackfixtures
addCleanupclose)selfs   &r   setUpTestPath.setUpV   s(    ",,.++,r   c                z   \         P                  ! V P                  P                  \	        4       4      4      pVP
                  pVP                  4        W!P                  ,          pVP                  R 4      ;_uu_ 4       pVP                  VP                  4       4       RRR4       V#   + '       g   i     T# ; i)wbN)pathlibPathr?   enter_contextr   fprA   r4   openwritegetvalue)rB   r8   tmpdirbufferpathstrms   &&    r   zipfile_ondiskTestPath.zipfile_ondiskZ   s{    dmm99(*EF)))YYt__JJv()  _s   ? B))B:	c                h   \         P                  ! V4      pVP                  4       '       g   Q hVP                  4       w  r4rVpVP	                  4       '       g   Q hVP                  4       '       g   Q hVP                  4       '       g   Q hVP                  4       w  rp
VP	                  4       '       d   V	P	                  4       '       g   Q hV
P                  4       w  pVP	                  4       '       g   Q hVP                  4       w  pVP                  4       w  pVP	                  4       '       g   Q hR # r<   )r   rH   is_diriterdiris_file)rB   r8   rootanbgjcfdehis   &&            r   test_iterdir_and_typesTestPath.test_iterdir_and_typesc   s    ||H%{{}}}aAyy{{{xxzzzxxzzz))+ayy{{qyy{{**yy{yy{{{yy{yy{yy{{{r   c                    \         P                  ! V4      pVP                  R 4      P                  4       '       d   Q hR# )zmissing.txtN)r   rH   joinpathrW   rB   r8   rX   s   && r   test_is_file_missingTestPath.test_is_file_missings   s1    ||H%==/7799999r   c                    \         P                  ! V4      pVP                  4       w  r4rVpV P                  \        4      ;_uu_ 4        VP                  4        R R R 4       R #   + '       g   i     R # ; ir<   )r   rH   rV   assertRaises
ValueErrorrB   r8   rX   rY   rZ   r[   r\   r]   s   &&      r   test_iterdir_on_fileTestPath.test_iterdir_on_filex   sJ    ||H%aAz**IIK +***s   A##A4	c                *   \         P                  ! V4      pVR ,          P                  4       '       g   Q hVR,          P                  4       '       g   Q hVR,          P                  4       '       g   Q hVR,          P                  4       '       g   Q hR# )r[   b/r\   zg/N)r   rH   rU   rh   s   && r   test_subdir_is_dirTestPath.test_subdir_is_dir   st    ||H%s
""$$$$t##%%%%s
""$$$$t##%%%%r   c                   \         P                  ! V4      pVP                  4       w  r4rVpVP                  R R7      ;_uu_ 4       pVP	                  4       p	RRR4       V P                  X	R4       VP                  RR 4      ;_uu_ 4       pVP	                  4       p	RRR4       V P                  V	R4       R#   + '       g   i     Li; i  + '       g   i     L7; i)utf-8encodingNcontent of ar)r   rH   rV   rK   readassertEqual)
rB   r8   rX   rY   rZ   r[   r\   r]   rQ   r5   s
   &&        r   	test_openTestPath.test_open   s    ||H%aAVVWV%%99;D &~.VVC!!T99;D "~. &% "!s   B7
C
7C	
C	c                \   \         P                  ! 4       p\        P                  ! VR 4      pVP	                  RRP                  R4      4       RVn        \        P                  ! V4      pVP                  4       w  pVP                  R4      pVP                  RR4      ;_uu_ 4       pVP                  4       pRRR4       XR8X  g   Q hVP                  RR7      ;_uu_ 4       pVP                  4       pRRR4       VR8X  g   Q hR#   + '       g   i     LW; i  + '       g   i     L.; i)	r$   zpath/16.txtzThis was utf-16zutf-16ztest_open_utf16.zipz16.txtrz   Nrw   )r/   r0   r   r1   r2   encoder4   rH   rV   rg   rK   r{   )rB   in_memory_filer6   rX   rP   u16rQ   r5   s   &       r   test_open_encoding_utf16!TestPath.test_open_encoding_utf16   s    __^S1
M#4#;#;H#EF+||B,,.mmH%XXc8$$99;D %((((XXxX((D99;D )(((( %$ )(s   (D$DD	D+	c           	     x   \         P                  ! 4       p\        P                  ! VR 4      pVP	                  RR4       RVn        \        P                  ! V4      pVP                  4       w  pVP                  R4      pVP                  RRR7      pVR8X  g   Q hVP                  R	RR
R7      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       V P                  \        R4      ;_uu_ 4        VP                  RRR7      pRRR4       VP                  R	RRR7      ;_uu_ 4       pV P                  \        4      ;_uu_ 4        VP                  4        RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L@; i  + '       g   i     R# ; i)r$   zpath/bad-utf8.bins   invalid utf-8: .z"test_read_text_encoding_errors.zipzbad-utf8.binrv   ignore)errorszinvalid utf-8: .rz   surrogateescapeu   invalid utf-8: .Nrx   rw   strict)rx   r   )r/   r0   r   r1   r2   r4   rH   rV   rg   	read_textrK   r{   assertRaisesRegex	TypeErrorrl   UnicodeDecodeError)rB   r   r6   rX   rP   r   r5   r_   s   &       r   test_open_encoding_errors"TestPath.test_open_encoding_errors   sF   __^S1
')DE:||B,,.mmN+ }}WX}6))))XXc7+<X==668==== > ##Iz::==7=;D ; XXcGHX==""#566 7 >= >= ;: 76 >==s<   7E/6F.F(F	F(/E?	F	F% F((F9	warn_default_encodingzRequires warn_default_encodingc                P   \         P                  P                  '       g   Q h\        P                  ! V4      pV P                  \        4      ;_uu_ 4       pVP                  R4      P                  4        RRR4       \        XP                  8X  g   Q hV P                  \        4      ;_uu_ 4       pVP                  R4      P                  R4      P                  4        RRR4       \        VP                  8X  g   Q hR#   + '       g   i     L; i  + '       g   i     L<; i)z8EncodingWarning must blame the read_text and open calls.r%   Nrz   )sysflagsr   r   rH   assertWarnsEncodingWarningrg   r   __file__r4   rK   rA   )rB   r8   rX   wcs   &&  r   test_encoding_warningsTestPath.test_encoding_warnings   s     yy.....||H%o.."MM'",,. /2;;&&&o.."MM'"'',224 /2;;&&& /. /.s    D2/DD	D%	c                   \         P                  ! \         P                  ! \        P                  ! 4       RR7      4      pVP                  R4      P                  R4      ;_uu_ 4       pVP                  R4       RRR4       VP                  R4      P                  RRR	7      ;_uu_ 4       pVP                  R
4       RRR4       R#   + '       g   i     LV; i  + '       g   i     R# ; i)zW
If the zipfile is open for write, it should be possible to
write bytes or text to it.
r$   )modezfile.binrF   s   binary contentsNzfile.txtrv   rw   z	text file)r   rH   r1   r/   r0   rg   rK   rL   )rB   r6   rQ   s   &  r   test_open_writeTestPath.test_open_write   s    
 \\'//"**,SAB[[$))$//4JJ)* 0[[$))#)@@DJJ{# A@ 0/@@@s   (C,CC	C,	c                    \         P                  ! V4      pV P                  \        4      ;_uu_ 4        VP	                  R4      P                  4        RRR4       R#   + '       g   i     R# ; i)z:
Attempting to open a directory raises IsADirectoryError.
r[   N)r   rH   rl   IsADirectoryErrorrg   rK   rB   r8   r6   s   && r   test_open_extant_directory#TestPath.test_open_extant_directory   H    
 \\(#011KK!!# 2111    AA/	c                   \         P                  ! V4      pV P                  \        4      ;_uu_ 4        VP	                  R 4      P                  RRR7       RRR4       V P                  \        4      ;_uu_ 4        VP	                  R 4      P                  RR4       RRR4       R#   + '       g   i     LY; i  + '       g   i     R# ; i)r%   rbrv   rw   N)r   rH   rl   rm   rg   rK   rh   s   && r   test_open_binary_invalid_args&TestPath.test_open_binary_invalid_args   s    ||H%z**MM'"''w'? +z**MM'"''g6 +* +****s   #B(<"B;(B8	;C	c                    \         P                  ! V4      pV P                  \        4      ;_uu_ 4        VP	                  R4      P                  4        RRR4       R#   + '       g   i     R# ; i)zB
Attempting to open a missing directory raises FileNotFoundError.
zN)r   rH   rl   FileNotFoundErrorrg   rK   r   s   && r   test_open_missing_directory$TestPath.test_open_missing_directory   r   r   c                    \         P                  ! V4      pVP                  4       w  r4rVpVP                  R R7      R8X  g   Q hVP                  R 4      R8X  g   Q hVP	                  4       R8X  g   Q hR# )rv   rw   ry   r&   N)r   rH   rV   r   
read_bytesrn   s   &&      r   	test_readTestPath.test_read   se    ||H%aA{{G{,>>>{{7#~555||~000r   c                   \         P                  ! V4      pVP                  R 4      pVP                  4       '       g   Q hVP                  R4      P                  R4      P                  R4      pVP	                  RR7      R8X  g   Q hR# r%   r[   r`   e.txtrv   rw   content of eN)r   rH   rg   rW   r   rB   r8   rX   rY   ra   s   &&   r   test_joinpathTestPath.test_joinpath   sk    ||H%MM'"yy{{{MM#'',55g>{{G{,>>>r   c                    \         P                  ! V4      pVP                  R RR4      pVP                  RR7      R8X  g   Q hR# )r[   r`   r   rv   rw   r   N)r   rH   rg   r   )rB   r8   rX   ra   s   &&  r   test_joinpath_multipleTestPath.test_joinpath_multiple   s;    ||H%MM#sG,{{G{,>>>r   c                    \         P                  ! V4      pVR ,          pVP                  4       '       g   Q hVR,          R,          R,          pVP                  RR7      R8X  g   Q hR# r   )r   rH   rW   r   r   s   &&   r   test_traverse_truedivTestPath.test_traverse_truediv  sU    ||H%7Nyy{{{3Jw&{{G{,>>>r   c                |    V P                  V4      p\        \        V4      4      p\        P                  ! V4       R# )z>
zipfile.Path should be constructable from a path-like object
N)rR   r   strr   rH   )rB   r8   rR   pathlikes   &&  r   test_pathlike_construction#TestPath.test_pathlike_construction  s/    
 ,,X6C/0Xr   c                V    \         P                  ! V4      pV\        R 4      ,           R# )rY   N)r   rH   r   rh   s   && r   test_traverse_pathlikeTestPath.test_traverse_pathlike  s    ||H%x}r   c                    \         P                  ! V4      pVR ,          P                  P                  R8X  g   Q hVR ,          R,          P                  P                  R8X  g   Q hR# )rY    r[   za/Nr   rH   parentatrh   s   && r   test_parentTestPath.test_parent  sQ    ||H%s
""%%+++s
S ((++t333r   c                    \         P                  ! V4      pVR ,          P                  P                  R8X  g   Q hVR,          P                  P                  R8X  g   Q hR# )r[   r   rr   Nr   rh   s   && r   test_dir_parentTestPath.test_dir_parent"  sL    ||H%s
""%%+++t##&&",,,r   c                z    \         P                  ! V4      pVR ,          P                  P                  R8X  g   Q hR# )zmissing dir/r   Nr   rh   s   && r   test_missing_dir_parent TestPath.test_missing_dir_parent(  s/    ||H%~%--00B666r   c                   \         P                  ! V4      pVP                  4       w  r4rVpVP                  RR4       VP                  RR4       \        ;QJ d*    R VP                  4        4       F  '       g   K   RM	  RM! R VP                  4        4       4      '       g   Q hVR,          P                  RR	7      R8X  g   Q hVR
,          P                  4       w  pVP                  RR	7      R8X  g   Q hR# )zS
If the underlying zipfile is changed, the Path object should
reflect that change.
foo.txtfoozbar/baz.txtbazc              3   >   "   T F  qP                   R 8H  x  K  	  R# 5i)r   N)name).0childs   & r   	<genexpr>+TestPath.test_mutability.<locals>.<genexpr>7  s     Gu::*s   TFrv   rw   barN)r   rH   rV   r2   anyr   )	rB   r8   rX   rY   rZ   r[   r\   r]   r   s	   &&       r   test_mutabilityTestPath.test_mutability-  s     ||H%aA)U+-/sGGsssGGGGGGy ++W+=FFF,'')}}g}.%777r   c                    \         P                  ! 4       p\        P                  ! VR4      p\	        \
        \        V P                  4      4       F  pVP                  W34       K  	  RVn	        V# )zACreate a read-only zipfile with a huge number of entries entries.r$   rz   )
r/   r0   r   r1   mapr   rangeHUGE_ZIPFILE_NUM_ENTRIESr2   r   )rB   rQ   r6   entrys   &   r   huge_zipfileTestPath.huge_zipfile>  sR    zz|__T3'eD$A$ABCEKK% D	r   c                   \         P                  ! V P                  4       4      p\        P                  P                  VP                  4       4      pV F  pVP                  R4       K  	  VP                  V P                  8X  g   Q hR# )z5
Ensure joinpath on items in zipfile is linear time.
suffixN)
r   rH   r   r
   r   r   rV   rg   countr   )rB   rX   entriesr   s   &   r   test_joinpath_constant_time$TestPath.test_joinpath_constant_timeG  sg     ||D--/0""**4<<>:ENN8$  }} = ====r   c                   V P                  V4      p\        P                  ! V4      ;_uu_ 4       p\        ^4       F*  p\        P                  ! VR4      P                  RR7       K,  	  RRR4       R#   + '       g   i     R# ; i)r   r%   rv   rw   N)rR   r   r1   r   rH   r   )rB   r8   filereps   &&  r   test_read_does_not_close!TestPath.test_read_does_not_closeR  s\    &&x0__X&&$QxT7+55w5G   '&&&s   :A44B	c                ~     ! R  R\         P                  4      pV! V4      p\        VR,          V4      '       g   Q hR# )c                       ] tR tRtRtR# )(TestPath.test_subclass.<locals>.Subclassi[  r   N)r   r   r   r   r   r   r   r   Subclassr   [  s    r   r   r[   N)r   rH   
isinstance)rB   r8   r   rX   s   &&  r   test_subclassTestPath.test_subclassY  s5    	w|| 	 !$*h////r   c                    \         P                  ! V4      pVP                  \        P                  ! R 4      8X  g   Q hR# )r-   N)r   rH   r4   rG   rh   s   && r   test_filenameTestPath.test_filenamea  s+    ||H%}}^ <<<<r   c                    \         P                  ! V4      pVP                  Ru;8X  d   VP                  P                  8X  g   Q h Q hR# )z8
The name of the root should be the name of the zipfile
r-   N)r   rH   r   r4   rh   s   && r   test_root_nameTestPath.test_root_namef  s9    
 ||H%yyN@dmm.@.@@@@@@r   c                   \         P                  ! V P                  V4      4      pVP                  Ru;8X  d   VP                  P                  8X  g   Q h Q hVP
                  Ru;8X  d   VP                  P
                  8X  g   Q h Q hR# )zi
The name/stem of the root should match the zipfile on disk.

This condition must hold across platforms.
r-   r8   N)r   rH   rR   r   r4   stemrh   s   && r   test_root_on_diskTestPath.test_root_on_diskn  sk     ||D//9:yyN@dmm.@.@@@@@@yyJ<$--*<*<<<<<<r   c                L   \         P                  ! V4      pVP                  Ru;8X  d   VP                  P                  8X  g   Q h Q hVR,          pVP                  R8X  g   Q hVR,          R,          pVP                  R8X  g   Q hVR,          pVP                  R8X  g   Q hR	# )

The suffix of the root should be the suffix of the zipfile.
The suffix of each nested file is the final component's last suffix, if any.
Includes the leading period, just like pathlib.Path.
.zipb.txt.txtr^   filename.tar.gz.gzr`   r   N)r   rH   r   r4   rB   r8   rX   r[   r^   r`   s   &&    r   test_suffixTestPath.test_suffixy  s     ||H%{{f<(<(<<<<<<7Nxx6!!!3J**xx5   3Jxx2~~r   c                   \         P                  ! V4      pVP                  R.u;8X  d   VP                  P                  8X  g   Q h Q hVR,          pVP                  R.8X  g   Q hVR,          R,          pVP                  RR.8X  g   Q hVR,          pVP                  . 8X  g   Q hVR	,          pVP                  . 8X  g   Q hR
# )r  r  r  r	  r^   r
  z.tarr  r`   z.hgrcN)r   rH   suffixesr4   )rB   r8   rX   r[   r^   r`   ra   s   &&     r   test_suffixesTestPath.test_suffixes  s     ||H%}}BDMM,B,BBBBBB7NzzfX%%%3J**zzfe_,,,3JzzR7NzzRr   c                    R Vn         \        P                  ! V4      pVP                  R4      P                  R8X  g   Q hVP                  R4      P
                  . 8X  g   Q hR # )Nexampler   )r4   r   rH   rg   r   r  rh   s   && r   test_suffix_no_filename TestPath.test_suffix_no_filename  sR     ||H%}}Y'.."444}}Y'00B666r   c                   \         P                  ! V4      pVP                  Ru;8X  d   VP                  P                  8X  g   Q h Q hVR,          pVP                  R8X  g   Q hVR,          R,          pVP                  R8X  g   Q hVR,          pVP                  R8X  g   Q hVR,          P                  R8X  g   Q hR	# )
z.
The final path component, without its suffix
r8   r  r[   r^   r
  zfilename.tarr`   z
.gitignoreN)r   rH   r  r4   r  s   &&    r   	test_stemTestPath.test_stem  s    
 ||H%yyJ<$--*<*<<<<<<7Nvv}}3J**vv'''3Jvv}}|#))\999r   c                    \         P                  ! V4      pVP                  \        P                  ! R 4      8X  g   Q hRVP                  n        VP                  \        P                  ! R4      8X  g   Q hR# ).zfoo/bar.zipr   N)r   rH   r   rG   rX   r4   rh   s   && r   test_root_parentTestPath.test_root_parent  sR    ||H%{{gll3////*		{{gll51111r   c                   RVn         \        P                  ! V4      pV P                  \        4      ;_uu_ 4        VP
                   RRR4       V P                  \        4      ;_uu_ 4        VP                   RRR4       VR,          pVP
                  R8X  g   Q hVP                  '       g   Q hR#   + '       g   i     Lt; i  + '       g   i     LU; i)zL
It is an error to attempt to get the name
or parent of an unnamed zipfile.
Nr[   )r4   r   rH   rl   r   r   r   )rB   r8   rX   subs   &&  r   test_root_unnamedTestPath.test_root_unnamed  s     !||H%y))II *y))KK * Sjxx3zzzz *)))s   B4-C4C	C	c                l   \         P                  ! V4      pVP                  R 4      '       d   Q h\        VP	                  R4      4      \         P                  ! VR4      .8X  g   Q h\        VP	                  R4      4      \         P                  ! VR4      \         P                  ! VR4      .8X  g   Q hR# )*.txtzb/c.*r'   zb/*.txtr(   N)r   rH   matchlistglobrh   s   && r   test_match_and_globTestPath.test_match_and_glob  s    ||H%::g&&&&DIIg&'GLL9,M+NNNNDIIi()LL9-LL9-.
 
 	
 
r   c                >   \         P                  ! V4      pVP                  R 4      p\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   Q h\	        VP                  R 4      4      \	        VP                  R4      4      8X  g   Q hR# )z**/*.txtc              3   B   "   T F  qP                  R 4      x  K  	  R# 5i)r#  N)r$  )r   eachs   & r   r   /TestPath.test_glob_recursive.<locals>.<genexpr>  s     954::g&&5s   FTr#  N)r   rH   r&  allr%  rglob)rB   r8   rX   filess   &&  r   test_glob_recursiveTestPath.test_glob_recursive  so    ||H%		*%s959sss9599999DIIj)*d4::g3F.GGGGr   c                   \         P                  ! V4      p\        VP                  R 4      4      \         P                  ! VR4      .8X  g   Q h\        VP                  R4      4      \         P                  ! VR4      .8X  g   Q hR# )r[   rr   zb*Nr   rH   r%  r&  rh   s   && r   test_glob_dirsTestPath.test_glob_dirs  sb    ||H%DIIcN#Xt(D'EEEEDIIdO$h)E(FFFFr   c                   \         P                  ! V4      p\        VP                  R 4      4      \         P                  ! VR4      .8X  g   Q h\        VP                  R4      4      \         P                  ! VR4      .8X  g   Q hR# )zg/hzg/h/zg*/h*Nr3  rh   s   && r   test_glob_subdirTestPath.test_glob_subdir  sd    ||H%DIIe$%',,x*H)IIIIDIIg&'GLL6,J+KKKKr   c                    \         P                  ! V4      p\        VP                  R 4      4      . 8X  g   Q h\        VP	                  R 4      4      \         P                  ! VR4      .8X  g   Q hR# )z*/i.txtr)   N)r   rH   r%  r&  r.  rh   s   && r   test_glob_subdirsTestPath.test_glob_subdirs  sV    ||H%DIIi()R///DJJy)*w||Hk/R.SSSSr   c                t    \         P                  ! V4      p\        VP                  R 4      4      . 8X  g   Q hR# )z*.xtNr3  rh   s   && r    test_glob_does_not_overmatch_dot)TestPath.test_glob_does_not_overmatch_dot  s,    ||H%DIIf%&",,,r   c                P   \         P                  ! V4      p\        VP                  R 4      4      \         P                  ! VR4      .8X  g   Q h\        VP                  R4      4      \         P                  ! VR4      .8X  g   Q h\        VP                  R4      4      . 8X  g   Q hR# )za?txtr%   za[.]txtza[?]txtNr3  rh   s   && r   test_glob_single_charTestPath.test_glob_single_char  s    ||H%DIIg&'GLL7,K+LLLLDIIi()gll8W.M-NNNNDIIi()R///r   c                    \         P                  ! V4      p\        VP                  R 4      4      \         P                  ! VR4      \         P                  ! VR4      .8X  g   Q hR# )zj/?.b[ai][nz]r*   r+   Nr3  rh   s   && r   test_glob_charsTestPath.test_glob_chars	  sQ    ||H%DIIo./LL9-LL9-4
 
 	
 
r   c                   \         P                  ! \         P                  ! \        P                  ! 4       R 4      4      pV P                  \        4      ;_uu_ 4        VP                  R4       RRR4       R#   + '       g   i     R# ; i)r$   r   N)r   rH   r1   r/   r0   rl   rm   r&  )rB   rX   s   & r   test_glob_emptyTestPath.test_glob_empty  sL    ||GOOBJJL#>?z**IIbM +***s   A88B		c                    \         P                  ! V4      pV\         P                  ! V4      8X  g   Q hW"R ,          8w  g   Q hVR ,          VR ,          8X  g   Q h\         P                  ! V4      pW"09   g   Q hR# )r%   N)r   rH   rh   s   && r   test_eq_hashTestPath.test_eq_hash  sg    ||H%w||H----w'''wD7N333||H%v~~r   c                    \         P                  ! V4      pVP                  R 4      P                  4       '       d   Q hVP                  R4      P                  4       '       g   Q hR# )r%   r,   N)r   rH   rg   
is_symlinkrh   s   && r   test_is_symlinkTestPath.test_is_symlink"  sL    ||H%==)446666}}W%002222r   c                   \         P                  ! V4      pVP                  R R4      P                  VR ,          4      p\	        V4      R8X  g   Q hVP                  R RR4      P                  VR ,          4      p\	        V4      R8X  g   Q hR# )r[   zc.txtr`   r   zd/e.txtN)r   rH   rg   relative_tor   )rB   r8   rX   relatives   &&  r   test_relative_toTestPath.test_relative_to(  st    ||H%==g.::4#:F8}'''==c73??s
K8}	)))r   c                    \        R \        P                  3/ 4      pV! V4      P                  R4      P                  p\        W24      '       g   Q hR# )	PathChildzsome dirN)typer   rH   rg   r   r   )rB   r8   clsr   s   &&  r   test_inheritanceTestPath.test_inheritance1  sA    ;48}%%j188$$$$$r   r   rr   c                <   V! \        V P                  V4      4      4      p\        P                  ! \        P
                  ! WCR 7      4      p\        P                  ! V4      pVP                  4       vrxVP                  RR7      P                  R4      '       g   Q hR# ))r   rv   rw   zcontent of N)
r   rR   pickledumpsr   rH   loadsrV   r   
startswith)	rB   r8   	path_typesubpathrR   saved_1
restored_1firstrests	   &&&&     r   test_pickleTestPath.test_pickle7  su     #3t':':8'D#EF,,w||NGH\\'*
!))+0;;MJJJJr   c                    V P                  V4      p\        P                  ! V4      p\        P                  ! V4       VP	                  VP
                  4       R# )zE
A zip file wrapped in a Path should extract even with implied dirs.
N)rR   r   r1   rH   
extractallr   )rB   r8   source_pathr6   s   &&  r   #test_extract_orig_with_implied_dirs,TestPath.test_extract_orig_with_implied_dirsG  s@    
 ))(3__[)R
k(()r   c                    \         P                  ! V4       V P                  \        4      ;_uu_ 4        VP	                  R4       RRR4       R#   + '       g   i     R# ; i)zB
Validate behavior of getinfo on original zipfile after wrapping.
zdoes-not-existN)r   rH   rl   KeyErrorgetinfo)rB   r8   s   &&r   test_getinfo_missingTestPath.test_getinfo_missingR  s?    
 	Xx((-. )(((s   AA!	c                   \         P                  ! 4       p\        P                  ! VR4      pVP	                  RR4       VP	                  RR4       VP	                  RR4       RVn        \        P                  ! V4      p\        \        \        VP                  4       4      4      R.8X  g   Q hVP                  R4      P                  R	4      P                  4       R8X  g   Q hR
# )z
Path should handle malformed paths gracefully.

Paths with leading slashes are not visible.

Paths with dots are treated like regular files.
r$   z/one-slash.txt   contentz//two-slash.txtz../parent.txtr   z../z..z
parent.txtN)r/   r0   r   r1   r2   r4   rH   r%  r   r   rV   rg   r   )rB   r5   r6   rX   s   &   r   test_malformed_pathsTestPath.test_malformed_paths[  s     zz|__T3'
$j1
%z2
OZ0||BCT\\^,-%888}}T"++L9DDF*TTTr   c                   \         P                  ! 4       p\        P                  ! VR4      pVP	                  RR4       VP	                  RR4       RVn        \        P                  ! V4      pVP                  4       p\        V4      P                  R8X  g   Q h\        V4      P                  R8X  g   Q hVP                  R4      P                  4       R8X  g   Q hR# )z
Path segments with special characters are readable.

On some platforms or file systems, characters like
``:`` and ``?`` are not allowed, but they are valid
in the zip file.
r$   zpath?rr  zV: NMS.flacs   fLaC...r   N)r/   r0   r   r1   r2   r4   rH   rV   nextr   rg   r   )rB   r5   r6   rX   contentss   &    r   test_unsupported_namesTestPath.test_unsupported_namesm  s     zz|__T3'
GZ(
M:.||B<<>H~""g---H~""m333}}]+668JFFFr   c                f   \         P                  ! 4       p\        P                  ! VR4      pVP	                  \        R4      P                  V4      R4       RVn        \        P                  ! V4      pVP                  4       w  pVP                  4       '       d   Q hVP                  R8X  g   Q hR# )z0
In a zip file, backslashes are not separators.
r$   zfoo\barrr  r   N)r/   r0   r   r1   r2   DirtyZipInfo_for_archiver4   rH   rV   rU   r   )rB   r5   r6   rX   rc  s   &    r   test_backslash_not_separator%TestPath.test_backslash_not_separator  s     zz|__T3'
L,99"=zJ||B<<><<>>!!zzZ'''r   c                d    ^ RI Hp \        P                  ! V4      p\	        W24      '       g   Q hR# )r   )TraversableN)importlib.resources.abcr  r   rH   r   )rB   r8   r  r6   s   &&  r   test_interfaceTestPath.test_interface  s$    7\\(#"****r   )r?   Ni    )r8   r_  r`  )Lr   r   r   r   rC   rR   pass_alphareprd   ri   ro   rs   r}   r   r   unittestskipIfgetattrr   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  r  r  r  r  r   r'  r0  r4  r7  r:  r=  r@  rC  rF  rI  rM  rR  rX  r   r   productalpharep_generatorsr   r   re  rj  ro  rs  rx  r}  r  r   __classdictcell__)__classdict__s   @r   r:   r:   U   s=    -   : :   & & / /)2 __CII6::( 	' 	
	'	$ $ $ 7 7 $ $ 1 1 ? ? ? ?
 ? ?     4 4
 - -
 7 7 8 8  %	> H H 0 0 = = A A = =  $    * 7 7 : :$ 2 2  " 
 
 H H G G
 L L
 T T - -
 0 0 
 

   3 3
 * * % %
 ,(OJ	
KK * * / /U$G&( + +r   r:   c                   6   a a ] tR tRt oRtV 3R ltRtVtV ;t# )r{  i  z
Bypass name sanitization.
c                <   < \         SV `  ! V.VO5/ VB  Wn        R # r<   )super__init__r4   )rB   r4   argskwargs	__class__s   &&*,r   r  DirtyZipInfo.__init__  s    3D3F3 r   )r4   )	r   r   r   r   __doc__r  r   r  __classcell__)r  r  s   @@r   r{  r{    s     ! !r   r{  )!r=   r/   r   rG   r[  r    r   r  r   zipfile._pathtest.support.os_helperr   r   
_functoolsr   
_itertoolsr   _test_paramsr   r   r
   r"   r7   wrap_pathCompleteDirsinjectr  r  TestCaser:   r   r{  r   r   r   <module>r     s     	     
    5   / 
-.d LL'(LL33::<RST 
 j\+>?}+x   }+@!7?? !r   