Ë
    ‹¤ëja  ã                  ó  — d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZmZ erddlmZ ddlmZmZmZ dd	lmZ  G d
„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)zNetwork-related pip exceptions.é    )Úannotations)ÚTYPE_CHECKINGÚLiteral)Úescape)ÚText)ÚDiagnosticPipErrorÚPipError)Úurllib3)ÚPreparedRequestÚRequestÚResponse)Ú_FileDownloadc                  ó@   ‡ — e Zd ZdZ	 	 d	 	 	 	 	 	 	 dˆ fd„Zdd„Zˆ xZS )ÚNetworkConnectionErrorzHTTP connection errorc                óÐ   •— || _         || _        || _        | j                   �3| j                  s't        |d«      r| j                   j                  | _        t        ‰| �  |||«       y)zc
        Initialize NetworkConnectionError with  `request` and `response`
        objects.
        NÚrequest)Úresponser   Ú	error_msgÚhasattrÚsuperÚ__init__)Úselfr   r   r   Ú	__class__s       €úm/home/oem/CyberBrain26-unified/dev-env/.venv/lib/python3.12/site-packages/pip/_internal/exceptions/network.pyr   zNetworkConnectionError.__init__   sW   ø€ ð !ˆŒØˆŒØ"ˆŒà�M‰MÐ%Ø—L’LÜ˜ )Ô,àŸ=™=×0Ñ0ˆDŒLÜ‰Ñ˜ H¨gÕ6ó    c                ó,   — t        | j                  «      S )N)Ústrr   )r   s    r   Ú__str__zNetworkConnectionError.__str__+   s   € Ü�4—>‘>Ó"Ð"r   )NN)r   r   r   zResponse | Noner   z Request | PreparedRequest | NoneÚreturnÚNone)r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__classcell__©r   s   @r   r   r      s>   ø„ Ùð
 %)Ø48ð	7àð7ð "ð7ð 2ð	7ð
 
õ7÷*#r   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )ÚConnectionFailedErrorzconnection-failedc                ó  •— ddl m} ddlm}m}m} t        |«      }t        ||«      r*|j                  dd¬«      }	t        |	«      dk(  rmd|	d   z   }ndt        ||«      r'|j                  d	d¬«      }	t        |	«      dk(  r7|	\  }
}n1t        ||«      r%	 |j                  d   }t        ||t        f«      rd
}	 t        ‰| �9  dt        |«      › dt        |«      › �t!        |«      dt        |«      › d�¬«       y # t        $ r Y ŒLw xY w)Nr   )ÚRemoteDisconnected)ÚNameResolutionErrorÚNewConnectionErrorÚProtocolErrorzFailed to resolve é   )Úmaxsplité   z!Failed to resolve IP address for z&Failed to establish a new connection: z:the connection was closed without a reply from the server.zFailed to connect to [magenta]ú[/] while fetching z\Are you connected to the Internet? If so, check whether your system can connect to [magenta]z[[/] before trying again. There may be a firewall or proxy that's preventing the connection.©ÚmessageÚcontextÚ	hint_stmt)Úhttp.clientr*   Úpip._vendor.urllib3.exceptionsr+   r,   r-   r   Ú
isinstanceÚsplitÚlenÚargsÚConnectionResetErrorÚ
IndexErrorr   r   r   r   )r   ÚurlÚhostÚerrorr*   r+   r,   r-   ÚdetailsÚpartsÚ_Úreasonr   s               €r   r   zConnectionFailedError.__init__2   s#  ø€ Ý2÷	
ñ 	
ô �e“*ˆÜ�eÐ0Ô1Ø—M‘MÐ"6À�MÓCˆEÜ�5‹z˜QŠØ=ÀÀaÁÑH‘Ü˜Ð1Ô2Ø—M‘MÐ"JÐUV�MÓWˆEÜ�5‹z˜QŠØ"‘
�‘7Ü˜˜}Ô-ðØŸ™ A™�ô ˜fÐ'9Ô;OÐ&PÔQàTñ ô 	‰Ñà0´¸³°Ð>QÜ˜#“;�-ð!ô ˜“Mð+Ü+1°$«<¨.ð 9UðUð 	õ 	
øô ò Ùðús   ÂC8 Ã8	DÄD)r>   r   r?   r   r@   Ú	Exceptionr   r    ©r!   r"   r#   Ú	referencer   r%   r&   s   @r   r(   r(   /   s   ø„ Ø#€I÷(
ñ (
r   r(   c                  ó8   ‡ — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZS )ÚConnectionTimeoutErrorzconnection-timeoutc               ó¦   •— t        j                  |dfd|› d�«      }|dk(  r|j                  d«       t        ‰| �  dt        |«      › �|d¬«       y )	NÚmagentaz didn't respond within z secondsÚconnectz" (while establishing a connection)zUnable to fetch zÐThis is probably a temporary issue with the remote server or the network connection. If this error persists, check the network configuration. There may be a firewall or proxy that's preventing the connection.r2   )r   ÚassembleÚappendr   r   r   )r   r>   r?   ÚkindÚtimeoutr4   r   s         €r   r   zConnectionTimeoutError.__init__`   sf   ø€ ô —-‘-Ø�9ÐÐ!8¸¸	ÀÐJó
ˆð �9ÒØ�N‰NÐ?Ô@Ü‰ÑØ&¤v¨c£{ mÐ4Øð"ð	 	õ 		
r   )
r>   r   r?   r   rO   zLiteral['connect', 'read']rP   Úfloatr   r    rF   r&   s   @r   rI   rI   ]   sB   ø„ Ø$€Ið
àð
ð ð
ð
 )ð
ð ð
ð 
÷
ñ 
r   rI   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )ÚSSLMissingErrorzssl-missingc                óB   •— t         ‰| �  dt        |«      › �dd ¬«       y )Nz,Failed to establish a secure connection for z;The 'ssl' module is unavailable but required for HTTPS URLsr2   )r   r   r   )r   r>   r   s     €r   r   zSSLMissingError.__init__|   s)   ø€ Ü‰ÑØBÄ6È#Ã;À-ÐPØQØð 	õ 	
r   )r>   r   r   r    rF   r&   s   @r   rS   rS   y   s   ø„ Ø€I÷
ñ 
r   rS   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )ÚSSLVerificationErrorzssl-verification-failedc                ó†   •— dt        |«      › dt        |«      › �}d}t        ‰| �	  |t        t	        |«      «      |¬«       y )Nz4Failed to establish a secure connection to [magenta]r1   zEYou may need to use --cert or check your proxy/firewall configurationr2   )r   r   r   r   r   )r   r>   r?   r@   r3   Úhintr   s         €r   r   zSSLVerificationError.__init__‡   sL   ø€ ðÜ˜t›�~Ð%8¼À»¸ðGð 	ð WˆÜ‰Ñ ´$´s¸5³zÓ2BÈdÐÕSr   )r>   r   r?   r   r@   zurllib3.exceptions.SSLErrorr   r    rF   r&   s   @r   rV   rV   „   s   ø„ Ø)€I÷Tñ Tr   rV   c                  ó4   ‡ — e Zd ZdZ	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZS )ÚProxyConnectionErrorzproxy-connection-failedc                ó~   •— t         ‰| �  dt        |«      › dt        |«      › �t        t	        |«      «      d¬«       y )Nz$Failed to connect to proxy [magenta]r1   z+This is likely a proxy configuration issue.r2   )r   r   r   r   r   )r   r>   Úproxyr@   r   s       €r   r   zProxyConnectionError.__init__“   sG   ø€ ô 	‰ÑðÜ" 5›M˜?Ð*=¼fÀS»k¸]ðLô œ˜U›Ó$ØCð 	õ 	
r   )r>   r   r\   r   r@   zurllib3.exceptions.ProxyErrorr   r    rF   r&   s   @r   rZ   rZ   �   s2   ø„ Ø)€Ið

Øð

Ø"ð

Ø+Hð

à	÷

ñ 

r   rZ   c                  ó(   ‡ — e Zd ZdZdZdˆ fd„Zˆ xZS )ÚIncompleteDownloadErrorzaRaised when the downloader receives fewer bytes than advertised
    in the Content-Length header.zincomplete-downloadc                ó@  •— ddl m} |j                  €J ‚ ||j                  «      › d ||j                  «      › �}|j                  rd|j                  dz   › d�}d}nd}d	}t        d
|› d|› d�«      }t        ‰| �  |d|j                  j                  › �|d¬«       y )Nr   )Úformat_sizeú/zafter r.   z
 attempts z7Use --resume-retries to configure resume attempt limit.Ú z>Consider using --resume-retries to enable download resumption.zDownload failed z(because not enough bytes were received (ú)zURL: z4This is an issue with network connectivity, not pip.)r3   r4   r5   Ú	note_stmt)
Úpip._internal.utils.miscr`   ÚsizeÚbytes_receivedÚ
reattemptsr   r   r   ÚlinkÚredacted_url)r   Údownloadr`   Údownload_statusÚretry_statusrX   r3   r   s          €r   r   z IncompleteDownloadError.__init__¦   sÊ   ø€ å8à�}‰}Ð(Ð(Ð(á˜8×2Ñ2Ó3Ð4°A±kÀ(Ç-Á-Ó6PÐ5QÐRð 	ð ×ÒØ# H×$7Ñ$7¸!Ñ$;Ð#<¸JÐGˆLØL‰Dð ˆLØSˆDÜØ˜|˜nð -Ø-Ð.¨að1ó
ˆô
 	‰ÑØØ˜HŸM™M×6Ñ6Ð7Ð8ØØLð	 	õ 	
r   )rk   r   r   r    )r!   r"   r#   r$   rG   r   r%   r&   s   @r   r^   r^       s   ø„ ñ%ð &€I÷
ñ 
r   r^   N)r$   Ú
__future__r   Útypingr   r   Úpip._vendor.rich.markupr   Úpip._vendor.rich.textr   Úpip._internal.exceptions._baser   r	   Úpip._vendorr
   Úpip._vendor.requests.modelsr   r   r   Úpip._internal.network.downloadr   r   r(   rI   rS   rV   rZ   r^   © r   r   ú<module>rw      sƒ   ðÙ %å "ç )å *Ý &ç GáÝ#ßNÑNå<ô#˜Xô #ô8+
Ð.ô +
ô\
Ð/ô 
ô8
Ð(ô 
ô	TÐ-ô 	Tô
Ð-ô 
ô 
Ð0õ 
r   