__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

*�_i�4��B�SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J
r
 SrSrSr
\
R(+r\R \R"4Sjr\4SjrS	rS
r\"5rSqSrSr\"5r\R8\S
S.Sj5rSr0rSr Sr!Sr"g)�N�)�support�	localhostz	127.0.0.1z::1c��[R"X5n[U5nSSS5 AU$!,(df   AW$=f)aL
Returns an unused port that should be suitable for binding.  This is
achieved by creating a temporary socket with the same family and type as
the 'sock' parameter (default is AF_INET, SOCK_STREAM), and binding it to
the specified host address (defaults to 0.0.0.0) with the port set to 0,
eliciting an unused ephemeral port from the OS.  The temporary socket is
then closed and deleted, and the ephemeral port is returned.

Either this method or bind_port() should be used for any tests where a
server socket needs to be bound to a particular port for the duration of
the test.  Which one to use depends on whether the calling code is creating
a python socket, or if an unused port needs to be provided in a constructor
or passed to an external program (i.e. the -accept argument to openssl's
s_server mode).  Always prefer bind_port() over find_unused_port() where
possible.  Hard coded ports should *NEVER* be used.  As soon as a server
socket is bound to a hard coded port, the ability to run multiple instances
of the test simultaneously on the same host is compromised, which makes the
test a ticking time bomb in a buildbot environment. On Unix buildbots, this
may simply manifest as a failed test, which can be recovered from without
intervention in most cases, but on Windows, the entire python process can
completely and utterly wedge, requiring someone to log in to the buildbot
and manually kill the affected process.

(This is easy to reproduce on Windows, unfortunately, and can be traced to
the SO_REUSEADDR socket option having different semantics on Windows versus
Unix/Linux.  On Unix, you can't have two AF_INET SOCK_STREAM sockets bind,
listen and then accept connections on identical host/ports.  An EADDRINUSE
OSError will be raised at some point (depending on the platform and
the order bind and listen were called on each socket).

However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE
will ever be raised when attempting to bind two identical host/ports. When
accept() is called on each socket, the second caller's process will steal
the port from the first caller, leaving them both in an awkwardly wedged
state where they'll no longer respond to any signals or graceful kills, and
must be forcibly killed via OpenProcess()/TerminateProcess().

The solution on Windows is to use the SO_EXCLUSIVEADDRUSE socket option
instead of SO_REUSEADDR, which effectively affords the same semantics as
SO_REUSEADDR on Unix.  Given the propensity of Unix developers in the Open
Source world compared to Windows ones, this is a common mistake.  A quick
look over OpenSSL's 0.9.8g source shows that they use SO_REUSEADDR when
openssl.exe is called with the 's_server' option, for example. See
http://bugs.python.org/issue2550 for more info.  The following site also
has a very thorough description about the implications of both REUSEADDR
and EXCLUSIVEADDRUSE on Windows:
https://learn.microsoft.com/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse

XXX: although this approach is a vast improvement on previous attempts to
elicit unused ports, it rests heavily on the assumption that the ephemeral
port returned to us by the OS won't immediately be dished back out to some
other process when we close and delete our temporary socket but before our
calling code has a chance to bind the returned port.  We can deal with this
issue if/when we come across it.
N)�socket�	bind_port)�family�socktype�tempsock�ports    �1/usr/lib/python3.13/test/support/socket_helper.py�find_unused_portrs;��p
���v�	(�H���"��
)���K�
)�	(���K�s�.�
>c���UR[R:XGaUR[R:XGa[[S5(aHUR
[R[R5S:Xa[R"S5e[[S5(aJUR
[R[R5S:Xa[R"S5e[[S5(a/UR[R[RS5 URUS45 UR!5SnU$![a Nxf=f)a�Bind the socket to a free port and return the port number.  Relies on
ephemeral ports in order to ensure we are using an unbound port.  This is
important as many tests may be running simultaneously, especially in a
buildbot environment.  This method raises an exception if the sock.family
is AF_INET and sock.type is SOCK_STREAM, *and* the socket has SO_REUSEADDR
or SO_REUSEPORT set on it.  Tests should *never* set these socket options
for TCP/IP sockets.  The only case for setting these options is testing
multicasting via multiple UDP sockets.

Additionally, if the SO_EXCLUSIVEADDRUSE socket option is available (i.e.
on Windows), it will be set on the socket.  This will prevent anyone else
from bind()'ing to our host/port for the duration of the test.
�SO_REUSEADDR�zHtests should never set the SO_REUSEADDR socket option on TCP/IP sockets!�SO_REUSEPORTzHtests should never set the SO_REUSEPORT socket option on TCP/IP sockets!�SO_EXCLUSIVEADDRUSEr)r	r�AF_INET�type�SOCK_STREAM�hasattr�
getsockopt�
SOL_SOCKETrr�
TestFailedr�OSError�
setsockoptr�bind�getsockname)�sock�hostrs   r
rrQs&���{�{�f�n�n�$����f�6H�6H�)H��6�>�*�*����v�0�0�&�2E�2E�F�!�K��(�(�*;�<�<��6�>�*�*�	
��?�?�6�#4�#4�f�6I�6I�J�a�O�!�,�,�.?�@�@�P��6�0�1�1��O�O�F�-�-�v�/I�/I�1�M��I�I�t�Q�i������a� �D��K���
��	
�s�2AE'�'
E4�3E4c���UR[R:XdeURU5 g![a' UR5 [R"S5ef=f)zBBind a unix socket, raising SkipTest if PermissionError is raised.zcannot bind AF_UNIX socketsN)r	r�AF_UNIXr�PermissionError�close�unittest�SkipTest)r�addrs  r
�bind_unix_socketr(xsR���;�;�&�.�.�(�(�(�?��	�	�$����?��
�
����� =�>�>�?�s	�4�1A%c��[R(agSn[R"[R[R5nUR	[
S45 U(aUR
5 ggg![a Of=fU(aUR
5 g!U(aUR
5 ff=f)z+Check whether IPv6 is enabled on this host.NrTF)r�has_ipv6�AF_INET6rr�HOSTv6r$r)rs r
�_is_ipv6_enabledr-�s���
�����	��=�=����&�2D�2D�E�D��I�I�v�q�k�"����
�
������	��	�����
�
������
�
���s$�A
A>�>
B�B'�
B�B'�'Cc���[[S5(d[R"S5"U5$[cWSSKJnJn US-n[R"[R5nURU5 SqU"U5 SSS5 [(a%S[-n[R"U5"U5$U$![anUqSnANTSnAff=f!U"U5 f=f!,(df   Nf=f)	zCDecorator for tests requiring a functional bind() for unix sockets.r"zNo UNIX SocketsNr)�TESTFN�unlink�can_bind_unix_socketFz%Requires a functional unix bind(): %s)rrr%�skip�_bind_nix_socket_error�	os_helperr/r0r"rr)�testr/r0�pathr�e�msgs       r
�skip_unless_bind_unix_socketr9�s����6�9�%�%��}�}�.�/��5�5��%�-��.�.��
�]�]�6�>�>�
*�d�
��	�	�$��).�&��t��+���5�8N�N���}�}�S�!�$�'�'�����
+�)*�&��
+���t���+�
*�sB�*C(�,C�?C(�
C�C�C�C�C�
C%�%C(�(
C6c��[R/n[[S5(aUR[R5 [[S5(aUR[R
5 [[S5(aUR[R5 [(dUR[R5 U$)zf
Get the different socket error numbers ('errno') which can be received
when a connection is refused.
�ENETUNREACH�
EADDRNOTAVAIL�EHOSTUNREACH)	�errno�ECONNREFUSEDr�appendr;r<r=�IPV6_ENABLED�EAFNOSUPPORT)�errorss r
�get_socket_conn_refused_errsrD�s���
� � �
!�F��u�m�$�$��
�
�e�'�'�(��u�o�&�&�	�
�
�e�)�)�*��u�n�%�%��
�
�e�(�(�)��<��
�
�e�(�(�)��M��)�timeout�errnosc	#�8^^^
^# �SSKmU[La[Rn/SQn/SQn[R"SU-5mUm/m
T(dJUVVs/sHupV[[XV5PM snnmUVVs/sHupV[[XV5PM snnm
UUU
U4Sjn[R"5nUb[R"U5 Sv� [R"U5 gs snnfs snnf![axn	U	Rn
[U
5S:�a[U
S[5(aU
Sn	O.[U
5S:�a[U
S[5(aU
Sn	OOMiU"U	5 eSn	A	ff=f![R"U5 f=f7f)	z�Return a context manager that raises ResourceDenied when various issues
with the internet connection manifest themselves as exceptions.rN))r?�o)�
ECONNRESET�h)r=�q)r;�e)�	ETIMEDOUT�n)r<�c))�	EAI_AGAIN���)�EAI_FAIL���)�
EAI_NONAME���)�
EAI_NODATA���)�
WSANO_DATAi�*zResource %r is not availablec�T>�[USS5n[U[5(d�[U[R5(aUT;d�[UTR
R5(aSURs=::aS::d]O [UTR
R5(a0SUR;d&SUR;dSUR;dUT;aG[R(d/[RRTRSS-5 TUeg)	Nr>i�iW�ConnectionRefusedError�TimeoutError�EOFErrorr�
)�getattr�
isinstancer]r�gaierror�error�	HTTPError�code�URLError�reasonr�verbose�sys�stderr�write�args)�err�n�captured_errnos�denied�
gai_errnos�urllibs  ����r
�filter_error�(transient_internet.<locals>.filter_error�s�����C��$�'���s�L�)�)�
��V�_�_�
-�
-�!�z�/�
��V�\�\�3�3�
4�
4�
�C�H�H�
#��
#�
��V�\�\�2�2�
3�
3�+�s�z�z�9�!�S�Z�Z�/�����+�
�� ��?�?��
�
� � ����Q��$�!6�7��c�!�
!rErr)�urllib.error�_NOT_SETr�INTERNET_TIMEOUT�ResourceDeniedr`r>r�getdefaulttimeout�setdefaulttimeoutrrl�lenra)�
resource_namerGrH�default_errnos�default_gai_errnos�name�numrs�old_timeoutrm�arorprqrrs           @@@@r
�transient_internetr��s�������(���*�*��	�N����
#�
#�$B�]�$R�
S�F��O��J��.<�>�.<�{��#�5�$�4�.<�>��*<�=�);�+�4��f�d�0�);�=�
�
"�
"��*�*�,�K�.����$�$�W�-�
�(	� � ��-��Y>��=��.������A��1�v��{�z�!�A�$��8�8���d���Q��1���A�a�D�'�!:�!:���d����	�S��
����&	� � ��-�sO�AF�C.�1	F�:C4�"F�9C:�#F�:
E<�A3E7�7E<�<E?�?F�Fc�^�[R"SS[RRS9$)z�
Create a UNIX domain name: socket.bind() argument of a AF_UNIX socket.

Return a path relative to the current directory to get a short path
(around 27 ASCII characters).
�test_python_z.sock)�prefix�suffix�dir)�tempfile�mktemp�osr6�curdirrFrEr
�create_unix_domain_namer�s$���?�?�.��!�w�w�~�~�/�/rEc	�L�[U$![a Of=fSSU/n[R"U[R[R
SS9nUR(a?[R"SRU5<SUR35 S[U'gURn[UR55nOQ![aDn[R"SSRU5<S	U<S
U<35 S[U'SnAgSnAff=fU[U'U$)z!Get a sysctl value as an integer.�sysctlz-nT)�stdoutrj�text� z command failed with exit code NzFailed to parse z command output z: )�
_sysctl_cache�KeyError�
subprocess�run�PIPE�STDOUT�
returncoder�
print_warning�joinr��int�strip�	Exception)r�cmd�proc�output�value�excs      r
�_get_sysctlr�s ��
��T�"�"���
��
���T�4�
 �C��>�>�#�!+���!+�!2�!2�#�%�D����������#�� 1�2+�+/�?�?�*;�=�	>�#�
�d���
�[�[�F���F�L�L�N�#�������� 0����#��0A�B0�06�z��C�7�D�	E�#�
�d������ �M�$���Ls$��
��0C
�

D�:D�Dc�t�[RRS5(dg[S5nUcgUS:g$)N�freebsdFznet.inet.tcp.blackholer)ri�platform�
startswithr�)r�s r
�
tcp_blackholer�As9���<�<�"�"�9�-�-��
�0�1�E��}���Q�J�rEc�P�[R"[5S5nU"U5$)z4Decorator skipping test if TCP blackhole is enabled.z8TCP blackhole is enabled (sysctl net.inet.tcp.blackhole))r%�skipIfr�)r5�skip_ifs  r
�skip_if_tcp_blackholer�Ms$���o�o���B��G��4�=�rE)#�
contextlibr>�os.pathr�rrir�r�r%�r�HOST�HOSTv4r,�is_wasi�has_gethostnamerrrrr(r-rAr3r9rD�objectrv�contextmanagerr�r�r�r�r�r�rFrEr
�<module>r�s������
�
�������	��	���o�o�%��#�N�N�V�5G�5G�;�z�%�N?�
� �!�����.�*�8�����19�"�J.��J.�Z/��
� �F	�rE

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 112.16 KB 0644
ast_helper.cpython-313.pyc File 2.22 KB 0644
asynchat.cpython-313.pyc File 10.8 KB 0644
asyncore.cpython-313.pyc File 25.15 KB 0644
bytecode_helper.cpython-313.pyc File 9.39 KB 0644
hashlib_helper.cpython-313.pyc File 2.5 KB 0644
hypothesis_helper.cpython-313.pyc File 1.26 KB 0644
i18n_helper.cpython-313.pyc File 3.56 KB 0644
import_helper.cpython-313.pyc File 14.17 KB 0644
logging_helper.cpython-313.pyc File 1.59 KB 0644
numbers.cpython-313.pyc File 745 B 0644
os_helper.cpython-313.pyc File 30.43 KB 0644
pty_helper.cpython-313.pyc File 3.77 KB 0644
refleak_helper.cpython-313.pyc File 396 B 0644
script_helper.cpython-313.pyc File 13.72 KB 0644
smtpd.cpython-313.pyc File 38.75 KB 0644
socket_helper.cpython-313.pyc File 15.57 KB 0644
testcase.cpython-313.pyc File 7.56 KB 0644
threading_helper.cpython-313.pyc File 11.66 KB 0644
venv.cpython-313.pyc File 4.75 KB 0644
warnings_helper.cpython-313.pyc File 9.71 KB 0644
Filemanager