ó
    01™i  ã                  óˆ   • S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJ	r
  S SKJrJr  S SKJrJrJr  S SKJr  SS	 jrSS
 jrg)é    )ÚannotationsN)ÚDict)Ú	HTTPError)Úquote)ÚurljoinÚurlsplit)ÚHTTPRedirectHandlerÚRequestÚurlopen)Ú
addinfourlc                ó,  • UR                   R                  S5      nUc  Ue[        U[        5      (       d  [	        SU< S35      e[        U5      nUR                  S;  a>  [        UUR                  UR                   SU< S3UR                   UR                  5      e[        US[        R                  S9n[        U R                  U5      nS	nU R                   R!                  5        VVs0 s H  u  pVUR#                  5       U;  d  M  XV_M     nnn[%        UUU R&                  S
S9n[)        U S5      (       a   U R*                  n	U	R                  US5      [,        R.                  :¼  d  [1        U	5      [,        R2                  :¼  aR  [        U R                  UR                  [,        R4                  UR                  -   UR                   UR                  5      eO0 n	[7        U SU	5        [7        USU	5        U	R                  US5      S-   X’'   U$ s  snnf )aª  Create a new request object for a redirected request.

The logic is based on [HTTPRedirectHandler](https://github.com/python/cpython/blob/b58bc8c2a9a316891a5ea1a0487aebfc86c2793a/Lib/urllib/request.py#L641-L751) from urllib.request.

Args:
    request: The original request that resulted in the redirect.
    http_error: The response to the original request that indicates a
        redirect should occur and contains the new location.

Returns:
    A new request object to the location indicated by the response.

Raises:
    HTTPError: the supplied `http_error` if the redirect request
        cannot be created.
    ValueError: If the response code is None.
    ValueError: If the response does not contain a `Location` header
        or the `Location` header is not a string.
    HTTPError: If the scheme of the new location is not `http`,
        `https`, or `ftp`.
    HTTPError: If there are too many redirects or a redirect loop.
ÚLocationzLocation header z is not a string)ÚhttpÚhttpsÚftpÚ z - Redirection to url z is not allowedz
iso-8859-1)ÚencodingÚsafe)zcontent-lengthzcontent-typeT)ÚheadersÚorigin_req_hostÚunverifiableÚredirect_dictr   é   )r   ÚgetÚ
isinstanceÚstrÚ
ValueErrorr   Úschemer   ÚcodeÚreasonÚfpÚurlquoteÚstringÚpunctuationr   Úfull_urlÚitemsÚlowerr
   r   Úhasattrr   r	   Úmax_repeatsÚlenÚmax_redirectionsÚinf_msgÚsetattr)
ÚrequestÚ
http_errorÚnew_urlÚnew_url_partsÚcontent_headersÚkÚvÚ
newheadersÚnew_requestÚvisiteds
             ÚL/home/james-whalen/.local/lib/python3.13/site-packages/rdflib/_networking.pyÚ_make_redirect_requestr9      sü  € ð. × Ñ ×$Ñ$ ZÓ0€GØØÐÜgœs×#Ñ#ÜÐ+¨G©;Ð6FÐGÓHÐHä˜WÓ%€Mð ×ÑÐ#?Ó?ÜØØO‰OØ× Ñ Ð!Ð!7¸±{À/ÐRØ×ÑØM‰Mó
ð 	
ô w¨¼F×<NÑ<NÑO€GÜg×&Ñ&¨Ó0€Gð
 9€Oà Ÿ™×.Ñ.Ô0ôÚ0‘°A·G±G³IÀ_Ñ4T‹ˆŠÑ0ð ñ ô ØØØ×/Ñ/Øñ	€Kô ˆw˜×(Ñ(Ø×'Ñ'ˆàK‰K˜ Ó#Ô':×'FÑ'FÓFÜ7‹|Ô2×CÑCÓCäØ× Ñ Ø—‘Ü#×+Ñ+¨j×.?Ñ.?Ñ?Ø×"Ñ"Ø—‘óð ð Dð ˆÜ˜¨'Ô2äˆK˜¨'Ô2Ø—{‘{ 7¨AÓ.°Ñ2€GÑØÐùó=s   Ã-HÄHc                ó¾   •  [        U 5      $ ! [         aE  nUR                  S:X  a/  [        R                  S:  a  [        X5      n[        U5      s SnA$ e SnAff = f)a!  This is a shim for `urlopen` that handles HTTP redirects with status code
308 (Permanent Redirect).

This function should be removed once all supported versions of Python
handles the 308 HTTP status code.

Args:
    request: The request to open.

Returns:
    The response to the request.
i4  )é   é   N)r   r   r   ÚsysÚversion_infor9   Ú_urlopen)r.   Úerrorr6   s      r8   r?   r?   b   sU   € ðÜwÓÐøÜó 
Ø:‰:˜Ó¤×!1Ñ!1°GÓ!;ô 1°Ó@ˆKÜ˜KÓ(Õ(àûð
ús    ‚
 
A—9AÁAÁAÁA)r.   r
   r/   r   Úreturnr
   )r.   r
   rA   r   )Ú
__future__r   r#   r=   Útypingr   Úurllib.errorr   Úurllib.parser   r"   r   r   Úurllib.requestr	   r
   r   Úurllib.responser   r9   r?   © ó    r8   Ú<module>rJ      s/   ðÝ "ã Û 
Ý Ý "Ý *ß *ß @Ñ @Ý &ôRõjrI   