• File: pathlib.cpython-38.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python38/lib64/python3.8/__pycache__/pathlib.cpython-38.pyc
  • Date Modified: 10/26/2026 8:15 PM
  • File size: 42.02 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
U

j@s:ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZdd	d
ddd
gZdZdZ dZ!ee
eefZ"ee e!fZ#ddZ$ddZ%Gddde&Z'Gddde'Z(Gddde'Z)e(Z*e)Z+GdddZ,Gddde,Z-e-Z.dd Z/e0ed!rje1e/Z/Gd"d#d#Z2Gd$d%d%Z3Gd&d'd'e2Z4Gd(d)d)e2Z5Gd*d+d+e2Z6Gd,d-d-e	Z7Gd.dde&Z8ej9:e8Gd/d	d	e8Z;Gd0d
d
e8Z<Gd1dde8Z=Gd2dde=e;Z>Gd3d
d
e=e<Z?dS)4N)Sequence)EINVALENOENTENOTDIREBADFELOOP)
attrgetter)S_ISDIRS_ISLNKS_ISREGS_ISSOCKS_ISBLKS_ISCHRS_ISFIFO)quote_from_bytesTPurePath
PurePosixPathPureWindowsPathPath	PosixPathWindowsPath{icCs t|ddtkpt|ddtkS)Nerrnowinerror)getattr_IGNORED_ERROS_IGNORED_WINERRORS)Z	exceptionr,/opt/alt/python38/lib64/python3.8/pathlib.py
_ignore_error(sr cCsd|kpd|kpd|kS)N*?[r)patrrr_is_wildcard_pattern-sr%c@s(eZdZdZddZddZddZdS)	_FlavourzPA flavour implements a particular (platform-specific) set of path
    semantics.cCs|jj|_dSN)sepjoinselfrrr__init__7sz_Flavour.__init__cCsg}|j}|j}d}}t|}|D]}|s.q$|r>|||}||\}}}	||	krt|	|D] }
|
rd|
dkrd|t|
qdn|	r|	dkr|t|	|s|r$|s|D]0}|sq|r|||}||d}|rqqqq$|s|r||||	|||fS)N.r)
r(altsepreversedreplace	splitrootsplitappendsysinternreverse)r+partsZparsedr(r/drvrootitpartZrelxrrrparse_parts:s@
z_Flavour.parse_partscCsz|r*|sp|rp||||g|ddfSnF|rb||ksJ||||krp||||ddfSn||||fS|||fS)z
        Join the two paths represented by the respective
        (drive, root, parts) tuples.  Return a new (drive, root, parts) tuple.
        N)casefold)r+r9r:r8Zdrv2Zroot2Zparts2rrrjoin_parsed_parts`sz_Flavour.join_parsed_partsN)__name__
__module____qualname____doc__r,r>rArrrrr&3s&r&c@seZdZdZdZdZeZej	dkZ
edZdZ
ddd	d
hdded
dDBdded
dDBZefddZddZddZddZe
fddZddZddZddZd S)!_WindowsFlavour\/TntZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|]}d|qS)zCOM%dr.0irrr	<setcomp>sz_WindowsFlavour.<setcomp>r?
cCsh|]}d|qS)zLPT%drrJrrrrMscCs\|dd}|dd}||krP||krP||\}}|dd}|dd}nd}|dd}||kr||kr||kr||d}|dkr|||d}||dkr|dkrt|}|r||d||||ddfS|d||||ddfSd}	}
|dkr6||jkr6|dd}	|dd}|}||krN|}
||}||	|
|fS)Nrr?r-:)_split_extended_pathfindlen
drive_letterslstrip)r+r<r(firstsecondprefixZthirdindexZindex2r9r:rrrr2s6"

z_WindowsFlavour.splitrootcCs|Sr'lowerr+srrrr@sz_WindowsFlavour.casefoldcCsdd|DS)NcSsg|]}|qSrr\)rKprrr
<listcomp>sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>rr+r8rrrcasefold_partssz_WindowsFlavour.casefold_partscCstt|tjjSr')recompilefnmatch	translate
IGNORECASE	fullmatchr+patternrrrcompile_patternsz_WindowsFlavour.compile_patterncCsXd}||rP|dd}|dd}|drP||dd7}d|dd}||fS)Nr-zUNC\rPrG)
startswith)r+r_Z
ext_prefixrZrrrrSs

z$_WindowsFlavour._split_extended_pathcCs6|sdS|ddrdS|ddd|jkS)NFrz\\rQr.)rn	partitionupperreserved_namesrbrrris_reserveds
z_WindowsFlavour.is_reservedcCsd|j}t|dkrJ|ddkrJ|ddd}d|t|dfSdt|dSdS)NrOr?rRrHz
file:///%s/%szutf-8zfile:)driverUas_posixrWurlquote_from_bytesencode)r+pathrsrestrrrmake_urisz_WindowsFlavour.make_uricCsdtjkrtjd}nJdtjkrXztjd}Wntk
rFd}YnX|tjd}ntd|rtjd|kr||f\}}}|dtjdkrtd|||d<|s|r||||d	d}n
||}|S)
NZUSERPROFILEZHOMEPATHZ	HOMEDRIVEr-zCan't determine home directoryZUSERNAMErQ%Can't determine home directory for %rr?)osenvironKeyErrorRuntimeErrorr>r))r+usernameuserhomer9r:r8rrr
gethomedirs*



z_WindowsFlavour.gethomedirN)rBrCrDr(r/has_drvntpathpathmodr{nameis_supportedsetrVZext_namespace_prefixrangerqr2r@rcrlrSrrryrrrrrrFrs*

'
rFc@sbeZdZdZdZdZeZej	dkZ
efddZddZd	d
Z
ddZd
dZddZddZdS)
_PosixFlavourrHr-FrIcCsV|rH|d|krH||}t|t|dkr<d|d|fSd||fSn
dd|fSdS)NrrOr-)rWrU)r+r<r(Z
stripped_partrrrr2s
z_PosixFlavour.splitrootcCs|Sr'rr^rrrr@sz_PosixFlavour.casefoldcCs|Sr'rrbrrrrcsz_PosixFlavour.casefold_partscCstt|jSr')rdrerfrgrirjrrrrlsz_PosixFlavour.compile_patterncCsdSNFrrbrrrrrsz_PosixFlavour.is_reservedcCst|}dt|S)Nzfile://)bytesru)r+rwZbpathrrrrysz_PosixFlavour.make_uricCs||s@ztjdWStk
r<ddl}|tjYSXn8ddl}z||jWStk
rvtd|YnXdS)NHOMErrz)	r{r|r}pwdgetpwuidgetuidpw_dirgetpwnamr~)r+rrrrrr$sz_PosixFlavour.gethomedirN)rBrCrDr(r/r	posixpathrr{rrr2r@rcrlrrryrrrrrrs
rc@seZdZdZdS)	_AccessorzjAn accessor implements a particular (system-specific or not) way of
    accessing paths on the filesystem.N)rBrCrDrErrrrr8src@seZdZejZejZejZejZejZej	Z	e
edr>ejZnddZejZej
Z
e
edrdejZneddZejZejZejZe
edrejZn
dd	d
ZejZddZejZeejjZeejjZd
S)_NormalAccessorlchmodcCstddS)Nz%lchmod() not available on this systemNotImplementedError)r+ZpathobjmoderrrrNsz_NormalAccessor.lchmodlinkcCstddS)Nz&os.link() not available on this systemrr+targetrrrlink_toXsz_NormalAccessor.link_tosymlinkFcCstddS)Nz)os.symlink() not available on this systemr)r+srcZdsttarget_is_directoryrrrresz_NormalAccessor.symlinkcCs
t|Sr')r{readlinkr+rwrrrrksz_NormalAccessor.readlinkN)F)rBrCrDr{statlstatopenlistdirscandirchmodhasattrrmkdirunlinkrrstaticmethodrmdirrenamer1rutimergetcwdrw
expanduserrealpathrrrrr=s4




rcCsR|d}|dd}|dkr"t}n$d|kr4tdnt|rBt}nt}||||S)Nrr?**z:Invalid pattern: '**' can only be an entire path component)_RecursiveWildcardSelector
ValueErrorr%_WildcardSelector_PreciseSelector)
pattern_partsflavourr$child_partsclsrrr_make_selector|s
r	lru_cachec@s eZdZdZddZddZdS)	_SelectorzYA selector matches a specific glob pattern part against the children
    of a given path.cCs0||_|rt|||_d|_nt|_d|_dS)NTF)rr	successordironly_TerminatingSelector)r+rrrrrr,sz_Selector.__init__cCs<t|}|j}|j}|jj}||s,tgS|||||S)zuIterate over all child paths of `parent_path` matched by this
        selector.  This can contain parent_path itself.)typeis_direxists	_accessorriter_select_from)r+parent_pathZpath_clsrrrrrrselect_fromsz_Selector.select_fromN)rBrCrDrEr,rrrrrrs	rc@seZdZddZdS)rccs
|VdSr'r)r+rrrrrrrrsz!_TerminatingSelector._select_fromN)rBrCrDrrrrrrsrc@seZdZddZddZdS)rcCs||_t|||dSr')rrr,)r+rrrrrrr,sz_PreciseSelector.__init__ccs\z@||j}|jr|n||r>|j||||D]
}|Vq2Wntk
rVYdSXdSr')_make_child_relpathrrrrPermissionError)r+rrrrrwr`rrrrsz_PreciseSelector._select_fromNrBrCrDr,rrrrrrsrc@seZdZddZddZdS)rcCs|||_t|||dSr')rlmatchrr,r+r$rrrrrr,sz_WildcardSelector.__init__ccsz||}t|}W5QRX|D]}|jrrz|s:Wq"Wn4tk
rp}zt|sXWYq"W5d}~XYnX|j}	||	r"||	}
|j	|
|||D]
}|Vqq"Wnt
k
rYdSXdSr')listrrOSErrorr rrrrrr)r+rrrr
scandir_itentriesentryerrwr`rrrrs&


z_WildcardSelector._select_fromNrrrrrrsrc@s$eZdZddZddZddZdS)rcCst|||dSr')rr,rrrrr,sz#_RecursiveWildcardSelector.__init__ccs|Vz||}t|}W5QRX|D]t}d}z|}Wn,tk
rh}zt|sXW5d}~XYnX|r(|s(||j}	||	||D]
}
|
Vqq(Wntk
rYdSXdSr)	rrrr 
is_symlinkrr_iterate_directoriesr)r+rrrrrrZentry_is_dirrrwr`rrrrs"
z/_RecursiveWildcardSelector._iterate_directoriesc	cs~zbt}zL|jj}||||D]0}|||||D]}||kr2|V||q2q W5|XWntk
rxYdSXdSr')rclearrrraddr)	r+rrrrZyieldedZsuccessor_selectZstarting_pointr`rrrrsz'_RecursiveWildcardSelector._select_fromN)rBrCrDr,rrrrrrrsrc@s4eZdZdZdZddZddZddZd	d
ZdS)_PathParentszvThis object provides sequence-like access to the logical ancestors
    of a path.  Don't try to construct it yourself.)_pathcls_drv_root_partscCs&t||_|j|_|j|_|j|_dSr')rrrrrrrrrr,s
z_PathParents.__init__cCs(|js|jrt|jdSt|jSdSNr?)rrrUrr*rrr__len__sz_PathParents.__len__cCs@|dks|t|krt||j|j|j|jd|dS)Nrr?)rU
IndexErrorr_from_parsed_partsrrr)r+idxrrr__getitem__s
z_PathParents.__getitem__cCsd|jjS)Nz<{}.parents>)formatrrBr*rrr__repr__sz_PathParents.__repr__N)	rBrCrDrE	__slots__r,rrrrrrrrsrc@seZdZdZdZddZddZeddZedVd
dZ	edWdd
Z
eddZddZddZ
ddZddZddZddZddZddZed d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zeed.d/d0Zeed1d2d0Zed3d4Zed5d6Z ed7d8Z!ed9d:Z"ed;d<Z#d=d>Z$d?d@Z%dAdBZ&edCdDZ'dEdFZ(dGdHZ)dIdJZ*edKdLZ+edMdNZ,dOdPZ-dQdRZ.dSdTZ/dUS)Xra|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.
    )rrr_str_hash_pparts_cached_cpartscGs$|tkrtjdkrtnt}||S)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.
        rI)rr{rrr_from_parts)rargsrrr__new__1szPurePath.__new__cCs|jt|jfSr')	__class__tuplerr*rrr
__reduce__;szPurePath.__reduce__cCsdg}|D]N}t|tr"||j7}qt|}t|trF|t|qtdt|q|j	
|S)NzNargument should be a str object or an os.PathLike object returning str, not %r)
isinstancerrr{fspathstrr4	TypeErrorr_flavourr>)rrr8arrr_parse_args@s


zPurePath._parse_argsTcCs<t|}||\}}}||_||_||_|r8||Sr')objectrrrrr_init)rrinitr+r9r:r8rrrrTs
zPurePath._from_partscCs,t|}||_||_||_|r(||Sr')rrrrrr)rr9r:r8rr+rrrras
zPurePath._from_parsed_partscCs4|s|r$|||j|ddS|j|SdSr)rr))rr9r:r8rrr_format_parsed_partskszPurePath._format_parsed_partscCsdSr'rr*rrrrrszPurePath._initcCs@||\}}}|j|j|j|j|||\}}}||||Sr')rrrArrrr)r+rr9r:r8rrr_make_childvs
zPurePath._make_childcCsBz|jWStk
r<||j|j|jp.d|_|jYSXdS)z[Return the string representation of the path, suitable for
        passing to system calls.r.N)rAttributeErrorrrrrr*rrr__str__|szPurePath.__str__cCst|Sr')rr*rrr
__fspath__szPurePath.__fspath__cCs|j}t||jdS)zNReturn the string representation of the path with forward (/)
        slashes.rH)rrr1r(r+frrrrtszPurePath.as_posixcCs
t|S)zaReturn the bytes representation of the path.  This is only
        recommended to use under Unix.)r{fsencoder*rrr	__bytes__szPurePath.__bytes__cCsd|jj|S)Nz{}({!r}))rrrBrtr*rrrrszPurePath.__repr__cCs|std|j|S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI)is_absoluterrryr*rrras_uriszPurePath.as_uricCs8z|jWStk
r2|j|j|_|jYSXdSr')rrrrcrr*rrr_cpartss
zPurePath._cpartscCs&t|tstS|j|jko$|j|jkSr')rrNotImplementedrrr+otherrrr__eq__s
zPurePath.__eq__cCs8z|jWStk
r2tt|j|_|jYSXdSr')rrhashrrr*rrr__hash__s
zPurePath.__hash__cCs&t|tr|j|jk	rtS|j|jkSr'rrrrrrrrr__lt__szPurePath.__lt__cCs&t|tr|j|jk	rtS|j|jkSr'rrrrr__le__szPurePath.__le__cCs&t|tr|j|jk	rtS|j|jkSr'rrrrr__gt__szPurePath.__gt__cCs&t|tr|j|jk	rtS|j|jkSr'rrrrr__ge__szPurePath.__ge__rz.The drive prefix (letter or UNC path), if any.)docrzThe root of the path, if any.cCs|j|j}|S)z/The concatenation of the drive and root, or ''.)rr)r+anchorrrrrszPurePath.anchorcCs.|j}t||js|jrdndkr&dS|dS)z!The final path component, if any.r?rr-rQ)rrUrrrbrrrrsz
PurePath.namecCsD|j}|d}d|kr,t|dkr<nn||dSdSdS)z{
        The final component's last suffix, if any.

        This includes the leading period. For example: '.txt'
        r.rr?Nr-rrfindrUr+rrLrrrsuffixs

 zPurePath.suffixcCs:|j}|drgS|d}dd|dddDS)z
        A list of the final component's suffixes, if any.

        These include the leading periods. For example: ['.tar', '.gz']
        r.cSsg|]}d|qS)r.r)rKrrrrrasz%PurePath.suffixes.<locals>.<listcomp>r?N)rendswithrWr3r+rrrrsuffixess


zPurePath.suffixescCsD|j}|d}d|kr,t|dkr<nn|d|S|SdS)z0The final path component, minus its last suffix.r.rr?Nrrrrrstems

 z
PurePath.stemcCs|jstd|f|j|f\}}}|rX|d|jj|jjfksX|sX|sXt|dkrdtd|||j|j	|j
dd|gS)z-Return a new path with the file name changed.%r has an empty namerQr?zInvalid name %rN)rrrr>r(r/rUrrrr)r+rr9r:r8rrr	with_names
zPurePath.with_namecCs|j}|j|ks |jr.|j|kr.td|f|r<|drD|dkrPtd||j}|shtd|f|j}|s|||}n|dt||}||j	|j
|jdd|gS)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.
        zInvalid suffix %rr.rNrQ)rr(r/rrnrrrUrrrr)r+rrrZ
old_suffixrrrwith_suffix
s
zPurePath.with_suffixc
Gs|std|j}|j}|j}|r8||g|dd}n|}||\}}}|rf||g|dd}	n|}	t|	}
|jj}|
dkr|s|rn||d|
||	kr||||}t	d
t|t||d|
dkr|nd||
dS)zReturn the relative path to another path identified by the passed
        arguments.  If the operation is not possible (because this is not
        a subpath of the other path), raise ValueError.
        zneed at least one argumentr?Nrz{!r} does not start with {!r}r-)
rrrrrrUrrcrrrrr)
r+rr8r9r:Z	abs_partsZto_drvZto_rootZto_partsZto_abs_partsncfZ	formattedrrrrelative_tos.	*
zPurePath.relative_tocCs4z|jWStk
r.t|j|_|jYSXdS)zZAn object providing sequence-like access to the
        components in the filesystem path.N)rrrrr*rrrr8?s
zPurePath.partscGs
||S)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).
        )r)r+rrrrjoinpathKszPurePath.joinpathcCs,z||fWStk
r&tYSXdSr')rrrr+keyrrr__truediv__SszPurePath.__truediv__cCs2z||g|jWStk
r,tYSXdSr')rrrrr"rrr__rtruediv__YszPurePath.__rtruediv__cCs@|j}|j}|j}t|dkr*|s&|r*|S||||ddS)zThe logical parent of the path.r?NrQ)rrrrUr)r+r9r:r8rrrparent_szPurePath.parentcCst|S)z*A sequence of this path's logical parents.)rr*rrrparentsiszPurePath.parentscCs|js
dS|jjpt|jS)zSTrue if the path is absolute (has both a root and, if applicable,
        a drive).F)rrrboolrr*rrrrnszPurePath.is_absolutecCs|j|jS)zaReturn True if the path contains one of the special names reserved
        by the system, if any.)rrrrr*rrrrruszPurePath.is_reservedc	Cs|jj}||}|j|f\}}}|s0td|rF|||jkrFdS|r\|||jkr\dS|j}|sj|rt|t|kr~dS|dd}nt|t|krdStt	|t	|D]\}}t
||sdSqdS)zE
        Return True if this path matches the given pattern.
        z
empty patternFr?NT)rr@r>rrrrrUzipr0rfZfnmatchcase)	r+Zpath_patternrr9r:Z	pat_partsr8r<r$rrrrzs(zPurePath.matchN)T)T)0rBrCrDrErrrclassmethodrrrrrrrrrtrrrpropertyrr	rr
rrrrrsr:rrrrrrrr r8r!r$r%r&r'rrrrrrrrr#sv

	








	 

	
c@seZdZdZeZdZdS)rzPurePath 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.
    rN)rBrCrDrE_posix_flavourrrrrrrrsc@seZdZdZeZdZdS)rzPurePath 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.
    rN)rBrCrDrE_windows_flavourrrrrrrrsc@seZdZdZdZddZddddZdd	Zd
dZdd
Z	ddZ
deddZdfddZe
ddZe
ddZddZddZddZd d!Zd"d#Zdgd%d&Zd'd(Zd)d*Zd+d,Zdhd/d0Zd1d2Zdid3d4Zd5d6Zdjd7d8Zdkd:d;Zdld<d=Zd>d?Z d@dAZ!dmdBdCZ"dDdEZ#dFdGZ$dHdIZ%dJdKZ&dndLdMZ'dNdOZ(dPdQZ)dRdSZ*dTdUZ+dVdWZ,dXdYZ-dZd[Z.d\d]Z/d^d_Z0d`daZ1dbdcZ2dS)oraPurePath 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.
    )r_closedcOsL|tkrtjdkrtnt}|j|dd}|jjs@td|j	f|
|S)NrIFrz$cannot instantiate %r on your system)rr{rrrrrrrrBr)rrkwargsr+rrrrszPath.__new__NcCs"d|_|dk	r|j|_nt|_dSr)r.r_normal_accessor)r+templaterrrrs
z
Path._initcCs|j|g}||j|j|Sr')rrrr)r+r<r8rrrrszPath._make_child_relpathcCs|jr||Sr')r.
_raise_closedr*rrr	__enter__szPath.__enter__cCs
d|_dS)NT)r.)r+tvtbrrr__exit__sz
Path.__exit__cCstddS)NzI/O operation on closed path)rr*rrrr3szPath._raise_closedcCs|j|||Sr')rr)r+rflagsrrrr_openerszPath._openercCs|jr||j|||S)zm
        Open the file pointed by this path and return a file descriptor,
        as os.open() does.
        )r.r3rr)r+r:rrrr	_raw_openszPath._raw_opencCs|tS)zjReturn a new path pointing to the current working directory
        (as returned by os.getcwd()).
        )r{rrrrrcwdszPath.cwdcCs||jdS)zrReturn a new path pointing to the user's home directory (as
        returned by os.path.expanduser('~')).
        N)rrr>rrrhomesz	Path.homecCsB|}z|}Wntk
r2t|}YnXtj||S)zoReturn whether other_path is the same or not as this file
        (as returned by os.path.samefile()).
        )rrr{rwsamestat)r+Z
other_pathstZother_strrrsamefilesz
Path.samefileccsH|jr||j|D](}|dkr(q||V|jr|qdS)zyIterate over the files in this directory.  Does not yield any
        result for the special paths '.' and '..'.
        >r...N)r.r3rrrrrrriterdir
szPath.iterdirccs`|std||j|f\}}}|s.|r6tdtt||j}||D]
}|VqPdS)zIterate over this subtree and yield all existing files (of any
        kind, including directories) matching the given relative pattern.
        zUnacceptable pattern: {!r}%Non-relative patterns are unsupportedN)rrrr>rrrrr+rkr9r:rZselectorr`rrrglobsz	Path.globccsR|j|f\}}}|s|r$tdtdt||j}||D]
}|VqBdS)zRecursively yield all existing files (of any kind, including
        directories) matching the given relative pattern, anywhere in
        this subtree.
        rF)rN)rr>rrrrrGrrrrglob%sz
Path.rglobcCsD|jr||r|S|jtg|jdd}|j|d|S)aReturn an absolute version of this path.  This function works
        even if the path doesn't point to anything.

        No normalization is done, i.e. all '.' and '..' will be kept along.
        Use resolve() to get the canonical path to a file.
        Fr/)r2)r.r3rrr{rrr)r+objrrrabsolute1sz
Path.absoluteFc
Cs|jr|dd}z|jj||d}Wn,tk
rV}z||W5d}~XYnX||f}|sz|Wn*tk
r}z||W5d}~XYnX|S)z
        Make the path absolute, resolving all symlinks on the way and also
        normalizing it (for example turning slashes into backslashes under
        Windows).
        cSs0t|dd}|jtks|tkr,td|jdS)NrrzSymlink loop from %r)rrr_WINERROR_CANT_RESOLVE_FILENAMEr~filename)rrrrrcheck_eloopLsz!Path.resolve.<locals>.check_eloop)strictN)r.r3rrrrr)r+rOrNr_rr`rrrresolveCszPath.resolvecCs|j|S)zh
        Return the result of the stat() system call on this path, like
        os.stat() does.
        )rrr*rrrrasz	Path.statcCsddl}||jjS)z:
        Return the login name of the file owner.
        rN)rrrst_uidZpw_name)r+rrrrownerhsz
Path.ownercCsddl}||jjS)z8
        Return the group name of the file gid.
        rN)grpZgetgrgidrst_gidZgr_name)r+rSrrrgrouposz
Path.grouprrQc	Cs(|jr|tj|||||||jdS)z|
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        )Zopener)r.r3iorr;)r+r	bufferingencodingerrorsnewlinerrrrvs
z	Path.openc
Cs,|jdd}|W5QRSQRXdS)zK
        Open the file in bytes mode, read it, and close the file.
        rbrNrreadrrrr
read_bytesszPath.read_bytesc
Cs0|jd||d}|W5QRSQRXdS)zJ
        Open the file in text mode, read it, and close the file.
        rVrrYrZNr^)r+rYrZrrrr	read_textszPath.read_textc
Cs6t|}|jdd}||W5QRSQRXdS)zO
        Open the file in bytes mode, write to it, and close the file.
        wbr]N)
memoryviewrwrite)r+dataZviewrrrrwrite_bytesszPath.write_bytesc
CsLt|tstd|jj|jd||d}||W5QRSQRXdS)zN
        Open the file in text mode, write to it, and close the file.
        zdata must be str, not %swraN)rrrrrBrre)r+rfrYrZrrrr
write_texts
zPath.write_textTcCsr|jr||r>z|j|dWntk
r8YnXdStjtjB}|sX|tjO}|	||}t
|dS)zS
        Create this file with the given access mode, if it doesn't exist.
        N)r.r3rrrr{O_CREATO_WRONLYO_EXCLr=close)r+rexist_okr:fdrrrtouchs
z
Path.touchcCs|jr|z|j||Wndtk
rd|r>|j|kr@|jjddd|j|d|dYn"tk
r|r~|sYnXdS)z<
        Create a new directory at this given path.
        T)r'rnFN)r.r3rrFileNotFoundErrorr&rr)r+rr'rnrrrrsz
Path.mkdircCs |jr||j||dS)zF
        Change the permissions of the path, like os.chmod().
        N)r.r3rrr+rrrrrsz
Path.chmodcCs |jr||j||dS)z
        Like chmod(), except if the path points to a symlink, the symlink's
        permissions are changed, rather than its target's.
        N)r.r3rrrrrrrrszPath.lchmodcCs>|jr|z|j|Wntk
r8|s4YnXdS)zd
        Remove this file or link.
        If the path is a directory, use rmdir() instead.
        N)r.r3rrrq)r+Z
missing_okrrrrszPath.unlinkcCs|jr||j|dS)zF
        Remove this directory.  The directory must be empty.
        N)r.r3rrr*rrrrsz
Path.rmdircCs|jr||j|S)z
        Like stat(), except if the path points to a symlink, the symlink's
        status information is returned, rather than its target's.
        )r.r3rrr*rrrrsz
Path.lstatcCs&|jr||j||||S)a2
        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.
        )r.r3rrrrrrrrs
zPath.renamecCs&|jr||j||||S)aS
        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.
        )r.r3rr1rrrrrr1
s
zPath.replacecCs"|jr||j|||dS)z
        Make this path a symlink pointing to the target path.
        Note the order of arguments (link, target) is the reverse of os.symlink.
        N)r.r3rr)r+rrrrr
symlink_toszPath.symlink_tocCs |jr||j||dS)aQ
        Make the target path a hard link pointing to this path.

        Note this function does not make this path a hard link to *target*,
        despite the implication of the function and argument names. The order
        of arguments (target, link) is the reverse of Path.symlink_to, but
        matches that of os.link.

        N)r.r3rrrrrrr"s
zPath.link_toc
CsXz|WnFtk
r>}zt|s(WYdSd}~XYntk
rRYdSXdS)z+
        Whether this path exists.
        FNT)rrr rr+rrrrr2szPath.existsc
Cs\zt|jWStk
rB}zt|s,WYdSd}~XYntk
rVYdSXdS)z3
        Whether this path is a directory.
        FN)r	rst_moderr rrtrrrrAszPath.is_dirc
Cs\zt|jWStk
rB}zt|s,WYdSd}~XYntk
rVYdSXdS)zq
        Whether this path is a regular file (also True for symlinks pointing
        to regular files).
        FN)rrrurr rrtrrris_fileQszPath.is_filecCsv|r|sdSt|j}z|j}Wntk
rBYdSX|j}||krZdS|j}|j}||kS)z;
        Check if this path is a POSIX mount point
        FT)rrrr&rst_devrst_ino)r+r&Z
parent_devZdevZinoZ
parent_inorrris_mountbs



z
Path.is_mountc
Cs\zt|jWStk
rB}zt|s,WYdSd}~XYntk
rVYdSXdS)z7
        Whether this path is a symbolic link.
        FN)r
rrurr rrtrrrrwszPath.is_symlinkc
Cs\zt|jWStk
rB}zt|s,WYdSd}~XYntk
rVYdSXdS)z6
        Whether this path is a block device.
        FN)r
rrurr rrtrrris_block_deviceszPath.is_block_devicec
Cs\zt|jWStk
rB}zt|s,WYdSd}~XYntk
rVYdSXdS)z:
        Whether this path is a character device.
        FN)rrrurr rrtrrris_char_deviceszPath.is_char_devicec
Cs\zt|jWStk
rB}zt|s,WYdSd}~XYntk
rVYdSXdS)z.
        Whether this path is a FIFO.
        FN)rrrurr rrtrrris_fifoszPath.is_fifoc
Cs\zt|jWStk
rB}zt|s,WYdSd}~XYntk
rVYdSXdS)z0
        Whether this path is a socket.
        FN)rrrurr rrtrrr	is_socketszPath.is_socketcCs`|js\|js\|jr\|jddddkr\|j|jddd}||g|jddS|S)zl Return a new path with expanded ~ and ~user constructs
        (as returned by os.path.expanduser)
        rNr?~)rrrrrr)r+ZhomedirrrrrszPath.expanduser)N)r9)r<)F)rVrQNNN)NN)NN)r9T)r<FF)F)F)3rBrCrDrErrrrr4r8r3r;r=r*r?r@rCrErHrIrKrPrrRrUrr`rbrgrirprrrrrrrr1rsrrrrvryrrzr{r|r}rrrrrrsj









	



	

	
	c@seZdZdZdZdS)rzsPath subclass for non-Windows systems.

    On a POSIX system, instantiating a Path should return this object.
    rN)rBrCrDrErrrrrrsc@s,eZdZdZdZddZddZddZd	S)
rzqPath subclass for Windows systems.

    On a Windows system, instantiating a Path should return this object.
    rcCstddS)Nz*Path.owner() is unsupported on this systemrr*rrrrRszWindowsPath.ownercCstddS)Nz*Path.group() is unsupported on this systemrr*rrrrUszWindowsPath.groupcCstddS)Nz-Path.is_mount() is unsupported on this systemrr*rrrryszWindowsPath.is_mountN)rBrCrDrErrRrUryrrrrrs
)@rf	functoolsrWrr{rrdr5_collections_abcrrrrrrroperatorrrr	r
rrr
rrZurllib.parserruZsupports_symlinks__all__Z_WINERROR_NOT_READYZ_WINERROR_INVALID_NAMErLrrr r%rr&rFrr-r,rrr1rrrrrrrrrrPathLikeregisterrrrrrrrrr<module>sz$	?
98
,t

'