+
    =i,                         R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
HtHtHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIt^ RIHt ^RIHtHtHtHtHt R	 tR
 t R t! ! R R]PD                  4      t#R# )z!Tests for distutils.archive_util.N)archive_util)ARCHIVE_FORMATScheck_archive_formatsmake_archivemake_tarballmake_zipfile)spawn)support)
splitdrive)patch)UID_0_SUPPORTgrppwdrequire_uid_0require_unix_idc                    \         P                  P                  '       d   R#  V P                  \        P
                  ! 4       4       R#   \         d     R# i ; i)z>
Return True if the filename can be saved in the file system.
TF)ospathsupports_unicode_filenamesencodesysgetfilesystemencodingUnicodeEncodeError)filenames   &Mlib/python3.14/site-packages/setuptools/_distutils/tests/test_archive_util.pycan_fs_encoder      sJ     
ww)))1134   s   $A
 
AAc                 L    \         P                  ! \        P                  V 4      # N)	functoolsreduceoperatoreq)valuess   &r   	all_equalr#   )   s    HKK00    c                  &    \        R  V  4       4      # )c              3   b   "   T F%  p\         P                  ! V4      P                  x  K'  	  R # 5ir   )pathlibPathdrive).0r   s   & r   	<genexpr>same_drive.<locals>.<genexpr>.   s     @%$W\\$'--%s   -/)r#   )pathss   *r   
same_driver.   -   s    @%@@@r$   c                   $  a ] tR t^1t o]P
                  P                  R4      RR l4       t]P
                  P                  R4      R 4       tR t	R t
]P
                  P                  R4      R 4       t]P
                  P                  R4      R	 4       tR
 tR t. ROt] U u. uF  q P#                  R4      NK  	  up tR t]P
                  P                  R4      ]P
                  P                  R4      R 4       4       t]P
                  P                  R4      R 4       tR tR tR tR tR t]P
                  P                  R4      R 4       tR tR tR t]P
                  P                  R4      ]] R 4       4       4       t!Rt"Vt#R# u up i )ArchiveUtilTestCase
needs_zlibc                r    V P                  4       pV P                  W!R 4       V P                  W!RRR7       R# ).tar.gz.tarNcompress_create_files_make_tarball)selfnametmpdirs   && r   test_make_tarball%ArchiveUtilTestCase.test_make_tarball2   s7     ##%636$?r$   c                P    V P                  4       pV P                  VR RRR7       R# )archiver3   gzipr5   Nr7   r:   r<   s   & r   test_make_tarball_gzip*ArchiveUtilTestCase.test_make_tarball_gzip:   s'    ##%69i&Ir$   c                |    \         P                  ! R 4       V P                  4       pV P                  VRRRR7       R# )bz2r@   z.tar.bz2bzip2r5   Npytestimportorskipr8   r9   rB   s   & r   test_make_tarball_bzip2+ArchiveUtilTestCase.test_make_tarball_bzip2?   s5    E"##%69j7Kr$   c                |    \         P                  ! R 4       V P                  4       pV P                  VRRRR7       R# )lzmar@   z.tar.xzxzr5   NrH   rB   s   & r   test_make_tarball_xz(ArchiveUtilTestCase.test_make_tarball_xzD   s5    F###%69i$Gr$   u   not can_fs_encode('årchiv')c                (    V P                  R4       R# )zF
Mirror test_make_tarball, except filename contains latin characters.
u   årchivNr=   r:   s   &r   test_make_tarball_latin1,ArchiveUtilTestCase.test_make_tarball_latin1I   s    
 	y)r$   u'   not can_fs_encode('のアーカイブ')c                (    V P                  R4       R# )zc
Mirror test_make_tarball, except filename contains extended
characters outside the latin charset.
u   のアーカイブNrS   rT   s   &r   test_make_tarball_extended.ArchiveUtilTestCase.test_make_tarball_extendedP   s     	34r$   c                   V P                  4       p\        W4      '       d   \        P                  ! R 4       \        P
                  P                  WR4      p\
        P                  ! V4      ;_uu_ 4        \        \        V4      ^,          R3/ VB  RRR4       Wc,           p\        P
                  P                  V4      '       g   Q hV P                  V4      V P                  8X  g   Q hR#   + '       g   i     Lc; i)z)source and target should be on same drivedistN)mkdtempr.   rI   skipr   r   joinr(   r   r
   exists_tarinfo_created_files)r:   r<   target_namesuffixkwargstmpdir2	base_nametarballs   &&&&,   r   r9   !ArchiveUtilTestCase._make_tarballX   s    ,,.f&&KKCDGGLL6	 YYvI.q16DVD  $ww~~g&&&&}}W%)<)<<<< s   5C..C>	c                    \         P                  ! V4      p VP                  4       pVP                  4        VVP	                  4        #   TP	                  4        i ; ir   )tarfileopengetnamessortclose)r:   r   tarnamess   &&  r   r`   ArchiveUtilTestCase._tarinfoh   s?    ll4 	LLNEJJLIIKCIIKs   !A
 
A/c                   V P                  4       p\        P                  P                  VR 4      p\        P                  ! V4       V P                  VR.R4       V P                  VR.R4       \        P                  ! \        P                  P                  VR4      4       V P                  VRR.R4       \        P                  ! \        P                  P                  VR4      4       V# )r[   file1xxxfile2subfile3sub2)r\   r   r   r^   mkdir
write_file)r:   r<   r[   s   &  r   r8   !ArchiveUtilTestCase._create_files{   s    ww||FF+
w/w/
dE*+ug.6
dF+,r$   z2not (shutil.which('tar') and shutil.which('gzip'))c                :   V P                  4       pV P                  4       p\        P                  P	                  VR 4      p\        P
                  ! 4       p\        P                  ! V4        \        VR4       \        P                  ! V4       VR,           p\        P                  P                  V4      '       g   Q h\        P                  P	                  VR4      p. ROp. ROp\        P
                  ! 4       p\        P                  ! V4        \        V4       \        V4       \        P                  ! V4       \        P                  P                  V4      '       g   Q hV P                  V4      V P                  8X  g   Q hV P                  V4      V P                  8X  g   Q h\        P                  P	                  VR 4      p\        P
                  ! 4       p\        P                  ! V4        \        VRRR7       \        P                  ! V4       VR,           p\        P                  P                  V4      '       g   Q hR#   \        P                  ! T4       i ; i  \        P                  ! T4       i ; i  \        P                  ! T4       i ; i)	r@   r[   r3   zarchive2.tar.gzNr5   r4   )ro   z-cfarchive2.tarr[   )rA   z-fz-9r~   )r8   r\   r   r   r^   getcwdchdirr   r_   r   r`   ra   )	r:   r<   re   rf   old_dirrg   tarball2tar_cmdgzip_cmds	   &        r   test_tarfile_vs_tar'ArchiveUtilTestCase.test_tarfile_vs_tar   s    ##%,,.GGLL)4	))+
	F+HHW i'ww~~g&&&& 77<<(9:87))+
	'N(OHHWww~~h''''}}W%)<)<<<<}}X&$*=*==== GGLL)4	))+
	FT:HHWf$ww~~g&&&&A HHW  HHW HHWs$   -I I' 6J I$'I?Jc                \   \         P                  ! R 4      pV P                  4       p\        P                  P                  V P                  4       R4      p\        P                  ! V4      ;_uu_ 4        \        VR4       RRR4       VR,           p\        P                  P                  V4      '       g   Q hVP                  V4      ;_uu_ 4       p\        VP                  4       4      V P                  8X  g   Q h RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zipfiler@   r[   N.zip)rI   rJ   r8   r   r   r^   r\   r(   r   r_   ZipFilesortednamelist_zip_created_files)r:   r   r<   rf   rg   zfs   &     r   test_make_zipfile%ArchiveUtilTestCase.test_make_zipfile   s    %%i0##%GGLL;	YYvF+  f$ww~~g&&&&__W%%"++-(D,C,CCCC &%  &%%s   3D+DD	D+	c                2  aaa \         P                  ! R 4      o\        V \        P                  RR4       . oSP
                  oVVV3R lp\        V \        P                  RV4       V P                  4       p\        P                  P                  V P                  4       R4      p\        P                  ! V4      ;_uu_ 4        \        VR4       RRR4       VR,           pSVR3R	SP                  /3.8X  g   Q h\        P                  P                  V4      '       g   Q hSP                  V4      ;_uu_ 4       p\        VP!                  4       4      V P"                  8X  g   Q h RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)
r   zlibNc                  z   < VP                  R R4      SP                  8X  d   SP                  W34       S! V / VB # )compressionN)get
ZIP_STOREDappend)akwcalledr   zipfile_classs   *,r   fake_zipfileCArchiveUtilTestCase.test_make_zipfile_no_zlib.<locals>.fake_zipfile   s:    vvmT*g.@.@@qg& !*r**r$   r   r@   r[   r   wr   )rI   rJ   r   r   r   r   r8   r   r   r^   r\   r(   r   r   r_   r   r   r   )	r:   r   r<   rf   rg   r   r   r   r   s	   &     @@@r   test_make_zipfile_no_zlib-ArchiveUtilTestCase.test_make_zipfile_no_zlib   s/   %%i0dL((&$7	+
 	dL(()\B ##%GGLL;	YYvF+  f$GS>M7;M;M+NOPPPPww~~g&&&&__W%%"++-(D,C,CCCC &%  &%%s   E2<+F2F	F	c                R    \        . RO4      R8X  g   Q h\        . RO4       e   Q hR# )gztarru   N)r   ru   zip)r   bztarxztarztarro   r   )r   rT   s   &r   test_check_archive_formats.ArchiveUtilTestCase.test_check_archive_formats   s1    $%<=FFF!"ST	
r$   c                    V P                  4       p\        P                  P                  VR 4      p\        P
                  ! \        4      ;_uu_ 4        \        VR4       RRR4       R#   + '       g   i     R# ; i)r@   ru   N)r\   r   r   r^   rI   raises
ValueErrorr   )r:   r<   rf   s   &  r   test_make_archive%ArchiveUtilTestCase.test_make_archive   sI    GGLL3	]]:&&E* '&&&s   A**A;	c                H   \         P                  ! 4       pR  pV. R3\        R&     \        RRV P	                  4       R7       \         P                  ! 4       V8X  g   Q h \        P                  ! R4       R#   \
         d     LBi ; i  \        P                  ! R4       i ; i)c                      \        4       hr   )RuntimeError)argsr   s   *,r   _breaks:ArchiveUtilTestCase.test_make_archive_cwd.<locals>._breaks   s
    . r$   zxxx fileru   )root_dirN)r   r   r   r   r\   	Exceptionpop)r:   current_dirr   s   &  r   test_make_archive_cwd)ArchiveUtilTestCase.test_make_archive_cwd   s    iik	! #*2z!:	'UEDLLNC 99;+---&	   &s)   A8 B	 8BB	 BB	 	B!c                |   V P                  4       p\        P                  P                  V P	                  4       R 4      p\        VRVR4      p\        P                  P                  V4      '       g   Q h\        P                  P                  V4      R8X  g   Q hV P                  V4      V P                  8X  g   Q hR# )r@   ro   r[   zarchive.tarN
r8   r   r   r^   r\   r   r_   basenamer`   ra   r:   base_dirrf   ress   &   r   test_make_archive_tar)ArchiveUtilTestCase.test_make_archive_tar   s    %%'GGLL;	9eXv>ww~~c""""ww$555}}S!T%8%8888r$   c                |   V P                  4       p\        P                  P                  V P	                  4       R 4      p\        VRVR4      p\        P                  P                  V4      '       g   Q h\        P                  P                  V4      R8X  g   Q hV P                  V4      V P                  8X  g   Q hR# )r@   r   r[   zarchive.tar.gzNr   r   s   &   r   test_make_archive_gztar+ArchiveUtilTestCase.test_make_archive_gztar  s    %%'GGLL;	9gx@ww~~c""""ww$(8888}}S!T%8%8888r$   c                   \         P                  ! R 4       V P                  4       p\        P                  P                  V P                  4       R4      p\        VRVR4      p\        P                  P                  V4      '       g   Q h\        P                  P                  V4      R8X  g   Q hV P                  V4      V P                  8X  g   Q hR# )rF   r@   r   r[   zarchive.tar.bz2NrI   rJ   r8   r   r   r^   r\   r   r_   r   r`   ra   r   s   &   r   test_make_archive_bztar+ArchiveUtilTestCase.test_make_archive_bztar  s    E"%%'GGLL;	9gx@ww~~c""""ww$(9999}}S!T%8%8888r$   c                   \         P                  ! R 4       V P                  4       p\        P                  P                  V P                  4       R4      p\        VRVR4      p\        P                  P                  V4      '       g   Q h\        P                  P                  V4      R8X  g   Q hV P                  V4      V P                  8X  g   Q hR# )rN   r@   r   r[   zarchive.tar.xzNr   r   s   &   r   test_make_archive_xztar+ArchiveUtilTestCase.test_make_archive_xztar  s    F#%%'GGLL;	9gx@ww~~c""""ww$(8888}}S!T%8%8888r$   c           	        \         '       d<   \        P                  ! ^ 4      ^ ,          p\        P                  ! ^ 4      ^ ,          pMR;rV P                  4       pV P                  4       p\        P                  P                  V P                  4       R4      p\        VRWCW!R7      p\        P                  P                  V4      '       g   Q h\        VRWC4      p\        P                  P                  V4      '       g   Q h\        VRWCW!R7      p\        P                  P                  V4      '       g   Q h\        VRWCRRR7      p\        P                  P                  V4      '       g   Q hR# )	    rootr@   r   )ownergroupro   	kjhkjhkjgoihohohN)r   r   getgrgidr   getpwuidr8   r\   r   r   r^   r   r_   )r:   r   r   r   r   rf   r   s   &      r   test_make_archive_owner_group1ArchiveUtilTestCase.test_make_archive_owner_group  s    =LLOA&ELLOA&E""E%%'<<>GGLL;	uh
 ww~~c""""9eX@ww~~c""""uh
 ww~~c""""uh9
 ww~~c""""r$   c                   V P                  4       p\        P                  P                  V P	                  4       R 4      p\        P
                  ! 4       p\        P                  ! V4       \        P                  ! ^ 4      ^ ,          p\        P                  ! ^ 4      ^ ,          p \        VRRWTR7      p\        P                  ! V4       \        P                  P                  V4      '       g   Q h\        P                  ! V4      p VP                  4        F)  pVP                   ^ 8X  g   Q hVP"                  ^ 8X  d   K)  Q h	  VP%                  4        R#   \        P                  ! T4       i ; i  TP%                  4        i ; i)r@   r[   N)r6   r   r   )r8   r   r   r^   r\   r   r   r   r   r   r   r   r_   rj   rk   
getmembersuidgidrn   )	r:   r<   rf   r   r   r   archive_namer@   members	   &        r   test_tarfile_root_owner+ArchiveUtilTestCase.test_tarfile_root_owner;  s    ##%GGLL;	))+
Q"Q"	'6DL HHW ww~~l++++ ,,|,	!,,.zzQ&zzQ& / MMO HHW MMOs   %E 4E2 E2 E/2F N)r@   )zdist/z
dist/file1z
dist/file2z	dist/sub/zdist/sub/file3z
dist/sub2/)$__name__
__module____qualname____firstlineno__rI   markusefixturesr=   rC   rK   rP   skipifrU   rX   r9   r`   r   rstripra   r8   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)p__classdict__s   0@r   r0   r0   1   s    [[\*@ +@ [[\*J +JL
H
 [[67* 8* [[AB5 C5=  .@@-?hhsm-?@N
 [[\*[[LM)' N +)'V [[\*D +DD4
+' 9 [[\*9 +999#< [[\*   +K As   $Fr0   )$__doc__r   r    r   r'   r   rj   	distutilsr   distutils.archive_utilr   r   r   r   r   distutils.spawnr   distutils.testsr	   os.pathr
   r   rI   test.supportr   unix_compatr   r   r   r   r   r   r#   r.   TempdirManagerr0   r   r$   r   <module>r      se    '   	  
  "  " #     P P
1Ae'00 er$   