HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1780863/root/usr/lib/python3/dist-packages/reportbug/__pycache__/
Upload File :
Current File : //proc/1780863/root/usr/lib/python3/dist-packages/reportbug/__pycache__/urlutils.cpython-311.pyc
�

�&=d����ddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZdezdzZdd�Zdd	�Zd
�ZdS)
�N�)�	NoNetwork)�VERSION_NUMBERz
reportbug/z	 (Debian)�<c��|stj���}tdd�}t	j||||���jS)ad
    Open an URL and return the content

    This is a helper function for :func:`open_url()`.

    Parameters
    ----------
    url : str
        The URL to retrieve
    proxies : dict
        proxies to use
    timeout : int
        request timeout in seconds
    data
        unused

    Returns
    -------
    str
        Content of the response
    z)gzip;q=1.0, deflate;q=0.9, identity;q=0.5)z
User-AgentzAccept-Encoding)�headers�proxies�timeout)�urllib�request�
getproxies�UA_STR�requests�get�text)�urlr	r
�datars     �4/usr/lib/python3/dist-packages/reportbug/urlutils.py�urlopenr+sQ��,�.��.�+�+�-�-��#�"M�O�O�G��<��W�g�w�O�O�O�T�T�c��tj|��tj���}|r
||d<||d<	t|||��}n�#tjj$r}|jdvrYd}~dS�d}~wtj	tjtjj
f$rt�t$r,}|r|ddkr|ddkrYd}~dSt�d}~wt$r#td	tj�
��t�t"jj$r,}|jj}d|�d|�d
|�d�}	t|	���d}~wwxYw|S)a�
    Open an URL and return the content

    Parameters
    ----------
    url : str
        The URL to retrieve
    http_proxy : str
        HTTP proxy server URL to use for connection.
        By default, use the :func:`urllib.request.getproxies()` settings.
    timeout : int
        connection timeout in seconds

    Returns
    -------
    str
        Content of the response
    �http�https)�i�i�Nrz
http errorrrz@http_proxy environment variable must be formatted as a valid URI)�filezFailed to open z (z: �))�socket�setdefaulttimeoutrrr
r�error�	HTTPError�code�gaierror�URLErrorr�OSError�	TypeError�print�sys�stderrr�client�
HTTPException�	__class__�__name__)
r�
http_proxyr
r	�page�xr�exc�exc_name�messages
          r�open_urlr3Ls���*��W�%�%�%��n�'�'�)�)�G��&�$����%����!��s�G�W�-�-�����<�!�����6�_�$�$��4�4�4�4�4�������O�V�\�6�<�+@�A�����������	�D��G�|�+�+��Q��3����4�4�4�4�4��O���������
�P�WZ�Wa�b�b�b�b����;�$�!�!�!��=�)��=�C�=�=�8�=�=�s�=�=�=���� � � �����!�����Ks=�A�E	�&	A6�5A6�6>E	�4C�C�AE	�'E�E	c���tjd��s-dtj|��z}tj|��dStrt	j|��dSdS)z�
    Launch a web browser to view an URL

    Parameters
    ----------
    url : str
        The URL to view

    Returns
    -------
    None
    z#command -v xdg-open >/dev/null 2>&1z	xdg-open N)�os�system�shlex�quote�
webbrowser�open)r�cmds  r�launch_browserr<�sd���9�:�;�;���E�K��,�,�,��
�	�#�����������������r)NrN)Nr)�http.clientr�urllib.requestr�urllib.errorrr7r5r'r9r�
exceptionsr�__init__rrrr3r<�rr�<module>rCs���0������������
�
�
�
�����	�	�	�	�
�
�
�
���������������%�$�$�$�$�$�	��	&��	4��U�U�U�U�B1�1�1�1�h����r