403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/mercurial/__pycache__/windows.cpython-39.pyc
a

�+�bW�@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZmZmZmZmZzddlZejWney�ddlZYn0e�d�ZejZejZejZejZejZejZej Z ej!Z!ej"Z"ej#Z#ej$Z$ej%j&Z&ej'Z'ej(Z(dZ)Gd	d
�d
e*�Z+Gdd�de*�Z,dcdd�Z-ej.Z.dd�Z/dd�Z0Gdd�de*�Z1dd�Z2dd�Z3dd�Z4dd�Z5ddd d!�Z6d"d#�Z7d$d%�Z8d&d'�Z9d(d)�Z:d*d+�Z;d,d-�Z<d.d/�Z=e�>d0�Z?e�>d1�Z@d2d3�ZAejBjCZDejEZFd4d5�ZGd6d7�ZHdaIdaJd8d9�ZKd:d;�ZLd<d=�ZMd>d?�ZNd@dA�ZOejPejQhZRdBdC�ZSdedDdE�ZTdfdFdG�ZUdHdI�ZVdJdK�ZWdLdM�ZXdNdO�ZYdPdQ�ZZdRdS�Z[GdTdU�dUe*�Z\dgdVdW�Z]dXZ^dYdZ�Z_d[d\�Z`d]d^�Zad_d`�Zbdadb�ZcdS)h�)�absolute_importN�)�_)�getattr)�encoding�error�policy�pycompat�win32�osutil�c@s|eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)�mixedfilemodewrappera)Wraps a file handle when it is opened in read/write mode.

    fopen() and fdopen() on Windows have a specific-to-Windows requirement
    that files opened with mode r+, w+, or a+ make a call to a file positioning
    function when switching between reads and writes. Without this extra call,
    Python will raise a not very intuitive "IOError: [Errno 0] Error."

    This class wraps posixfile instances when the file is opened in read/write
    mode and automatically adds checks or inserts appropriate file positioning
    calls when necessary.
    rr�cCs t�|d|�t�|dd�dS)N�_fp�_lastopr)�object�__setattr__��self�fp�r�7/usr/lib64/python3.9/site-packages/mercurial/windows.py�__init__Jszmixedfilemodewrapper.__init__cCs|j��|S�N�r�	__enter__�rrrrrNs
zmixedfilemodewrapper.__enter__cCs|j�|||�dSr�r�__exit__)r�exc_typeZexc_valZexc_tbrrrrRszmixedfilemodewrapper.__exit__cCst|j|�Sr�rr�r�namerrr�__getattr__Usz mixedfilemodewrapper.__getattr__cCs|j�||�Sr)rr)rr"�valuerrrrXsz mixedfilemodewrapper.__setattr__cCs|j�dtj�dS)Nr)r�seek�os�SEEK_CURrrrr�	_noopseek[szmixedfilemodewrapper._noopseekcOs"t�|d|j�|jj|i|��S�Nr)rr�OPNONErr%�r�args�kwargsrrrr%^szmixedfilemodewrapper.seekcCs0|j|jkr|��t�|d|j�|j�|�Sr))r�OPREADr(rr�OPWRITEr�write)r�drrrr0bszmixedfilemodewrapper.writecOs6|j|jkr|��t�|d|j�|jj|i|��Sr))rr.Z
_noopeseekrrr/r�
writelinesr+rrrr2iszmixedfilemodewrapper.writelinescOs6|j|jkr|��t�|d|j�|jj|i|��Sr))rr/r(rrr.r�readr+rrrr3pszmixedfilemodewrapper.readcOs6|j|jkr|��t�|d|j�|jj|i|��Sr))rr/r(rrr.r�readliner+rrrr4wszmixedfilemodewrapper.readlinecOs6|j|jkr|��t�|d|j�|jj|i|��Sr))rr/r(rrr.r�	readlinesr+rrrr5~szmixedfilemodewrapper.readlinesN)�__name__�
__module__�__qualname__�__doc__r*r.r/rrrr#rr(r%r0r2r3r4r5rrrrr
9s r
c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�fdproxyzeWraps osutil.posixfile() to override the name attribute to reflect the
    underlying file name.
    cCs||_||_dSr)r"r)rr"rrrrr�szfdproxy.__init__cCs|j��|Srrrrrrr�s
zfdproxy.__enter__cCs|j�|||�dSrr)rr�	exc_value�	tracebackrrrr�szfdproxy.__exit__cCs
t|j�Sr)�iterrrrrr�__iter__�szfdproxy.__iter__cCst|j|�Srr r!rrrr#�szfdproxy.__getattr__N)	r6r7r8r9rrrr>r#rrrrr:�sr:�r���c
Cs�zLt�|||�}tjr t||�}d|vr6|�dtj�d|vrHt|�WS|WSt	y�}z(t
|jdt�
|�|jf��WYd}~n
d}~00dS)z/Open a file with even more POSIX-like semantics�ar�+z%s: %sN)r�	posixfiler	�ispy3r:r%r&�SEEK_ENDr
ZWindowsError�IOError�errnor�strfromlocal�strerror)r"�mode�	bufferingr�errrrrrC�s

�rCcCs$z
|��WStyYdS0dS�NF)�isatty�AttributeError)rrrr�_isatty�s
rPcCshd}t��}|dksJ|dkrqJ|dkr*t�|dkr@|dd�}q||}qt�d�t�d�t�|�S)z�Prompt for password with echo off, using Windows getch().

    This shouldn't be called directly- use ``ui.getpass()`` instead, which
    checks if the session is interactive first.
    ��
�
��Nr@)�msvcrtZgetwch�KeyboardInterruptZputwchr�
unitolocal)Zpw�crrr�get_password�s


rZc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	winstdoutz�Some files on Windows misbehave.

    When writing to a broken pipe, EINVAL instead of EPIPE may be raised.

    When writing too many bytes to a console at the same, a "Not enough space"
    error may happen. Python 3 already works around that.
    cCs||_tjot|�|_dSr)rr	rDrP�throttlerrrrr�szwinstdout.__init__cCst|j|�Sr)rr)r�keyrrrr#�szwinstdout.__getattr__cCs&z|j��Wnty Yn0dSr)r�closerFrrrrr^�szwinstdout.closec
Cs�zR|js|j�|�WSd}t|�}d}||krP||}|j�|||��|}q&WnNty�}z6|jdkrxt�|�sx�|��ttj	d��WYd}~n
d}~00dS)Ni�>r�Broken pipe)
r\rr0�lenrFrGr
�lasterrorwaspipeerrorr^�EPIPE)r�s�limit�l�start�end�instrrrr0�s
zwinstdout.writec
CsNz|j��WStyH}z$t�|�s(�ttjd��WYd}~n
d}~00dS)Nr_)r�flushrFr
rarGrb)rrhrrrris
zwinstdout.flushN)	r6r7r8r9rr#r^r0rirrrrr[�sr[cCsdS�NTrrrrr�
openhardlinks
srkcCs(|dd�}|ddkr$|dd�}|S)z<parses the output produced by patch and returns the filename�Nr�`rr@r)Zoutput_lineZpfrrr�parsepatchoutputsrncCspd|��vrdpd}|r$d||fp&|}|�d�s<|�d�rNt�td�|��t|�}|rld|t|�|f}|S)	z$Build argument list for ssh or Plinksplinks-Ps-ps%s@%s�-�/s9illegal ssh hostname or username starting with - or /: %ss%s %s %s)�lower�
startswithrZAbortr�
shellquote)Zsshcmd�host�user�portZpflagr,rrr�sshargss��rwcCsdSrr)�fre�xrrr�setflags(srzFcCsdSrr)�src�dstrJZenforcewritablerrr�copymode,sr}cCsdSrMr��pathrrr�	checkexec0sr�cCsdSrMrr~rrr�	checklink4sr�cCs2t|dd�}|dur.|�dkr.t�|�tj�dS)N�filenor)rrVZsetmoder&ZO_BINARY)�fdZfnorrr�	setbinary8sr�cCs|�tjd�S)Nrp)�replacer	�ossepr~rrr�pconvert@sr�cCs|�dd�S)Nrp�\)r�r~rrr�	localpathDsr�cCsttj�|��Sr)r�r&r�normpathr~rrrr�Hsr�cCs
t�|�Sr)r�upperr~rrr�normcaseLsr�s^[a-z]:z^[a-z]:cCshtj�|�}t|t�r>t�|�rd|dd���|dd�}n&t�|�rd|dd���|dd�}|S)Nrr)	r&r�abspath�
isinstance�bytes�
DRIVE_RE_B�matchr��
DRIVE_RE_S)rZabs_pathrrrr�Ts


r�cCsdSrMr)�s1�s2rrr�samestathsr�cs:t�fdd�dD��s�St�tjtj�d}d}d}t��}||k�r6�||d�}|dkr̈|dd	��t��}z&��d�}|d
�d	|�d
7}Wn&ty�||�7}|d}Yn0�n`|dk�rF�|dd	��t��}z��d�}Wn(t�y$|d�7}|d}Yn0�d	|�}|d|d7}�n�|dk�r��|d|d
�dk�r��|d
d	��t��}zN��d�}�d	|�}|�	|d�dk�r�|d|d7}n|d|d7}Wn(t�y�|d�7}|d}Yn0n�d}|d7}�||d�}|dk�rP||v�rP||7}|d7}�||d�}�q|�	|d�dk�rt|d|d7}n|d|7}|dk�r,|d8}n�|dk�r�|d|k�rЈ|d|d
�dv�r�|d7}n\|dk�r$|d|k�r$�|d|d
�dv�r$|�|d|d
�7}|d7}n||7}|d7}q@|S)a�Convert shell variables in the form $var and ${var} inside ``path``
    to %var% form.  Existing Windows style variables are left unchanged.

    The variables are limited to the given environment.  Unknown variables are
    left unchanged.

    >>> e = {b'var1': b'v1', b'var2': b'v2', b'var3': b'v3'}
    >>> # Only valid values are expanded
    >>> shelltocmdexe(b'cmd $var1 ${var2} %var3% $missing ${missing} %missing%',
    ...               e)
    'cmd %var1% %var2% %var3% $missing ${missing} %missing%'
    >>> # Single quote prevents expansion, as does \$ escaping
    >>> shelltocmdexe(b"cmd '$var1 ${var2} %var3%' \$var1 \${var2} \\", e)
    'cmd "$var1 ${var2} %var3%" $var1 ${var2} \\'
    >>> # $$ is not special. %% is not special either, but can be the end and
    >>> # start of consecutive variables
    >>> shelltocmdexe(b"cmd $$ %% %var1%%var2%", e)
    'cmd $$ %% %var1%%var2%'
    >>> # No double substitution
    >>> shelltocmdexe(b"$var1 %var1%", {b'var1': b'%var2%', b'var2': b'boom'})
    '%var1% %var1%'
    >>> # Tilde expansion
    >>> shelltocmdexe(b"~/dir ~\dir2 ~tmpfile \~/", {})
    '%USERPROFILE%/dir %USERPROFILE%\\dir2 ~tmpfile ~/'
    c3s|]}|�vVqdSrr)�.0rYr~rr�	<genexpr>��z shelltocmdexe.<locals>.<genexpr>s$'~s_-r�rr�'N�"�%�$r�{�}s${�~)r�rps
%USERPROFILE%r�)r�r�)
�anyr	Zsysbytes�string�
ascii_letters�digitsr`�index�
ValueError�get)r�env�varchars�resr��pathlenrY�varrr~r�
shelltocmdexels�






�
��
�
��

r�cCsPtdurt�d�atdur&t�d�ja|r@t|�s@t�|�s@|Sdt�d|�S)a�
    >>> shellquote(br'C:\Users\xyz')
    '"C:\\Users\\xyz"'
    >>> shellquote(br'C:\Users\xyz/mixed')
    '"C:\\Users\\xyz/mixed"'
    >>> # Would be safe not to quote too, since it is all double backslashes
    >>> shellquote(br'C:\\Users\\xyz')
    '"C:\\\\Users\\\\xyz"'
    >>> # But this must be quoted
    >>> shellquote(br'C:\\Users\\xyz/abc')
    '"C:\\\\Users\\\\xyz/abc"'
    Ns(\\*)("|\\$)s[^a-zA-Z0-9._:/-]s"%s"s\1\1\\\2)�_quotere�re�compile�_needsshellquote�search�sub�rcrrrrs�s
rscCs$|�d�r |�d�r |dd�S|S)Nr�rr@)rr�endswithr�rrr�_unquotesr�cCst�ttj|dd��S)z3Parse a command string in cmd.exe way (best-effort)F)�posix)r	Zmaplistr�Z
shlexsplitr�rrr�
shellsplitsr�cCsdSrjr��strrr�isownersr�cs�tj�dd�}dd�|���tj�D��tj�	|�d���vrFdg��fdd�}tj
|vrd||�Stj�d	d��tj�D]&}|tj�||��}|d
urz|Sqz|tj�tj�
|���S)a*Find executable for command searching like cmd.exe does.
    If command is a basename then PATH is searched for command.
    PATH isn't searched if command is an absolute or relative path.
    An extension from PATHEXT is found and added if not present.
    If command isn't found None is returned.sPATHEXTs.COM;.EXE;.BAT;.CMDcSsg|]}|�qSrr)r��extrrr�
<listcomp>#r�zfindexe.<locals>.<listcomp>rr�cs*�D] }||}tj�|�r|SqdS)z:Will append extension (if needed) and return existing fileN)r&r�exists)Zpathcommandr��
executable�Zpathextsrr�findexisting's

zfindexe.<locals>.findexistingsPATHN)r�environr�rq�splitr	Z	ospathsepr&r�splitextr��join�
expanduser�
expandvars)Zcommand�pathextr�rr�rr�r�findexes

r�c#s�i}tj�|D]�}t|�}tj�|�\}}|s2d}|�|d�}|dur�z�fdd�t|d�D�}Wn@ty�}z(|j	t	j
t	jt	jfvr��i}WYd}~n
d}~00|�
||�}|�|d�VqdS)z�Stat each file in files. Yield each stat, or None if a file
    does not exist or has a type we don't care about.

    Cluster and cache stat per directory to minimize number of OS stat calls.�.Ncs*i|]"\}}}�|j�tvrt|�|�qSr)�st_mode�_wantedkindsr�)r��n�krc�Zgetkindrr�
<dictcomp>Ks�zstatfiles.<locals>.<dictcomp>T)�stat�S_IFMTr�r&rr�r��listdir�OSErrorrG�ENOENT�EINVAL�ENOTDIR�
setdefault)�filesZdircacheZnf�dir�base�cacheZdmaprLrr�r�	statfiles<s&
�
r�cCs|st�t���SdS)ziReturn the name of the user with the given uid.

    If uid is None, return the name of the current user.N)r	�fsencode�getpass�getuser)�uidrrr�usernameZsr�cCsdS)zkReturn the name of the group with the given gid.

    If gid is None, return the name of the current group.Nr)�gidrrr�	groupnamecsr�c
CsPt�|�}zt�|�}Wn,tyD}zt|��WYd}~n
d}~00t�|�Sr)r	�fsdecoder&�readlinkr�rOr�)�pathnamer�link�errrr�js
r�c	Cs�t|�rdSt�|�tj�|�\}}|s:tj�|�\}}|r�|r�zt|�rRWdSt�|�WnttfyxYq�Yn0tj�|�\}}q:dS)z�special version of os.removedirs that does not remove symlinked
    directories or junction points if they actually contain filesN)r�r&�rmdirrr�r�r�)r"�head�tailrrr�
removedirsws

r�c
Cs\zt�||�WnFtyV}z.|jtjkr.�t|�t�||�WYd}~n
d}~00dS)z=atomically rename file src to dst, replacing dst if it existsN)r&�renamer�rGZEEXIST�unlink)r{r|r�rrrr��sr�cCs dd�tjgtjdd�D�S)NcSsg|]}t�|��qSr)rZ
strtolocal)r��argrrrr��r�zgethgcmd.<locals>.<listcomp>r)�sysr��argvrrrr�gethgcmd�sr�cCst�dSr)�KeyError)r"rrr�groupmembers�sr�cCsdSrMr)rxrrr�isexec�sr�c@seZdZdd�Zdd�ZdS)�	cachestatcCsdSrr)rrrrrr�szcachestat.__init__cCsdSrMrrrrr�	cacheable�szcachestat.cacheableN)r6r7r8rr�rrrrr��sr�c	Cs�|durtjtjf}nt|ttf�s*|f}|D]�}zht�|t�|���B}|rVt�|�pX|}t�	||�d}t�
|�Wd�WS1s�0YWq.ty�Yq.0q.dS)a)Look up a key/value name in the Windows registry.

    valname: value name. If unspecified, the default value for the key
    is used.
    scope: optionally specify scope for registry lookup, this can be
    a sequence of scopes to look up in order. Default (CURRENT_USER,
    LOCAL_MACHINE).
    Nr)�winreg�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINEr��list�tuple�OpenKeyrrHZQueryValueExrX�EnvironmentError)r]ZvalnameZscoperc�hkeyr"�valrrr�	lookupreg�s	2rTcCsdS)z(check whether a stat result is a symlinkFrr�rrr�
statislink�srcCsdS)z1check whether a stat result is an executable fileFrr�rrr�
statisexec�srcCs
t��dSr��NotImplementedError)Zfdsrrr�poll�srcCs:g}t�|�}|sq0|�|�}|s$q0|�|�qd�|�S)z$Read all available data from a pipe.r�)r
Zpeekpiper3�appendr�)�pipe�chunks�sizercrrr�readpipe�s

rcCstd��dS)Nzunsupported platformr)Zsockrrrr�bindunixsocket�sr)r?r@)NF)N)N)NN)dZ
__future__rrGr�rVr&r�r�r�r�Zi18nrr	rrQrrrr
Z_winregr�ZCloseKey�ImportErrorZ	importmodrZ
getvolumenameZgetfsmountpointZ	getfstyper�Z
hidewindowZmakedirZnlinksZoslinkZ
samedevice�samefileZsetsignalhandlerZ
spawndetachedrr�Ztestpidr��umaskrr
r:rCr�rPrZr[rkrnrwrzr}r�r�r�r�r�r�r�r�r�r�r�Z
normcasespecsr�ZnormcasespecZ
upperfallbackZnormcasefallbackr�r�r�r�rsr�r�r�r��S_IFREG�S_IFLNKr�r�r�r�r�r�r�r�r�r�r�rZexpandglobsrrrrrrrrr�<module>s�

M
2


}
	




Youez - 2016 - github.com/yon3zu
LinuXploit