a Z^c@sbddlZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z m Z mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkrddlZe dd d krdd lm!Z!qd ZdZ!ndZgd Z"e e eefZ#dZ$ddZ%ddZ&Gddde'Z(Gddde(Z)Gddde(Z*e)Z+e*Z,GdddZ-Gddde-Z.e.Z/ddZ0e1edre2e0Z0Gd d!d!Z3Gd"d#d#Z4Gd$d%d%e3Z5Gd&d'd'e3Z6Gd(d)d)e3Z7Gd*d+d+e Z8Gd,d-d-e'Z9ej:;e9Gd.d/d/e9ZGd4d5d5e>e<Z?Gd6d7d7e>e=Z@dS)8N)Sequence)EINVALENOENTENOTDIREBADFELOOP) attrgetter)S_ISDIRS_ISLNKS_ISREGS_ISSOCKS_ISBLKS_ISCHRS_ISFIFO)quote_from_bytesTnt)ir)_getfinalpathnameF)PurePath PurePosixPathPureWindowsPathPath PosixPath WindowsPath)iicCs t|ddtvpt|ddtvS)NerrnoZwinerror)Zgetattr_IGNORED_ERROS_IGNORED_WINERRORS)Z exceptionr/usr/lib64/python3.9/pathlib.py _ignore_error-srcCsd|vpd|vpd|vS)NZ*z?z[r)patrrr_is_wildcard_pattern2r c@s(eZdZdZddZddZddZdS) _FlavourzPA flavour implements a particular (platform-specific) set of path semantics.cCs|jj|_dSN)sepjoinselfrrr__init__<z_Flavour.__init__c Csg}|j}|j}d}}t|}|D]}|s.q$|r>|||}||\}}} || vrt| |D] } | rd| dkrd|t| qdn| r| dkr|t| |s|r$|s|D]0}|sq|r|||}||d}|rqqqq$|s|r|||| |||fS)N.r) r$altsepreversedreplace splitrootsplitappendsysZinternZreverse) r'partsZparsedr$r,drvrootZitpartZrelZxrrr parse_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'r4r5r3Zdrv2Zroot2Zparts2rrrjoin_parsed_partsesz_Flavour.join_parsed_partsN)__name__ __module__ __qualname____doc__r(r7r:rrrrr"8s&r"c@seZdZdZdZdZeZej dkZ e dZ dZ hddd ed d DBd d ed d DBZefd dZddZddZddZd#ddZe fddZddZddZddZd d!Zd"S)$_WindowsFlavour\/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\>ZPRNZAUXZNULZCONcCh|] }d|qS)zCOM%dr.0irrr z_WindowsFlavour.r8i cCrB)zLPT%drrCrrrrFrGc Cs\|dd}|dd}||krP||krP||\}}|dd}|dd}nd}|dd}||kr||kr||kr||d}|dkr|||d}||dkr|dkrt|}|r||d||||ddfS|d||||ddfSd} } |dkr6||jvr6|dd} |dd}|}||krN|} ||}|| | |fS)Nrr8rr*:)_split_extended_pathZfindlen drive_letterslstrip) r'r6r$ZfirstZsecondprefixZthirdZindexZindex2r4r5rrrr/s6      "    z_WindowsFlavour.splitrootcCs|Sr#Zlowerr'srrrr9r)z_WindowsFlavour.casefoldcCsdd|DS)NcSsg|] }|qSrrP)rDprrr rGz2_WindowsFlavour.casefold_parts..rr'r3rrrcasefold_partsr)z_WindowsFlavour.casefold_partscCstt|tjjSr#)recompilefnmatch translateZ IGNORECASE fullmatchr'patternrrrcompile_patternr)z_WindowsFlavour.compile_patternFcCst|}|stSd}tdur|r2|t|Sg}z|t|}Wn@ty|}tj|\}}||||kr|YSYq60tjj |gt |RSq6dSr#) strosgetcwdr_ext_to_normalFileNotFoundErrorpathr0r1r%r-)r'rdstrictrRZ previous_sZ tail_partsZtailrrrresolves$  z_WindowsFlavour.resolvecCsXd}||rP|dd}|dd}|drP||dd7}d|dd}||fS)Nr*izUNC\rHr@) startswith)r'rRZ ext_prefixrOrrrrKs    z$_WindowsFlavour._split_extended_pathcCs||dSNr8)rKrQrrrrbz_WindowsFlavour._ext_to_normalcCs6|sdS|ddrdS|ddd|jvS)NFrz\\rIr+)rgZ partitionZupperreserved_namesrUrrr is_reserveds z_WindowsFlavour.is_reservedcCsd|j}t|dkrJ|ddkrJ|ddd}d|t|dfSdt|dSdS)Nrr8rJrAz file:///%s/%szutf-8zfile:)driverLas_posixrNurlquote_from_bytesZencode)r'rdrlrestrrrmake_urisz_WindowsFlavour.make_uricCsdtjvrtjd}nHdtjvrVztjd}WntyDd}Yn0|tjd}ntd|rtjd|kr||f\}}}|dtjdkrtd|||d<|s|r||||d d}n ||}|S) NZ USERPROFILEZHOMEPATHZ HOMEDRIVEr*zCan't determine home directoryZUSERNAMErI%Can't determine home directory for %rr8)r`environKeyError RuntimeErrorr7r%)r'usernameZuserhomer4r5r3rrr gethomedirs*      z_WindowsFlavour.gethomedirNF)r;r<r=r$r,has_drvntpathpathmodr`name is_supportedsetrMZext_namespace_prefixZrangerjr/r9rVr^rfrKrbrkrprvrrrrr?ws.  '    r?c@sleZdZdZdZdZeZej dkZ efddZ ddZ d d Z d d Zdd dZddZddZddZdS) _PosixFlavourrAr*FrcCsV|rH|d|krH||}t|t|dkr._resolver*)r$ _accessor is_absoluter`rar_)r'rdreZbaserrrrf<s &z_PosixFlavour.resolvecCsdSNFrrUrrrrkir)z_PosixFlavour.is_reservedcCst|}dt|S)Nzfile://)Zbytesrn)r'rdZbpathrrrrplsz_PosixFlavour.make_uricCsx|s>z tjdWSty:ddl}|tjYS0n6ddl}z||jWStyrtd|Yn0dS)NZHOMErrq) r`rrrspwdgetpwuidZgetuidZpw_dirZgetpwnamrt)r'rurrrrrvrs   z_PosixFlavour.gethomedirNrw)r;r<r=r$r,rx posixpathrzr`r{r|r/r9rVr^rfrkrprvrrrrr~s   -r~c@seZdZdZdS) _AccessorzjAn accessor implements a particular (system-specific or not) way of accessing paths on the filesystem.N)r;r<r=r>rrrrrsrc@seZdZejZejZejZejZejZej Z e edr>ej Z nddZ ej Z ej Z e edrdejZn eddZejZejZejZererejZqddZn ed dZejZd d Zd d ZddZdS)_NormalAccessorlchmodcC tddS)Nz%lchmod() not available on this systemNotImplementedError)r'Zpathobjmoderrrrr)z_NormalAccessor.lchmodlinkcCr)Nz&os.link() not available on this systemrr'rrrrlink_toriz_NormalAccessor.link_tocCr)Nz&symlink() not available on this systemraZbtarget_is_directoryrrrsymlinkr)z_NormalAccessor.symlinkcCs t||Sr#)r`rrrrrrricCs t|Sr#)r`rr'rdrrrrr)z_NormalAccessor.readlinkcC>zddl}|||jjWSty8tdYn0dS)Nrz*Path.owner() is unsupported on this system)rrstatZst_uidZpw_name ImportErrorr)r'rdrrrrowner  z_NormalAccessor.ownercCr)Nrz*Path.group() is unsupported on this system)grpZgetgrgidrZst_gidZgr_namerr)r'rdrrrrgrouprz_NormalAccessor.groupN)r;r<r=r`rlstatopenlistdirscandirchmodhasattrrmkdirunlinkrrZ staticmethodrmdirrenamer.rsupports_symlinksrutimerrrrrrrrs8     rcCsR|d}|dd}|dkr"t}n$d|vr4tdnt|rBt}nt}||||S)Nrr8**z:Invalid pattern: '**' can only be an entire path component)_RecursiveWildcardSelector ValueErrorr _WildcardSelector_PreciseSelector) pattern_partsflavourr child_partsclsrrr_make_selectors  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_direxistsrrZiter _select_from)r' parent_pathZpath_clsrrrrrr select_fromsz_Selector.select_fromN)r;r<r=r>r(rrrrrrs rc@seZdZddZdS)rccs |VdSr#r)r'rrrrrrrrr)z!_TerminatingSelector._select_fromN)r;r<r=rrrrrrsrc@eZdZddZddZdS)rcCs||_t|||dSr#)r{rr()r'r{rrrrrr( sz_PreciseSelector.__init__ccsZz@||j}|jr|n||r>|j||||D] }|Vq2WntyTYdS0dSr#)_make_child_relpathr{rrrPermissionError)r'rrrrrdrSrrrrs   z_PreciseSelector._select_fromNr;r<r=r(rrrrrrrc@r)rcCs|||_t|||dSr#)r^matchrr(r'rrrrrrr(s z_WildcardSelector.__init__c csz||}t|}Wdn1s(0Y|D]}|jrz|sNWq6Wn:ty}z"t|sjWYd}~q6WYd}~n d}~00|j} || r6|| } |j | |||D] } | Vqq6Wnt yYdS0dSr#) listrrrrr{rrrrr) r'rrrr scandir_itentriesentryrr{rdrSrrrrs& &"   z_WildcardSelector._select_fromNrrrrrrrrc@s$eZdZddZddZddZdS)rcCst|||dSr#)rr(rrrrr(9r)z#_RecursiveWildcardSelector.__init__c cs|Vz||}t|}Wdn1s.0Y|D]v}d}z |}Wn.ty~}zt|sjWYd}~n d}~00|r<|s<||j} || ||D] } | Vqq)formatrr;r&rrr__repr__{r)z_PathParents.__repr__N) r;r<r=r> __slots__r(rrrrrrrrcs rc@seZdZdZdZddZddZeddZed\d d Z ed]d d Z eddZ ddZ ddZ ddZddZddZddZddZddZed d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zeed0d1d2Zeed3d4d2Zed5d6Z ed7d8Z!ed9d:Z"ed;d<Z#ed=d>Z$d?d@Z%dAdBZ&dCdDZ'dEdFZ(dGdHZ)edIdJZ*dKdLZ+dMdNZ,dOdPZ-edQdRZ.edSdTZ/dUdVZ0dWdXZ1dYdZZ2d[S)^ra|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$|turtjdkrtnt}||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. r)rr`r{rr _from_parts)rargsrrr__new__szPurePath.__new__cCs|jt|jfSr#) __class__tuplerr&rrr __reduce__r!zPurePath.__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`Zfspathr_r1 TypeErrorr_flavourr7)rrr3rrrr _parse_argss    zPurePath._parse_argsTcCs<t|}||\}}}||_||_||_|r8||Sr#)objectrrrrr_init)rrinitr'r4r5r3rrrrs zPurePath._from_partscCs,t|}||_||_||_|r(||Sr#)rrrrrr)rr4r5r3rr'rrrrs zPurePath._from_parsed_partscCs4|s|r$|||j|ddS|j|SdSrh)rr%)rr4r5r3rrr_format_parsed_partsszPurePath._format_parsed_partscCdSr#rr&rrrrrizPurePath._initcCs@||\}}}|j|j|j|j|||\}}}||||Sr#)rrr:rrrr)r'rr4r5r3rrr _make_childs  zPurePath._make_childcCs@z|jWSty:||j|j|jp,d|_|jYS0dS)z[Return the string representation of the path, suitable for passing to system calls.r+N)rAttributeErrorrrrrr&rrr__str__s  zPurePath.__str__cCt|Sr#)r_r&rrr __fspath__r)zPurePath.__fspath__cCs|j}t||jdS)zNReturn the string representation of the path with forward (/) slashes.rA)rr_r.r$r'frrrrmszPurePath.as_posixcCs t|S)zaReturn the bytes representation of the path. This is only recommended to use under Unix.)r`Zfsencoder&rrr __bytes__r!zPurePath.__bytes__cCsd|jj|S)Nz{}({!r}))rrr;rmr&rrrrr)zPurePath.__repr__cCs|std|j|S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI)rrrrpr&rrras_uriszPurePath.as_uricCs6z|jWSty0|j|j|_|jYS0dSr#)rrrrVrr&rrr_cpartss  zPurePath._cpartscCs&t|tstS|j|jko$|j|juSr#)rrNotImplementedrrr'otherrrr__eq__s zPurePath.__eq__cCs6z|jWSty0tt|j|_|jYS0dSr#)rrZhashrrr&rrr__hash__s  zPurePath.__hash__cCs&t|tr|j|jurtS|j|jkSr#rrrrrrrrr__lt__zPurePath.__lt__cCs&t|tr|j|jurtS|j|jkSr#rrrrr__le__rzPurePath.__le__cCs&t|tr|j|jurtS|j|jkSr#rrrrr__gt__rzPurePath.__gt__cCs&t|tr|j|jurtS|j|jkSr#rrrrr__ge__rzPurePath.__ge__cC|Sr#r)rrrrr__class_getitem__"r)zPurePath.__class_getitem__rz.The drive prefix (letter or UNC path), if any.)ZdocrzThe root of the path, if any.cCs|j|j}|S)z/The concatenation of the drive and root, or ''.)rr)r'anchorrrrr+ zPurePath.anchorcCs.|j}t||js|jrdndkr&dS|dS)z!The final path component, if any.r8rr*rI)rrLrrrUrrrr{1sz PurePath.namecCsD|j}|d}d|kr,t|dkr.r8N)r{ZendswithrNr0r'r{rrrsuffixesGs   zPurePath.suffixescCsD|j}|d}d|kr,t|dkrrrr classmethodrrrrrrrrrmrrrZpropertyrrrrrrrrrrlr5rr{r r r rrrrrr3rrrrrrrkrrrrrrs|             !    rc@eZdZdZeZdZdS)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)r;r<r=r>_posix_flavourrrrrrrrrc@r)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)r;r<r=r>_windows_flavourrrrrrrrrrc@seZdZdZdZddZddddZdd Zd d Zd d Z deddZ dfddZ e ddZ e ddZddZddZddZddZd d!Zdgd#d$Zd%d&Zd'd(Zd)d*Zdhd-d.Zd/d0Zdid1d2Zd3d4Zdjd5d6Zd7d8Zdkd:d;Zdldd?Z d@dAZ!dmdBdCZ"dDdEZ#dFdGZ$dHdIZ%dJdKZ&dLdMZ'dndNdOZ(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. )rcOsL|turtjdkrtnt}|j|dd}|jjs@td|j f| |S)NrFrz$cannot instantiate %r on your system) rr`r{rrrrr|rr;r)rrZkwargsr'rrrr)sz Path.__new__NcCs|dur|j|_nt|_dSr#)r_normal_accessor)r'templaterrrr3s z Path._initcCs|j|g}||j|j|Sr#)rrrr)r'r6r3rrrr<rzPath._make_child_relpathcCrr#rr&rrr __enter__Br)zPath.__enter__cCrr#r)r'ZtZvZtbrrr__exit__Es z Path.__exit__cCs|j|||Sr#rr)r'r{flagsrrrr_openerPriz Path._openercCs|j|||S)zm Open the file pointed by this path and return a file descriptor, as os.open() does. r')r'r(rrrr _raw_openTzPath._raw_opencCs |tS)zjReturn a new path pointing to the current working directory (as returned by os.getcwd()). )r`rarrrrcwd]r,zPath.cwdcCs||jdS)zrReturn a new path pointing to the user's home directory (as returned by os.path.expanduser('~')). N)rrvr-rrrhomedr,z Path.homecCsB|}z |}Wnty2|j|}Yn0tj||S)zoReturn whether other_path is the same or not as this file (as returned by os.path.samefile()). )rrrr`rdZsamestat)r'Z other_pathZstZother_strrrsamefileks   z Path.samefileccs,|j|D]}|dvrq ||Vq dS)zyIterate over the files in this directory. Does not yield any result for the special paths '.' and '..'. >r+rN)rrrr rrriterdirvsz Path.iterdirccsntd|||s td||j|f\}}}|s<|rDtdtt||j}| |D] }|Vq^dS)zIterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern. zpathlib.Path.globzUnacceptable pattern: {!r}%Non-relative patterns are unsupportedN) r2auditrrrr7rrrrr'r]r4r5rZselectorrSrrrglobsz Path.globccs`td|||j|f\}}}|s*|r2tdtdt||j}||D] }|VqPdS)zRecursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree. zpathlib.Path.rglobr2)rN)r2r3rr7rrrrr4rrrrglobsz Path.rglobcCs6|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!r#)rrr`rarr)r'objrrrabsolutes  z Path.absoluteFcCsZ|jj||d}|dur,|t|}|jj|}|j|fdd}|j|d|S)z Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows). )reNFr!r7) rrfrr_r9rzZnormpathrr)r'rerRZnormedr8rrrrfs  z Path.resolvecC |j|S)zh Return the result of the stat() system call on this path, like os.stat() does. )rrr&rrrrr,z Path.statcCr:)z: Return the login name of the file owner. )rrr&rrrrz Path.ownercCr:)z8 Return the group name of the file gid. )rrr&rrrrr;z Path.grouprrIc Cstj|||||||jdS)z| Open the file pointed by this path and return a file object, as the built-in open() function does. )Zopener)iorr))r'rZ bufferingencodingerrorsZnewlinerrrrsz Path.opencCs8|jdd}|WdS1s*0YdS)zK Open the file in bytes mode, read it, and close the file. ZrbrNrZreadrrrr read_bytesszPath.read_bytescCs<|jd||d}|WdS1s.0YdS)zJ Open the file in text mode, read it, and close the file. r<rr>r?NrA)r'r>r?rrrr read_textszPath.read_textcCsBt|}|jdd}||WdS1s40YdS)zO Open the file in bytes mode, write to it, and close the file. Zwbr@N)Z memoryviewrwrite)r'dataZviewrrrr write_bytesszPath.write_bytescCsXt|tstd|jj|jd||d}||WdS1sJ0YdS)zN Open the file in text mode, write to it, and close the file. zdata must be str, not %sZwrCN)rr_rrr;rrE)r'rFr>r?rrrr write_texts  zPath.write_textcCs,|j|}|j|fdd}|j|d|S)zD Return the path to which the symbolic link points. Fr!r7)rrrr)r'rdr8rrrrs  z Path.readlinkTcCsb|r.z|j|dWnty(Yn0dStjtjB}|sH|tjO}|||}t|dS)zS Create this file with the given access mode, if it doesn't exist. N) rrrr`ZO_CREATZO_WRONLYZO_EXCLr+Zclose)r'rexist_okr(Zfdrrrtouchs    z Path.touchcCsxz|j||Wn`tyT|r.|j|kr0|jjddd|j|d|dYn tyr|rl|snYn0dS)z< Create a new directory at this given path. T)rrIFN)rrrcrrr)r'rrrIrrrrs   z Path.mkdircC|j||dS)zF Change the permissions of the path, like os.chmod(). N)rrr'rrrrr)r;z Path.chmodcCrK)z Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. N)rrrLrrrr/r,z Path.lchmodcCs.z|j|Wnty(|s$Yn0dS)zd Remove this file or link. If the path is a directory, use rmdir() instead. N)rrrc)r'Z missing_okrrrr6s  z Path.unlinkcCs|j|dS)zF Remove this directory. The directory must be empty. N)rrr&rrrrAr;z Path.rmdircCr:)z Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's. )rrr&rrrrGr,z Path.lstatcCrK)zE Create a hard link pointing to a path named target. N)rrrrrrrNr;z Path.link_tocC|j||||S)zx Rename this path to the given path, and return a new Path instance pointing to the given path. )rrrrrrrrTsz Path.renamecCrM)z Rename this path to the given path, clobbering the existing destination if it exists, and return a new Path instance pointing to the given path. )rr.rrrrrr.\sz Path.replacecCs|j|||dS)z Make this path a symlink pointing to the given path. Note the order of arguments (self, target) is the reverse of os.symlink's. N)rr)r'rrrrr symlink_toer,zPath.symlink_toc CsTz |WnBty<}zt|s&WYd}~dSd}~0tyNYdS0dS)z+ Whether this path exists. NFT)rrrrr'rrrrrns  z Path.existsc CXzt|jWSty@}zt|s*WYd}~dSd}~0tyRYdS0dS)z3 Whether this path is a directory. NF)rrst_moderrrrOrrrr} z Path.is_dirc CrP)zq Whether this path is a regular file (also True for symlinks pointing to regular files). NF)r rrQrrrrOrrris_files z Path.is_filecCsn|r|sdSz|jj}Wnty8YdS0|j}||krPdS|j}|jj}||kS)z; Check if this path is a POSIX mount point FT)rrrrZst_devrZst_ino)r'Z parent_devZdevZinoZ parent_inorrris_mounts    z Path.is_mountc CrP)z7 Whether this path is a symbolic link. NF)r rrQrrrrOrrrrs zPath.is_symlinkc CrP)z6 Whether this path is a block device. NF)r rrQrrrrOrrris_block_devicerRzPath.is_block_devicec CrP)z: Whether this path is a character device. NF)r rrQrrrrOrrris_char_devicerRzPath.is_char_devicec CrP)z. Whether this path is a FIFO. NF)rrrQrrrrOrrris_fiforRz Path.is_fifoc CrP)z0 Whether this path is a socket. NF)r rrQrrrrOrrr is_socketrRzPath.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) rNr8z~)rrrrrvr)r'Zhomedirrrr expandusers zPath.expanduserr#)r&)r*rw)r<rINNNNNrZ)r&T)r*FFrwrw)3r;r<r=r>rrrrr$r%r)r+rr.r/r0r1r5r6r9rfrrrrrBrDrGrHrrJrrrrrrrrr.rNrrrSrTrrUrVrWrXrYrrrrrsh                rc@seZdZdZdZdS)rzsPath subclass for non-Windows systems. On a POSIX system, instantiating a Path should return this object. rN)r;r<r=r>rrrrrr src@seZdZdZdZddZdS)rzqPath subclass for Windows systems. On a Windows system, instantiating a Path should return this object. rcCr)Nz-Path.is_mount() is unsupported on this systemrr&rrrrTr)zWindowsPath.is_mountN)r;r<r=r>rrTrrrrrsr)ArYZ functoolsr=ryr`rrWr2Z_collections_abcrrrrrrrZoperatorrrrr r r r r rZ urllib.parserrnrr{rZgetwindowsversionrZ__all__rrrr rr"r?r~r rrrr"rrrrrrrrrrZPathLikeZregisterrrrrrrrrrZsp  $   ?&fF  ,   t