+
    i׶  c                   s   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI5 ^ RIH	t	H
t
 ^ RIHt ^ RIHtHtHtHtHtHt ^ RIHt  ^ RIt ^ RIt^ RIHtHtHtHtHtHtH t H!t! . ROt" ! R R]#4      t$ ! R R]4      t% ! R R	4      t&]PN                  PQ                  ]&4        ! R R
]&4      t) ! R R]&4      t* ! R R]&4      t+ ! R R]+])4      t, ! R R]+]*4      t-R#   ] d    Rt Li ; i  ] d    Rt Li ; i)zObject-oriented filesystem paths.

This module provides classes to represent abstract paths and concrete
paths with operations that have semantics appropriate for different
operating systems.
N)Z*)_StringGlobber_no_recurse_symlinks)chain)S_ISDIRS_ISREGS_ISSOCKS_ISBLKS_ISCHRS_ISFIFO)Sequence)PathInfoDirEntryInfoensure_different_filesensure_distinct_paths	copyfile2copyfileobj
magic_open	copy_infoUnsupportedOperationPurePathPurePosixPathPureWindowsPathPath	PosixPathWindowsPathc                   s    ] tR t^+tRtRtR# )r   zLAn exception that is raised when an unsupported operation is attempted.
     N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       )/usr/lib64/python3.14/pathlib/__init__.pyr   r   +   s
    r    c                   s@   a  ] tR t^1t o RtRtR tR tR tR t	Rt
V tR# )	_PathParentszrThis object provides sequence-like access to the logical ancestors
of a path.  Don't try to construct it yourself.c                sx    Wn         VP                  V n        VP                  V n        VP
                  V n        R # N)_pathdrive_drvroot_root_tailselfpath   &&r!   __init__Z_PathParents.__init__6   s(    
JJ	YY
ZZ
r    c                s,    \        V P                  4      # r#   )lenr)   r+      &r!   __len__Z_PathParents.__len__<   s    4::r    c           
     s&  a  \        V\        4      '       dq   \        ;QJ d6    . V 3R  l\        VP	                  \        S 4      4      !   4       F  NK  	  5# ! V 3R  l\        VP	                  \        S 4      4      !   4       4      # V\        S 4      8  g   V\        S 4      ) 8  d   \        V4      hV^ 8  d   V\        S 4      ,          pS P                  P                  S P                  S P                  S P                  RV) ^,
           4      # )c              3   s6   <"   T F  pSV,          x  K  	  R # 5ir#   r   ).0ir+      & r!   	<genexpr>Z+_PathParents.__getitem__.<locals>.<genexpr>A   s     I*HQa*Hs   N)
isinstanceslicetupleZrangeZindicesr/   Z
IndexErrorr$   _from_parsed_partsr&   r(   r)   )r+   Zidxs   f&r!   __getitem__Z_PathParents.__getitem__?   s    c5!!5I%SY1G*HI5I5I%SY1G*HIII#d)sc$iZ/S/!73t9Czz,,TYY

-1ZZ	#-BD 	Dr    c                s^    R P                  \        V P                  4      P                  4      # )z<{}.parents>)formattyper$   r   r0   r1   r!   __repr__Z_PathParents.__repr__J   s"    $$T$**%5%>%>??r    )r&   r$   r(   r)   N)r$   r&   r(   r)   )r   r   r   r   r   	__slots__r.   r2   r;   r>   r   __classdictcell__Z__classdict__   @r!   r"   r"   1   s+     73I 	D@ @r    r"   c                   s  a  ] tR t^Nt o RtR6t]P                  tR t	R t
R tR tR tR tR tR	 tR
 tR t]R 4       tR tR t]R 4       tR tR tR tR tR t]R 4       tR tR t ]R 4       t!]R 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$ t-R% t.R& t/]R' 4       t0]R( 4       t1]R) 4       t2R*R+/R, lt3R- t4R. t5R/ t6R0 t7R1R2/R3 lt8R1R2/R4 lt9R5t:V t;R2# )7r   ad  Base class for manipulating paths without I/O.

PurePath represents a filesystem path and offers operations which
don't imply any actual filesystem I/O.  Depending on your system,
instantiating a PurePath will return either a PurePosixPath or a
PureWindowsPath object.  You can also instantiate either of these classes
directly, regardless of your system.
c                s    V \         J d"   \        P                  R8X  d   \        M\        p \
        P                  V 4      # )zConstruct a PurePath from one or several strings and or existing
PurePath objects.  The strings and path objects are combined so as
to yield a canonicalized path, which is incorporated into the
new PurePath object.
nt)r   osnamer   r   object__new__clsargskwargs   &*,r!   rG   ZPurePath.__new__}   s+     (?%'WW_/-C~~c""r    c                s   . pV F  p\        V\        4      '       dY   VP                  V P                  Jd"   VP                  VP	                  4       4       KT  VP                  VP                  4       Kq   \        P                  ! V4      p\        V\        4      '       g#   \        R \        V4      P                  : 24      hVP                  V4       K  	  W n        R#   \         d    Tp Ldi ; i)zVargument should be a str or an os.PathLike object where __fspath__ returns a str, not N)r7   r   parserappendas_posixextend
_raw_pathsrD   fspath	TypeErrorstrr=   r   )r+   rJ   pathsZargr,   s   &*   r!   r.   ZPurePath.__init__   s    C#x((::T[[0LL0LL099S>D "$,,##Dz22578 8 T"# $   ! Ds   7C""C21C2c                s     \        V 4      ! V!  # )zConstruct a new path object from any number of path-like objects.
Subclasses may override this method to customize how new path objects
are created from methods like `iterdir()`.
)r=   r+   Zpathsegments   &*r!   with_segmentsZPurePath.with_segments   s    
 Dz<((r    c                s*    V P                   ! V .VO5!  # )zCombine this path with one or several arguments, and return a
new path representing either a subpath (if all arguments are relative
paths) or a totally different path (if one of the arguments is
anchored).
)rX   rV   rW   r!   joinpathZPurePath.joinpath   s     !!$666r    c                sT     V P                  W4      #   \         d
    \        u # i ; ir#   rX   rS   NotImplementedr+   Zkeyr-   r!   __truediv__ZPurePath.__truediv__   s-    	"%%d00 	"!!	"    ''c                sT     V P                  W4      #   \         d
    \        u # i ; ir#   rZ   r\   r-   r!   __rtruediv__ZPurePath.__rtruediv__   s-    	"%%c00 	"!!	"r^   c                sD    V P                   \        V P                  4      3# r#   )	__class__r9   rQ   r0   r1   r!   
__reduce__ZPurePath.__reduce__   s    ~~uT__555r    c                sj    R P                  V P                  P                  V P                  4       4      # )z{}({!r}))r<   r`   r   rO   r0   r1   r!   r>   ZPurePath.__repr__   s%      !8!8$--/JJr    c                    \        V 4      # r#   )rT   r0   r1   r!   
__fspath__ZPurePath.__fspath__   s    4yr    c                .    \         P                  ! V 4      # )zYReturn the bytes representation of the path.  This is only
recommended to use under Unix.)rD   fsencoder0   r1   r!   	__bytes__ZPurePath.__bytes__   s     {{4  r    c                s     V P                   #   \         dS    T P                  \        J d   \	        T 4      T n         M\	        T 4      P                  4       T n         T P                   u # i ; ir#   )_str_normcase_cachedAttributeErrorrM   	posixpathrT   Zlowerr0   r1   r!   _str_normcaseZPurePath._str_normcase   sY    	-,,, 	-{{i',/I),/IOO,=),,,	-s    AA+*A+c                s     V P                   #   \         d*    \        T P                  4      T n         T P                   u # i ; ir#   )_hashrh   Zhashrj   r0   r1   r!   __hash__ZPurePath.__hash__   s<    	:: 	d001DJ::	s    1AAc                s    \        V\        4      '       g   \        # V P                  VP                  8H  ;'       d    V P                  VP                  J # r#   )r7   r   r[   rj   rM   r+   otherr-   r!   __eq__ZPurePath.__eq__   sA    %**!!!!U%8%88XXT[[ELL=XXr    c                s     V P                   #   \         dD    T P                  P                  T P                  P
                  4      T n         T P                   u # i ; ir#   )_parts_normcase_cachedrh   rj   splitrM   sepr0   r1   r!   _parts_normcaseZPurePath._parts_normcase   sO    	/... 	/*.*<*<*B*B4;;??*SD'...	/s    AAAc                s    \        V\        4      '       d   V P                  VP                  Jd   \        # V P                  VP                  8  # r#   r7   r   rM   r[   rs   rm   r-   r!   __lt__ZPurePath.__lt__   ;    %**dkk.M!!##e&;&;;;r    c                s    \        V\        4      '       d   V P                  VP                  Jd   \        # V P                  VP                  8*  # r#   rt   rm   r-   r!   __le__ZPurePath.__le__   ;    %**dkk.M!!##u'<'<<<r    c                s    \        V\        4      '       d   V P                  VP                  Jd   \        # V P                  VP                  8  # r#   rt   rm   r-   r!   __gt__ZPurePath.__gt__   rv   r    c                s    \        V\        4      '       d   V P                  VP                  Jd   \        # V P                  VP                  8  # r#   rt   rm   r-   r!   __ge__ZPurePath.__ge__   rx   r    c                s     V P                   #   \         dP    T P                  T P                  T P                  T P
                  4      ;'       g    RT n         T P                   u # i ; i)zSReturn the string representation of the path, suitable for
passing to system calls..)_strrh   _format_parsed_partsr%   r'   r)   r0   r1   r!   __str__ZPurePath.__str__   sa    	99 	11$**dii26**> E EAD I99	s    AA(A('A(c                sR   V'       g	   V'       d3   W,           V P                   P                  P                  V4      ,           # V'       d:   V P                   P                  V^ ,          4      ^ ,          '       d   R.V,           pV P                   P                  P                  V4      # )i    r{   )rM   rr   joinZ
splitdrive)rI   drvr'   tail   &&&&r!   r}   ZPurePath._format_parsed_parts  sk    $:

 3 3D 999cjj++DG4Q7754<Dzz~~""4((r    c                sl    V P                  V P                  WV4      4      pWn        W$n        W4n        V# r#   )_from_parsed_stringr}   r&   r(   _tail_cached)r+   r   r'   r   r,      &&&& r!   r:   ZPurePath._from_parsed_parts  s4    ''(A(A#T(RS	
 r    c                sJ    V P                  V4      pT;'       g    R Vn        V# )r{   )rX   r|   )r+   path_strr,      && r!   r   ZPurePath._from_parsed_string  s$    !!(+OO	r    c                sJ   V'       g   R R . 3# V P                   P                  pV P                   P                  pV'       d   VP                  W24      pV P                   P	                  V4      w  rEpV'       gs   VP                  V4      '       d\   VP                  V4      '       gE   VP                  V4      p\        V4      ^8X  d   V^,          R9  d   TpM\        V4      ^8X  d   TpYEVP                  V4       Uu. uF  q'       g   K  VR8w  g   K  VNK  	  up3# u upi ) z?.r{   )	rM   rr   altsepreplace	splitroot
startswithendswithrq   r/   )	rI   r,   rr   r   r   r'   relZ	drv_partsx	   &&       r!   _parse_pathZPurePath._parse_path  s    r2:jjnn""<<,D--d33s++CLL4E4E		#I9~"y|4'?Y1$ciinGn1a3h11nGGGGs   ?	D D D c                s    V P                   P                  V4      w  r#pV'       g	   V'       d   \        R4      hV P                   P                  pV P                   P                  pV'       d   VP                  We4      pVP                  V4       Uu. uF  qw'       g   K  VR8w  g   K  VNK  	  ppV'       g   \        R\        V4      : 24      hVP                  V4      '       d   VP                  R4       V# u upi )a:  Parse a glob pattern to a list of parts. This is much like
_parse_path, except:

- Rather than normalizing and returning the drive and root, we raise
  NotImplementedError if either are present.
- If the path has no real parts, we raise ValueError.
- If the path ends in a slash, then a final empty part is added.
z%Non-relative patterns are unsupportedr{   zUnacceptable pattern: r   )rM   r   NotImplementedErrorrr   r   r   rq   
ValueErrorrT   r   rN   )	rI   patternr   r'   r   rr   r   r   partsr   r!   _parse_patternZPurePath._parse_pattern,  s     --g633%&MNNjjnn""++f*CIIcN=NqaAHN=5c'l5EFGG\\#LL >s   	C; C;)C;c                s`    \        V 4      P                  V P                  P                  R4      # )zFReturn the string representation of the path with forward (/)
slashes./)rT   r   rM   rr   r0   r1   r!   rO   ZPurePath.as_posixE  s#     4y  #66r    c                s    V P                   p\        V4      ^8X  d
   V^ ,          # V'       d   V P                  P                  ! V!  # R# )   r   )rQ   r/   rM   r   )r+   rU      & r!   	_raw_pathZPurePath._raw_pathJ  s:    u:?8O;;##U++r    c                s     V P                   #   \         d>    T P                  T P                  4      w  T n         T n        T n        T P                   u # i ; i)z.The drive prefix (letter or UNC path), if any.)r&   rh   r   r   r(   r   r0   r1   r!   r%   ZPurePath.driveU  sL    	99 	7;7G7G7W4DItz4#499	    AAAc                s     V P                   #   \         d>    T P                  T P                  4      w  T n        T n         T n        T P                   u # i ; i)zThe root of the path, if any.)r(   rh   r   r   r&   r   r0   r1   r!   r'   ZPurePath.root^  sL    	:: 	7;7G7G7W4DItz4#4::	r   c                s     V P                   #   \         d>    T P                  T P                  4      w  T n        T n        T n         T P                   u # i ; ir#   )r   rh   r   r   r&   r(   r0   r1   r!   r)   ZPurePath._tailg  sP    	%$$$ 	%7;7G7G7W4DItz4#4$$$	%r   c                s<    V P                   V P                  ,           # )z/The concatenation of the drive and root, or ''.)r%   r'   r0   r1   r!   anchorZPurePath.anchoro  s     zzDII%%r    c                s    V P                   '       g   V P                  '       d9   V P                   V P                  ,           3\        V P                  4      ,           # \        V P                  4      # )zRAn object providing sequence-like access to the
components in the filesystem path.)r%   r'   r9   r)   r0   r1   r!   r   ZPurePath.partst  sH     :::JJ*,uTZZ/@@@$$r    c                s    V P                   pV P                  pV P                  pV'       g   V # V P                  WVRR 4      # )zThe logical parent of the path.N)r%   r'   r)   r:   )r+   r   r'   r      &   r!   parentZPurePath.parent}  s@     jjyyzzK&&s$s)<<r    c                rb   )z*A sequence of this path's logical parents.)r"   r0   r1   r!   parentsZPurePath.parents  s    
 D!!r    c                s@    V P                   pV'       g   R# VR,          # )z!The final path component, if any.r   r   )r)   )r+   r   r   r!   rE   ZPurePath.name  s     zzBxr    c                sv   V P                   pV'       d<   VP                  V9   g+   VP                  '       d   VP                  V9   g   VR8X  d   \        RV: 24      hV P                  P                  4       pV'       g   \        V : R24      hWR&   V P                  V P                  V P                  V4      # )z-Return a new path with the file name changed.r{   zInvalid name  has an empty namer   )	rM   rr   r   r   r)   copyr:   r%   r'   )r+   rE   Zpr      &&  r!   	with_nameZPurePath.with_name  s    KKquu}ahh$6F4SV;}TH566zz x'9:;;R&&tzz499dCCr    c                s    V P                   pV'       g   V P                  V4      # V'       g   \        V : R24      hV P                  W,           4      # )z(Return a new path with the stem changed.z has a non-empty suffix)suffixr   r   )r+   stemr   r   r!   	with_stemZPurePath.with_stem  sD    >>$''x'>?@@>>$-00r    c                s    V P                   pV'       g   \        V : R24      hV'       d'   VP                  R4      '       g   \        RV: 24      hV P                  W!,           4      # )zReturn a new path with the file suffix changed.  If the path
has no suffix, add given suffix.  If the given suffix is an empty
string, remove the suffix from the path.
r   r{   zInvalid suffix )r   r   r   r   )r+   r   r   r   r!   with_suffixZPurePath.with_suffix  sY    
 yyx'9:;;F--c22vj9::>>$-00r    c                s    V P                   pVP                  R4      pVR8w  d   VRV pVP                  R4      '       d   V# V# )z0The final path component, minus its last suffix.r{   Nr   )rE   rfindlstrip)r+   rE   r4   r   r   r!   r   ZPurePath.stem  sE     yyJJsO78D{{3r    c                st    V P                   P                  R4      pVP                  R4      pVR8w  d   WR # R# )zc
The final component's last suffix, if any.

This includes the leading period. For example: '.txt'
r{   Nr   r   )rE   r   r   )r+   rE   r4      &  r!   r   ZPurePath.suffix  s8     yy$JJsO78Or    c                s    V P                   P                  R4      P                  R4      R,           Uu. uF  pRV,           NK  	  up# u upi )zt
A list of the final component's suffixes, if any.

These include the leading periods. For example: ['.tar', '.gz']
r{   r   NN)rE   r   rq   )r+   Zextr   r!   suffixesZPurePath.suffixes  sC     &*YY%5%5c%:%@%@%Eb%IJ%Icc		%IJJJs   A	walk_upFc               sH   \        VR4      '       g   V P                  V4      p\        \        V.VP                  4      4       Fs  w  r4W@8X  g   W@P                  9   d    MV'       g%   \        \        V 4      : R\        V4      : 24      hVP                  R8X  g   K\  \        R\        V4      : R24      h	  \        \        V 4      : R\        V4      : R24      hR.V,          V P                  \        VP                  4      R ,           pV P                  R	R	V4      # )
a  Return the relative path to another path identified by the passed
arguments.  If the operation is not possible (because this is not
related to the other path), raise ValueError.

The *walk_up* parameter controls whether `..` may be used to resolve
the path.
rX   z is not in the subpath of z..z'..' segment in z cannot be walkedz and z have different anchorsNr   )hasattrrX   Z	enumerater   r   r   rT   rE   r)   r/   r:   )r+   rn   r   Zstepr,   r   s   &&$   r!   relative_toZPurePath.relative_to  s     uo..&&u-E#E5'5==$ABJD|t||3 CI=0J3u:.!YZZd" #3CJ>AR!STT C D	}E#e*?VWXX

3tzz?+; <<&&r2u55r    c                s|    \        VR4      '       g   V P                  V4      pW8H  ;'       g    WP                  9   # )zFReturn True if the path is relative to another path or False.
        rX   )r   rX   r   rm   r-   r!   is_relative_toZPurePath.is_relative_to  s8     uo..&&u-E}55 55r    c                s    V P                   \        J d0   V P                   F  pVP                  R4      '       g   K   R# 	  R# V P                   P	                  V 4      # )zKTrue if the path is absolute (has both a root and, if applicable,
a drive).r   TF)rM   ri   rQ   r   Zisabsr*   r   r!   is_absoluteZPurePath.is_absolute  sJ     ;;)#??3'' ( {{  &&r    c                s    ^ RI pRpVP                  RVRR7       V P                  \        J d   V P                  P	                  V 4      # R# )zYReturn True if the path contains one of the special names reserved
by the system, if any.Nzpathlib.PurePath.is_reserved() is deprecated and scheduled for removal in Python 3.15. Use os.path.isreserved() to detect reserved paths on Windows.zpathlib.PurePath.is_reservedZremoveF)   i   )warnings_deprecatedrM   ntpathZ
isreserved)r+   r   msgr   r!   is_reservedZPurePath.is_reserved  sJ     	3 	;SQ;;& ;;))$//r    c                s   ^ RI pRpVP                  RVRR7       V P                  4       '       g   \        R4      hV P                  p\        V4      ^8X  d0   V^,          R8X  d"   RV,           pV P                  4       R,          pM(V'       d   R	pV P                  4       pMR
p\        V 4      p^ RIH	p WF! \        P                  ! V4      4      ,           # )Return the path as a URI.Nzlpathlib.PurePath.as_uri() is deprecated and scheduled for removal in Python 3.19. Use pathlib.Path.as_uri().zpathlib.PurePath.as_urir   z.relative path can't be expressed as a file URIZ:zfile:///i   NNzfile:zfile://)quote_from_bytes)r   i   )r   r   r   r   r%   r/   rO   rT   Zurllib.parser   rD   re   )r+   r   r   r%   Zprefixr,   r   s   &      r!   as_uriZPurePath.as_uri  s    H6GL!!MNN

u:?uQx3%'F==?2&DF==?D Ft9D1(T):;;;r    case_sensitiveNc               sf   \        VR4      '       g   V P                  V4      pVf   V P                  \        J pV P                  '       d   \        V 4      MRpVP                  '       d   \        V4      MRp\        V P                  P                  VRR7      pVP                  V4      ! V4      RJ# )zp
Return True if this path matches the given glob-style pattern. The
pattern is matched against the entire path.
rX   Nr   T)	recursive)	r   rX   rM   ri   r   rT   r    rr   compile)r+   r   r   r,   globbers   &&$  r!   
full_matchZPurePath.full_match)  s    
 w00((1G!![[I5N !JJJs4yB")---#g,R .DQw'-T99r    c               s*   \        VR4      '       g   V P                  V4      pVf   V P                  \        J pV P                  RRR1,          pVP                  RRR1,          pV'       g   \        R4      h\        V4      \        V4      8  d   R# \        V4      \        V4      8  d   VP                  '       d   R# \        V P                  P                  V4      p\        W44       F#  w  rgVP                  V4      pV! V4      e   K"   R# 	  R# )z
Return True if this path matches the given pattern. If the pattern is
relative, matching is done from the right; otherwise, the entire path
is matched. The recursive wildcard '**' is *not* supported by this
method.
rX   Nzempty patternFTr   )r   rX   rM   ri   r   r   r/   r   r    rr   Zzipr   )	r+   Zpath_patternr   Z
path_partsZpattern_partsr   Z	path_partZpattern_partmatchs	   &&$      r!   r   ZPurePath.match:  s     |_55--l;L!![[I5NZZ"%
$**4R40_--z?S//z?S//L4G4G4G .A'*:'E#IOOL1EY' (F r    )r&   rk   rp   rQ   r(   r|   rg   r   )rQ   r&   r(   r   r|   rg   rp   rk   )<r   r   r   r   r   r?   rD   r,   rM   rG   r.   rX   rY   r]   r_   ra   r>   rc   rf   propertyrj   rl   ro   rs   ru   rw   ry   rz   r~   classmethodr}   r:   r   r   r   rO   r   r%   r'   r)   r   r   r   r   rE   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r@   rA   rB   r!   r   r   N   s(    "IF WWF# ,)7""6K!
 	- 	-Y
 / /<
=
<
=
 ) )
 H H$  07
       % % & & % % = = " "  	D	11 	 	 
 
 K K6E 6,6	'
<2:D :"D  r    c                   "    ] tR tRtRt]tRtRtR# )r   iY  zPurePath subclass for non-Windows systems.

On a POSIX system, instantiating a PurePath should return this object.
However, you can also instantiate it directly on any system.
r   N)	r   r   r   r   r   ri   rM   r?   r   r   r    r!   r   r   Y  s    
 FIr    c                   r   )r   ic  zPurePath subclass for Windows systems.

On a Windows system, instantiating a PurePath should return this object.
However, you can also instantiate it directly on any system.
r   N)	r   r   r   r   r   r   rM   r?   r   r   r    r!   r   r   c  s    
 FIr    c                   sx  a  ] tR tRt o RtRJtR t]R 4       tRR/R lt	R t
RR/R	 ltRR/R
 ltRR/R ltR tR tR tR tR tR tR tR tRLR ltR tRMR ltR tRMR lt]P8                  ! ]! ^R4      4      t]P8                  ! ]! RK4      4      tR t R t!R t"RRRR/R  lt#RRRR/R! lt$RNR" lt%R# t&]'R$ 4       t(ROR% lt)]*'       d	   RR/R& lt+MRR/R' lt+],'       d	   RR/R( lt-MRR/R) lt-].! ]/R*4      '       d   R+ t0MR, t0RPR- lt1RQR. lt2RR/R/ lt3R0 t4ROR1 lt5R2 t6R3 t7R4 t8R5 t9R6 t:R7 t;RRR8 lt<ROR9 lt=]>'       d   ]=t?ROR: lt=]/P                  R;8X  d   ROR< ltAMROR= ltAR> tBR? tC].! ]/R@4      '       d   RORA ltDMRORB ltD].! ]/RC4      '       d   RD tEMRE tERF tF]'RG 4       tGRH tH]'RI 4       tIRJtJV tKR# )Sr   im  a  PurePath subclass that can make system calls.

Path represents a filesystem path but unlike PurePath, also offers
methods to do system calls on path objects. Depending on your system,
instantiating a Path will return either a PosixPath or a WindowsPath
object. You can also instantiate a PosixPath or WindowsPath directly,
but cannot instantiate a WindowsPath on a POSIX system or vice versa.
c                s    V \         J d"   \        P                  R 8X  d   \        M\        p \
        P                  V 4      # )rC   )r   rD   rE   r   r   rF   rG   rH   rL   r!   rG   ZPath.__new__x  s)    $;!#D+iC~~c""r    c                sv     V P                   #   \         d     \        T 4      T n         T P                   u # i ; i)zV
A PathInfo object that exposes the file type and other file attributes
of this path.
)_inforh   r
   r0   r1   r!   infoZ	Path.info}  s5    	:: 	!$DJ::	s    '88follow_symlinksTc               s0    \         P                  ! WR7      # )zP
Return the result of the stat() system call on this path, like
os.stat() does.
r   )rD   statr+   r      &$r!   r   Z	Path.stat  s    
 wwt==r    c                rd   )z~
Like stat(), except if the path points to a symlink, the symlink's
status information is returned, rather than its target's.
)rD   lstatr0   r1   r!   r   Z
Path.lstat  s    
 xx~r    c               s    V'       d    \         P                  P                  V 4      # \         P                  P                  V 4      # )z
Whether this path exists.

This method normally follows symlinks; to check whether a symlink exists,
add the argument follow_symlinks=False.
)rD   r,   existsZlexistsr   r   r!   r   ZPath.exists  s-     77>>$''wwt$$r    c                   V'       d    \         P                  P                  V 4      #  \        V P	                  VR7      P
                  4      #   \        \        3 d     R# i ; i)z#
Whether this path is a directory.
r   F)rD   r,   Zisdirr   r   st_modeOSErrorr   r   r   r!   is_dirZPath.is_dir  sR     77==&&	499_9EMMNN$ 		   $A A#"A#c               r   )zY
Whether this path is a regular file (also True for symlinks pointing
to regular files).
r   F)rD   r,   Zisfiler   r   r   r   r   r   r   r!   is_fileZPath.is_file  sR    
 77>>$''	499_9EMMNN$ 		r   c                @    \         P                  P                  V 4      # )z%
Check if this path is a mount point
)rD   r,   Zismountr0   r1   r!   is_mountZPath.is_mount  s     wwt$$r    c                r   )z'
Whether this path is a symbolic link.
)rD   r,   Zislinkr0   r1   r!   
is_symlinkZPath.is_symlink  s     ww~~d##r    c                r   )z"
Whether this path is a junction.
)rD   r,   Z
isjunctionr0   r1   r!   is_junctionZPath.is_junction  s     ww!!$''r    c                z     \        V P                  4       P                  4      #   \        \        3 d     R# i ; i)z&
Whether this path is a block device.
F)r   r   r   r   r   r0   r1   r!   is_block_deviceZPath.is_block_device  5    	499;..//$ 		   "% ::c                r   )z*
Whether this path is a character device.
F)r   r   r   r   r   r0   r1   r!   is_char_deviceZPath.is_char_device  r   r   c                r   )z
Whether this path is a FIFO.
F)r   r   r   r   r   r0   r1   r!   is_fifoZPath.is_fifo  5    	DIIK//00$ 		r   c                r   )z 
Whether this path is a socket.
F)r   r   r   r   r   r0   r1   r!   	is_socketZPath.is_socket  r   r   c                s   V P                  4       p VP                  4       pVP                  VP                  8H  ;'       d    VP                  VP                  8H  #   \         d#    T P                  T4      P                  4       p Lfi ; i)z_Return whether other_path is the same or not as this file
(as returned by os.path.samefile()).
)r   rh   rX   Zst_inoZst_dev)r+   Z
other_pathZstZother_str   r!   samefileZPath.samefile  s{     YY[	=!(H 		X__, - -		X__,	.  	=))*5::<H	=s   A *B	B	Nc                sl    RV9  d   \         P                  ! V4      p\         P                  ! WW#WE4      # )zg
Open the file pointed to by this path and return a file object, as
the built-in open() function does.
Zb)iotext_encodingopen)r+   mode	bufferingencodingerrorsnewlines   &&&&&&r!   r   Z	Path.open  s.     d?''1Hwwt9HHr    c                s    V P                  R^ R7      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)z;
Open the file in bytes mode, read it, and close the file.
rb)r   r   N)r   readr+   fr   r!   
read_bytesZPath.read_bytes  s1     YYDAY..!668 /...s	   7A	c                s    \         P                  ! V4      pV P                  RWVR7      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)z:
Open the file in text mode, read it, and close the file.
rr   r   r   r   N)r   r   r   r   )r+   r   r   r   r   r   r!   	read_textZPath.read_text  sE     ##H-YYC(7YSSWX668 TSSSs   AA	c                s    \        V4      pV P                  RR7      ;_uu_ 4       pVP                  V4      uuRRR4       #   + '       g   i     R# ; i)z?
Open the file in bytes mode, write to it, and close the file.
wb)r   N)Z
memoryviewr   write)r+   dataZviewr   r   r!   write_bytesZPath.write_bytes  s;    
 $YYDY!!Q774= "!!!s   AA	c                s>   \         P                  ! V4      p\        V\        4      '       g'   \	        RVP
                  P                  ,          4      hV P                  RW#VR7      ;_uu_ 4       pVP                  V4      uuRRR4       #   + '       g   i     R# ; i)z>
Open the file in text mode, write to it, and close the file.
zdata must be str, not %sZwr   N)	r   r   r7   rT   rS   r`   r   r   r   )r+   r   r   r   r   r   s   &&&&& r!   
write_textZPath.write_text  sv     ##H-$$$6 NN334 5 5YYC(7YSSWX774= TSSSs   /BB	c              #  s   "   V P                   P                  p\        V P                  4      pV F*  p\        V4      V8  d   VR,          V8X  d   VRR pVx  K,  	  R# 5i)r   Nr   )rM   rr   r/   r   )r+   rU   rr   Z
anchor_lenr   s   &&   r!   _filter_trailing_slashZPath._filter_trailing_slash/  sQ     kkoo%
H8}z)hrlc.A#CR=N s   AA c                sT    V P                  V4      pW#n        \        V4      Vn        V# r#   )rX   r|   r   r   )r+   Z	dir_entryr   r,      &&& r!   _from_dir_entryZPath._from_dir_entry7  s(    !!(+	!),
r    c                s   a  \        S 4      p\        P                  ! V4      ;_uu_ 4       p\        V4      pRRR4       VR8X  d   V 3R lX 4       # V 3R lX 4       #   + '       g   i     L/; i)zYield path objects of the directory contents.

The children are yielded in arbitrary order, and the
special entries '.' and '..' are not included.
Nr{   c              3   Z   <"   T F   pSP                  WP                  4      x  K"  	  R # 5ir#   )r   rE   r3   Zer+   r5   r!   r6   Path.iterdir.<locals>.<genexpr>G  #     EWD((FF33W   (+c              3   r   r#   )r   r,   r   r5   r!   r6   r   I  r   r   )rT   rD   ZscandirZlist)r+   root_dirZ
scandir_itZentriess   f   r!   iterdirZPath.iterdir=  sT     t9ZZ!!Z:&G "s?EWEEEWEE "!s   AA.	r   recurse_symlinksFc               sl   \         P                  ! RW4       Vf   V P                  \        J pRpMRpV P	                  V4      pV'       d   RM\
        p\        V P                  P                  W$V4      pVP                  VRRR1,          4      p\        V 4      p	V! V P                  P                  V	R4      4      p
V	R8X  d   \        V P                  V
4      p
VR,          R8X  d   \        V P                  V
4      p
MVR,          R8X  d   V P                  V
4      p
\        V P                  V
4      p
V
# )	zIterate over this subtree and yield all existing files (of any
kind, including directories) matching the given relative pattern.
zpathlib.Path.globNFTr   r{   **r   )sysauditrM   ri   r   r   r    rr   ZselectorrT   r   Zmap_remove_leading_dot_remove_trailing_slashr   r   )r+   r   r   r  Zcase_pedanticr   r   r   Zselectr'   rU   s   &&$$       r!   globZ	Path.globK  s    			%t5!![[I5N!M
 !M##G,,D2F	 .QZ[!!%"+.4yt{{''b12 3;00%8E9?33U;E2Y$//6ED,,e4r    c               s    \         P                  ! RW4       V P                  P                  RV4      pV P	                  WVR7      # )zRecursively yield all existing files (of any kind, including
directories) matching the given relative pattern, anywhere in
this subtree.
zpathlib.Path.rglobr  )r   r  )r  r  rM   r   r  )r+   r   r   r  s   &&$$r!   rglobZ
Path.rglobi  s=    
 			&6++""41yyRbyccr    c              #  s  "   \         P                  ! RWV4       \        V 4      pV'       g   \        P                  p\        P
                  ! WAW#4      pV F+  w  rgpVR8X  d
   VR,          pV P                  V4      Wx3x  K-  	  R# 5i)zBWalk the directory tree from this directory, similar to os.walk().zpathlib.Path.walkr{   r   N)r  r  rT   rD   Z_walk_symlinks_as_fileswalkr   )	r+   Ztop_downZon_errorr   r   Zresultsr   ZdirnamesZ	filenamess	   &&&&     r!   r
  Z	Path.walkr  sr     		%tGt9 88O''(hH-4)H	3#B<**84hII .5s   BBc                s,   V P                  4       '       d   V # V P                  '       d`   \        P                  P	                  \        P
                  ! 4       4      ^ ,          pV P                  WP                  V P                  4      # V P                  '       d+   \        P                  P                  V P                  4      pM\        P
                  ! 4       pV P                  '       g   V P                  V4      # \        P                  P	                  V4      w  rpV'       g   V P                  WV P                  4      # VP                  V P                  P                  4      pVP                  V P                  4       V P                  WV4      # )zReturn an absolute version of this path
No normalization or symlink resolution is performed.

Use resolve() to resolve symlinks and remove '..' segments.
)r   r'   rD   r,   r   getcwdr:   r)   r%   Zabspathr   rq   rM   rr   rP   )r+   r%   cwdr'   r   r   s   &     r!   absoluteZPath.absolute~  s    K999GG%%biik215E**5))TZZHH:::''//$**-C))+Czzz ++C0077,,S1S**5

CCyy)DJJ&&uD99r    c                sL    \         P                  ! 4       pV ! V4      pWn        V# )z<Return a new path pointing to the current working directory.)rD   r  r|   )rI   r  r,   r   r!   r  ZPath.cwd  s"     iik3x	r    c                s`    V P                  \        P                  P                  WR7      4      # )zT
Make the path absolute, resolving all symlinks on the way and also
normalizing it.
)strict)rX   rD   r,   Zrealpath)r+   r  r-   r!   resolveZPath.resolve  s'     !!"''"2"24"2"GHHr    c               z    V P                  VR7      P                  p\        P                  ! V4      P                  # )*
Return the login name of the file owner.
r   )r   Zst_uidpwdZgetpwuidZpw_name)r+   r   Zuid   &$ r!   owner
Path.owner  /     ))O)<CCC<<$,,,r    c               N    \        V 4      P                   R2p\        V R24      h)r  z.owner() is unsupported on this systemr=   r   r   r+   r   r   r  r!   r  r    .     :&&'x0A&!,J'KLLr    c               r  )(
Return the group name of the file gid.
r   )r   Zst_gidgrpZgetgrgidZgr_name)r+   r   Zgidr  r!   group
Path.group  r  r    c               r  )r  z.group()r  r  r  r  r!   r  r    r  r    readlinkc                sL    V P                  \        P                  ! V 4      4      # )4
Return the path to which the symbolic link points.
)rX   rD   r   r0   r1   r!   r   Path.readlink  s     %%bkk$&788r    c                sN    \        V 4      P                   R2p\        V R24      h)r!  z.readlink()r  r  r   r   r!   r   r"    s.     :&&'{3A&!,J'KLLr    c                sN   V'       d    \         P                  ! V R4       R# \         P                  \         P                  ,          pV'       g   V\         P
                  ,          p\         P                  ! WV4      p\         P                  ! V4       R#   \         d     Li ; i)zC
Create this file with the given access mode, if it doesn't exist.
N)rD   Zutimer   ZO_CREATZO_WRONLYZO_EXCLr   Zclose)r+   r   exist_okZflagsZfd   &&&  r!   touchZ
Path.touch  sq    
 t$
 

R[[(RYYEWWT$'
  s   B B$#B$c                sF    \         P                  ! W4       R#   \         dP    T'       d   T P                  T 8X  d   h T P                  P                  RRR7       T P                  TRTR7        R# \         d$    T'       d   T P                  4       '       g   h  R# i ; i)z,
Create a new directory at this given path.
T)r   r#  FN)rD   mkdirFileNotFoundErrorr   r   r   )r+   r   r   r#  r   r!   r&  Z
Path.mkdir  s{    	HHT   	?dkkT1KKdT:JJtUXJ> 	 4;;== $1	s-    B AB 3B <B B B B c               s6    \         P                  ! WVR7       R# )z6
Change the permissions of the path, like os.chmod().
r   N)rD   chmod)r+   r   r   s   &&$r!   r(  Z
Path.chmod  s     	_=r    c                s,    V P                  VRR7       R# )zx
Like chmod(), except if the path points to a symlink, the symlink's
permissions are changed, rather than its target's.
Fr   N)r(  )r+   r   r-   r!   lchmodZPath.lchmod  s    
 	

4
/r    c                sj     \         P                  ! V 4       R#   \         d    T'       g   h  R# i ; i)zL
Remove this file or link.
If the path is a directory, use rmdir() instead.
N)rD   unlinkr'  )r+   Z
missing_okr-   r!   r*  ZPath.unlink  s,    
	IIdO  	 	s    222c                s2    \         P                  ! V 4       R# )z6
Remove this directory.  The directory must be empty.
N)rD   rmdirr0   r1   r!   r+  Z
Path.rmdir  s     	r    c                s    V P                  4       '       g   V P                  4       '       d   V P                  4        R# V P                  4       '       d   ^ RIpVP                  V 4       R# V P                  4        R# )z@
Delete this file or directory (including all sub-directories).
N)r   r   r*  r   shutilZrmtree)r+   r,  r   r!   _deleteZPath._delete  sK     ?? 0 0 2 2KKM[[]]MM$KKMr    c                x    \         P                  ! W4       \        VR4      '       g   V P                  V4      pV# )a  
Rename this path to the target path.

The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.

Returns the new Path instance pointing to the target path.
rX   )rD   renamer   rX   r+   targetr-   r!   r/  ZPath.rename*  s2     			$v//''/Fr    c                r.  )a#  
Rename this path to the target path, overwriting if that path exists.

The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.

Returns the new Path instance pointing to the target path.
rX   )rD   r   r   rX   r0  r-   r!   r   ZPath.replace9  s2     	

4 v//''/Fr    c                s    \        VR4      '       g   V P                  V4      p\        W4       VP                  ! V 3/ VB  VP	                  4       # )zH
Recursively copy this file or directory tree to the given destination.
rX   )r   rX   r   
_copy_fromrY   )r+   r1  rK   s   &&,r!   r   Z	Path.copyH  sI     v//''/Fd+$)&)  r    c                s    V P                   pV'       g   \        V : R24      h\        VR4      '       d
   W,          pMV P                  W4      pV P                  ! V3/ VB # )zE
Copy this file or directory tree into the given existing directory.
r   rX   )rE   r   r   rX   r   )r+   
target_dirrK   rE   r1  s   &&,  r!   	copy_intoZPath.copy_intoR  s\     yyx'9:;;Z11&F''
9Fyy*6**r    c                s   V'       g4   VP                   P                  4       '       d   V P                  W4       R# VP                   P                  4       '       d}   VP	                  4       p\
        P                  ! V 4       V F.  pV P                  VP                  4      P                  WRV4       K0  	  V'       d   \        VP                   V 4       R# R# V P                  W4       R# )z/
Recursively copy the given path to this path.
N)r   r   _copy_from_symlinkr   r  rD   r&  rY   rE   r2  r   _copy_from_file)r+   sourcer   preserve_metadataZchildrenZchilds   &&&&  r!   r2  ZPath._copy_from_  s     6;;#9#9#;#;##F>[[!!~~'HHHTN!ejj)44,=? " !&++t, !   ;r    c           	     s2   \        W4       \        VR 4      ;_uu_ 4       p\        V R4      ;_uu_ 4       p\        W44       RRR4       RRR4       V'       d   \	        VP
                  V 4       R# R#   + '       g   i     L:; i  + '       g   i     LE; i)r   r   N)r   r   r   r   r   r   )r+   r7  r8  Zsource_fZtarget_fr$  r!   r6  Path._copy_from_filep  sd    v,%%dD!!XH/ " & fkk4(  "! &%s"   BA3	B3B>BB	c                s     \         P                  ! V4      p\        V\        V 4      4       R #   \         d     Mi ; iT P                  Y4       R # r#   )rD   rR   r   rT   rS   _copy_from_file_fallbackr+   r7  r8     &&&r!   r6  r9  {  sL    6* &#d),	  
 ))&Ds   / ==rC   c                s    \         P                  ! \        VP                  4       4      WP                  P                  4       4       V'       d   \        VP                  V R R7       R# R# Fr   N)rD   symlinkrT   r   r   r   r   r;  r<  r!   r5  Path._copy_from_symlink  sA    JJs6??,-t[[5G5G5IJ &++tUC !r    c                s    \         P                  ! \        VP                  4       4      V 4       V'       d   \	        VP
                  V R R7       R# R# r=  )rD   r>  rT   r   r   r   r;  r<  r!   r5  r?    s4    JJs6??,-t4 &++tUC !r    c                sT    V P                  V4      p\        W4        \        P                  ! W4       VP	                  4       #   \
         d!   pTP                  \        8w  d   h  Rp?MRp?ii ; i  \         d     Mi ; iT P                  TRRR7      pT P                  4        T# )zH
Recursively move this file or directory tree to the given destination.
NFT)r   r8  )rX   r   rD   r   rY   r   errnoZEXDEVrS   r   r-  )r+   r1  Zerrr   r!   moveZ	Path.move  s    
	)''/F #40)

4(
 ((	  99% &  		 65DQs(   A3 A A0A++A03B Bc                s    V P                   pV'       g   \        V : R24      h\        VR4      '       d
   W,          pMV P                  W4      pV P	                  V4      # )zE
Move this file or directory tree into the given existing directory.
r   rX   )rE   r   r   rX   rA  )r+   r3  rE   r1  r   r!   	move_intoZPath.move_into  sW     yyx'9:;;Z11&F''
9Fyy  r    r>  c                s4    \         P                  ! WV4       R# )
Make this path a symlink pointing to the target path.
Note the order of arguments (link, target) is the reverse of os.symlink.
N)rD   r>  )r+   r1  target_is_directoryr<  r!   
symlink_toPath.symlink_to  s    
 JJv%89r    c                sN    \        V 4      P                   R2p\        V R24      h)rC  z.symlink_to()r  r  )r+   r1  rD  r   r   r!   rE  rF    s.    
 :&&'}5A&!,J'KLLr    linkc                s2    \         P                  ! W4       R# )
Make this path a hard link pointing to the same file as *target*.

Note the order of arguments (self, target) is the reverse of os.link's.
N)rD   rG  r0  r-   r!   hardlink_toPath.hardlink_to  s     GGF!r    c                r  )rH  z.hardlink_to()r  r  )r+   r1  r   r   r!   rI  rJ    s.     :&&'~6A&!,J'KLLr    c                s   V P                   '       g   V P                  '       g   V P                  '       d   V P                  ^ ,          R,          R8X  d   \        P                  P                  V P                  ^ ,          4      pVR,          R8X  d   \        R4      hV P                  V4      w  r#pV P                  W#W@P                  R,          ,           4      # V # )z[Return a new path with expanded ~ and ~user constructs
(as returned by os.path.expanduser)
:Nr   N~#Could not determine home directory.r   )	r%   r'   r)   rD   r,   
expanduserRuntimeErrorr   r:   )r+   homedirr   r'   r   s   &    r!   rM  ZPath.expanduser  s     tyyyJJJ4::a=,3gg((A7Gr{c!"#HII"..w7OCt**3dZZ^6KLLr    c                st    \         P                  P                  R4      pVR8X  d   \        R4      hV ! V4      # )z7Return a new path pointing to expanduser('~').
        rK  rL  )rD   r,   rM  rN  )rI   rO  r   r!   homeZ	Path.home  s5     ''$$S)c>DEE7|r    c                sv    V P                  4       '       g   \        R4      h^ RIHp V! \	        V 4      RR7      # )r   z.relative paths can't be expressed as file URIs)pathname2urlT)Z
add_scheme)r   r   urllib.requestrQ  rT   )r+   rQ  r   r!   r   ZPath.as_uri  s1    !!MNN/CI$77r    c                s    ^ RI Hp ^ RIHp  V ! V! VRR7      4      pTP                  4       '       g   \	        RT: 24      hT#   T d   p\	        TP
                  4      RhRp?ii ; i)z,Return a new path from the given 'file' URI.)URLError)url2pathnameT)Zrequire_schemeNzURI is not absolute: )Zurllib.errorrS  rR  rT  r   Zreasonr   )rI   ZurirS  rT  r,   Zexcs   &&    r!   from_uriZPath.from_uri  sl     	*/	3|C=>D !!4SG<==	  	3SZZ(d2	3s   A A'A""A')r   r   )r   r   NNN)NNN)TNF)F)i  T)i  FF)TF)Lr   r   r   r   r   r?   rG   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   operatorZ
itemgetterr8   r  r  r   r   r  r  r	  r
  r  r   r  r  r  r  r  r  r   rD   r   r%  r&  r(  r)  r*  r+  r-  r/  r   r   r4  r2  r6  r   r:  rE   r5  rA  rB  rE  rI  rM  rP  r   rU  r   r@   rA   rB   r!   r   r   m  sg     I#
 	 	>d >	% 	%	 	
 
%$(
.I!! #--eAtn=%00r;Fd U <dt de d
J:<  I 	-4 	-	M4 	M 	-4 	-	M4 	M r:	9	M,">T >0	!+<") #2 	E 
ww$	D
	D
.! r9	:	M r6	"	M  8 
 
r    c                   s\   a  ] tR tRt o RtRt]P                  R8X  d
   R tRt	V t
R# Rt	V t
R# )r   i  zkPath subclass for non-Windows systems.

On a POSIX system, instantiating a Path should return this object.
rC   c                6    \        R V P                  : R24      hzcannot instantiate z on your systemr   r   rH   rL   r!   rG   ZPosixPath.__new__  "    &%cll%5_EG Gr    r   Nr   r   r   r   r   r?   rD   rE   rG   r   r@   rA   rB   r!   r   r     -      I	ww$	G 	G r    c                   s\   a  ] tR tRt o RtRt]P                  R8w  d
   R tRt	V t
R# Rt	V t
R# )r   i  ziPath subclass for Windows systems.

On a Windows system, instantiating a Path should return this object.
rC   c                rW  rX  rY  rH   rL   r!   rG   ZWindowsPath.__new__  rZ  r    r   Nr[  rA   rB   r!   r   r     r\  r    )r   r   r   r   r   r   r   ).r   r   r   rV  rD   ri   r  r@  r  r    r   Z	itertoolsr   r   r   r   r   r   r   r   Z_collections_abcr	   r  ZImportErrorr  Zpathlib._osr
   r   r   r   r   r   r   r   Z__all__r   r   r"   r   ZPathLikeZregisterr   r   r   r   r   r   r    r!   <module>r]     s   
   	  
  5  G G %  	. 	@8 @:D DP   X H h U
8 U
p
Gm 
G
G$ 
Gw'  
C  
Cs$   C 
C+ 	C('C(+	C76C7