python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_pathlib.cpython-312.opt-1.pyc

Αe% ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlm
Z
ddlmZddlmZddlmZmZddlmZddlmZmZ	ddlZddlZGdd	eZGd
deZGdd
eej:ZGddeej:ZGddeej:Z ejBjEeZ#dZ$dZ%ejLejNdk7dZ(ejLejNdk(dZ)e)GddeZ*e(GddeZ+GddeZ,Gddej:Z-Gdd e,ej:Z.e)Gd!d"e,ej:Z/e(Gd#d$e,ej:Z0Gd%d&eej:Z1Gd'd(e,ej:Z2Gd)d*ej:Z3e4d+k(rejjyy#e$rdxZZYwxYw),N)mock)
import_helper)set_recursion_limit)
is_emscriptenis_wasi)	os_helper)TESTFNFakePathc$eZdZfdZdZxZS)_BasePurePathSubclassc,t||||_yN)super__init__
session_id)selfrpathsegments	__class__s   E/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_pathlib.pyrz_BasePurePathSubclass.__init__ s
,'$c8t||d|jiS)Nr)typer)rrs  r
with_segmentsz#_BasePurePathSubclass.with_segments$stDz<DDOODDr)__name__
__module____qualname__rr
__classcell__)rs@rrrs%ErrceZdZgdgddZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*y+),_BasePurePathTest)
ab)a/r")r!b/)r#r$a/b/)za//b)za//b//)r!r")r!r'r")r!r"r'))r!/b/cd)/ar(r))/r"r'c/d)r+r'zb/c/d)r'/b/c/d)a/br-c|jd}|j|_|jj|_|jj|_yNr!)cls_flavourflavoursepaltseprps  rsetUpz_BasePurePathTest.setUp:s<HHSMzz<<##ll))rc	`|j}|d}|j|||ddd|ddd|d|d|td|j||d|d|j||dd|d|j||d|d|d|j||d|d|d|td|j||d|dy)	Nr!r"cr*a/b/c/a/b/cr../a:b)r1assertIsInstancer
assertEqualrPr7s   rtest_constructor_commonz)_BasePurePathTest.test_constructor_common@sHH
cFa#	#sC	$S	'
	(	(7
1S6AcF+1S63521S61S6*AeH51S61S61S62Ahw6G4HI1W:'
3rcF|j}d}|jt|5|dddd|jt|5|ddddd|jt|5|ddddd|jt5|dj	dddd|jt5|ddzddd|jt5d|dzddd|jt5|djdddd|jt5|dj
dddd|jt5|djdddd|jt5|djdddd|jt5|djddddy#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swYqxYw#1swYUxYw#1swY-xYw#1swYxYw#1swYxYw#1swYxYw#1swYyxYw)Nz^argument should be a str or an os\.PathLike object where __fspath__ returns a str, not 'bytes'ar"r!b)
r1assertRaisesRegex	TypeErrorassertRaisesjoinpathmatchrelative_to	with_name	with_stemwith_suffix)rrAmessages   r
test_bytesz_BasePurePathTest.test_bytesOs6HHB

#
#Iw
7	
dG	

#
#Iw
7	
dCL	

#
#Iw
7	
c4L	


y
)	"
cFOOD!	"


y
)	
cFTM	


y
)	1S6M	


y
)	
cFLL	


y
)	%
cFt$	%


y
)	#
cFT"	#


y
)	#
cFT"	#


y
)	%
cFt$	%	%)							"	"							%	%	#	#	#	#	%	%s	H
H$4
H1H>I9I"I%I2I?J6JH!$H.1H;>III"%I/2I<?JJJ cGddt|j}|fd|D}|j||||jD]!}|j	t|t#y)NceZdZy):_BasePurePathTest._check_str_subclass.<locals>.StrSubclassNrrrrrStrSubclassrSnrrVc3.K|]}|ywrrU).0xrVs  r	<genexpr>z8_BasePurePathTest._check_str_subclass.<locals>.<genexpr>qs-1A-s)strr1r?partsassertIsr)rargsrAr7partrVs     @r_check_str_subclassz%_BasePurePathTest._check_str_subclassjsa	#	HH
--.AtH%GG	+DMM$t*c*	+rc|jd|jd|jd|jd|jdy)Nr'.r!za/b.txtz/a/b.txtrars rtest_str_subclass_commonz*_BasePurePathTest.test_str_subclass_commonvsH  $  %  %  +  ,rctGddt|j}|ddd}|jd|dzj|jdd|zj|jd|j	dj|jd|jdj|jd|j
dj|jd|jdj|jd|jdj|jd|jdj|jd|jj|jD]}|jd|j y)NceZdZy)6_BasePurePathTest.test_with_segments_common.<locals>.PNrTrUrrrAri~rWrrAfoobar*rz.foo)rr1r?rrIrLrMrNrrKparentparents)rrAr7rns    rtest_with_segments_commonz+_BasePurePathTest.test_with_segments_common}sT	%txx	
eUr*a%i334eai334QZZ.99:Q[[/::;Q[[/::;Q]]62==>Q__U3>>?Q]]51<<=QXX001ii	4FR!2!23	4rcf|j|}|j|j|jfSr)r1driverootr])rr]paths   r_get_drive_root_partsz'_BasePurePathTest._get_drive_root_partss+txxzz499djj00rc	z|jj}|j|Dcgc]}|jd|c}}|j	|||jj
x}rB|j|Dcgc]}|jd|c}}|j	||yycc}wcc}wNr+)r3r4rureplacer?r5)rargexpectedr4rZactualr5s       r_check_drive_root_partsz)_BasePurePathTest._check_drive_root_partssll++#,NQQYYsC-@,NO*\\(((6(//QT0UA31G0UVFVX.)-O1VsB3?B8c|j}|jj}|dddd|dddd|dddd|dddd|dddd|dddd|dddd	|d
ddd	|dddd	|dddd|d
ddd|dddd|dddd|dd||ddf|dd||ddf|dd||ddf|dd||ddf|dd||dfy)NrUr')r!)r#r r.r%)r!zb/cr))r!r"r:r))r!zb//cr))r!zb/c/r))rc)rcrcr")r")r!rcr")r!rcrc)/a/br!r")r*r")/a/r"r!/br:r:)r!r/c)r|r3r4)rcheckr4s   rtest_drive_root_parts_commonz._BasePurePathTest.test_drive_root_parts_commons<,,ll
bBB/
fBF3
gBF3
jBJ7
hBJ7
iBJ7
B,@A
 B,@A
 B,@A
fBB/
oBF3
oBJ7
oBF3
iBc3_=
kBc3_=
lBc3_=
Bc3_=
Bc3Z8rc|j}|d}|jd}|j||d|jt	|t	||jdd}|j||d|j|d}|j||d|jd}|j||dy)Nr.r:r;r)a/b/c/dr)r1rIr?r^rrrAr7pps    rtest_join_commonz"_BasePurePathTest.test_join_commonsHH
eH
ZZ_QwZ(

d2hQ(
ZZS
!Qy\*
ZZ#
QwZ(
ZZ
QtW%rc|j}|d}|dz}|j||d|jt|t||dz}|j||d|dzdz}|j||dd|zdz}|j||d||dz}|j||d|dz}|j||dy)	Nr.r:r;r,rr)zc/a/b/dr)r1r?r^rrs    rtest_div_commonz!_BasePurePathTest.test_div_commonsHH
eH
WQwZ(

d2hQ(
YQy\*
Ws]Qy\*
1Ws]Qy\*
3ZQwZ(
WQtW%rc|j|}|jt||jd|jyrw)r1r?r\rxr4)rrzr_r7s    r
_check_strz_BasePurePathTest._check_strs6DHHdOQ!1!1#txx!@Arc\dD]}|j||f|jddy)Nr!r.r;r+rr<rc)r')r)rpathstrs  rtest_str_commonz!_BasePurePathTest.test_str_commons1C	1GOOGgZ0	1	
U#rcv|j}dD](}|j||j|*y)Nr)r1r?as_posix)rrArs   rtest_as_posix_commonz&_BasePurePathTest.test_as_posix_commons7HHC	=GQwZ002G<	=rctj|j}|j}|j	t|dd|zdzy)Nr.rDrE)osfsencoder4r1r?bytes)rr4rAs   rtest_as_bytes_commonz&_BasePurePathTest.test_as_bytes_commons>kk$((#HHqx$*t*;<rc|j}|jt5|djddd|jt5|jdddy#1swY=xYw#1swYyxYwr0)r1rH
ValueErroras_urirrAs  rtest_as_uri_commonz$_BasePurePathTest.test_as_uri_commonsnHH


z
*	
cFMMO	


z
*	
CJJL						sA5B5A>B
cdD]}|j|5|j|}|jj}t	|}|j|j
|dz||j|jd||t|dzd}|jt||jdddy#1swYxYw)Nrr())subTestr1rrrepr
assertTrue
startswithendswithlenr?evalr)rrr7clsnamerinners      rtest_repr_commonz"_BasePurePathTest.test_repr_commonsC		<Gg.
<HHW%++..GWs] ;Q?

33#g,*R0  eajjl;
<
<		<
<
<sB2CC	crdD]}|j|5|j|}t|}t|tj
}|j
|j|j|j|||jt||dddy#1swYxYw)Nrr)	rr1rrpathlib__dict__r^rr?)rrr7rqs     rtest_repr_roundtripsz&_BasePurePathTest.test_repr_roundtripssC	-Gg.
-HHW%GG,,-

akk1;;7  A&  a!,
-
-	-
-
-sB
B--B6	cP|j}|j|d|d|j|d|dd|j|d|d|j|d|d|j|d||j|d|d|j||d|j|d|j|i|j|ty)Nr.r!r"rr+r')r1r?assertNotEqualintrs  rtest_eq_commonz _BasePurePathTest.test_eq_common	sHH51U8,51S#;/AeHaf-AeHai0AeHac*AfIqv.AC3(AC$AC$AC%rc
|j}|jt|djd|jt|djd|j	|djd|j	|djd|j	|djd|j|djd|j|djd|j|d	jd|j|d
jd|j	|djd|j	|djd|j	|djd|j|djd|j|d
jd|j|d
jd|j	|djd|j	|djd|j|djd|j|djd|j|djd|j	|djd|j|djd|j|djd|j|djd|j	|djd|j|djd|j|djd|j|djd|j	|djd|j|djdd|j	|djdd|j|djd d|j	|djd!d|j|jd"|j	|jd#|j|jd$y)%Nr!r'rcb.pya/b.py/a/b.pyza.pyzb/pyz/a.pyzb.py/cz*.pyzb.pyczb./pyzab/c.pyza*/*.pyz
/d/ab/c.pyz	/dab/c.pyz	ab/c.py/d/b.py/*.pyz/a/*.pyz/ab.pyz	/a/b/c.pyz/**/*.pyz
/a/**/*.pyA.pya.PYTcase_sensitiveF	c:/a/B.Py	C:/A/*.pYz	/A/*/*.Py*****/*)r1rHrrJrassertFalsers  rtest_match_commonz#_BasePurePathTest.test_match_commonsHH*afllB7*afllC8&	/0())&12)**6236016017))&128**623&	/0())&12)**6237))&127))&128**623)**956,--i89634;--i89;--i89'
((126128**7349++G45)**9568**956;--i89;--j9:+,,\:;6EF&	uEF;--k$-OP+,,[,OP3(		$(6*+rcfd}j}|d}|d}|d}|d}|||||||||||||||j}|d}|d}|d}|d	}|||||||||||||||jt5|ikdddy#1swYyxYw)
NcNj||j||yr)
assertLess
assertGreaterr!r"rs  rrz:_BasePurePathTest.test_ordering_common.<locals>.assertLessGs!OOAq!q!$rr!r.abcr"r*rz/abcr)r1rHrG)rrrAr!r"r:r)s`      rtest_ordering_commonz&_BasePurePathTest.test_ordering_commonEs	%
HH
cF
eH
eH
cF1a1a1a1a1aHH
dG
fI
fI
dG1a1a1a1a1a


y
)	
C"H			sC""C+c|j}|j}|d}|j}|j|d|d}|j}|j||ddfy)Nr.r rr!r")r4r1r]r?)rr4rAr7r]s     rtest_parts_commonz#_BasePurePathTest.test_parts_commonas^hhHH
eH
+
fIc30rc|j}|d}|j|jd|jtj|dy)Nr.r~)r1r
__fspath__rfspathr@s   rtest_fspath_commonz$_BasePurePathTest.test_fspath_commonms>HH
eH1		!h/rc	jjD]"\}}|jdj}|jjd}||k7r7||Dcgc]}t	fd|Dc}z}|j|fj
|}|D]}j|}j||dj|jt|t|jt||j|j|%ycc}w)Nr+c3VK|] }|jdj"yw)r+N)rxr4)rYr`rs  rr[z6_BasePurePathTest.test_equivalences.<locals>.<genexpr>ys D$$,,sDHH5Ds&)zfailed with args {})equivalencesitemsrxr4tupleappendr1r?formathashr\r)rktuplescanonposixtpcanonr7s`       rtest_equivalencesz#_BasePurePathTest.test_equivalencesss**002	6IAvIIc488,EIIdhh,E~##D!DD#

ui(XXe_F
6DHHaL  F,A,H,H,KL  a$v,7  Q/  u5
6	6#s%EcH|j}|d}|j|j|d|j|jj|d|j|jjj||j|jjjj||d}|j|j|d|j|jj|d|j|jjj|d|j|jjjj|dy)Nr;r.r!r<rr*r+r1r?rnr@s   rtest_parent_commonz$_BasePurePathTest.test_parent_commonsHH
gJ1U8,!C&1//5//66<
hK1V9-!D'2//38//66#?rc\	|j}|d}|j}|jt|d|j|d|d|j|d|d|j|d|d|j|d	|d|j|d
|d|j|d|d|j|dd|df|j|dd|d|df|j|dd	|d|df|j|dd|d|df|j|ddd|d|df|j|ddd	|d|d|df|jt	||d|d|dg|jt5|dddd|jt5|dddd|jt5||d<ddd|d
}|j}|jt|d|j|d|d|j|d|d|j|d|d|j|d	|d|j|d
|d|j|d|d|j|dd|df|j|dd|d|df|j|dd	|d|df|j|dd|d|df|j|ddd|d|df|j|ddd	|d|d|df|jt	||d|d|dg|jt5|dddd|jt5|ddddy#1swYpxYw#1swYZxYw#1swYDxYw#1swYTxYw#1swYyxYw)Nr;rr.rr!rcrr<rr*r+)r1ror?rlistrH
IndexErrorrGrrAr7pars    rtest_parents_commonz%_BasePurePathTest.test_parents_commonsJHH
gJiiS1%Q5*Q3(Q3(R!C&)R!C&)R!E(+QqAeH;/Ra1U8QsV"45SbAeHaf#56QR1S61S6"23SqSAeHaf#56TrTQsVQsVQuX$>?cQuXqvqv$>?


z
*	G	


z
*	F	


y
)	CF	
hKiiS1%Q6+Q4)Q3(R!C&)R!D'*R!F),QqAfI<0Ra1V9ag"67SbAfIqw#78QR1T7AcF"34SqSAfIqv#67TrTQsVQtWai$@AcQvY$3$@A


z
*	G	


z
*	F		3						&				s<;Q/Q<R	=R R"/Q9<R	RR"R+c|j}|j|djd|j|djd|j|djdy)Nr.r'rr1r?rrrs  rtest_drive_commonz#_BasePurePathTest.test_drive_commonsSHH5,6"-2b)rcD|j}|j}|j|djd|j|djd|j|dj||j|dj|yNr'r.r+r)r1r4r?rsrrAr4s   rtest_root_commonz"_BasePurePathTest.test_root_commonstHHhh2R(5+3c*6-rcD|j}|j}|j|djd|j|djd|j|dj||j|dj|yr)r1r4r?anchorrs   rtest_anchor_commonz$_BasePurePathTest.test_anchor_commonsvHHhh2r*5"-3,6))3/rc<|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd	|j|d
jd	y)Nr'rcr+r.r"r/a/b/.rrrr1r?namers  rtest_name_commonz"_BasePurePathTest.test_name_commonsHH2R(3b)3b)5,6-8))3/8))629**F3rc|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd	|j|d
jd	|j|djd|j|djd|j|d
jd|j|djd|j|djd|j|djd|j|djd|j|djdy)Nr'rc..r+r.rrr.pyra/.hgrc/a/.hgrca/.hg.rc.rc	/a/.hg.rc
a/b.tar.gz.gz/a/b.tar.gza/Some name. Ending with a dot. /a/Some name. Ending with a dot.r1r?suffixrs  rtest_suffix_commonz$_BasePurePathTest.test_suffix_commonsHH2r*3+4,3+5"-6))2.8++R08++U39,,e49,,b1:--r2:--u5;..6<//7=)00%8<=DDbI=>EErJrcl|j}|j|djg|j|djg|j|djg|j|djg|j|djg|j|djg|j|djdg|j|d	jdg|j|d
jg|j|djg|j|djd
g|j|djd
g|j|djddg|j|djddg|j|djg|j|djgy)Nr'rcr+r.rrrrrrrr	r
rr.tarr
rrrr1r?suffixesrs  rtest_suffixes_commonz&_BasePurePathTest.test_suffixes_commonsHH2,3"-3"-5**B/6++R08--r28--w79..89..3://4://%9;005':<11FE?C=)22VUOD<=FFK=>GGLrc|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd	|j|d
jd|j|djd
|j|djdy)Nr'rcrr+r.r"rr.hgrcr	.hgrb.tarrSome name. Ending with a dot.r1r?stemrs  rtest_stem_commonz"_BasePurePathTest.test_stem_commons
HH2R(3b)4t,3b)5,8))3/9**G4:++U3<--w7<=BB8	:rcZ|j}|j|djd|d|j|djd|d|j|djd|d|j|djd|d|j|djd|d|j|d	jd|d|jt|d
jd|jt|djd|jt|djd|jt|djd
|jt|djd
|jt|djd|jt|djdy)Nr.d.xmlza/d.xmlrz/a/d.xmlrr
a/Dot ending./a/Dot ending.r'rcr+rc/r,r1r?rLrHrrs  rtest_with_name_commonz'_BasePurePathTest.test_with_name_commonsHH5++G4a	lC6,,W5q}E8..w79F9//8!J-H?+55g>)M+,66w?:O*aeoow?*af&6&6@*af&6&6@*ah&8&8"=*ah&8&8$?*ah&8&8$?*ah&8&8%@rc|j}|j|djd|d|j|djd|d|j|djd|d|j|djd|d	|j|d
jd|d|j|djd|d|j|d
jd|d|jt|djd|jt|djd|jt|djd|jt|djd|jt|djd|jt|djd|jt|djdy)Nr.r)za/drz/a/drza/d.pyrz/a/d.pyrz/a/d.gzr#r$r'rcr+rr%r,r1r?rMrHrrs  rtest_with_stem_commonz'_BasePurePathTest.test_with_stem_common)sHH5++C0!E(;6,,S11V9=8..s3Qx[A9//4a	lC=)33C8!I,G?+55c:AeHE+,66s;QvYG*aeoos;*af&6&6<*af&6&6<*ah&8&8"=*ah&8&8$?*ah&8&8$?*ah&8&8%@rc|j}|j|djd|d|j|djd|d|j|djd|d|j|djd|d|j|djd|d|j|djd|d|jt|djd|jt|d	jd|jt|d
jd|jt|djd|jt|djd
|jt|djd	|jt|djd|jt|djd
|jt|djd|jt|djd|jt|djd|jt|dj|j
jdfy)Nr.r
za/b.gzrz/a/b.gzrrr'rcr+gz/.gzr,z.c/.dz./.dz.d/.r))r1r?rNrHrr3r4rs  rtest_with_suffix_commonz)_BasePurePathTest.test_with_suffix_common:s?HH5--e4akB6..u5q|D80078E911%8!I,G8004ah?6..r2AfI>*ae&7&7?*af&8&8%@*af&8&8%@*ah&:&:DA*ah&:&:C@*ah&:&:C@*ah&:&:FC*ah&:&:EB*ah&:&:GD*ah&:&:FC*ah&:&:FC*ah&:&:<<++S1	3rc|j}|d}|jt|j|jt|jd|j	|j||d|j	|jd|d|j	|j|d|d|j	|jd|d|j	|jd|d|j	|j|d||j	|jd||j	|j|d|d|j	|jdd|d|j	|j|dd|d|j	|jdd|d|j	|jdd|d|j	|j|dd||j	|jdd||j	|j|d	d|d
|j	|jd	d|d
|j	|j|dd|d|j	|jdd|d|j	|j|d
d|d|j	|jd
d|d|jt5|jdd|jdddddd|jt|j|d
|jt|j|d|jt|j|d	|jt|j|d|jt|j|d|jt|j|d|jt|j|d|jt|j|dd|jt|j|dd|jt|j|dd|jt|j|dd|jt|j|dd|d}|j	|j|d|d|j	|jd|d|j	|j|d|d|j	|jd|d|j	|jd|d|j	|j|d||j	|jd||j	|j|dd|d|j	|jdd|d|j	|j|dd|d|j	|jdd|d|j	|jdd|d|j	|j|dd||j	|jdd||j	|j|dd|d
|j	|jdd|d
|j	|j|dd|d|j	|jdd|d|j	|j|dd|d|j	|jdd|d|jt|j|d|jt|j|d|jt|j|d|jt|j||jt|jd|jt|j|d|jt|j|d|jt|j|d|jt|j|d|jt|j|dd|jt|j|dd|jt|j|dd|jt|j|dd|jt|j|ddy#1swYnxYw)Nr.rDr'r!r"r#Twalk_upa/cz../br;rr:z../a/br*z../aza/..z/a/..r+rr/a/cr<r)r1rHrGrKr?assertWarnsDeprecationWarningrr@s   rtest_relative_to_commonz)_BasePurePathTest.test_relative_to_commonSsHH
eH)Q]]3)Q]]D9qs+QuX6r*AeH5qv.#7s+QsV4t,af5qx0!#6u-qs3qsD91U8Dr48!E(Cqvt<afEsD91S6BtT:AcFCqx>Dud;QSAqx>&	Jud;QvYGqz4@!D'Jw=qwGqvt<akJsD91X;G


0
1	2
MM#s#
MM#sDM1	2	
*ammQsV<*ammQwZ@*ammQuX>*ammQtW=*ammQvY?*ammQvY?*ammQwZ@*ammQsVTJ*ammQtWdK*ammQvYM*ammQvYM*ammQwZN
fIqv.%9s+QuX6qw/38t,af5u-qv6qy1137v.4qvt<ahGsD91U8Dqw=qvFtT:AcFCud;QsVDqy$?Evt<acBqy$?6Kvt<aiHq{DA1T7Kx>$Hqw=q{KtT:AhKH*ammQtW=*ammQx[A*ammQvY?*ammQS9*ammR8*ammQsV<*ammQvY?*ammQvY?*ammQwZ@*ammQrUDI*ammQsVTJ*ammQvYM*ammQvYM*ammQwZNg	2	2s'mmc|j}|d}|jt|j|jt|jd|j	|j||j	|jd|j	|j|d|j	|jd|j	|j|d|j	|jd|jt5|jddddd|j|j|d|j|j|d|j|j|d	|j|j|d
|d}|j	|j|d|j	|jd|j	|j|d
|j	|jd
|j	|jd
|j	|j|d|j	|jd|j|j|d|j|j|d|j|j|d|j|j||j|jd|j|j|dy#1swYzxYw)Nr.rDr'r!r#r"r:r;r2r*rr+rrr<r3)r1rHrGis_relative_torr4r5rr@s   rtest_is_relative_to_commonz,_BasePurePathTest.test_is_relative_to_commonsHH
eH)Q%5%56)Q%5%5t<((-.((,-((301((./((523((/0


0
1	'
S#&	'	
))!C&12))!G*56))!E(34))!D'23
fI((301((-.((412((./((/0((634((01))!D'23))!H+67))!F)45))!#./))"-.))!C&12+	'	's<OOc|j}|d}tdtjdzD]}tj||}tj
|}|j
|j|j|j|||jt|t||jt|t|y)Nrrr)r1rangepickleHIGHEST_PROTOCOLdumpsloadsr^rr?rr\)rrAr7protodumpedrs      rtest_pickling_commonz&_BasePurePathTest.test_pickling_commonsHH
fI1f559:	.E\\!U+Ff%BMM",,4R#T"XtAw/SWc!f-
	.rN)+rrrrr8rBrPrarfrprur|rrrrrrrrrrrrrrrrrrrrrrrrr r'r*r.r6r9rBrUrrrr(s
L*
4%6
+-4 1/98&&$B$==

<	-&-,^8
106$
@-^*.0	4K(M&:A A"32MO^!3F	.rrcfeZdZejZdZdZdZdZ	dZ
dZdZdZ
d	Zd
ZdZy)
PurePosixPathTestc|j}|dddd|dddd|dddd|d	ddd	|d
ddd
|ddddy)N)//ar"r'//)rGr!r")///ar"r+)r+r!r")z////ar"c:a)c:\a)z\ar|rrs  rtest_drive_root_partsz'PurePosixPathTest.test_drive_root_partssd,,	lD2BC
mCA
nCA
hB9
jB
;
hB9rc|j}|j|djd|j|djd|j|djdy)Nrr+z///a/b//a/brGr1r?rsrs  r	test_rootzPurePosixPathTest.test_rootsUHH6-8))3/7$/rc|j}|j|d|d|j|d|d|j|d|dy)Nr.A/br*rHrF)r1rr?rs  rtest_eqzPurePosixPathTest.test_eqsSHHAeHah/4!F),AdGQuX.rc|j}|j|djd|j|djd|j|djdy)Nr+zfile:///z/a/b.cz
file:///a/b.cz/a/b%#czfile:///a/b%25%23c)r1r?rrs  rtest_as_urizPurePosixPathTest.test_as_uris`HH3*58++-?9,,.0DErc	ddlm}|j}	tjd|j|djd|tjdzy#t
$r|j
dY_wxYw)Nr)quote_from_byteséz1\xe9 cannot be encoded to the filesystem encodingu/a/bézfile:///a/b)	urllib.parserYr1rrUnicodeEncodeErrorskipTestr?r)rrYrAs   rtest_as_uri_non_asciiz'PurePosixPathTest.test_as_uri_non_asciisw1HH	PKK	
:--/&)9"++f:M)NN	P"	PMMNO	PsA,,B	B	ch|j}|j|djdy)Nrr)r1rrJrs  r
test_matchzPurePosixPathTest.test_matchs&HH601rcj|j}|j|j|j|dj|j|dj|j|dj|j|dj|j|dj|j|dj|j|djy)Nr!r&r+r*/a/b/rFrPr1ris_absoluterrs  rtest_is_absolutez"PurePosixPathTest.test_is_absolutesHH*+3++-.6..01#**,-$++-.'
..01%,,./'
..01rcL|j}|jd|dj|jd|dj|jd|dj|jd|djy)NFr'r+/foo/barz/dev/con/PRN/NULr1r^is_reservedrs  rtest_is_reservedz"PurePosixPathTest.test_is_reservedsyHH

eQrU..01

eQsV//12

eQz]6689

eQ12>>@Arc:|j}|d}|jd}|j||d|djd}|j||d|djd}|j||dyNrFr"rPr*z//crr1rIr?rs    r	test_joinzPurePosixPathTest.test_joinsHH
eH
ZZ_QwZ(
tW

e
$QuX&
uX

t
$QtW%rc|j}|d}|dz}|j||d|ddz}|j||d|ddz}|j||dyrlr1r?rs    rtest_divzPurePosixPathTest.test_divssHH
eH
WQwZ(
tWu_QuX&
uX_QtW%rc|j}|ddd}|tjd}|j||y)Nc:r!r"c:\a\b)r1rPureWindowsPathr?rs    rtest_parse_windows_pathz)PurePosixPathTest.test_parse_windows_path(s>HH
dC
w&&z2
3BrN)rrrr
PurePosixPathr1rNrRrUrWr^r`rerjrnrqrvrUrrrDrDsG


C
:0/FP2	2B&	& rrDc2eZdZejZejjZejdggdgddgddgddZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#y")#PureWindowsPathTest)r=)rsr!)rsr#)rcrsr!))c:/r!)rsr+r!)rsr*)z/zr{r!)z//x/yr{r!rP)rPr:)//a/b/r:)r=rJc:/ar}//a/b/cc|j}|dddd|dddd|dddd|d	ddd
|dddd|d
ddd|dddd|dddd|dddd|dddd|dddd|dddd|dddd |d!ddd"|d#d$dd%|d&ddd'|d(d$dd%|d)d*dd+|d,d-dd.|d/d-dd0|d1d-dd2|d3d4dd5|d6d7dd8|d9d:dd;|d<d=dd>|d?d@ddA|dBdCddD|dEdFddG|dHdFddG|dIdFddJ|dKdLddM|dNdOddP|dQdRddS|dTdUddV|dWdXddY|dZddd[|d\ddd"|d]d^dd_|d`ddda|dbdddc|ddddde|dfdddf|dgdhddi|djdhddk|dldmddn|dodmddpy)qN)rsrsr')r{\)c:\)r+)rrIrz)r~)rr!)r*)rr!)rG\\)r)rF\\a)r)z//a/\\a\)rr|\\a\b)\\a\b\)r})r)rr:)r!zZ:br:Z:)rr"r:)r!zZ:/br:)Z:\r"r:)r!z//b/cr)z\\b\c)z\\b\c\r))r!z	Z://b//c/zd/)rr"r:r))r!z//b/c//r))z//./c:\\.\c:)r)z//?/c:/z\\?\c:)\\?\c:\)//?/c:/a)rr!)rr)rr")z//?\\?)r)z//?/\\?\)r)z//?/UNC\\?\UNC)r)z//?/UNC/\\?\UNC\)r)z	//?/UNC/b	\\?\UNC\b)r)z
//?/UNC/b/
\\?\UNC\b\)r)z//?/UNC/b/cz\\?\UNC\b\c)\\?\UNC\b\c\)z//?/UNC/b/c/)z
//?/UNC/b/c/d)rr))z//./BootPartition/z\\.\BootPartition)z\\.\BootPartition\)z//?/BootPartition/z\\?\BootPartition)z\\?\BootPartition\)z//./PhysicalDrive0\\.\PhysicalDrive0)r)z
//?/Volume{}/z\\?\Volume{})z
\\?\Volume{}\)z//./nul\\.\nul)rr)rr"r:)zZ:/arr:)z//?/Z:/arr:z\\?\Z:)z\\?\Z:\r"r:)c:/a/bc:x/y)rr!r"rZy)rc:/x/y)rrZr)z./c:s)c:s)zcc:s)zC:c:sC:)rr)zC:/c:s)C:\r)zD:a./c:bD:)rr!c:b)zD:/ar)zD:\r!rrLrMs  rrNz)PureWindowsPathTest.test_drive_root_parts@s,,
gb':
hdI>
fD':
hb+>
idMB
gD+>
gI>
hZ@
i	2|D
j
D/J
k
D/J
l
D:MN
b2BC
 d4FG
!
D:MN
&d4KL
#
D:MN
kRH
lT;KL
mT;OP
 T;OP
hZ@
i	2|D
lb/J
m<MN
n=OP
o(92?ST
(:DBYZ
(:DBYZ
 (:DB]^
%)?Gbc
%)?Gbc
%)@"F`a
 ):DBXY
lr?K
D2BC
!d4FG
%T;TU	!d4PQ
"d4FG
jB9
iB	:
jb-@
kdOD
b2DE
d4HIrc|jd}|jt|d|jd}|jt|d|jd}|jt|d|jd}|jt|d|jd	}|jt|d
y)Nr;za\b\czc:/a/b/czc:\a\b\crPrrz\\a\b\c	//a/b/c/dz	\\a\b\c\d)r1r?r\r6s  rtest_strzPureWindowsPathTest.test_str~sHHWQ+HHZ Q/HHWQ.HHYQ/HH[!Q!12rcX|jd|jd|jd|jd|jd|jd|jd|jd|jd	|jd
y)Nz.\a:brsrJz	c:a\b.txtrrKz
c:\a\b.txtz\\some\sharez\\some\share\az\\some\share\a\b.txtrdres rtest_str_subclassz%PureWindowsPathTest.test_str_subclasss  *  &  '  .  (  )  0  !23  !56  !<=rc<|j}|j|d|d|j|d|ddd|j|d|d|j|d|d|j|d|d|j|d|d	|j|d
|d|j|d|d
|j|d|dy)Nc:a/brsr!r"zd:a/brrza/BrTC:a/Bc:A/b//Some/SHARE/a/Bz//somE/share/A/buİui̇)r1r?rrs  rrUzPureWindowsPathTest.test_eqsHH7QwZ07QtS#%67AgJ'
3AgJ(4AfIq{351U8,7QwZ0-.2D0EF8a	l3rc4|j}|jt5|djddd|jt5|djddd|j	|djd|j	|djd|j	|djd|j	|d	jd
|j	|djd|j	|d
jd|j	|djdy#1swYIxYw#1swY"xYw)Nrrr{zfile:///c:/zc:/a/b.czfile:///c:/a/b.cz	c:/a/b%#czfile:///c:/a/b%25%23cuc:/a/bézfile:///c:/a/b%C3%A9z
//some/share/zfile://some/share/z//some/share/a/b.czfile://some/share/a/b.cu//some/share/a/b%#céz"file://some/share/a/b%25%23c%C3%A9)r1rHrrr?rs  rrWzPureWindowsPathTest.test_as_urisIHH


z
*	
fI	


z
*	 
gJ	 5*M::--/1CD;..02IJ<//13IJ?+2246JK/07792	445<<>=	?			 	 sFF
F

Fc|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|d	jd|j|d	jd|j|d
jd|j|d
jd|j|d
jd|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|d
jdy)Nzc:/b.pyz*:/*.pyzc:/*.pyzd:/b.pyrrzc:*.pyzc:b.pyrz//some/share/a.pyz
//*/*/*.pyz//some/share/*.pyz//other/share/a.pyz//some/share/a/b.pyzB.pyzb.PYrrz//Some/Share/B.Pyz//somE/sharE/*.pY)r1rrJrrs  rr`zPureWindowsPathTest.test_matchsIHH)**956)**9569++I676126236348**7348**9567))(347)))45-.44\BC-.445HIJ/0667JKL01778KLM&	/0+,,[9:-.445HIJ9++G459++H56./55g>?rc,fd}j}|d}|d}|||j||kj||kD|d}|d}|||j||kj||kDy)NcNj||j||yr)assertLessEqualassertGreaterEqualrs  rassertOrderedEqualzDPureWindowsPathTest.test_ordering_common.<locals>.assertOrderedEquals#  A&##Aq)rrrz//some/Share/A/br)r1r)rrrAr7rs`    rrz(PureWindowsPathTest.test_ordering_commons	*
HH
gJ
gJ1a QQ
 !
 !1a QQrc|j}|d}|j}|j|d|d}|j}|j|d|d}|j}|j|dy)Nr)rsr!r"r)rr!r"r)rr:r))r1r]r?)rrAr7r]s    r
test_partszPureWindowsPathTest.test_partsstHH
gJ 01
hK 23
kN 89rcd|j}|d}|j|j|d|j|jj|d|j|jjj|d|j|jjjj|d|d}|j|j|d|j|jj|d|j|jjj|d|j|jjjj|d|d	}|j|j|d
|j|jj|d|j|jjj|dy)Nzz:a/b/czz:a/bz:az:zz:/a/b/czz:/a/bz:/az:/rrrPrr@s   rtest_parentzPureWindowsPathTest.test_parentsxHH
iL1W:.!E(3//49//66$@
jM1X;/!F)4//5://66%A
kN1Y<0!G*5//7<rc|j}|d}|j}|jt|d|j|d|d|j|d|d|j|dd|df|j|dd|df|j|dd|d|df|j|dd|df|j|ddd|df|j|ddd|d|df|jt	||d|dg|jt5|dddd|d}|j}|jt|d|j|d|d	|j|d|d
|j|dd|d	f|j|dd|d	f|j|dd|d	|d
f|j|dd|d
f|j|ddd|d	f|j|ddd|d
|d	f|jt	||d	|d
g|jt5|dddd|d}|j}|jt|d|j|d|d|j|d|d
|j|dd|df|j|dd|df|j|dd|d|d
f|j|dd|d
f|j|ddd|df|j|ddd|d
|df|jt	||d|d
g|jt5|ddddy#1swYxYw#1swYxYw#1swYyxYw)Nzz:a/b/rrrrrrzz:/a/b/rrrrrP)r1ror?rrrHrrs    rtest_parentsz PureWindowsPathTest.test_parentss!HH
hKiiS1%Q5*Q4)QqAeH;/SbAeH;/Ra1U8QtW"56QR1T7*-SqSAeH;/TrTQtWah$78cQuXqw$78


z
*	F	
iLiiS1%Q6+Q5*QqAfI<0QrQvYL1Ra1V9ah"78QR1U8+.SqSAfI<0TrTQuXqy$:;cQvY%$9:


z
*	F	
kNiiS1%Q9.Q7,QqAiL?3QrQy\O4Ra1Y<7"<=QR1W:-0SqSAiL?3TrTQwZ9$>?cQy\1W:$>?


z
*	F		9						s$,QQ"Q/Q"Q,/Q8c<|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|d	jd
y)Nrsrr{c:/a/b/rPrr}rz./c:ar'rrs  r
test_drivezPureWindowsPathTest.test_drive+sHH4-7))405.9++T27)):68**J7;--z:7))2.rc|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|d	jdy)
Nrsr'rr{rrrPr}rrQrs  rrRzPureWindowsPathTest.test_root6sHH4r*7"-5-9**D17$/8))40;,,d3rc|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|d	jdy)
Nrsrr{rrrPrr}r)r1r?rrs  rtest_anchorzPureWindowsPathTest.test_anchor@sHH4.7**D15&19,,f57**L98++\:;..=rc<|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|d	jd|j|d
jd|j|djdy)Nrsr'r{rr"rc:a/b.pyr	c:/a/b.py//My.py/Share.php//My.py/Share.php/a/brrs  r	test_namezPureWindowsPathTest.test_nameJsHH4r*5+7#.8))3/:++V4;,,f5./44b92388#>rc\|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|djd|j|d	jd|j|d
jd|j|djd|j|d
jd|j|djd|j|djd|j|djd|j|djd|j|djd|j|djdy)Nrsr'r{rrrrr	c:a/.hgrc
c:/a/.hgrc
c:a/.hg.rcr
c:/a/.hg.rcc:a/b.tar.gzr

c:/a/b.tar.gz!c:a/Some name. Ending with a dot."c:/a/Some name. Ending with a dot.rrrrs  rtest_suffixzPureWindowsPathTest.test_suffixUsHH4,5"-7**B/8++R0:--u5;..6;..3<//4<//7=)00%8>*1159?+22E:>?FFK?@GGL./66;23::B?rcl|j}|j|djg|j|djg|j|djg|j|djg|j|djdg|j|djdg|j|djg|j|d	jg|j|d
jdg|j|djdg|j|d
jddg|j|djddg|j|djg|j|djg|j|djg|j|djgy)Nrsr{rrrrrrrrr
rrrr
rrrrrrrs  r
test_suffixesz!PureWindowsPathTest.test_suffixeshsHH4))2.5**B/7,,b18--r2://%9;005':;00"5<1126<11E7;=)22UG<>*33fe_E?+44vuoF./88"=23<<bA>?HH"M?@II2Nrc|j}|j|djd|j|djd|j|djd|j|djd|j|djd|j|d	jd|j|d
jd|j|djd
|j|djd|j|djdy)Nrsr'zc:.zc:..rr{rr"rrrrrrrrrrrs  r	test_stemzPureWindowsPathTest.test_stem{sHH4r*5+6.5+7#.:++S1;,,g6<--u5>*//9>?DD8	:rc|j}|j|djd|d|j|djd|d|j|djd|d|j|djd|d|jt|djd|jt|d	jd|jt|d
jd|jt|djd|jt|djd|jt|djd
|jt|djd
y)Nrr"z	c:a/d.xmlrz
c:/a/d.xmlc:a/Dot ending.c:/a/Dot ending.rsr{
//My/Shared:d:ed:/er&rs  rtest_with_namez"PureWindowsPathTest.test_with_names_HH7--g6+G8..w7<I,-77@!K.Q-.88A1\?S*ag&7&7A*ah&8&8'B*ao&?&?I*aj&:&:DA*aj&:&:EB*aj&:&:FC*aj&:&:LIrc|j}|j|djd|d|j|djd|d|j|djd|d|j|djd|d|jt|djd|jt|d	jd|jt|d
jd|jt|djd|jt|djd|jt|djd
|jt|djd
y)Nrr)zc:a/drzc:/a/drrrsr{rrrrr)rs  rtest_with_stemz"PureWindowsPathTest.test_with_stems_HH7--c2AgJ?8..s3Qx[A,-77<ajI-.88=q{K*ag&7&7=*ah&8&8#>*ao&?&?E*aj&:&:DA*aj&:&:EB*aj&:&:FC*aj&:&:LIrc|j}|j|djd|d|j|djd|d|j|djd|d|j|djd|d|jt|djd|jt|d	jd|jt|d
jd|jt|djd|jt|djd|jt|djd
|jt|djd
|jt|djd|jt|djd|jt|djd|jt|djd|jt|djd|jt|djd|jt|djd|jt|djdy)Nrr
zc:a/b.gzrz	c:/a/b.gzrrr'rcr+rr,rrsr-z\.gzzc:.gzr,zc\dz.c/dz.c\d)r1r?rNrHrrs  rtest_with_suffixz$PureWindowsPathTest.test_with_suffixs;HH7//6*
F8007;H:22591Z=I;33E:AkNK*ae&7&7?*af&8&8%@*af&8&8%@*ao&A&A5I*aj&<&<dC*aj&<&<cB*aj&<&<dC*aj&<&<dC*aj&<&<fE*aj&<&<gF*aj&<&<gF*aj&<&<eD*aj&<&<fE*aj&<&<fE*aj&<&<gFrc|j}|d}|j|j|d|d|j|jd|d|j|j|d|d|j|jd|d|j|jd|d|j|j|d||j|jd||j|j|dd	|d|j|jdd	|d|j|j|dd	|d|j|jdd	|d|j|jdd	|d|j|j|dd	||j|jdd	||j|j|d
d	|d|j|j|dd	|d
|j|j|dd	|d|jt|j||jt|jd|jt|j|d|jt|j|d|jt|j|d|jt|j|d|jt|j|d|jt|j|d
|jt|j|d|jt|j|d	|jt|jdd	|jt|j|dd	|jt|j|dd	|jt|j|dd	|jt|j|dd	|jt|j|dd	|d}|j|j|d|d|j|jd|d|j|j|d|d|j|jd|d|j|jd|d|j|j|d||j|jd||j|j|dd	|d|j|jdd	|d|j|j|dd	|d|j|jdd	|d|j|jdd	|d|j|j|dd	||j|jdd	||j|jdd	|d|j|jdd	|d|j|jdd	|d
|jt|jd|jt|j|d|jt|j|d|jt|j|d|jt|j|d|jt|j|d|jt|j|d|jt|j|d |jt|j|d|jt|j|d|jt|j|d!|jt|jdd	|jt|j|dd	|jt|j|dd	|jt|j|dd	|jt|j|d d	|jt|j|dd	|jt|j|dd	|jt|j|d!d	|d"}|j|j|d#|d|j|jd#|d|j|jd$|d|j|j|d%|d|j|jd%|d|j|jd&|d|j|j|d'||j|jd'||j|j|d#d	|d|j|jd#d	|d|j|jd$d	|d|j|j|d%d	|d|j|jd%d	|d|j|jd&d	|d|j|j|d'd	||j|jd'd	||j|j|d(d	|d|j|jd(d	|d|jt|j|d)|jt|j|d*|jt|j|d+|jt|j|d,|jt|j|d)d	|jt|j|d*d	|jt|j|d+d	|jt|j|d,d	y)-N	C:Foo/BarrszFoo/Barc:foOBarc:foO/	c:foO/baRTr0
C:Foo/Bar/Bazr	C:Foo/Bazz../Barz	C:Baz/Barz
../../Foo/Barr'rr+Foo/FooC:/Foo
C:/Foo/Barr{c:/foOc:/foO/
c:/foO/baRC:/Bazz
../Foo/BarC:/Foo/Bar/Baz
C:/Foo/BazC:Food:///C/Foo//Server/Share/Foo/Bar//sErver/sHare//sErver/sHare///sErver/sHare/Foo//sErver/sHare/Foo///sErver/sHare/Foo/Barz//sErver/sHare/bar/Server/Share/Fooc:/Server/Share/Foo
//z/Share/Foo//Server/z/Foo)r1r?rKrHrr@s   rtest_relative_toz$PureWindowsPathTest.test_relative_tosHH
kNqw/9>t,a	l;qz2AeH=w/5:x0!E(;q~6<{3QS9qw=q|LtT:AiLIqz4@!E(Kw=qxHx>%Iq~tDacJ{DA13Gq'94H!D'Rq~tDakRq~tDaFXY*ammQS9*ammR8*ammQtW=*ammQsV<*ammQuX>*ammQvY?*ammQx[A*ammQ5GH*ammQ{^D*ammQS$G*ammRF*ammQtWdK*ammQsVTJ*ammQuXtL*ammQvYM*ammQx[$O
lOqx0!I,?u-q|<q{3QuX>x0!E(;y11U8<q7=|4ac:qx>)Mud;Qy\Jq{DA1U8Lx>%Iy$?5JqEqsK|TBACHx>,P'7F$P|TBAhKP*ammT:*ammQtW=*ammQx[A*ammQ7G5HI*ammQ|_E*ammQwZ@*ammQtW=*ammQuX>*ammQsV<*ammQvY?*ammQy\B*ammT4H*ammQtWdK*ammQwZN*ammQtWdK*ammQuXtL*ammQsVTJ*ammQvYM*ammQy\4P
&'q)9':;Qy\J'78!I,G'891Y<Hq)='>?5J';<ahG'<=qxHq)A'BCQSI'?@!#Fq)9':DI1Y<X'7F)U'8$G9Vq)='>MqQVxX';TJAeHU'<dKQuXVq)A'BDQSTSVW'?NPQPSTq)='>MqQ]_';TJAlO\*ammQ7J5KL*ammQ7L5MN*ammQ5GH*ammQ7G5HI*ammQ7J5KUYZ*ammQ7L5MW[\*ammQ5GQUV*ammQ7G5HRVWrcr|j}|d}|j|j|d|j|jd|j|j|d|j|jd|j|jd|j|j|d|j|jd|j|j||j|jd|j|j|d|j|j|d|j|j|d	|j|j|d
|j|j|d|j|j|d|j|j|d
|d}|j|j|d|j|j|d|j|jd|j|j|d|j|jd|j|jd|j|j|d|j|j|d|j|j|d|j|j|d|j|j|d|j|j|d|j|j|d|j|j|d
|j|j|d|d}|j|j|d|j|jd|j|jd|j|j|d|j|jd|j|jd|j|j|d|j|jd|j|j|d|j|j|d |j|j|d!|j|j|d"y)#Nrrsrrrr'rr+rrrrrrr{rrrrrrrrrrrrrrrrrrr)r1rr8rr@s   rtest_is_relative_toz'PureWindowsPathTest.test_is_relative_to&sHH
kN((412((./((745((12((23((;89((56))!#./))"-.))!D'23))!C&12))!E(34))!F)45))!H+67))!O*<=>))!K.9:
lO((523((856((34((<9:((67))$/0))!H+67))!,<*=>?))!L/:;))!G*56))!D'23))!E(34))!C&12))!F)45))!I,78
&'((+;)<=>(()9:;(():;<((+?)@AB(()=>?(()>?@((+C)DEF(()ABC))!,?*@AB))!,A*BCD))!O*<=>))!,<*=>?rc|j}|j|j|j|dj|j|dj|j|dj|j|dj|j|dj|j|dj|j|dj|j|dj|j|d	j|j|d
j|j|dj|j|dj|j|d
j|j|dj|j|djy)Nr!r&r+r*rbrsrJzc:a/b/r{r~rrPr}rrrcrs  rrez$PureWindowsPathTest.test_is_absolute[sHH*+3++-.6..013++-.4,,./7//124,,./5--/080023%,,./&	--/0)0023'
..01(//12)0023+2245rc|j}|d}|jd}|j||d|jd}|j||d|jd}|j||d|jd}|j||d|jd}|j||d|jd	}|j||d|jd
}|j||d|j|d}|j||d|j|d
}|j||d|j|d}|j||d|djd}|j||d|djd}|j||d|djd}|j||dy)NC:/a/bx/y
C:/a/b/x/y/x/yC:/x/yD:x/yD:/x/y//host/share/x/yrr./d:s
C:/a/b/d:s./dd:sC:/a/b/dd:sE:d:srGserverz//serversharez//server/sharez//./BootPartitionWindowsz//./BootPartition/Windowsrmrs    rrnzPureWindowsPathTest.test_joinpsHH
hK
ZZ
Q|_-
ZZ
Qx[)ZZ
 QwZ(
ZZ
!Qx[)
ZZ*
+Q123ZZ
 Q|_-
ZZ
!Qx[)ZZ'

#Q|_-
ZZ(
$Q}-.
ZZ'

#QwZ(
tW

h
'Qz]+
z]
#
#G
,Q/01
"
#
,
,Y
7Q:;<rc\|j}|d}|j|dz|d|j|dzdz|d|j|dz|d|j|dzdz|d|j|d	z|d	|j|d
zdz|d	|j|dz|d|j|d
zdz|d|j|dz|d|j|d
z|d|j|dz|d|j||dz|d|j||dz|d|j||dz|dy)NrrrrZrrr	z/xr
rrrrrr
rrrrrpr@s   rrqzPureWindowsPathTest.test_divsHH
hKUAlO4S3,8VQx[1TC85	
Waj1TE)1W:6Xq{3TF*AhK8//3E1FG	
Wao6Xq{3	
QwZ<9Qx[!M*:;QwZ74rc<|j}|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|d	j|jd|d
j|jd|dj|jd|dj|jd|d
j|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|dj|jd|djy)NFr'r+rgz//my/share/nul/con/auxTnulauxprnconzconin$zconout$COM1LPT9ucom¹ucom²ulpt³zNUL.txtzPRN  z	AUX  .txtzCOM1:barzLPT9   :barzbar.com9zbar.lpt9zc:/baz/con/NULzc:/NUL/con/bazrhrs  rrjz$PureWindowsPathTest.test_is_reservedsHH

eQrU..01

eQsV//12

eQz]6689

eQ78DDFG

dAeH0023

dAeH0023

dAeH0023

dAeH0023

dAhK3356

dAiL4467

dAfI1134

dAfI1134

dAiL4467

dAiL4467

dAiL4467	


dAiL4467

dAgJ2245

dAkN6689

dAjM5578

dAm,88:;	


eQz]6689

eQz]6689

dA./;;=>

eQ/0<<>?rN)$rrrrrur1rrcopyupdaterNrrrUrWr`rrrrrrRrrrrrrrrrrrernrqrjrUrrryry/s

!
!C$11668L>.O<J|
3
>4? @6 "
:=$,\	/4>	?@&O&:JJG0gXR3@j6*#=J52!@rryc6eZdZejZdZdZdZy)PurePathTestc|jd}|jt|tjdk(rt
jyt
jyNr!nt)r1r^rrrrrurwr6s  rtest_concrete_classz PurePathTest.test_concrete_classsDHHSM

d1g')ww$G##	S<C<Q<Q	Src|tjd}tjd}|j||yr0)rrwrurrr7rs   rtest_different_flavours_unequalz,PurePathTest.test_different_flavours_unequals2!!#&##C(Aq!rctjd}tjd}|jt5||kddd|jt5||kddd|jt5||kDddd|jt5||k\dddy#1swYsxYw#1swY\xYw#1swYExYw#1swYyxYwr0)rrwrurHrGr&s   r!test_different_flavours_unorderedz.PurePathTest.test_different_flavours_unordereds!!#&##C(


y
)	
E	


y
)	
F	


y
)	
E	


y
)	
F		
								s0B8#CC)C8CC
CC%N)	rrrrPurePathr1r$r'r)rUrrr r s


CS
"

rr cJtjjtg|Sr)rrtjoinBASErZs r<lambda>r/s"'',,t(a(rcJtjjtg|Sr)rrtr,r	r.s rr/r/sbggll6.A.rr#z)test requires a Windows-compatible systemz'test requires a POSIX-compatible systemc$eZdZejZy)PosixPathAsPureTestN)rrrr	PosixPathr1rUrrr2r2s



Crr2c0eZdZejZdZdZy)WindowsPathAsPureTestc|j}|jt5|djdddy#1swYyxYwNr{)r1rHNotImplementedErrorownerrs  r
test_ownerz WindowsPathAsPureTest.test_owner=HH


2
3	
eHNN			AAc|j}|jt5|djdddy#1swYyxYwr7)r1rHr8grouprs  r
test_groupz WindowsPathAsPureTest.test_groupr;r<N)rrrrWindowsPathr1r:r?rUrrr5r5s


C
rr5ceZdZdZdZejdk(rdZndZdZdZ	dZ
d	Zd
ZdZ
dZej ed
uddZdZdZdZej eddZdZdZdZdZdZdZej>dZ dZ!dZ"dZ#d Z$ej>d!Z%d"Z&d#Z'ej>d$Z(ej>d%Z)d&Z*djd'Z+e+xZ,Z-ej>d(Z.ej>d)Z/d*Z0d+Z1ejdd,Z3e4ejdd-Z5ejdd.Z6ej>d/Z7d0Z8ej>d1Z9d2Z:ejved3d4Z<ejve=d5d6Z>d7Z?d8Z@d9ZAejveBed:d;d<ZCej eBed:d=d>ZDd?ZEd@ZFej>dAZGdBZHdCZIdDZJdEZKdFZLdGZMej eNdHdIZOePdJZQdKZRdLZSdMZTej>dNZUdOZVdPZWdQZXdRZYdSZZdTZ[ejveBedUdVej e\jdWk(dXdYZ^dZZ_ejveBe`d[d\ej eNd]ej ed^d_Zad`ZbdaZcdbZddcZeddZfdeZgej>dfZhej>dgZiej>dhZjdiZky
)k
_BasePathTestz?Tests for the FS-accessing functionalities of the Path classes.c.d}|j|tjttjt	dtjt	dtjt	dtjt	ddtjt	dtt	dd5}|j
d	dddtt	dd
d5}|j
ddddtt	ddd5}|j
d
dddtt	ddd5}|j
ddddtt	dddd5}|j
ddddtjt	ddtjrtjdt	dtjdt	d|jdt	d|jtjj	ddt	dd|jtjj	ddt	ddtjdt	dyy#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swY_xYw)Ncttjtddtjt
y)NdirE)rchmodr,rrmtreer-rUrrcleanupz$_BasePathTest.setUp.<locals>.cleanup$s"HHT&\5)T"rdirAdirBdirCdirDrEfileAwbsthis is file A
fileBsthis is file B
fileCsthis is file C
z	novel.txtsthis is a novel
fileDsthis is file D
rlinkAnon-existing
brokenLinklinkBrlinkClinkDbrokenLinkLoop)
addCleanuprmkdirr-r,openwriterGrcan_symlinksymlinkdirlinkrt)rrIfs   rr8z_BasePathTest.setUp#s2	#	
 

f
f
f
ff%&
f
$w-
&	)!
GG'(	)
$vw'
.	)!
GG'(	)
$vw'
.	)!
GG'(	)
$v{+T
2	*a
GG()	*
$vvw/
6	)!
GG'(	)
fq!  "JJwW
.JJ~tL'9:LLg/LLdF3T&'5JKLLdF3T&'5JKJJ'$/?*@A#	)	)	)	)	)	)	*	*	)	)s<K
K#:K0*K=L
K #K-0K:=L
Lr#c4tj||dy)NTtarget_is_directoryrr_rsrcdests   rr`z_BasePathTest.dirlinkFsJJsDd;rc0tj||yrrerfs   rr`z_BasePathTest.dirlinkIsJJsD!rc|jtjjt	|t	||d|dy)Nz and z don't point to the same file)rrrtsamefiler\rpath_apath_bs   r
assertSamez_BasePathTest.assertSameLs3((Vc&kB)	*rc|jt5}||i|ddd|jjjtj
y#1swY>xYwr)rHFileNotFoundErrorr?	exceptionerrnoENOENT)rfuncr_kwargscms     rassertFileNotFoundz _BasePathTest.assertFileNotFoundQsS


0
1	"R$!&!	"++U\\:	"	"s	AA%c|jtjj|tjj|yr)r?rrtnormcaserls   rassertEqualNormCasez!_BasePathTest.assertEqualNormCaseVs0))&12773C3CF3KLrc<|jtj}|j|||j	t|t||j
t|t||j|jyr)
r1rgetcwdr?r{r\r^rrrdr&s   r	_test_cwdz_BasePathTest._test_cwdYsfHHRYY[!A  QQ0

d1gtAw'

(rcZ|jj}|j|yr)r1cwdr~r6s  rtest_cwdz_BasePathTest.test_cwd`sHHLLNqrc
t|j}tjd5}t|_|jt
|jt|jt
|djt|jt
|djtjjtd|jt
|dddjtjjtddd|jt
|ddjtjjtdd|jt
|djtjjtd|jt
|d	jtjjtd	|jt
|d
jtjjtd
|jt
|dd
jtjjtdd
|jt
|d
djtjjtd
ddddy#1swYyxYw)N	os.getcwdrcr!r"r:rVrPrUrYr)r1rpatchr-return_valuer?r\absoluterrtr,)rrAr}s   rtest_absolute_commonz"_BasePathTest.test_absolute_commonds$HH
ZZ
$	Z"&F
S0$7S3!23T:S3!23RWW\\$5LMS3S!1!:!:!<=rww||DRUWZ\_?`a
S7G!4!=!=!?@"'',,tU\^eBfgS<!9!9!;<bggll4Q]>^_S#3!4!=!=!?@"'',,tUeBfg
S4!1!1!34bggll46NOS3!6!6!89277<<cSW;XYS4!6!6!89277<<dTW;XY#	Z	Z	ZsLL..L7cR|jtjjd}|j	|||jt
|t
||jt|t||j|jy)N~)r1rrt
expanduserr?r{r\r^rrrdr&s   r
_test_homez_BasePathTest._test_homezsoHHRWW'',-A  QQ0

d1gtAw'

(rNz(Test requires pwd module to get homedir.)reasonctj5}|j|jj	|jtjjtd|d<|j|jj	tjjtd|d<|j|jj	dddy#1swYyxYw)NuserprofileUSERPROFILEhomeHOME)
rEnvironmentVarGuardrr1rclearrrtr,r-)renvs  r	test_homez_BasePathTest.test_homes
*
*
,		-OODHHMMO,IIK!#dM!BC
OODHHMMO,'',,tV4CKOODHHMMO,		-		-		-sCC88DcTGddt|j}|td}|jd|j	j
|jd|j
j
ts9|jd|jdjj
|jd|dzj|dzj
|jd|dzj|dzj
tjr-|jd|dzjj
|jD]}|jd|j
 |j!d	D]}|jd|j
 |j#d	D]}|jd|j
 |j%D]"\}}}|jd|j
$y)
NceZdZy)+_BasePathTest.test_with_segments.<locals>.PNrTrUrrrArrWrrArlrmrrNrPrSr)rr1r-r?rrresolverrrrenamerxrr^readlinkiterdirglobrglobwalk)rrAr7rtdirpathdirnames	filenamess       rtest_with_segmentsz _BasePathTest.test_with_segmentss	%txx	
dr"QZZ\445QYY[334R!5!@!@!B!M!MNa'k11!g+>IIJa'k221w;?JJK  "R!g+!7!7!9!D!DEIIK	2DR1	2FF3K	2DR1	2GGCL	2DR1	2,-FFH	5(GXyR!3!34	5rctjjtd}tjjtdd}|j	|}|j	|}|j	|}|j|j
||j|j
||j|j
||j|j
|tjjtd}|j	|}|jt|j||jt|j||jt|j||jt|j||jt|j||jt|j|y)NrNrKrPrj)
rrtr,r-r1rrkrrHrq)r
fileA_path
fileB_pathr7rrnon_existentrs        r
test_samefilez_BasePathTest.test_samefilesXWW\\$0
WW\\$8
HHZ 
XXj
!HHZ 

:./

2'J/0A'ww||D%0HH\"+QZZ;+QZZF+QZZ;+QZZF+QZZ;+QZZFrc|jd}|j|jtjdy)Nr'rc)r1r?statrr6s  rtest_empty_pathz_BasePathTest.test_empty_paths-HHRL2773<0rzWASI has no user accounts.c|j}|d}|j|j|tjjd|d}|j|j||d}|j|j||d}|j|j|||djjdz}|j|j||d}|j|j|tjjddy)Nrrj/~../~r'z~/a:br=)r1r?rrrtrrr@s   rtest_expanduser_commonz$_BasePathTest.test_expanduser_commonsHH
cF277+=+=c+B)CD
eH+
dG+
fI+
aenn%%&,+
gJ277+=+=c+BG)LMrcn|j}|t}|jd|j|jd|dzj|jd|dzj|jd|dzdzjt	j
r|jd|dzj|jd|dzj|jd|dzdzj|jd|dzdzj|jd|d	zj|jd|d	zjd
|jd|dzj|jd|dj|jd|td
zj|jd|tdzjy)NTrJrNFbahrSrVrPrUfollow_symlinksrjz/xyzzy)r1r-r^existsrr^r@s   rtest_existsz_BasePathTest.test_existssHH
dG

dAHHJ'

dQZ//12

dQ[0023

ea'kE199;<  "MM$W 4 4 67MM$W 4 4 67MM$Ww!6 > > @AMM%!g+"5!=!=!?@MM%!l"2!:!:!<=MM$\!1 9 9% 9 PQ

ea%i//12

eQx[//12

eQth/6689

eQtf}-4467rc|jt}|dzjd5}|j|tj
|j
|jdddd|dzjd5}|j|tj|j
|jjdddd|dzjdd5}|j|tj|j
|jjddddy#1swYxYw#1swYxYw#1swYyxYw)NrNrzthis is file A
rbthis is file Ar)	buffering)r1r-r\r>io
TextIOBaser?readBufferedIOBasestrip	RawIOBase)rr7ras   rtest_open_commonz_BasePathTest.test_open_commons2HHTN'k


$	;!!!R]]3QVVX'9:	;'k


%	B!!!R%6%67QVVX^^-/@A	B'k



2	Ba!!!R\\2QVVX^^-/@A	B	B
	;	;	B	B	B	Bs&AEAE4AE$EE!$E-c*|jt}|dzjd|j|dzj	d|jt|dzjd|j|dzj	dy)NrNsabcdefgsomestr)r1r-write_bytesr?
read_bytesrHrGr6s  rtest_read_write_bytesz#_BasePathTest.test_read_write_bytesswHHTN	
W!!*-!g+113Z@)a'k%>%>	J!g+113Z@rc8|jt}|dzjdd|j|dzj	ddd|jt|dzjd	|j|dzj	ddy)
NrNuäbcdefgzlatin-1encodingutf-8ignore)rerrorsbcdefgs	somebytes)r1r-
write_textr?	read_textrHrGr6s  rtest_read_write_textz"_BasePathTest.test_read_write_textsHHTN	
W  i @!g+00X1/08	:	
)a'k%=%=|L!g+00)0DjQrc@|jt}|dzjdd|j|dzj	d|dzjdd|j|dzj	d|dzjdd|j|dzj	d	ttjd
}|dzjd|j|dzj	d
|zdz|zdzy)NrNzabcde
fghlk

mnopq
)newlinesabcde
fghlk

mnopq
sabcde

fghlk

mnopqz
sabcde

fghlk

mnopqasciirzabcde
fghlk

mnopqsabcdesfghlks
mnopq)r1r-rr?rrrlinesep)rr7os_linesep_bytes   rtest_write_text_with_newlinesz+_BasePathTest.test_write_text_with_newlinessHHTN	
W  !:D I!g+1133	5
W  !:D I!g+1133	5
W  !:F K!g+1137	9 

W=	
W  !89!g+113"_4x?/QT^^	`rc
|j}|t}|j}t|}gd}t	j
r|gdz
}|j
||Dchc]}|t|c}ycc}w)N)rJrKrLrErN)rSrVrUrY)r1r-rsetrr^r?)rrAr7itpathsrzrs       rtest_iterdirz_BasePathTest.test_iterdirshHH
dG
YY[B<  "JJHh @!D!* @A @s#A?
c|j}|td}t|j}dDchc]}|td|}}|j	||ycc}w)NrV)rPrX)r1r-rrr?)rrAr7rrrzs      rtest_iterdir_symlinkz"_BasePathTest.test_iterdir_symlinks[
HH
dGAIIK 2DFQQtWa(FF)GsA!c\|jtd}|jt5}t	|jddd|j
jjtjtjtjfy#1swY]xYwNrN)r1r-rHOSErrornextrassertInrrrsENOTDIRrtEINVALrr7rws   rtest_iterdir_nodirz _BasePathTest.test_iterdir_nodir%syHHT7#


w
'	2		


bll((5==+0<<+G	H			sB""B+cfd}jt}|jd}j|tj
j||dg||jdg||jdddgtjs||jdddgn||jdgd	tjs||jd
dgn||jd
gdtjs||jddgn||jddd
gtjr||jddgtjs||jdgdy||jdgdy)Nc
xjt||Dchc]}t|c}ycc}wr)r?rr-)rrzrrArs   r_checkz._BasePathTest.test_glob_common.<locals>._check0s+SYh(H!D!*(HI(Hs7
rNrPz
dir*/file*
dirB/fileB
dirC/fileCz*ArJ)rJrNrSz*B/*)r
dirB/linkDlinkB/fileBzlinkB/linkD*/fileBrrU*/)rJrKrLrE)rJrKrLrErV)	r1r-rr>collectionsrIteratorrr^rrr7rrAs`   @rtest_glob_commonz_BasePathTest.test_glob_common/ss	JHH
dG
VVG_b+//":":;rG9qvvg#qvvl#lL%AB$$&166$<&'!23166$<!;<$$&166&>L>2166&>$B
C$$&166)$|n5166)$|]&CD  "166,',8$$&166$<!AB166$<!JKrcjfd}t}||ddg||dddg||ddg||dddgy)Nc	|j||Dchc]
}t|}}|Dchc]}tt|}}j||ycc}wcc}w)Nr)rr\r-r?)rtpatternrrzrr{rArs      rrz6_BasePathTest.test_glob_case_sensitive.<locals>._checkPs]&*iii&WXc!fXFX19:AAdAJ:H:VX.Y:s
A!A&z
DIRB/FILE*TFrz
dirb/file*)r1r-)rrrtrAs`  @rtest_glob_case_sensitivez&_BasePathTest.test_glob_case_sensitiveNsXHH	/wt\4,t\5<.9t\4,t\5<.9rcfd}jt}|jd}j|tj
j||dg||jddg||jddg||jdgtjs||jddgn||jdgd||jd	gd
tjs||jdgdn||jdgd
||jdgdtd}||jdgd||jd	ddg||jdddg||jddg||jddg||jddg||jdddg||jdddg||jddg||jddgy)Nc`jt|tfd|Dy)Nc38K|]}t|ywr)r-)rYrrAs  rr[zB_BasePathTest.test_rglob_common.<locals>._check.<locals>.<genexpr>\s1O!D!*1Os)r?sorted)rrzrArs  rrz/_BasePathTest.test_rglob_common.<locals>._check[s"VD\61Oh1O+OPrrNrPrz**/fileBz*/fileAr)rzdirB/linkD/fileBrzdirA/linkC/fileBzfile*)rNrrdirC/dirD/fileDr)rJrKrL	dirC/dirDrE)rJ
dirA/linkCrKrrLrrErVr')r'rJrKrLrErrLr)rdirC/novel.txtrrrrz**/file*zdir*/**rz*/*rz*.txtrz*.*)	r1r-rr>rrrrr^rs`   @rtest_rglob_commonz_BasePathTest.test_rglob_commonZs 	QHH
dG
WWW
b+//":":;rG9qwww,0qwwz"\N3qwwy!2&$$&1779%~61779%(K
Lqwww"C	D$$&1774=#

1774=#
	qwwr{MN
dFOqwws|>	?qwww,0A!BCqwwz"\3D$EFqwwy!K=1qwwu~ 123qwwt}{m,qwwr{V[12qwwt}v{34qwww"2!34qwwu~ 012rc|j}|t}t|jd}hd}|j	||Dchc]}||z	c}ycc}w)Nr>rJrKrLrErNrSrVrUrYrrrrrrr)r1r-rrr?)rrAr7givenexpectrZs      rtest_rglob_symlink_loopz%_BasePathTest.test_rglob_symlink_loopsS
HH
dGAGGCL!
	
 71Q 78 7sA
cd}|j}|tdz}||gdg|z}|jddjdg|z}t	dDcgc]}|j|}}|D]}|j
t||t	dDcgc]}|jd}}|}t	|D])}	|dz}|D]}|j
t||+ycc}wcc}w)	Ndeepr)Tror+rd)	r1r-r[r,r;rr?rr)
rdepthrAbaser7rjitersris
          rtest_glob_many_open_filesz'_BasePathTest.test_glob_many_open_filessHHw
d#seEk#	((C55=)-23Z87#88	*BT"Xq)	**/*5QC55u	.ACA
.  b1-
.	.96sC<(Dc
|j}|t}|jt|j	d|tdh|jt|j	d|tddh|jt|j	d|tddh|jt|j	d|tdh|jt|j	dt|jt|j	dt|jt|j	d	t|jt|j	d
jdgdz|tgdgdzhy)Nrz../..zdirA/..rJz
dirA/../file*z
dirA/../fileAzdirA/../file*/..z../xyzzyzxyzzy/..r+2)r1r-r?rrr,r@s   rtest_glob_dotdotz_BasePathTest.test_glob_dotdotsWHH
dGQVVD\*adm,=>QVVG_-4t1D/FGQVVI./1T643H1JKQVVO4549Q7STQVV$678#%@QVVJ/0#%8QVVJ/0#%8QVVCHHdVb[$9:;q?TQS?T=UVrc	|j}|tdz}|j|jtj
|t
dD]I}|d|z}|dzr|j|tdd.|j|tdK|jtt|jdd|jtt|jd	d
|jtt|jdd
|jtt|jdd
y)
NpermissionsrlinkrrEnonexistentrLrrrz*/fileCz*/file*)r1r-r[rZrrHr;
symlink_tor?rrr)rrArrrs     rtest_glob_permissionsz#_BasePathTest.test_glob_permissionss
HHw&

	(($/s	1AD*$D1u$
 >?$0	1	
S30137S412B7S9!567<S9!567<rc|jtdz}|j|dz}|jd|j	t|j
d|gy)Nlong_symlinkbad_linkXbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadr)r1r-r[rr?rr)rrrs   rtest_glob_long_symlinkz$_BasePathTest.test_glob_long_symlinksWxx~.

*$K(		& 12XJ?rc&d}|dz}tjtjd}tj|gdg|z}|j	dt|5t
|jddddy#1swYyxYw)Nr
r
r)Trr)rPathrr	r[rrrrrecursion_limitdirectory_depthrrts     rtest_glob_above_recursion_limitz-_BasePathTest.test_glob_above_recursion_limits|)B.||I,,f5||D=SEO$;=

4
 
 
1	"4!	"	"	"s#BBcJ|j|}|j||yr)rr?)rr7rzstrictrs     r_check_resolvez_BasePathTest._check_resolves 
IIfH%rc	|j}|td}|jt5}|j	dddd|jjjtj|jt|j	dtjjtd|tddd}|jt|j	dtjjtddd|tdddd}|jt|j	dtjjtjjddd|tdd	}|j|||td
}|j||td|tdd
d	}|j||tdd	|tddd	}|j||tdd	|tdd
d	ddd}|j||tdd	dddd|tdd
dddd}tj dk(r"|j||tdddddn |j||tddddt#j$t'j(dtj*}|j-t"j.|tj0tjj|tddtj0tdtjj|d|tdddd	}|j3||tdd	|tdddddd}|j||tddddd|tddddddd}tj dk(r|j|||ddddy|j||tddddy#1swY:xYw)NrjTr)FinspamrrKrPrSrNrJrWrXr#z-dirD)rdirlinkXlinkY)r1r-rHrrr?rrrsrtr{r\rrtr,abspath_check_resolve_relativerr	_longpathtempfilemkdtempr}rZrHr__check_resolve_absolute)rrAr7rwr)s     rtest_resolve_commonz!_BasePathTest.test_resolve_commonsHH
dEN


w
'	#2
IITI"	#++U\\:  QYYeY%<!=!#dE!:	<
dE4(  QYYeY%<!=!#dE4!H	J
dD%v.  QYYeY%<!=!#eT61R!S	U
dFG$$$Q*
dG$$Q$(89
dFGW-$$Q$(@A
dFGW-$$Q$(@A
dFGWeT6B$$Q$*0)238	:
dFGT5$?
77d?
((AdFE4.4-67<
>

((AdE4,H%P 0 057YY[!B
C	((!,


277<<?D$9:


4<a!9:
dFGWg6$$Q$(@A
dFGWeT6B$$Q$tV(L%*	,
dFGWdE4H
77d?
((Aaf,EuM
((AdE4,H%Po	#	#sQ::Rc:|jt}|jdtd|jtj
jddtd|jtj
jddtd|dz}|j
|jd||dzdz}|jt|jd|j
|jd	|dzdzy)
Nrc012Tr,34F)
r1r-r`r,rrtr?rrHrq)rr7rrs    rtest_resolve_dotz_BasePathTest.test_resolve_dot"s
HHTNS$s)$RWW\\#s+T#Y7RWW\\#s+T#Y7
G$/3
GcM+QYYtD%0!c'C-@rcJ|jdd}tj}tjt	|j|j
|jt|tj|y#tj|wxYw)Nnonexist)r1rr}chdirr-r?r)rr7old_cwds   r)test_resolve_nonexist_relative_issue38671z7_BasePathTest.test_resolve_nonexist_relative_issue386710sgHHUG$))+
	QYY[$((4*;<HHWBHHWs4BB"c|jt}|j}|j}t||j	t
5|5	ddddddt|t||j
|j|j|j	t
5|5	ddddddy#1swYxYw#1swYxYw#1swY*xYw#1swYyxYwr)	r1r-rrr4r5rrr)rr7rit2s    r	test_withz_BasePathTest.test_with:sHHTN
YY[iikS	


0
1	

	
	
RS		
				




0
1	

		

		

		sHC(CC(D	C4DC%	!C((C14C=	9DD	ch|jtdz}|jj}|dz}|j	||j|jj||dz}|j	||j|jj|y)NrNm)r1r-rst_moderGr?)rr7modenew_modes    r
test_chmodz_BasePathTest.test_chmodNsHHTNW$vvx&=	))84%<	))84rc|jtdz}|j}|jj}|dz}|j|d|j
|jj||dz}|j|d|j
|jj|y)NrSrJTrrK)r1r-rrrLrGr?)rr7rrMrNs     rtest_chmod_follow_symlinks_truez-_BasePathTest.test_chmod_follow_symlinks_true\s
HHTNW$
IIKvvx&=	$/))84%<	$/))84rc\|jtdz}|j}|j|j||j	|j
dz|j
|j|j
|j|j|y)NrNrK)r1r-rr?rGrLrZrrr7sts   r	test_statz_BasePathTest.test_statmsvHHTNW$
VVX2&	

U"#,AFFHb)rc|jtdz}|j}|j||jdy)NrSFr)r1r-rrrSs   rtest_stat_no_follow_symlinksz*_BasePathTest.test_stat_no_follow_symlinksws:HHTNW$
VVXBu =>rc|jtdz}|j}|j||jdy)NrNFr)r1r-rr?rSs   r&test_stat_no_follow_symlinks_nosymlinkz4_BasePathTest.test_stat_no_follow_symlinks_nosymlink}s:HHTNW$
VVXQVVEV:;rc|jtdz}|j}|j||j	y)NrS)r1r-rrlstatrSs   r
test_lstatz_BasePathTest.test_lstats5HHTNG#
VVXB	*rc|jtdz}|j}|j||j	yr)r1r-rr?r[rSs   rtest_lstat_nosymlinkz"_BasePathTest.test_lstat_nosymlinks5HHTNW$
VVXQWWY'rz&the pwd module is needed for this testc.|jtdz}|jj}	t	j
|j}|j|jy#t$r|jd|zY@wxYw)NrNz4user %d doesn't have an entry in the system database)r1r-rst_uidpwdgetpwuidpw_nameKeyErrorr]r?r9)rr7uidrs    rr:z_BasePathTest.test_owners}HHTNW$ffhoo	N<<$,,D	
qwwy)	NMMFL
N	NA44BBz&the grp module is needed for this testc.|jtdz}|jj}	t	j
|j}|j|jy#t$r|jd|zY@wxYw)NrNz5group %d doesn't have an entry in the system database)r1r-rst_gidgrpgetgrgidgr_namerdr]r?r>)rr7gidrs    rr?z_BasePathTest.test_groups}HHTNW$ffhoo	O<<$,,D	
qwwy)	OMMG#M
O	Orfc|jtdz}|j|j|j|j|jyr)r1r-unlinkrxrr6s  rtest_unlinkz_BasePathTest.test_unlinksAHHTNW$	
')rc|jtdz}|j|j|jdy)NfileAAAT)
missing_ok)r1r-rxrnr6s  rtest_unlink_missing_okz$_BasePathTest.test_unlink_missing_oks4HHTNY&)	D!rc
|jtdz}|jD]}|j|j	|j|j|j|jy)NrJ)r1r-rrnrmdirrxrr&s   r
test_rmdirz_BasePathTest.test_rmdirs_HHTNV#	A
HHJ			')rrzos.link() is not presentcr|jt}|dz}|jj}|dzdz}|j	||j|jj||j
tjj|||j
|j|dzdz}td}|j	||jtj|j||j
|jyNrNrJfileAArq)r1r-rst_sizehardlink_tor?rrrtrkrrel_join)rrAtargetsizerlink2target2s       rtest_hardlink_toz_BasePathTest.test_hardlink_tosHHTNW{{}$$6zH$ ,,d3((67

(F
Y&7#
'")1148'rzos.link() is presentc|jt}|dz}|dzdz}|jt5|j	|dddy#1swYyxYw)NrNrJry)r1r-rHr8r{rrAr7rs    rtest_link_to_not_implementedz*_BasePathTest.test_link_to_not_implementedsVHHTN
K
J!


2
3	
MM!			sAAcZ|jt}|dz}|jj}|dzdz}|j	|}|j|||j|jj||j
|jtd}|j	|}|j||j||jtj|j||j
|jyrx)	r1r-rrzrr?rxr|r)rrAr7r~r	renamed_pr	renamed_qs        rtest_renamez_BasePathTest.test_renamesHHTN
Kvvx
J!HHQK	A&))40'YHHQK	DHHQK0++T2'rc\|jt}|dz}|jj}|dzdz}|j	|}|j|||j|jj||j
|jtdd}|j	|}|j||j||jtj|j||j
|jy)NrNrJryrKrP)	r1r-rrzrxr?rxr|r)rrAr7r~r
replaced_pr
replaced_qs        rtest_replacez_BasePathTest.test_replacesHHTN
Kvvx
J!YYq\
Q'))40'VW%YYq\
TXXa[1++T2'rc|jt}|j|dzj|jd|j|dzj|jd|j|dzj|jd|j	t
5|dzjdddy#1swYyxYw)NrSrNrUrTrVrK)r1r-r?rrHrrs  r
test_readlinkz_BasePathTest.test_readlinksHHTN!g+//1488G3DE!l*446.1	3!g+//1488F3CD


w
'	%
[""$	%	%	%sCC'c|jt}|dz}|j|j|j	|j|j|j
}|j}|j}tjt||dz
|dz
f|j	|j
}|j|j||j|j||dz}|j|j|j	dd|j|j|jt|jdy)NnewfileAr"newfileBiF)rMexist_okr)r1r-rrtouchrrst_mtimest_mtime_nsrutimer\rrHr)rrAr7rT	old_mtimeold_mtime_nss      rtest_touch_commonz_BasePathTest.test_touch_commonsHHTN
N$		
#
VVXKK	~~	Q)b.)b.9:		
VVX=Y7
N$	UU+
#'177U;rc|jt}|dz}|j|jd5}|j	|jj
ddddy#1swYyxYw)NrNrr)r1r-rr\r?rr)rrAr7ras    rtest_touch_nochangez!_BasePathTest.test_touch_nochange	seHHTN
K		
VVD\	BQQVVX^^-/@A	B	B	Bs/A44A=c|jt}|dz}|j|j|j	|j|j|j|j
|jt5}|j	ddd|jjjtjy#1swY>xYw)NnewdirA)
r1r-rrr[ris_dirrHrr?rrrsEEXIST)rrAr7rws    r
test_mkdirz_BasePathTest.test_mkdir	sHHTN
	M$		
#
#


w
'	2
GGI	++U\\:		sC++C4c.|jtdd}|j|j|j	t
5}|j
ddd|jjjtj|j
d|j|j|j|j|j	t
5}|j
dddd|j|jjtjtj|jj }|jtdd}|j
dd|j|j|j|jt"j$dk7r@|jtj|jj d	|z|jtj|j&jj |y#1swY"xYw#1swY{xYw)
NnewdirBnewdirCTrnewdirDnewdirEimr#im)r1r-rrrHrr[r?rrrsrtrrrrS_IMODErLrrrn)rr7rwrMs    rtest_mkdir_parentsz _BasePathTest.test_mkdir_parents'	sHHT9i0$


w
'	2
GGI	++U\\:	
#
#


w
'	"2
GGDG!	"++U\\:||AFFH,,-HHT9i0	t$
#
#
77d?T\\!&&(*:*:;Vd]Kahhmmo&=&=>E'			"	"sI=>J
=J
Jcr|jtd}|jj}|j	|j|j	|j
|jt5}|jddd|jjjtj|jd|j	|j|j|jj|y#1swYxYw)NrKTr)r1r-rst_ctimerrrrHFileExistsErrorr[r?rrrsr)rr7st_ctime_firstrws    rtest_mkdir_exist_okz!_BasePathTest.test_mkdir_exist_ok@	sHHT6"**
#
#



/	2
GGI	++U\\:	
#**N;		sD--D6c|jtd}|j|j|j	t
5}|j
ddd|jjjtj|dz}|j
d|jj}|j|j|j	t
5}|j
dddd|j|jjtj|j
dd|j|j|j|jj|y#1swYOxYw#1swYxYw)NrLrTrror)
r1r-rrrHrr[r?rrrsrrr)rr7rwrs    rtest_mkdir_exist_ok_with_parentz-_BasePathTest.test_mkdir_exist_ok_with_parentL	s9HHT6"
#



/	2
GGI	++U\\:
	M	**
#



/	"2
GGDG!	"++U\\:	t,
#**N;			"	"sF)=F6)F36F?z)FS root cannot be modified on Emscripten.c|jdjjd|jdjjddy)Nr+Trr)r1rr[res rtest_mkdir_exist_ok_rootz&_BasePathTest.test_mkdir_exist_ok_root]	sJ	

%%t%4
%%dT%BrcdD](}|j|dz}|jr(n|jd|jt5dzdzjddddy#1swYyxYw)NZYXWVUTSRQPONMLKJIHGFEDCBAz:\z&cannot find a drive that doesn't existchildrtTr)r1rr]rHrr[)rr)r7s   rtest_mkdir_with_unknown_drivez+_BasePathTest.test_mkdir_with_unknown_drivec	s}-	DAU#A88:	D

MMBC


w
'	7
[6
!(((6	7	7	7sA66A?c2|jtdd}|j|j|j	t
5}|j
dddd|jjjtj|j	t
5}|j
ddddd|j|jjtjy#1swYxYw#1swYJxYw)NrKrPTrrr1r-rrrHrr[r?rrrsrrs   rtest_mkdir_with_child_filez(_BasePathTest.test_mkdir_with_child_filen	sHHT67+
#


/	"2
GGDG!	"++U\\:



/	12
GGD4G0	1++U\\:	"	"	1	1sD0D
D

Dc*|jtd}|j|j|j	t
5}|j
ddd|jjjtj|j	t
5}|j
dddd|j|jjtjy#1swYxYw#1swYJxYw)NrNTrrrs   rtest_mkdir_no_parents_filez(_BasePathTest.test_mkdir_no_parents_filez	sHHT7#
#


/	2
GGI	++U\\:



/	#2
GGTG"	#++U\\:			#	#sC=-D	=D	Dc	tdD]}|jtd|z}|j|j	t
jdfd	}tdDcgc]}t|d|zzc}t|dzdz}	tjd|5|j
d	d
ddd|jt||j|j	ycc}w#1swYKxYw#t$r|jt|YYwxYw)
N zdirCPC%dct|}jr||j|||yr)r\popadd)rtrMconcurrently_createdr
real_mkdirs  rmy_mkdirzE_BasePathTest.test_mkdir_concurrent_parent_creation.<locals>.my_mkdir	s94y;;=tT*(,,T24&rrdir1dir2zos.mkdirTFr)rF)r;r1r-rrrr[boolrrrassertNotInr\rrr)	rpattern_numr7rnp12rrrs	      @@@r%test_mkdir_concurrent_parent_creationz3_BasePathTest.test_mkdir_concurrent_parent_creation	s 9	(KzK78AQXXZ(J

'>C1XFtK1623FG#&5 f*v%C
AZZ
H5<IIdUI;<
  S+?@OOAHHJ'7	("G<<"
>

c#h(<=
>s0/DD3DDD	D$EEc|jt}|dz}|dzdz}|j||j|j	|j	|j|j
|j	|dzdz}|jt||j|j	|j	|j|j
|j	|j|j|dz}|dzdz}|j|d|j|j	|j	|j|j
|j	|j|j|jt|jy)	NrNrJlinkAAlinkAAArKlinkAAAATrc)
r1r-rr?rrr[r\rrrrr)rrAr}rs    rtest_symlink_toz_BasePathTest.test_symlink_to	s\HHTNW6zH$fkkm4DJJL&++-86zI%F$fkkm4DJJL&++-8'V6zJ&D9fkkm4DJJL&++-8
&T\\^,-rc|jt}|j|dzj|j	|dzj|j	|dzj|j	|dzdzjtjrg|j	|dzj|j|dzj|j	|dzjd|j|d	zjd|j|d
zjdy)NrJrNrTrrSrVrUFudirAzdirA)r1r-rrrrr^r^rs  rtest_is_dirz_BasePathTest.test_is_dir	sHHTNV++-.!g+--/0!n,4467!g+-5578  "a'k1134OOQ[0023ao557?

q<'//159

q:~--/7rc|jt}|j|dzj|j	|dzj|j	|dzj|j	|dzdzjtjrf|j|dzj|j	|dzj|j	|dzj|j|dzjd	|j|d
zjd	y)NrNrJrTrrSrVrUfileAFfileA)r1r-ris_filerrr^r^rs  rtest_is_filez_BasePathTest.test_is_file	sHHTNW--/0!f*--/0!n,5578!g+-6689  "OOQ[1134a'k2245ao6689

q=(113U;

q;//159rc|jt}tjdk(r|jd}n|jd}|j	|dzj|j	|dzj|j	|dzj|j	|dzdzj|j
|jtjr"|j	|dzj|j|d	zjd
y)Nr#rr+rNrJrTrrSrF)
r1r-rrris_mountrrr^r^)rrARs   r
test_is_mountz_BasePathTest.test_is_mount	sHHTN
77d? A
A!g+//12!f*..01!n,6689!g+-779:

%  "a'k3356

q8|--/7rcz|jt}|j|dzj|j|dzj|j|dzj|j|dzdzjt	j
rf|j
|dzj|j
|dzj|j
|dzj|j|dzjd	|j|d
zjd	t	j
rG|j|dzjd	|j|dzjd	yy)
NrNrJrTrrSrVrUrFrulinkAzlinkA)	r1r-r
is_symlinkrr^rr^rrs  rtest_is_symlinkz_BasePathTest.test_is_symlink	sWHHTN!g+1134!f*0023!n,88:;!g+-99;<  "OOQ[4467OOQ[4467OOQ_88:;

q=(113U;

q;//159  "MM1},557?MM1{?335u=#rcr|jt}tjj	|j
d5|j
|j|j
jj|j
jj|dddy#1swYyxYw)N
isjunction)r1r-rrobjectr2r?is_junctionrrassert_called_once_withrs  rtest_is_junctionz_BasePathTest.test_is_junction	szHHTN
ZZ

qzz<
8	=Q]]_ajj.C.C.P.PQ
JJ!!99!<	=	=	=s
A$B--B6c|jt}|j|dzj|j|dzj|j|dzj|j|dzdzj|j	|dzjd|j	|dzjdyNrNrJrTrrFr)r1r-ris_fifor^rs  rtest_is_fifo_falsez _BasePathTest.test_is_fifo_false	sHHTN!g+..01!f*--/0!n,5578!g+-6689

q=(113U;

q;//159rmkfifozos.mkfifo() requiredvxworksz%fifo requires special path on VxWorkscL|jtd}	tjt	||j|j|j|j|j|j|j|jtdjd|j|jtdjdy#t
$r}|j
d|zYd}~d}~wwxYw)Nmyfifozos.mkfifo(): %su	myfifoFzmyfifo)
r1r-rrr\PermissionErrorr]rrr	is_socketrr^)rrAes   rtest_is_fifo_truez_BasePathTest.test_is_fifo_true
s
HHT8$	1IIc!f	
		$'%

dhht^4<<>F

dhht\2::<eD
	1MM+a/00	1sC<<	D#DD#c|jt}|j|dzj|j|dzj|j|dzj|j|dzdzj|j	|dzjd|j	|dzjdyr)r1r-rrr^rs  rtest_is_socket_falsez"_BasePathTest.test_is_socket_false
sHHTN!g+0023!f*//12!n,779:!g+-88:;

q=(335u=

q;113U;rAF_UNIXzUnix sockets requiredz/Unix sockets are not implemented on Emscripten.zCannot create socket on WASI.c,|jtd}tjtjtj}|j|j	|jt||j|j|j|j!|j|j#|j%|jtdjd|j%|jtdjdy#t$rE}t|ts
dt|vr|jdt|zYd}~d}~wwxYw)NmysockzAF_UNIX path too longzcannot bind Unix socket: u	mysockFzmysock)r1r-socketrSOCK_STREAMrZclosebindr\r
isinstancerr]rrrrrr^)rrAsockrs    rtest_is_socket_truez!_BasePathTest.test_is_socket_true
s
HHT8$}}V^^V-?-?@

#	DIIc!f
	

&%%

dhht^4>>@%H

dhht\2<<>F	D1o.+s1v5

9CFBC	Ds%E	F:FFc|jt}|j|dzj|j|dzj|j|dzj|j|dzdzj|j	|dzjd|j	|dzjdyr)r1r-ris_block_devicer^rs  rtest_is_block_device_falsez(_BasePathTest.test_is_block_device_false4
sHHTN!g+6689!f*5578!n,==?@!g+->>@A

q=(99;UC

q;7795Arc|jt}|j|dzj|j|dzj|j|dzj|j|dzdzj|j	|dzjd|j	|dzjdyr)r1r-ris_char_devicer^rs  rtest_is_char_device_falsez'_BasePathTest.test_is_char_device_false=
sHHTN!g+5578!f*4467!n,<<>?!g+-==?@

q=(88:EB

q;668%@rc|jd}|js|jd|j|j	|j|j
|j|j|j|jdj	d|j|jdj	dy)Nz	/dev/nullz/dev/null requiredu/dev/nullFz
/dev/null)	r1rr]rrrrrr^rs  rtest_is_char_device_truez&_BasePathTest.test_is_char_device_trueF
sHH[!xxzMM./((*+**,-%

dhh01@@BEJ

dhh/>>@%Hrc&|jtd}tdtjdzD][}tj
||}tj|}|j|j|j]y)NrNrr)	r1r-r;r<r=r>r?r?r)rr7r@rArs     rrBz"_BasePathTest.test_pickling_commonQ
smHHT7#1f559:	2E\\!U+Ff%BRWWY1	2rc|j}|d}|d}|j|jd|jd|j|jd|jdy)Nz/usr/bin/fooz/usr/local/binrrr)r1r^r]rs    rtest_parts_interningz"_BasePathTest.test_parts_interningX
s\HH
n


aggaj!''!*-

aggaj!''!*-rc|jt}|jtjjddtd|jtjjddtd|jtjjddtd|j|td|dzj
}|j|||jt|t|dzj
}|j|||jt|t|dzj
}|j|||jt|t|dzj
}|j|||jt|ttj}tjt	|jdj
}|j|||jt|t|jdj
}|j|||jt|t|jdj
}|j|||jt|t|jdj
}|j|||jt|ttj|y#tj|wxYw)Nlink0link1rlink3)r1r-r`rrtr,rr?r{r\r}rC)rlink0_targetrAr7old_paths     r_check_complex_symlinksz%_BasePathTest._check_complex_symlinksa
sHHTNRWW\\'73T']CRWW\\'73T']CRWW\\'73T']C\4=1[!!#A  Q.
[!!#A  Q.
[!!#A  Q.
[!!#A  Q.99;
	!))+AQ"$$SVT2!))+AQ"$$SVT2!))+AQ"$$SVT2!))+AQ"$$SVT2HHXBHHXs
EM00Nc.|jtyr)rr-res rtest_complex_symlinks_absolutez,_BasePathTest.test_complex_symlinks_absolute
s$$T*rc&|jdy)Nrc)rres rtest_complex_symlinks_relativez,_BasePathTest.test_complex_symlinks_relative
s$$S)rcb|jtjjddy)NrJr)rrrtr,res r&test_complex_symlinks_relative_dot_dotz4_BasePathTest.test_complex_symlinks_relative_dot_dot
s$$RWW\\&$%?@rc||jt5|jddddy#1swYyxYw)Nrk)rj)r4r5r1res rtest_passing_kwargs_deprecatedz,_BasePathTest.test_passing_kwargs_deprecated
s4


0
1	 HHH	 	 	 s2;)T)lrrr__doc__r8rrr`rorxr{r~rrrunittestskipIfrarrrrrrrrrrrrrskip_unless_symlinkrrrrrrrrrr r'r*r3r7r8r?rErHskip_unless_working_chmodrO
only_posixrQrUrWrYr\r^
skipUnlessr:rir?rorsrvhasattrrrrrrrrrrrrrronly_ntrrrrrrrrrrrsysplatformrrrrrrrrBrrrrrrrUrrrBrBsI,BB
ww$	<	"*
;
M)Z,)X__tF
-
-5*G(1
X__W:;
N<
N8&
BAR`(B""*#*HL>
:)3V""9#9$."W""=#=&""@#@	"&
9GF5"":Q#:Qx""A#A(((
5)
5((5)5((*)*""?#?
<
""+#+
(
XFG*H*XFG*H**"
*XV,.HI(J("X__WR(*@AB("("""%#%<0B	;F2
<<"X__]$OPCQC

7
7
;
;(<"".#..8:
8> =:XX.0FGX__S\\Y.;=
E=H
E<X35LMX__HX__0GNG BA	I2.'R""+#+""*#*""A#A rrBceZdZdZdZddZdZdZejdZ
ejdZd	Zd
Z
dZy)
	WalkTestsc|jtjtjt	j
tjd|_|jdz|_|jdz|_|jdz|_	|jdz}|jdz}|jdz}|jdz}|dz}|jd	z|_
t	j
tjd
}t	j
tjd
d}|jdz}|jd
z}	|jdz}
tj|jtj|jtj|tj||||||fD].}t|dd5}|jd|dddd0tjrtj tj"j%||jtj d|dtj t	j
dd|	dtj t	j
dd|
d|jdggdf|_n|jdgdgf|_t(stj*|d	tj,|tj*|t.j0tj2|tj4||j&ddd=y#1swYxYw#t6$r2|jtj*|t.j0YywxYw)NTEST1SUB1SUB11SUB2SUB21tmp1tmp2tmp3rTEST2tmp4broken_linkbroken_link2broken_link3rZrrzI'm z' and proud of it.  Blame test_pathlib.
brokenTtmp5)r0r1r2rr-rr)rZrrHr	rr#	walk_path	sub1_path
sub11_path	sub2_path	link_pathrmakedirsr\r]r^r_rtr2	sub2_treerrGlistdirrS_IRWXUrnrur)
r
sub21_path	tmp1_path	tmp2_path	tmp3_path	tmp5_patht2_path	tmp4_pathbroken_link_pathbroken_link2_pathbroken_link3_pathrtras
             rr8zWalkTests.setUp
s	(()*:*:;&!i&6&6@&0..72&0NNW,
NNV+	NNV+	NNV+	'	&0,,y//9LL!1!17FC	>>M9 NN^; NN^;
DOO$
DNN#
J
Gy)Y	I	ODdC'2
Oa$tf$LMN
O
O	O  "JJrwww/@JJx!148JJw||FH57H$OJJw||GV46GN"nnwi/0DN#nnwi&BDNHHZ#	&JJz"
HHZ.IIi HHZ q!"1"%3
O
O&	@OOBHHj$,,?	@sM>N>N	8OOch|jj}t|}|dj|j	||jddgdgft|}|j	||j
dgdgft|}|j	||jggft|}|dj|dj|j	||j|jt5t|dddy#1swYyxYw)Nrr'r)r+r(r,r)
r5rrsortr?r6r7r;rH
StopIteration)rwalkerentrys   rtest_walk_topdownzWalkTests.test_walk_topdown
s$$&V
a

&&1AF8 LMV'VH EFV"b 9:V
a


a

/


}
-	L			sD((D1Nc||j}g}|jD]0\}}}|j|||fd|vs |jd2|j	t|d|j	|d|jdgdgf|ddj
|ddj
|j	|d|jy)Nr'rrr)r+rr)r5rrremover?rrIr;)rr5allrsdirsfiless      rtest_walk_prunezWalkTests.test_walk_prune
sI!*!1	$D$JJdE*+~F#		$	
S1%Q$..6(VH!EFAr
Aq	Q0rch|jt|jjyr)rSr
r5rres rtest_file_like_pathzWalkTests.test_file_like_paths"Xdnn5@@BCrc<dx}x}x}}|jjdD]\}}}||jk(rf|j||j||j||j	t|ddg|j	|dgd}}||jk(r\|j||j||j||j	|dg|j	|dgd}||jk(rJ|j||j||j	|g|j	|gd}A||jk(r|j||j||j	t|t|jd	|j	t|t|jd
d}td||j|y)NFtop_downr'r)r+Tr(r,rrzUnexpected path: )r5rrrr?rr6r7r8r;AssertionError)rseen_testfn	seen_sub1
seen_sub11	seen_sub2rtrrs        rtest_walk_bottom_upzWalkTests.test_walk_bottom_ups;@@@i@*y)-)<)<e)<)L	A%D(It~~%  -	*	*  !1FF3CD  VH5"'  -  +
+  G95  VH5 	(  +  ,  2.  B/!
'  -  +  !16$..:K3LM  	!2F4>>!;L4MN 	$'8%?@@9	A:	
$rc|jjd}|D]<\}}}||jk(s|j|g|j|dgy|j	dy)NTrr/z/Didn't follow symlink with follow_symlinks=True)r5rr9r?failrwalk_itrsrQrRs     rtest_walk_follow_symlinksz#WalkTests.test_walk_follow_symlinks(sq..%%d%;!(	ID$t~~%  r*  1		I
IIGHrcN|jjd}|D])\}}}||jk(s|jd|n|j	d|jjd}|D])\}}}||jk(s|jd|yy)NFrrzsymlink not foundT)r5rr8rr`ras     rtest_walk_symlink_locationz$WalkTests.test_walk_symlink_location3s..%%e%<!(	+D$t~~%

fe,	+

II)*..%%d%;!(	D$t~~%

fd+	rc$g}|jj|j}t|\}}}|j	|gd}||z}||zjd}|j
|	|D	
cgc]\}	}
}
|	
}}	}
|j||j|||j|||D]}||k7s	|j||z|	|j
|ycc}
}	w#|j
|wxYw)N)on_errorr'z.new)
r5rrrr?rNrrrr)
rrrbrsrQrRrpath1path1newr_rootsrs
             rtest_walk_bad_dirzWalkTests.test_walk_bad_dirEs..%%v}}%= MdE$t4K,,V4
X		#&-.71aQ.E.OOF#UE*Xu-
64<MM$+u5
6
OOE"/
OOE"s%7C<<
C6	AC<C<6C<<Dcd}tjtjd}tj|gdg|z}|j	dtdDcgc]}|j
d}}t|d	zD]:}||rdgnggf}|D]}|jt|||j}<tdDcgc]}|j
d}}|}t|d	zD]6}|||krdgnggf}|D]}|jt|||dz}8ycc}wcc}w)
Nr	r
r)TrrFrWr)
rr#rr	r[r;rr?rrn)	rr
rrtrjrrrzrs	         rtest_walk_many_open_filesz#WalkTests.test_walk_many_open_filesYsJ||I,,f5||D1SE%K1

4
 49#J?qE*??uqy!	Aqseb"5H
5  b84
5;;D		49:>aD)>>uqy!	Aq5yseb"=H
5  b84
5#:D		@?s D8D=cZd}|dz}tjtjd}tj|gdg|z}|j	dt|5t
|jt
|jddddy#1swYyxYw)	N(r"r
r)TrFrW)rr#rr	r[rrrr$s     rtest_walk_above_recursion_limitz)WalkTests.test_walk_above_recursion_limitns)B.||I,,f5||D=SEO$;=

4
 
 
1	,E*+	,	,	,s#5B!!B*r)rrrr8rMrSrUr^rrrcrerlrnrqrUrrr$r$
sdC&J 1$D%B""I#I""#"#(*
,rr$c6eZdZejZdZdZdZy)PathTestc|jd}|jt|tjdk(rt
jyt
jyr")r1r^rrrrr@r3r6s  rr$zPathTest.test_concrete_class~sDHHSM

d1g#%77d?G	K8?8I8I	Krctjdk(r%|jttj
y|jttjy)Nr#)rrrHr8rr3r@res rtest_unsupported_flavourz!PathTest.test_unsupported_flavours;
77d?173D3DE173F3FGrc|j}|jtd5t|j	ddddy#1swYyxYw)NzUnacceptable patternr')r1rFrrrr6s  rtest_glob_empty_patternz PathTest.test_glob_empty_patternsCHHJ

#
#J0F
G				sAAN)	rrrrr#r1r$rvrxrUrrrsrs{s
,,CK
HrrsceZdZejZdZdddZeje
xseddZdZ
eje
xseddZej d	Zd
ZdZej(eedd
ejej0dk(ddZejej0dk7ddZy)
PosixPathTestcP|j}|jt|djd|jt|djd|jt|djd|jt|djd|jt|djd|jt|djdy)Nr+r*rrGrFrP)r1r?r\rrs  r
test_absolutezPosixPathTest.test_absolutesHHQsV__./5QtW--/0$7QvY//12F;	
QtW--/0$7QuX..0159QwZ0023W=rTr,c|j|}|jt5t|j	|dddy#1swYyxYwr)r1rHRuntimeErrorprintr)rr)r_rts    r_check_symlink_loopz!PosixPathTest._check_symlink_loopsEtxx


|
,	($,,v&'	(	(	(sA		Az,umask is not implemented on Emscripten/WASI.ctjd}|jtj||jt}|dzjd5	dddtjtd}|jt
j|jdtjd|dzjd5	dddtjtd}|jt
j|jdy#1swYxYw#1swYcxYw)Nrnew_filerOother_new_file)rumaskrZr1r-r\rr,r?rrLrold_maskr7rTs    rtest_open_modezPosixPathTest.test_open_modes
88A;(+HHTN*n
"
"4
(		
WWT*%
&bjj159
""
(
(
.		
WWT*+
,bjj159		
		sD7E7EEc*tj}	tjd|jd}|j	t|j
dtj|y#tj|wxYw)Nr+r.z/spam)rr}rCr1r?r\r)rcurrent_directoryr7s   rtest_resolve_rootzPosixPathTest.test_resolve_rootsbIIK	(HHSM AS-w7HH&'BHH&'sAA;;Bctjd}|jtj||jt}|dzjtjtd}|jt
j|jdtjd|dzjtjtd}|jt
j|jd|dzjd	tjtd}|jt
j|jdy)
Nrrrrrrmasked_new_filei)rM)rrrZr1r-rrr,r?rrLrs    rtest_touch_modezPosixPathTest.test_touch_modes
88A;(+HHTN	
Z 
WWT*%
&bjj159
	

	$$&
WWT*+
,bjj159	

	%%5%1
WWT+,
-bjj159rctjdtd|jtdtjdtd|jtdtjdtd|jtd|jtdddtjtd	td
|jtd
tjtdtd|jtdtjtdtd
|jtd
|jtd
ddy)NzlinkX/insider0r1zlinkZ/../linkZlinkZrjFr,zlinkU/insidelinkUlinkVzlinkW/../linkWlinkW)rr_r,rr-res rtest_resolve_loopzPosixPathTest.test_resolve_loops	

>4=1  w/


7DM*  w/


#T']3  w/  we D


4'g7  w/


4=$w-0  w/


4()4=9  w/  we Drc:|j}|t}t|jd}t	j
ts
tn|}|j
|||j
t|jdty)NFILEazFILEa*)r1r-rrrfs_is_case_insensitiver?rrAr7rrs     r	test_globzPosixPathTest.test_globslHH
dGAFF7O$'>>tD%'QVVH-.6rc<|j}|td}t|jd}t	j
ts
tn|}|j
|||j
t|jdty)NrLFILEdzFILEd*)r1r-rrrrr?rs     r
test_rglobzPosixPathTest.test_rglobsoHH
dFOAGGG$%'>>tD%'QWWX./7rgetpwallz%pwd module does not expose getpwall()rzno home directory on VxWorksc|j}tjdddl}|jtj}|j}|jjdxsd}|jD]3}|j}|jjd}||k7s0|s3n|}|}d}	|j|r|dz
}|j|r|d}	|d|d}
|d|d}|d	|d}|d
|d}
|d}|d|d}tj5}|jdd|j!|	j#||d
z|j!|
j#||d
z|j!|j#||d
z|j!|j#||j!|
j#|
|j!|j#||j%t&|j"d|d<|j!|	j#|d|j!|
j#||d
z|j!|j#||d
z|j!|j#||j!|
j#|
|j!|j#||j%t&|j"dddy#t$rYwxYw#1swYyxYw)Nrarr+fakeuserr;z~/Documentsrz
/Documentsrrr'r	Documentsz/tmpz/tmp/Documents)r1r
import_modulerarbrgetuidrcpw_dirrstriprgetpwnamrdrrrr?rrHr~)rrArapwdentusernameuserhome	othername	otherhomefakenamep1p2p3p4p5p6p7rs                 rtest_expanduserzPosixPathTest.test_expandusers

HH##E*biik*>>=='',3"clln	!FI

,,S1IH$		!!I I	#,,x(C#,,x(
}

8*J'
(
9+Z(
)
hZz*
+
H:Z(
)
rU
8*J'
(

*
*
,	;GGFD!R]]_akK.GHR]]_akK.GHR]]_a	l[.HIR]]_b1R]]_b1R]]_b1lBMM: CKR]]_a0@.ABR]]_akK.GHR]]_a	l[.HIR]]_b1R]]_b1R]]_b1lBMM:%	;	;			;	;s)M!
HM1!	M.-M.1M:darwinz1Bad file descriptor in /dev/fd affects only macOSc	ttjdjddd}|s|j	d|D]}|j|j
|j|j|j|j|j|jy#t$r4}|jtjk(r|j!dd}~wwxYw)Nz/dev/fdrrz.no file descriptors - issue was not reproducedz Bad file descriptor not handled.)rrr#rr]rrrrrrrrrrsEBADFr`)rfile_descriptorsrars    rtest_handling_bad_descriptorz*PosixPathTest.test_handling_bad_descriptor/s	#GLL$;$A$A#$FGK#

NO&


		!!#  "		

	ww%++%		<=	sC
C

	D
/DD
N)rrrrr3r1r|rrrrrrrrrrrrrrrrar!r"rrrUrrrzrzs


C	>15(
X__ 6:	:(X__ 6
:	
:""E#E(78Xj1@BX__S\\Y.353;5B3;jX__S\\X-HJJrrzc<eZdZejZdZdZdZdZ	y)WindowsPathTestc
|j}|jt|djd|jt|djd|jt|djdd}|jt||j||jt||dzj|dz|jt||dzj|dzt	j
d5}||_|jt|j||jt|dj||jt|djtjj|d|jt|dd	d
jtjj|dd	d
dddtjjtd}tjt5|jt|dj|dz|jt|d
j|d
z|jt||jt|jt||dzjtjjtddddtjt5}tj}|d}tj |tj ||jt||j||jt||dzj|d
zdddy#1swYxYw#1swYxYw#1swYyxYw)NrrKrtz\\server\share\r!za\brrcr"r:rrz\foorjz\dirA)r1r?r\rrrrrrtr,
splitdriver-r
change_cwdsubst_driver}rC)rrArr}rrother_drive	saved_cwd	other_cwds        rr|zWindowsPathTest.test_absoluteKsgHH	
QvY//12F;QwZ0023W=Qz]3356
C&QuX..0159Qus{^4467EQuv~.779:EFNKZZ
$	A"'FS0%8S3!23U;S3!23RWW\\%5MNS3S!1!:!:!<=WW\\%c3?
A
	A""4(+

!
!$
'	ZS4!1!1!34edlCS7!4!4!67I
S5!2!2!45t<S55=!1!:!:!<=rww||DRW?XY	Z
"
"4
(		ZK		I&-v.IHHYHHY
S;!8!8!:;YGS;#6!7!@!@!BCYQXEXY		Z		Z'	A	A	Z	Z		Z		Zs'
DQC,Q!B(Q+QQ(+Q4c
h|j}|t}|jt|j	d|tdh|jt|j	d|tdh|jt|j	d|tdh|jttt|j	d|dh|jttt|j	d|dhy)NrrNz*a\rJzF*az\fileA)r1r-r?rrmapr\r@s   rrzWindowsPathTest.test_globxsHH
dGQVVG_-41A/CDQVVF^,$.ABQVVE]+qw/?-ABSaffWo67QCw-ISaffUm451#W
Grc
|j}|td}|jt|j	d|tdh|jt|j	d|tdh|jttt|j	d|dhy)NrLrrz*\rz\dirD\fileD)r1r-r?rrrr\r@s   rrzWindowsPathTest.test_rglobsHH
dFOQWWW-.!D:K2L0NOQWWU^,$0D.FGSaggg&678aS
;N:OPrc
	jtj5jddjddjddjdddd<ddd	d
dd	j	t
jj	t
jj	t
jjj
jj
j	j
		f	d
}dd<|dd<dd<|jddjdddd<|dd<|dddy#1swYyxYw)NrrHOMEPATH	HOMEDRIVEaliceUSERNAMEz~/My Documentsz~alice/My Documentsz~bob/My Documentsz/~/My Documentszd:~/My Documentsr'c	jddjjdjtjdd<jjdjjdjjjjjjy)NrzC:/Users/alice/My DocumentsrzC:/Users/bob/My Documents)rr?rrHr~)	rArrrrrrrrs	rrz.WindowsPathTest.test_expanduser.<locals>.checks
D)  !"#@!AC!!,

>")J  !"#@!AC  !"#>!?A  "5  "5  "5rzC:\Users\alicerzUsers\alicezC:\Users\eve)r1rrrrHr~rr?)
rrrArrrrrrrs
` @@@@@@@@rrzWindowsPathTest.test_expandusersHH

*
*
,1	GGFD!GGM4(GGJ%GGK&%C
O#$B()B&'B$%B%&B2BlBMM:lBMM:lBMM:R]]_b1R]]_b1R]]_b1
6
61C
OG%C,C
OGGGK&GGJ%!3C
G+CKGc1	1	1	sF$GG N)
rrrrr@r1r|rrrrUrrrrGs%


C+ZZHQ3rrc:eZdZGddejZdZy)PurePathSubclassTestceZdZy)PurePathSubclassTest.clsNrTrUrrr1rrr1N)rrrrr*r1rrUrrrrs
g
 rrc:eZdZGddejZdZy)PathSubclassTestceZdZy)PathSubclassTest.clsNrTrUrrr1rrrr1N)rrrrr#r1rrUrrrrs
gll
 rrc0eZdZdZGddZdZdZy)CompatiblePathTestz|
    Test that a type can be made compatible with PurePath
    derivatives by implementing division operator overloads.
    c"eZdZdZdZdZdZy)CompatiblePathTest.CompatPathz
        Minimum viable class to test PurePath compatibility.
        Simply uses the division operator to join a given
        string and the string value of another object with
        a forward slash.
        c||_yr)string)rrs  rrz&CompatiblePathTest.CompatPath.__init__s	 DKrcBt||jd|Srwrrrothers  r__truediv__z)CompatiblePathTest.CompatPath.__truediv__s"4:
Qug677rcBt||d|jSrwrrs  r__rtruediv__z*CompatiblePathTest.CompatPath.__rtruediv__s"4:q
677rN)rrrrrrrrUrr
CompatPathrs		!	8	8rrcFtjd|jdz}|j||j|j	|j
d|j
t5tjddzdddy#1swYyxYw)Ntestrightz
test/rightr")rr*rr>r?rrHrGrresults  rtest_truedivzCompatiblePathTest.test_truedivs~!!&)DOOG,DDfdoo65


y
)	*V$r)	*	*	*5BB cF|jdtjdz}|j||j|j	|j
d|j
t5dtjdzdddy#1swYyxYw)Nleftrz	left/testr")rrr*r>r?rrHrGrs  r
test_rtruedivz CompatiblePathTest.test_rtruedivs~(7+;+;F+CCfdoo64


y
)	*!!&))	*	*	*rN)rrrrrrrrUrrrrs
88 **rr__main__)6
contextlibcollections.abcrrrr!rsrr<rrr5rrtest.supportrrrrrtest.support.os_helperr	r
riraImportErrorrrrTestCaserDryr rtrealpathr-r,r|rrr rr2r5rBr$rsrzrrrrrmainrUrr<module>rs4		


&,/"3EFEf
.f
.R[ )8+<+<[ |`
@+X->->`
@D$h&7&7>
ww(.
(//"''T/EG
X__RWW_FH
+	/	L FL ^$],!!],@}h//(tM8#4#4ttn	smX%6%6s	sl ,h.?.?  }h&7&7 &***&*RzHMMOAgC#sH	H
H