chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d7c28e20-2dfd-4d46-811f-85e9a0b2c112 | CPython Docs | file://datasets/cpython/Doc/library/termios.rst | unknown | e8e5d342-2b06-49a5-a63d-6b1c43d563d7 | 37,178 | supabase-export-v2 | f219c0e62154d1a6 | *fd* as their first argument. This can be an integer file descriptor, such as returned by ``sys.stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` itself.
This module also defines all the constants needed to work with the functions
provided here; these have the same name as their counterparts in C. Pleas... | trusted_official_docs | CPython Docs | *fd* as their first argument. This can be an integer file descriptor, such as returned by ``sys.stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` itself.
This module also defines all the constants needed to work with the functions
provided here; these have the same name as their counterparts in C. Pleas... | *fd* as their first argument. This can be an integer file descriptor, such as returned by ``sys.stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` itself.
This module also defines all the constants needed to work with the functions
provided here; these have the same name as their counterparts in C. Pleas... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ec0378bc-a4e6-4067-acab-70d2aa920766 | CPython Docs | file://datasets/cpython/Doc/library/termios.rst | unknown | e8e5d342-2b06-49a5-a63d-6b1c43d563d7 | 37,194 | supabase-export-v2 | 6647c41126da4294 | .. function:: tcflush(fd, queue)
Discard queued data on file descriptor *fd*. The *queue* selector specifies
which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for the
output queue, or :const:`TCIOFLUSH` for both queues. | trusted_official_docs | CPython Docs | .. function:: tcflush(fd, queue)
Discard queued data on file descriptor *fd*. The *queue* selector specifies
which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for the
output queue, or :const:`TCIOFLUSH` for both queues. | .. function:: tcflush(fd, queue)
Discard queued data on file descriptor *fd*. The *queue* selector specifies
which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for the
output queue, or :const:`TCIOFLUSH` for both queues. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f838fc38-ce98-45a9-a00d-e5dd3925946c | CPython Docs | file://datasets/cpython/Doc/library/termios.rst | unknown | e8e5d342-2b06-49a5-a63d-6b1c43d563d7 | 37,201 | supabase-export-v2 | 6e8d3641715c2637 | .. function:: tcsetwinsize(fd, winsize)
Set the tty window size for file descriptor *fd* from *winsize*, which is
a two-item tuple ``(ws_row, ws_col)`` like the one returned by
:func:`tcgetwinsize`. Requires at least one of the pairs
(:const:`termios.TIOCGWINSZ`, :const:`termios.TIOCSWINSZ`);
(:const:`termios.TIOCG... | trusted_official_docs | CPython Docs | .. function:: tcsetwinsize(fd, winsize)
Set the tty window size for file descriptor *fd* from *winsize*, which is
a two-item tuple ``(ws_row, ws_col)`` like the one returned by
:func:`tcgetwinsize`. Requires at least one of the pairs
(:const:`termios.TIOCGWINSZ`, :const:`termios.TIOCSWINSZ`);
(:const:`termios.TIOCG... | .. function:: tcsetwinsize(fd, winsize)
Set the tty window size for file descriptor *fd* from *winsize*, which is
a two-item tuple ``(ws_row, ws_col)`` like the one returned by
:func:`tcgetwinsize`. Requires at least one of the pairs
(:const:`termios.TIOCGWINSZ`, :const:`termios.TIOCSWINSZ`);
(:const:`termios.TIOCG... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0186c6c4-2468-4ea8-82fd-3f1c2494d1c1 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,483 | supabase-export-v2 | cf099c1893efd60d | .. method:: HTTPPasswordMgrWithPriorAuth.add_password(realm, uri, user, \ passwd, is_authenticated=False)
*realm*, *uri*, *user*, *passwd* are as for
:meth:`HTTPPasswordMgr.add_password`. *is_authenticated* sets the initial
value of the ``is_authenticated`` flag for the given URI or list of URIs. If *is_authenticated... | trusted_official_docs | CPython Docs | .. method:: HTTPPasswordMgrWithPriorAuth.add_password(realm, uri, user, \ passwd, is_authenticated=False)
*realm*, *uri*, *user*, *passwd* are as for
:meth:`HTTPPasswordMgr.add_password`. *is_authenticated* sets the initial
value of the ``is_authenticated`` flag for the given URI or list of URIs. If *is_authenticated... | .. method:: HTTPPasswordMgrWithPriorAuth.add_password(realm, uri, user, \ passwd, is_authenticated=False)
*realm*, *uri*, *user*, *passwd* are as for
:meth:`HTTPPasswordMgr.add_password`. *is_authenticated* sets the initial
value of the ``is_authenticated`` flag for the given URI or list of URIs. If *is_authenticated... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
04bd748c-9266-4808-a6ed-9616d820ab0b | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,309 | supabase-export-v2 | fba0401cd19ebdd5 | sent. If ``is_authenticated`` is ``False``, credentials are not sent, and then if a ``401`` response is received the request is re-sent with the authentication credentials.
If
authentication succeeds, ``update_authenticated`` is called to set
``is_authenticated`` ``True`` for the URI, so that subsequent requests to
... | trusted_official_docs | CPython Docs | sent. If ``is_authenticated`` is ``False``, credentials are not sent, and then if a ``401`` response is received the request is re-sent with the authentication credentials.
If
authentication succeeds, ``update_authenticated`` is called to set
``is_authenticated`` ``True`` for the URI, so that subsequent requests to
... | sent. If ``is_authenticated`` is ``False``, credentials are not sent, and then if a ``401`` response is received the request is re-sent with the authentication credentials.
If
authentication succeeds, ``update_authenticated`` is called to set
``is_authenticated`` ``True`` for the URI, so that subsequent requests to
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
05c8dbd0-98b3-455f-8040-ac5b03449457 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,305 | supabase-export-v2 | ad2983a9c3efedc0 | .. class:: HTTPPasswordMgrWithPriorAuth()
A variant of :class:`HTTPPasswordMgrWithDefaultRealm` that also has a
database of ``uri -> is_authenticated`` mappings. Can be used by a
BasicAuth handler to determine when to send authentication credentials
immediately instead of waiting for a ``401`` response first. | trusted_official_docs | CPython Docs | .. class:: HTTPPasswordMgrWithPriorAuth()
A variant of :class:`HTTPPasswordMgrWithDefaultRealm` that also has a
database of ``uri -> is_authenticated`` mappings. Can be used by a
BasicAuth handler to determine when to send authentication credentials
immediately instead of waiting for a ``401`` response first. | .. class:: HTTPPasswordMgrWithPriorAuth()
A variant of :class:`HTTPPasswordMgrWithDefaultRealm` that also has a
database of ``uri -> is_authenticated`` mappings. Can be used by a
BasicAuth handler to determine when to send authentication credentials
immediately instead of waiting for a ``401`` response first. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
06740df1-5f5a-4b56-954d-eb89f1e53a2c | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,401 | supabase-export-v2 | 39cb0cd950f04557 | The order in which these methods are called within each stage is determined by sorting the handler instances.
#. Every handler with a method named like :meth:`!<protocol>_request` has that
method called to pre-process the request. | trusted_official_docs | CPython Docs | The order in which these methods are called within each stage is determined by sorting the handler instances.
#. Every handler with a method named like :meth:`!<protocol>_request` has that
method called to pre-process the request. | The order in which these methods are called within each stage is determined by sorting the handler instances.
#. Every handler with a method named like :meth:`!<protocol>_request` has that
method called to pre-process the request. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
07612c64-41e2-4e7f-a179-11fa0644b84d | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,574 | supabase-export-v2 | 1a3a4b837075263b | Use of Basic HTTP Authentication::
import urllib.request
# Create an OpenerDirector with support for Basic HTTP Authentication... auth_handler = urllib.request.HTTPBasicAuthHandler()
auth_handler.add_password(realm='PDQ Application',
uri='https://mahler:8092/site-updates.py',
user='klem',
passwd='kadidd!ehopper')
... | trusted_official_docs | CPython Docs | Use of Basic HTTP Authentication::
import urllib.request
# Create an OpenerDirector with support for Basic HTTP Authentication... auth_handler = urllib.request.HTTPBasicAuthHandler()
auth_handler.add_password(realm='PDQ Application',
uri='https://mahler:8092/site-updates.py',
user='klem',
passwd='kadidd!ehopper')
... | Use of Basic HTTP Authentication::
import urllib.request
# Create an OpenerDirector with support for Basic HTTP Authentication... auth_handler = urllib.request.HTTPBasicAuthHandler()
auth_handler.add_password(realm='PDQ Application',
uri='https://mahler:8092/site-updates.py',
user='klem',
passwd='kadidd!ehopper')
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
07a471ec-6316-4822-93c5-4192bd21d74a | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,319 | supabase-export-v2 | 61dcd295f871c9e6 | .. class:: HTTPDigestAuthHandler(password_mgr=None)
Handle authentication with the remote host. *password_mgr*, if given, should
be something that is compatible with :class:`HTTPPasswordMgr`; refer to
section :ref:`http-password-mgr` for information on the interface that must
be supported. When both Digest Authentic... | trusted_official_docs | CPython Docs | .. class:: HTTPDigestAuthHandler(password_mgr=None)
Handle authentication with the remote host. *password_mgr*, if given, should
be something that is compatible with :class:`HTTPPasswordMgr`; refer to
section :ref:`http-password-mgr` for information on the interface that must
be supported. When both Digest Authentic... | .. class:: HTTPDigestAuthHandler(password_mgr=None)
Handle authentication with the remote host. *password_mgr*, if given, should
be something that is compatible with :class:`HTTPPasswordMgr`; refer to
section :ref:`http-password-mgr` for information on the interface that must
be supported. When both Digest Authentic... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
095389c4-8fe2-4c5b-b55c-cd0c7b538194 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,383 | supabase-export-v2 | 4f589ff5361bc8e1 | .. method:: OpenerDirector.add_handler(handler)
*handler* should be an instance of :class:`BaseHandler`. The following methods
are searched, and added to the possible chains (note that HTTP errors are a
special case). Note that, in the following, *protocol* should be replaced
with the actual protocol to handle, for ... | trusted_official_docs | CPython Docs | .. method:: OpenerDirector.add_handler(handler)
*handler* should be an instance of :class:`BaseHandler`. The following methods
are searched, and added to the possible chains (note that HTTP errors are a
special case). Note that, in the following, *protocol* should be replaced
with the actual protocol to handle, for ... | .. method:: OpenerDirector.add_handler(handler)
*handler* should be an instance of :class:`BaseHandler`. The following methods
are searched, and added to the possible chains (note that HTTP errors are a
special case). Note that, in the following, *protocol* should be replaced
with the actual protocol to handle, for ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0a3b4a13-d8b3-46b4-947e-662918bd82bd | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,602 | supabase-export-v2 | 3fdc7db22603c7c3 | a ``POST`` request (normally the request type is ``GET``). The *data* argument must be a bytes object in standard :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urllib.parse.urlencode` function.
:func:`urlretrieve` will raise :exc:`~urllib.error.ContentTooShortError` when it detects that
the amou... | trusted_official_docs | CPython Docs | a ``POST`` request (normally the request type is ``GET``). The *data* argument must be a bytes object in standard :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urllib.parse.urlencode` function.
:func:`urlretrieve` will raise :exc:`~urllib.error.ContentTooShortError` when it detects that
the amou... | a ``POST`` request (normally the request type is ``GET``). The *data* argument must be a bytes object in standard :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urllib.parse.urlencode` function.
:func:`urlretrieve` will raise :exc:`~urllib.error.ContentTooShortError` when it detects that
the amou... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0b354779-83ea-4d60-9cca-5fa43c7530f8 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,238 | supabase-export-v2 | ee2727892c693b40 | .. versionchanged:: 3.4.3 *context* was added.
.. versionchanged:: 3.10
HTTPS connection now send an ALPN extension with protocol indicator
``http/1.1`` when no *context* is given. Custom *context* should set
ALPN protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.4.3 *context* was added.
.. versionchanged:: 3.10
HTTPS connection now send an ALPN extension with protocol indicator
``http/1.1`` when no *context* is given. Custom *context* should set
ALPN protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`. | .. versionchanged:: 3.4.3 *context* was added.
.. versionchanged:: 3.10
HTTPS connection now send an ALPN extension with protocol indicator
``http/1.1`` when no *context* is given. Custom *context* should set
ALPN protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
10b79002-a2df-48f8-b583-7bef4073873d | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,595 | supabase-export-v2 | 4dd341973d567aac | Legacy interface ----------------
The following functions and classes are ported from the Python 2 module
``urllib`` (as opposed to ``urllib2``). They might become deprecated at
some point in the future. | trusted_official_docs | CPython Docs | Legacy interface ----------------
The following functions and classes are ported from the Python 2 module
``urllib`` (as opposed to ``urllib2``). They might become deprecated at
some point in the future. | Legacy interface ----------------
The following functions and classes are ported from the Python 2 module
``urllib`` (as opposed to ``urllib2``). They might become deprecated at
some point in the future. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
140773bb-0a03-492e-9f8d-1ffe8c3f52bf | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,601 | supabase-export-v2 | 37b6c442d0a79e58 | >>> import urllib.request >>> local_filename, headers = urllib.request.urlretrieve('http://python.org/') >>> html = open(local_filename) >>> html.close()
If the *url* uses the :file:`http:` scheme identifier, the optional *data*
argument may be given to specify a ``POST`` request (normally the request
type is ``GET``... | trusted_official_docs | CPython Docs | >>> import urllib.request >>> local_filename, headers = urllib.request.urlretrieve('http://python.org/') >>> html = open(local_filename) >>> html.close()
If the *url* uses the :file:`http:` scheme identifier, the optional *data*
argument may be given to specify a ``POST`` request (normally the request
type is ``GET``... | >>> import urllib.request >>> local_filename, headers = urllib.request.urlretrieve('http://python.org/') >>> html = open(local_filename) >>> html.close()
If the *url* uses the :file:`http:` scheme identifier, the optional *data*
argument may be given to specify a ``POST`` request (normally the request
type is ``GET``... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15a41b54-0cb5-480e-ac4d-ce14f3924e0a | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,569 | supabase-export-v2 | 229d78fe7c58f89a | passed to stdin of the CGI') >>> with urllib.request.urlopen(req) as f: ... print(f.read().decode('utf-8')) ... Got Data: "This data is passed to stdin of the CGI"
The code for the sample CGI used in the above example is:: | trusted_official_docs | CPython Docs | passed to stdin of the CGI') >>> with urllib.request.urlopen(req) as f: ... print(f.read().decode('utf-8')) ... Got Data: "This data is passed to stdin of the CGI"
The code for the sample CGI used in the above example is:: | passed to stdin of the CGI') >>> with urllib.request.urlopen(req) as f: ... print(f.read().decode('utf-8')) ... Got Data: "This data is passed to stdin of the CGI"
The code for the sample CGI used in the above example is:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15f159ea-40b1-46a1-85cf-b7532ad06448 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,575 | supabase-export-v2 | 70e5753077ea04c0 | Application', uri='https://mahler:8092/site-updates.py', user='klem', passwd='kadidd!ehopper') opener = urllib.request.build_opener(auth_handler) # ...and install it globally so it can be used with urlopen. urllib.request.install_opener(opener) with urllib.request.urlopen('http://www.example.com/login.html') as f: prin... | trusted_official_docs | CPython Docs | Application', uri='https://mahler:8092/site-updates.py', user='klem', passwd='kadidd!ehopper') opener = urllib.request.build_opener(auth_handler) # ...and install it globally so it can be used with urlopen. urllib.request.install_opener(opener) with urllib.request.urlopen('http://www.example.com/login.html') as f: prin... | Application', uri='https://mahler:8092/site-updates.py', user='klem', passwd='kadidd!ehopper') opener = urllib.request.build_opener(auth_handler) # ...and install it globally so it can be used with urlopen. urllib.request.install_opener(opener) with urllib.request.urlopen('http://www.example.com/login.html') as f: prin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
169985a7-db4f-4ec3-86ff-0bdd2604b38f | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,239 | supabase-export-v2 | 55bd7cc07d7e084e | 3.10 HTTPS connection now send an ALPN extension with protocol indicator ``http/1.1`` when no *context* is given. Custom *context* should set ALPN protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`.
.. versionchanged:: 3.13
Remove *cafile*, *capath* and *cadefault* parameters: use the *context*
parameter inste... | trusted_official_docs | CPython Docs | 3.10 HTTPS connection now send an ALPN extension with protocol indicator ``http/1.1`` when no *context* is given. Custom *context* should set ALPN protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`.
.. versionchanged:: 3.13
Remove *cafile*, *capath* and *cadefault* parameters: use the *context*
parameter inste... | 3.10 HTTPS connection now send an ALPN extension with protocol indicator ``http/1.1`` when no *context* is given. Custom *context* should set ALPN protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`.
.. versionchanged:: 3.13
Remove *cafile*, *capath* and *cadefault* parameters: use the *context*
parameter inste... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
17bfd481-cfc1-42a4-8246-9d9616c58d0b | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,577 | supabase-export-v2 | 771047db27201e99 | This example replaces the default :class:`ProxyHandler` with one that uses programmatically supplied proxy URLs, and adds proxy authorization support with :class:`ProxyBasicAuthHandler`. ::
proxy_handler = urllib.request.ProxyHandler({'http': 'http://www.example.com:3128/'})
proxy_auth_handler = urllib.request.ProxyBa... | trusted_official_docs | CPython Docs | This example replaces the default :class:`ProxyHandler` with one that uses programmatically supplied proxy URLs, and adds proxy authorization support with :class:`ProxyBasicAuthHandler`. ::
proxy_handler = urllib.request.ProxyHandler({'http': 'http://www.example.com:3128/'})
proxy_auth_handler = urllib.request.ProxyBa... | This example replaces the default :class:`ProxyHandler` with one that uses programmatically supplied proxy URLs, and adds proxy authorization support with :class:`ProxyBasicAuthHandler`. ::
proxy_handler = urllib.request.ProxyHandler({'http': 'http://www.example.com:3128/'})
proxy_auth_handler = urllib.request.ProxyBa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
17d475b5-f3ac-4360-80d7-9749909d9987 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,222 | supabase-export-v2 | da111f874e07fd08 | urllib.request module uses HTTP/1.1 and includes ``Connection:close`` header in its HTTP requests.
The optional *timeout* parameter specifies a timeout in seconds for
blocking operations like the connection attempt (if not specified,
the global default timeout setting will be used). This actually
only works for HTTP... | trusted_official_docs | CPython Docs | urllib.request module uses HTTP/1.1 and includes ``Connection:close`` header in its HTTP requests.
The optional *timeout* parameter specifies a timeout in seconds for
blocking operations like the connection attempt (if not specified,
the global default timeout setting will be used). This actually
only works for HTTP... | urllib.request module uses HTTP/1.1 and includes ``Connection:close`` header in its HTTP requests.
The optional *timeout* parameter specifies a timeout in seconds for
blocking operations like the connection attempt (if not specified,
the global default timeout setting will be used). This actually
only works for HTTP... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
18cfe142-c31c-4e5f-ae01-eb944939842c | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,592 | supabase-export-v2 | c1e3ce27d8a295e9 | >>> import urllib.request >>> proxies = {'http': 'http://proxy.example.com:8080/'} >>> opener = urllib.request.build_opener(urllib.request.ProxyHandler(proxies)) >>> with opener.open("http://www.python.org") as f: ... f.read().decode('utf-8') ...
The following example uses no proxies at all, overriding environment sett... | trusted_official_docs | CPython Docs | >>> import urllib.request >>> proxies = {'http': 'http://proxy.example.com:8080/'} >>> opener = urllib.request.build_opener(urllib.request.ProxyHandler(proxies)) >>> with opener.open("http://www.python.org") as f: ... f.read().decode('utf-8') ...
The following example uses no proxies at all, overriding environment sett... | >>> import urllib.request >>> proxies = {'http': 'http://proxy.example.com:8080/'} >>> opener = urllib.request.build_opener(urllib.request.ProxyHandler(proxies)) >>> with opener.open("http://www.python.org") as f: ... f.read().decode('utf-8') ...
The following example uses no proxies at all, overriding environment sett... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
19f16952-c6ce-4f87-b6ab-04441d8ba00e | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,459 | supabase-export-v2 | 418c37c9c8ac6087 | .. method:: HTTPRedirectHandler.http_error_307(req, fp, code, msg, hdrs)
The same as :meth:`http_error_301`, but called for the 'temporary redirect'
response. It does not allow changing the request method from ``POST``
to ``GET``. | trusted_official_docs | CPython Docs | .. method:: HTTPRedirectHandler.http_error_307(req, fp, code, msg, hdrs)
The same as :meth:`http_error_301`, but called for the 'temporary redirect'
response. It does not allow changing the request method from ``POST``
to ``GET``. | .. method:: HTTPRedirectHandler.http_error_307(req, fp, code, msg, hdrs)
The same as :meth:`http_error_301`, but called for the 'temporary redirect'
response. It does not allow changing the request method from ``POST``
to ``GET``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1b55f3c8-e66c-4423-9b80-161b7d575a37 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,440 | supabase-export-v2 | 82c8886ae30bf168 | This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The return value should be a :class:`Request` object.
.. _protocol_response:
.. method:: BaseHandler.<protocol>_response(req, response)
:noindex: | trusted_official_docs | CPython Docs | This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The return value should be a :class:`Request` object.
.. _protocol_response:
.. method:: BaseHandler.<protocol>_response(req, response)
:noindex: | This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The return value should be a :class:`Request` object.
.. _protocol_response:
.. method:: BaseHandler.<protocol>_response(req, response)
:noindex: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1d077b31-5060-462e-9947-68fd0e7d25ff | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,248 | supabase-export-v2 | c0fd10270a2395df | Convert the given local path to a ``file:`` URL. This function uses :func:`~urllib.parse.quote` function to encode the path.
If *add_scheme* is false (the default), the return value omits the
``file:`` scheme prefix. Set *add_scheme* to true to return a complete URL. | trusted_official_docs | CPython Docs | Convert the given local path to a ``file:`` URL. This function uses :func:`~urllib.parse.quote` function to encode the path.
If *add_scheme* is false (the default), the return value omits the
``file:`` scheme prefix. Set *add_scheme* to true to return a complete URL. | Convert the given local path to a ``file:`` URL. This function uses :func:`~urllib.parse.quote` function to encode the path.
If *add_scheme* is false (the default), the return value omits the
``file:`` scheme prefix. Set *add_scheme* to true to return a complete URL. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2209a71a-5000-43ae-9880-afb943b09d92 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,272 | supabase-export-v2 | fe0294debbfaf8ed | *url* should be a string containing a valid, properly encoded URL.
*data* must be an object specifying additional data to send to the
server, or ``None`` if no such data is needed. Currently HTTP
requests are the only ones that use *data*. The supported object
types include bytes, file-like objects, and iterables of... | trusted_official_docs | CPython Docs | *url* should be a string containing a valid, properly encoded URL.
*data* must be an object specifying additional data to send to the
server, or ``None`` if no such data is needed. Currently HTTP
requests are the only ones that use *data*. The supported object
types include bytes, file-like objects, and iterables of... | *url* should be a string containing a valid, properly encoded URL.
*data* must be an object specifying additional data to send to the
server, or ``None`` if no such data is needed. Currently HTTP
requests are the only ones that use *data*. The supported object
types include bytes, file-like objects, and iterables of... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
227268ec-f8c9-4c1b-9a85-ea98d4f10649 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,252 | supabase-export-v2 | 699d2077d3a5185e | are no longer converted to uppercase, and ``:`` characters not following a drive letter no longer cause an :exc:`OSError` exception to be raised on Windows.
.. versionchanged:: 3.14
Paths beginning with a slash are converted to URLs with authority
sections. For example, the path ``/etc/hosts`` is converted to
the UR... | trusted_official_docs | CPython Docs | are no longer converted to uppercase, and ``:`` characters not following a drive letter no longer cause an :exc:`OSError` exception to be raised on Windows.
.. versionchanged:: 3.14
Paths beginning with a slash are converted to URLs with authority
sections. For example, the path ``/etc/hosts`` is converted to
the UR... | are no longer converted to uppercase, and ``:`` characters not following a drive letter no longer cause an :exc:`OSError` exception to be raised on Windows.
.. versionchanged:: 3.14
Paths beginning with a slash are converted to URLs with authority
sections. For example, the path ``/etc/hosts`` is converted to
the UR... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
25c18485-7c45-42db-acc0-e62bccf8c7c9 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,244 | supabase-export-v2 | 1a6541c18694f41d | unless the *handler*\s contain them, instances of them or subclasses of them: :class:`ProxyHandler` (if proxy settings are detected), :class:`UnknownHandler`, :class:`HTTPHandler`, :class:`HTTPDefaultErrorHandler`, :class:`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`, :class:`HTTPErrorProcessor`.
If ... | trusted_official_docs | CPython Docs | unless the *handler*\s contain them, instances of them or subclasses of them: :class:`ProxyHandler` (if proxy settings are detected), :class:`UnknownHandler`, :class:`HTTPHandler`, :class:`HTTPDefaultErrorHandler`, :class:`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`, :class:`HTTPErrorProcessor`.
If ... | unless the *handler*\s contain them, instances of them or subclasses of them: :class:`ProxyHandler` (if proxy settings are detected), :class:`UnknownHandler`, :class:`HTTPHandler`, :class:`HTTPDefaultErrorHandler`, :class:`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`, :class:`HTTPErrorProcessor`.
If ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
274a0c24-a72b-4e28-a7dd-28eeaf805f3e | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,398 | supabase-export-v2 | d8e03c27cbec6769 | is a special case which uses the HTTP response code to determine the specific error handler; refer to the :meth:`!http_error_\<type\>` methods of the handler classes.
Return values and exceptions raised are the same as those of :func:`urlopen`. | trusted_official_docs | CPython Docs | is a special case which uses the HTTP response code to determine the specific error handler; refer to the :meth:`!http_error_\<type\>` methods of the handler classes.
Return values and exceptions raised are the same as those of :func:`urlopen`. | is a special case which uses the HTTP response code to determine the specific error handler; refer to the :meth:`!http_error_\<type\>` methods of the handler classes.
Return values and exceptions raised are the same as those of :func:`urlopen`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
29a26ef9-a561-4e70-9a70-28eea849a2ed | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,405 | supabase-export-v2 | 17a2672608ed002f | Note that the implementation of these methods may involve calls of the parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :meth:`~OpenerDirector.error` methods.
#. Every handler with a method named like :meth:`!<protocol>_response` has that
method called to post-process the response. | trusted_official_docs | CPython Docs | Note that the implementation of these methods may involve calls of the parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :meth:`~OpenerDirector.error` methods.
#. Every handler with a method named like :meth:`!<protocol>_response` has that
method called to post-process the response. | Note that the implementation of these methods may involve calls of the parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :meth:`~OpenerDirector.error` methods.
#. Every handler with a method named like :meth:`!<protocol>_response` has that
method called to post-process the response. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
29cefa39-701a-499b-a087-3256ebebbef5 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,384 | supabase-export-v2 | 8492f005c75718df | would be the HTTP protocol response handler. Also *type* should be replaced with the actual HTTP code, for example :meth:`http_error_404` would handle HTTP 404 errors.
* :meth:`!<protocol>_open` --- signal that the handler knows how to open *protocol*
URLs. | trusted_official_docs | CPython Docs | would be the HTTP protocol response handler. Also *type* should be replaced with the actual HTTP code, for example :meth:`http_error_404` would handle HTTP 404 errors.
* :meth:`!<protocol>_open` --- signal that the handler knows how to open *protocol*
URLs. | would be the HTTP protocol response handler. Also *type* should be replaced with the actual HTTP code, for example :meth:`http_error_404` would handle HTTP 404 errors.
* :meth:`!<protocol>_open` --- signal that the handler knows how to open *protocol*
URLs. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2ab04e47-21c3-4fe2-8f51-ac419ae30d6e | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,322 | supabase-export-v2 | ee962c33a1c73e31 | .. class:: ProxyDigestAuthHandler(password_mgr=None)
Handle authentication with the proxy. *password_mgr*, if given, should be
something that is compatible with :class:`HTTPPasswordMgr`; refer to section
:ref:`http-password-mgr` for information on the interface that must be
supported. | trusted_official_docs | CPython Docs | .. class:: ProxyDigestAuthHandler(password_mgr=None)
Handle authentication with the proxy. *password_mgr*, if given, should be
something that is compatible with :class:`HTTPPasswordMgr`; refer to section
:ref:`http-password-mgr` for information on the interface that must be
supported. | .. class:: ProxyDigestAuthHandler(password_mgr=None)
Handle authentication with the proxy. *password_mgr*, if given, should be
something that is compatible with :class:`HTTPPasswordMgr`; refer to section
:ref:`http-password-mgr` for information on the interface that must be
supported. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2cee8c12-d0f7-40c5-92ce-76b876b4e426 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,283 | supabase-export-v2 | 6af88537539d0d8a | .. versionchanged:: 3.4 Default :attr:`Request.method` may be indicated at the class level.
.. versionchanged:: 3.6
Do not raise an error if the ``Content-Length`` has not been
provided and *data* is neither ``None`` nor a bytes object. Fall back to use chunked transfer encoding instead. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.4 Default :attr:`Request.method` may be indicated at the class level.
.. versionchanged:: 3.6
Do not raise an error if the ``Content-Length`` has not been
provided and *data* is neither ``None`` nor a bytes object. Fall back to use chunked transfer encoding instead. | .. versionchanged:: 3.4 Default :attr:`Request.method` may be indicated at the class level.
.. versionchanged:: 3.6
Do not raise an error if the ``Content-Length`` has not been
provided and *data* is neither ``None`` nor a bytes object. Fall back to use chunked transfer encoding instead. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2d80bdcd-4e2c-4291-ae8c-348a29d30f37 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,241 | supabase-export-v2 | bd16e6631a892908 | .. function:: install_opener(opener)
Install an :class:`OpenerDirector` instance as the default global opener. Installing an opener is only necessary if you want urlopen to use that
opener; otherwise, simply call :meth:`OpenerDirector.open` instead of
:func:`~urllib.request.urlopen`. The code does not check for a rea... | trusted_official_docs | CPython Docs | .. function:: install_opener(opener)
Install an :class:`OpenerDirector` instance as the default global opener. Installing an opener is only necessary if you want urlopen to use that
opener; otherwise, simply call :meth:`OpenerDirector.open` instead of
:func:`~urllib.request.urlopen`. The code does not check for a rea... | .. function:: install_opener(opener)
Install an :class:`OpenerDirector` instance as the default global opener. Installing an opener is only necessary if you want urlopen to use that
opener; otherwise, simply call :meth:`OpenerDirector.open` instead of
:func:`~urllib.request.urlopen`. The code does not check for a rea... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
300d6e24-0193-4cf5-8f3a-6ff791876c9e | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,258 | supabase-export-v2 | 3554f22454f11414 | 8089 §3 <8089#section-3>`). If the authority is still unhandled, then on Windows a UNC path is returned, and on other platforms a :exc:`~urllib.error.URLError` is raised.
This example shows the function being used on Windows:: | trusted_official_docs | CPython Docs | 8089 §3 <8089#section-3>`). If the authority is still unhandled, then on Windows a UNC path is returned, and on other platforms a :exc:`~urllib.error.URLError` is raised.
This example shows the function being used on Windows:: | 8089 §3 <8089#section-3>`). If the authority is still unhandled, then on Windows a UNC path is returned, and on other platforms a :exc:`~urllib.error.URLError` is raised.
This example shows the function being used on Windows:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3184216f-0805-49da-bd43-92d7815b8821 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,566 | supabase-export-v2 | c9a54c7bc235cda8 | It is also possible to achieve the same result without using the :term:`context manager` approach::
>>> import urllib.request
>>> f = urllib.request.urlopen('http://www.python.org/')
>>> try:
... print(f.read(100).decode('utf-8'))
... finally:
... f.close()
... <!doctype html>
<!--[if lt IE 7]> <html class="no-j... | trusted_official_docs | CPython Docs | It is also possible to achieve the same result without using the :term:`context manager` approach::
>>> import urllib.request
>>> f = urllib.request.urlopen('http://www.python.org/')
>>> try:
... print(f.read(100).decode('utf-8'))
... finally:
... f.close()
... <!doctype html>
<!--[if lt IE 7]> <html class="no-j... | It is also possible to achieve the same result without using the :term:`context manager` approach::
>>> import urllib.request
>>> f = urllib.request.urlopen('http://www.python.org/')
>>> try:
... print(f.read(100).decode('utf-8'))
... finally:
... f.close()
... <!doctype html>
<!--[if lt IE 7]> <html class="no-j... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
329c9b56-0172-42c2-be18-b68a2726c5cd | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,243 | supabase-export-v2 | 9b3fa5b8a75222bc | .. function:: build_opener([handler, ...])
Return an :class:`OpenerDirector` instance, which chains the handlers in the
order given. *handler*\s can be either instances of :class:`BaseHandler`, or
subclasses of :class:`BaseHandler` (in which case it must be possible to call
the constructor without any parameters). I... | trusted_official_docs | CPython Docs | .. function:: build_opener([handler, ...])
Return an :class:`OpenerDirector` instance, which chains the handlers in the
order given. *handler*\s can be either instances of :class:`BaseHandler`, or
subclasses of :class:`BaseHandler` (in which case it must be possible to call
the constructor without any parameters). I... | .. function:: build_opener([handler, ...])
Return an :class:`OpenerDirector` instance, which chains the handlers in the
order given. *handler*\s can be either instances of :class:`BaseHandler`, or
subclasses of :class:`BaseHandler` (in which case it must be possible to call
the constructor without any parameters). I... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
332443ea-0758-4554-9553-7d3d32b7609d | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,353 | supabase-export-v2 | ca41b2260b95bdc7 | .. attribute:: Request.method
The HTTP request method to use. By default its value is :const:`None`,
which means that :meth:`~Request.get_method` will do its normal computation
of the method to be used. Its value can be set (thus overriding the default
computation in :meth:`~Request.get_method`) either by providing ... | trusted_official_docs | CPython Docs | .. attribute:: Request.method
The HTTP request method to use. By default its value is :const:`None`,
which means that :meth:`~Request.get_method` will do its normal computation
of the method to be used. Its value can be set (thus overriding the default
computation in :meth:`~Request.get_method`) either by providing ... | .. attribute:: Request.method
The HTTP request method to use. By default its value is :const:`None`,
which means that :meth:`~Request.get_method` will do its normal computation
of the method to be used. Its value can be set (thus overriding the default
computation in :meth:`~Request.get_method`) either by providing ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
35a24773-bea3-425c-a2ce-3d4cd15a3ad1 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,230 | supabase-export-v2 | 70de72043a24e2ed | (for example, when a ``*_proxy`` environment variable like :envvar:`!http_proxy` is set), :class:`ProxyHandler` is default installed and makes sure the requests are handled through the proxy.
The legacy ``urllib.urlopen`` function from Python 2.6 and earlier has been
discontinued; :func:`urllib.request.urlopen` corres... | trusted_official_docs | CPython Docs | (for example, when a ``*_proxy`` environment variable like :envvar:`!http_proxy` is set), :class:`ProxyHandler` is default installed and makes sure the requests are handled through the proxy.
The legacy ``urllib.urlopen`` function from Python 2.6 and earlier has been
discontinued; :func:`urllib.request.urlopen` corres... | (for example, when a ``*_proxy`` environment variable like :envvar:`!http_proxy` is set), :class:`ProxyHandler` is default installed and makes sure the requests are handled through the proxy.
The legacy ``urllib.urlopen`` function from Python 2.6 and earlier has been
discontinued; :func:`urllib.request.urlopen` corres... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
364ff2e2-0249-4610-9bfa-154ddd9f7cc4 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,619 | supabase-export-v2 | ecfdcc29ea28d27c | .. index:: single: FTP
* The code handling the FTP protocol cannot differentiate between a file and a
directory. This can lead to unexpected behavior when attempting to read a URL
that points to a file that is not accessible. If the URL ends in a ``/``, it is
assumed to refer to a directory and will be handled accor... | trusted_official_docs | CPython Docs | .. index:: single: FTP
* The code handling the FTP protocol cannot differentiate between a file and a
directory. This can lead to unexpected behavior when attempting to read a URL
that points to a file that is not accessible. If the URL ends in a ``/``, it is
assumed to refer to a directory and will be handled accor... | .. index:: single: FTP
* The code handling the FTP protocol cannot differentiate between a file and a
directory. This can lead to unexpected behavior when attempting to read a URL
that points to a file that is not accessible. If the URL ends in a ``/``, it is
assumed to refer to a directory and will be handled accor... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3bff9ef0-7b1f-46e2-b98e-4d36f67905e1 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,568 | supabase-export-v2 | 9e070459a9e2ba81 | of a CGI and reading the data it returns to us. Note that this example will only work when the Python installation supports SSL. ::
>>> import urllib.request
>>> req = urllib.request.Request(url='https://localhost/cgi-bin/test.cgi',
... data=b'This data is passed to stdin of the CGI')
>>> with urllib.request.urlopen... | trusted_official_docs | CPython Docs | of a CGI and reading the data it returns to us. Note that this example will only work when the Python installation supports SSL. ::
>>> import urllib.request
>>> req = urllib.request.Request(url='https://localhost/cgi-bin/test.cgi',
... data=b'This data is passed to stdin of the CGI')
>>> with urllib.request.urlopen... | of a CGI and reading the data it returns to us. Note that this example will only work when the Python installation supports SSL. ::
>>> import urllib.request
>>> req = urllib.request.Request(url='https://localhost/cgi-bin/test.cgi',
... data=b'This data is passed to stdin of the CGI')
>>> with urllib.request.urlopen... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3c4df0a0-a2e5-46d7-beb5-f1ad88e1c7d8 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,320 | supabase-export-v2 | 38651ecd2a5fe984 | sent to Basic Authentication handler to Handle. This Handler method will raise a :exc:`ValueError` when presented with an authentication scheme other than Digest or Basic.
.. versionchanged:: 3.3
Raise :exc:`ValueError` on unsupported Authentication Scheme. | trusted_official_docs | CPython Docs | sent to Basic Authentication handler to Handle. This Handler method will raise a :exc:`ValueError` when presented with an authentication scheme other than Digest or Basic.
.. versionchanged:: 3.3
Raise :exc:`ValueError` on unsupported Authentication Scheme. | sent to Basic Authentication handler to Handle. This Handler method will raise a :exc:`ValueError` when presented with an authentication scheme other than Digest or Basic.
.. versionchanged:: 3.3
Raise :exc:`ValueError` on unsupported Authentication Scheme. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3d3b6eeb-3dfc-41e5-913b-9a21ca46f65d | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,565 | supabase-export-v2 | f50e973d224f48e8 | >>> with urllib.request.urlopen('http://www.python.org/') as f: ... print(f.read(100).decode('utf-8')) ... <!doctype html> <!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]--> <!-
It is also possible to achieve the same result without using the
:term:`context manager` approach:: | trusted_official_docs | CPython Docs | >>> with urllib.request.urlopen('http://www.python.org/') as f: ... print(f.read(100).decode('utf-8')) ... <!doctype html> <!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]--> <!-
It is also possible to achieve the same result without using the
:term:`context manager` approach:: | >>> with urllib.request.urlopen('http://www.python.org/') as f: ... print(f.read(100).decode('utf-8')) ... <!doctype html> <!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]--> <!-
It is also possible to achieve the same result without using the
:term:`context manager` approach:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3d53583d-74ad-4f85-a230-ae59afbba623 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,303 | supabase-export-v2 | f564f77484968c6c | .. class:: HTTPPasswordMgrWithDefaultRealm()
Keep a database of ``(realm, uri) -> (user, password)`` mappings. A realm of
``None`` is considered a catch-all realm, which is searched if no other realm
fits. | trusted_official_docs | CPython Docs | .. class:: HTTPPasswordMgrWithDefaultRealm()
Keep a database of ``(realm, uri) -> (user, password)`` mappings. A realm of
``None`` is considered a catch-all realm, which is searched if no other realm
fits. | .. class:: HTTPPasswordMgrWithDefaultRealm()
Keep a database of ``(realm, uri) -> (user, password)`` mappings. A realm of
``None`` is considered a catch-all realm, which is searched if no other realm
fits. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3fb0d717-0460-44ed-acd9-06ccee2ad174 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,588 | supabase-export-v2 | 928ef4ae4333a3b9 | import urllib.parse >>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) >>> url = "http://www.musi-cal.com/cgi-bin/query?%s" % params >>> with urllib.request.urlopen(url) as f: ... print(f.read().decode('utf-8')) ...
The following example uses the ``POST`` method instead. Note that params output
fro... | trusted_official_docs | CPython Docs | import urllib.parse >>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) >>> url = "http://www.musi-cal.com/cgi-bin/query?%s" % params >>> with urllib.request.urlopen(url) as f: ... print(f.read().decode('utf-8')) ...
The following example uses the ``POST`` method instead. Note that params output
fro... | import urllib.parse >>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) >>> url = "http://www.musi-cal.com/cgi-bin/query?%s" % params >>> with urllib.request.urlopen(url) as f: ... print(f.read().decode('utf-8')) ...
The following example uses the ``POST`` method instead. Note that params output
fro... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
40b982d6-10ac-43ad-9be9-fd701b2e9ec9 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,403 | supabase-export-v2 | eb3f0e292439b550 | stage ends when a handler either returns a non-\ :const:`None` value (ie. a response), or raises an exception (usually :exc:`~urllib.error.URLError`). Exceptions are allowed to propagate.
In fact, the above algorithm is first tried for methods named
:meth:`~BaseHandler.default_open`. If all such methods return :const:... | trusted_official_docs | CPython Docs | stage ends when a handler either returns a non-\ :const:`None` value (ie. a response), or raises an exception (usually :exc:`~urllib.error.URLError`). Exceptions are allowed to propagate.
In fact, the above algorithm is first tried for methods named
:meth:`~BaseHandler.default_open`. If all such methods return :const:... | stage ends when a handler either returns a non-\ :const:`None` value (ie. a response), or raises an exception (usually :exc:`~urllib.error.URLError`). Exceptions are allowed to propagate.
In fact, the above algorithm is first tried for methods named
:meth:`~BaseHandler.default_open`. If all such methods return :const:... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
40e3e17a-03cf-4d79-9d03-d957758e1770 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,245 | supabase-export-v2 | 5e48f19869ef306e | If the Python installation has SSL support (i.e., if the :mod:`ssl` module can be imported), :class:`HTTPSHandler` will also be added.
A :class:`BaseHandler` subclass may also change its :attr:`handler_order`
attribute to modify its position in the handlers list. | trusted_official_docs | CPython Docs | If the Python installation has SSL support (i.e., if the :mod:`ssl` module can be imported), :class:`HTTPSHandler` will also be added.
A :class:`BaseHandler` subclass may also change its :attr:`handler_order`
attribute to modify its position in the handlers list. | If the Python installation has SSL support (i.e., if the :mod:`ssl` module can be imported), :class:`HTTPSHandler` will also be added.
A :class:`BaseHandler` subclass may also change its :attr:`handler_order`
attribute to modify its position in the handlers list. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
41f66d40-5f88-4c44-931a-fadded88b702 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,562 | supabase-export-v2 | fd9ebe4a3169009b | The following HTML spec document, https://html.spec.whatwg.org/#charset, lists the various ways in which an HTML or an XML document could have specified its encoding information.
For additional information, see the W3C document: https://www.w3.org/International/questions/qa-html-encoding-declarations. | trusted_official_docs | CPython Docs | The following HTML spec document, https://html.spec.whatwg.org/#charset, lists the various ways in which an HTML or an XML document could have specified its encoding information.
For additional information, see the W3C document: https://www.w3.org/International/questions/qa-html-encoding-declarations. | The following HTML spec document, https://html.spec.whatwg.org/#charset, lists the various ways in which an HTML or an XML document could have specified its encoding information.
For additional information, see the W3C document: https://www.w3.org/International/questions/qa-html-encoding-declarations. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
42225a3d-2f47-43ed-89d1-1d950cfbd190 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,429 | supabase-export-v2 | b99f58d42cecc7e8 | .. method:: BaseHandler.http_error_default(req, fp, code, msg, hdrs)
This method is *not* defined in :class:`BaseHandler`, but subclasses should
override it if they intend to provide a catch-all for otherwise unhandled HTTP
errors. It will be called automatically by the :class:`OpenerDirector` getting
the error, and... | trusted_official_docs | CPython Docs | .. method:: BaseHandler.http_error_default(req, fp, code, msg, hdrs)
This method is *not* defined in :class:`BaseHandler`, but subclasses should
override it if they intend to provide a catch-all for otherwise unhandled HTTP
errors. It will be called automatically by the :class:`OpenerDirector` getting
the error, and... | .. method:: BaseHandler.http_error_default(req, fp, code, msg, hdrs)
This method is *not* defined in :class:`BaseHandler`, but subclasses should
override it if they intend to provide a catch-all for otherwise unhandled HTTP
errors. It will be called automatically by the :class:`OpenerDirector` getting
the error, and... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
437cf235-ceef-4f6e-bebe-124f5626b514 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,223 | supabase-export-v2 | 407b58ddd5a1f70d | like the connection attempt (if not specified, the global default timeout setting will be used). This actually only works for HTTP, HTTPS and FTP connections.
If *context* is specified, it must be a :class:`ssl.SSLContext` instance
describing the various SSL options. See :class:`~http.client.HTTPSConnection`
for more... | trusted_official_docs | CPython Docs | like the connection attempt (if not specified, the global default timeout setting will be used). This actually only works for HTTP, HTTPS and FTP connections.
If *context* is specified, it must be a :class:`ssl.SSLContext` instance
describing the various SSL options. See :class:`~http.client.HTTPSConnection`
for more... | like the connection attempt (if not specified, the global default timeout setting will be used). This actually only works for HTTP, HTTPS and FTP connections.
If *context* is specified, it must be a :class:`ssl.SSLContext` instance
describing the various SSL options. See :class:`~http.client.HTTPSConnection`
for more... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
442072d3-d979-4400-93b1-2577c55bb632 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,295 | supabase-export-v2 | 418bfd36a7e997fb | .. class:: ProxyHandler(proxies=None)
Cause requests to go through a proxy. If *proxies* is given, it must be a
dictionary mapping protocol names to URLs of proxies. The default is to read
the list of proxies from the environment variables
``<protocol>_proxy``. If no proxy environment variables are set, then
in a W... | trusted_official_docs | CPython Docs | .. class:: ProxyHandler(proxies=None)
Cause requests to go through a proxy. If *proxies* is given, it must be a
dictionary mapping protocol names to URLs of proxies. The default is to read
the list of proxies from the environment variables
``<protocol>_proxy``. If no proxy environment variables are set, then
in a W... | .. class:: ProxyHandler(proxies=None)
Cause requests to go through a proxy. If *proxies* is given, it must be a
dictionary mapping protocol names to URLs of proxies. The default is to read
the list of proxies from the environment variables
``<protocol>_proxy``. If no proxy environment variables are set, then
in a W... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
45aec4d2-2967-4d1e-92c4-3e1971c56082 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,475 | supabase-export-v2 | 303d66bd44f1a98d | .. method:: HTTPPasswordMgr.add_password(realm, uri, user, passwd)
*uri* can be either a single URI, or a sequence of URIs. *realm*, *user* and
*passwd* must be strings. This causes ``(user, passwd)`` to be used as
authentication tokens when authentication for *realm* and a super-URI of any of
the given URIs is give... | trusted_official_docs | CPython Docs | .. method:: HTTPPasswordMgr.add_password(realm, uri, user, passwd)
*uri* can be either a single URI, or a sequence of URIs. *realm*, *user* and
*passwd* must be strings. This causes ``(user, passwd)`` to be used as
authentication tokens when authentication for *realm* and a super-URI of any of
the given URIs is give... | .. method:: HTTPPasswordMgr.add_password(realm, uri, user, passwd)
*uri* can be either a single URI, or a sequence of URIs. *realm*, *user* and
*passwd* must be strings. This causes ``(user, passwd)`` to be used as
authentication tokens when authentication for *realm* and a super-URI of any of
the given URIs is give... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
461417b5-3288-498e-900f-8e8349c9449e | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,273 | supabase-export-v2 | b1500380dc7012d0 | will be used to send bytes objects, while ``Transfer-Encoding: chunked`` as specified in :rfc:`7230`, Section 3.3.1 will be used to send files and other iterables.
For an HTTP POST request method, *data* should be a buffer in the
standard :mimetype:`application/x-www-form-urlencoded` format. The
:func:`urllib.parse.u... | trusted_official_docs | CPython Docs | will be used to send bytes objects, while ``Transfer-Encoding: chunked`` as specified in :rfc:`7230`, Section 3.3.1 will be used to send files and other iterables.
For an HTTP POST request method, *data* should be a buffer in the
standard :mimetype:`application/x-www-form-urlencoded` format. The
:func:`urllib.parse.u... | will be used to send bytes objects, while ``Transfer-Encoding: chunked`` as specified in :rfc:`7230`, Section 3.3.1 will be used to send files and other iterables.
For an HTTP POST request method, *data* should be a buffer in the
standard :mimetype:`application/x-www-form-urlencoded` format. The
:func:`urllib.parse.u... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4b20727d-071a-4e5e-b6e9-331984ff6469 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,560 | supabase-export-v2 | 99bcd10cfa5bb58f | html>\n<!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]-->\n<!--[if IE 7]> <html class="no-js ie7 lt-ie8 lt-ie9"> <![endif]-->\n<!--[if IE 8]> <html class="no-js ie8 lt-ie9">
Note that urlopen returns a bytes object. This is because there is no way
for urlopen to automatically determine the enc... | trusted_official_docs | CPython Docs | html>\n<!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]-->\n<!--[if IE 7]> <html class="no-js ie7 lt-ie8 lt-ie9"> <![endif]-->\n<!--[if IE 8]> <html class="no-js ie8 lt-ie9">
Note that urlopen returns a bytes object. This is because there is no way
for urlopen to automatically determine the enc... | html>\n<!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]-->\n<!--[if IE 7]> <html class="no-js ie7 lt-ie8 lt-ie9"> <![endif]-->\n<!--[if IE 8]> <html class="no-js ie8 lt-ie9">
Note that urlopen returns a bytes object. This is because there is no way
for urlopen to automatically determine the enc... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4b64637c-def3-446e-a5b8-5d642f7bfe28 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,430 | supabase-export-v2 | 944f719c56b9bc75 | for otherwise unhandled HTTP errors. It will be called automatically by the :class:`OpenerDirector` getting the error, and should not normally be called in other circumstances.
:class:`OpenerDirector` will call this method with five positional arguments: | trusted_official_docs | CPython Docs | for otherwise unhandled HTTP errors. It will be called automatically by the :class:`OpenerDirector` getting the error, and should not normally be called in other circumstances.
:class:`OpenerDirector` will call this method with five positional arguments: | for otherwise unhandled HTTP errors. It will be called automatically by the :class:`OpenerDirector` getting the error, and should not normally be called in other circumstances.
:class:`OpenerDirector` will call this method with five positional arguments: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4b7199ab-3d60-4ded-ab4e-2d6c73f3e965 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,316 | supabase-export-v2 | 624dfe026d19eb2d | .. class:: AbstractDigestAuthHandler(password_mgr=None)
This is a mixin class that helps with HTTP authentication, both to the remote
host and to a proxy. *password_mgr*, if given, should be something that is
compatible with :class:`HTTPPasswordMgr`; refer to section
:ref:`http-password-mgr` for information on the i... | trusted_official_docs | CPython Docs | .. class:: AbstractDigestAuthHandler(password_mgr=None)
This is a mixin class that helps with HTTP authentication, both to the remote
host and to a proxy. *password_mgr*, if given, should be something that is
compatible with :class:`HTTPPasswordMgr`; refer to section
:ref:`http-password-mgr` for information on the i... | .. class:: AbstractDigestAuthHandler(password_mgr=None)
This is a mixin class that helps with HTTP authentication, both to the remote
host and to a proxy. *password_mgr*, if given, should be something that is
compatible with :class:`HTTPPasswordMgr`; refer to section
:ref:`http-password-mgr` for information on the i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4c0b3795-c6cd-40fb-b5ab-d0e3d7b15dae | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,431 | supabase-export-v2 | a355fe6210e68744 | :class:`OpenerDirector` will call this method with five positional arguments:
1. a :class:`Request` object,
#. a file-like object with the HTTP error body,
#. the three-digit code of the error, as a string,
#. the user-visible explanation of the code, as a string, and
#. the headers of the error, as a mapping objec... | trusted_official_docs | CPython Docs | :class:`OpenerDirector` will call this method with five positional arguments:
1. a :class:`Request` object,
#. a file-like object with the HTTP error body,
#. the three-digit code of the error, as a string,
#. the user-visible explanation of the code, as a string, and
#. the headers of the error, as a mapping objec... | :class:`OpenerDirector` will call this method with five positional arguments:
1. a :class:`Request` object,
#. a file-like object with the HTTP error body,
#. the three-digit code of the error, as a string,
#. the user-visible explanation of the code, as a string, and
#. the headers of the error, as a mapping objec... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4d541dab-3a97-43a3-b475-b7997ae4cbd9 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,442 | supabase-export-v2 | a053955f9c499595 | This method is *not* defined in :class:`BaseHandler`, but subclasses should define it if they want to post-process responses of the given protocol.
This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. *response* will be an object
implementing the same ... | trusted_official_docs | CPython Docs | This method is *not* defined in :class:`BaseHandler`, but subclasses should define it if they want to post-process responses of the given protocol.
This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. *response* will be an object
implementing the same ... | This method is *not* defined in :class:`BaseHandler`, but subclasses should define it if they want to post-process responses of the given protocol.
This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. *response* will be an object
implementing the same ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4e475cad-c732-4778-b69e-c80e7e7e1093 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,582 | supabase-export-v2 | 4c7530c8ed5eec5d | import urllib.request req = urllib.request.Request('http://www.example.com/') req.add_header('Referer', 'http://www.python.org/') # Customize the default User-Agent header value: req.add_header('User-Agent', 'urllib-example/0.1 (Contact: . . .)') with urllib.request.urlopen(req) as f: print(f.read().decode('utf-8'))
:c... | trusted_official_docs | CPython Docs | import urllib.request req = urllib.request.Request('http://www.example.com/') req.add_header('Referer', 'http://www.python.org/') # Customize the default User-Agent header value: req.add_header('User-Agent', 'urllib-example/0.1 (Contact: . . .)') with urllib.request.urlopen(req) as f: print(f.read().decode('utf-8'))
:c... | import urllib.request req = urllib.request.Request('http://www.example.com/') req.add_header('Referer', 'http://www.python.org/') # Customize the default User-Agent header value: req.add_header('User-Agent', 'urllib-example/0.1 (Contact: . . .)') with urllib.request.urlopen(req) as f: print(f.read().decode('utf-8'))
:c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4eda5c67-0384-4def-b0bf-7ef1d9908b35 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,261 | supabase-export-v2 | eb7e016ade03b27c | are no longer converted to uppercase, and ``:`` characters not following a drive letter no longer cause an :exc:`OSError` exception to be raised on Windows.
.. versionchanged:: 3.14
The URL authority is discarded if it matches the local hostname. Otherwise, if the authority isn't empty or ``localhost``, then on
Windo... | trusted_official_docs | CPython Docs | are no longer converted to uppercase, and ``:`` characters not following a drive letter no longer cause an :exc:`OSError` exception to be raised on Windows.
.. versionchanged:: 3.14
The URL authority is discarded if it matches the local hostname. Otherwise, if the authority isn't empty or ``localhost``, then on
Windo... | are no longer converted to uppercase, and ``:`` characters not following a drive letter no longer cause an :exc:`OSError` exception to be raised on Windows.
.. versionchanged:: 3.14
The URL authority is discarded if it matches the local hostname. Otherwise, if the authority isn't empty or ``localhost``, then on
Windo... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
50f824e4-0b33-4a1a-b1e0-a06a0f3d221a | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,446 | supabase-export-v2 | 840f378ad1935277 | .. note::
Some HTTP redirections require action from this module's client code. If this
is the case, :exc:`~urllib.error.HTTPError` is raised. See :rfc:`2616` for
details of the precise meanings of the various redirection codes. | trusted_official_docs | CPython Docs | .. note::
Some HTTP redirections require action from this module's client code. If this
is the case, :exc:`~urllib.error.HTTPError` is raised. See :rfc:`2616` for
details of the precise meanings of the various redirection codes. | .. note::
Some HTTP redirections require action from this module's client code. If this
is the case, :exc:`~urllib.error.HTTPError` is raised. See :rfc:`2616` for
details of the precise meanings of the various redirection codes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5564661a-f8c1-45c7-bcbe-64e738700ee6 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,439 | supabase-export-v2 | e2891a6ed6d7a143 | This method is *not* defined in :class:`BaseHandler`, but subclasses should define it if they want to pre-process requests of the given protocol.
This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The return value should be a
:class:`Request` object. | trusted_official_docs | CPython Docs | This method is *not* defined in :class:`BaseHandler`, but subclasses should define it if they want to pre-process requests of the given protocol.
This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The return value should be a
:class:`Request` object. | This method is *not* defined in :class:`BaseHandler`, but subclasses should define it if they want to pre-process requests of the given protocol.
This method, if defined, will be called by the parent :class:`OpenerDirector`. *req* will be a :class:`Request` object. The return value should be a
:class:`Request` object. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5bebb380-34b7-4471-906d-557236b4ebdd | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,221 | supabase-export-v2 | 0aef6009e9a641e5 | must be an object specifying additional data to be sent to the server, or ``None`` if no such data is needed. See :class:`Request` for details.
urllib.request module uses HTTP/1.1 and includes ``Connection:close`` header
in its HTTP requests. | trusted_official_docs | CPython Docs | must be an object specifying additional data to be sent to the server, or ``None`` if no such data is needed. See :class:`Request` for details.
urllib.request module uses HTTP/1.1 and includes ``Connection:close`` header
in its HTTP requests. | must be an object specifying additional data to be sent to the server, or ``None`` if no such data is needed. See :class:`Request` for details.
urllib.request module uses HTTP/1.1 and includes ``Connection:close`` header
in its HTTP requests. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5db720a9-0255-4300-b214-dfaeb7da8326 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,434 | supabase-export-v2 | b81b77aa3067b615 | .. _http_error_nnn: .. method:: BaseHandler.http_error_<nnn>(req, fp, code, msg, hdrs)
*nnn* should be a three-digit HTTP error code. This method is also not defined
in :class:`BaseHandler`, but will be called, if it exists, on an instance of a
subclass, when an HTTP error with code *nnn* occurs. | trusted_official_docs | CPython Docs | .. _http_error_nnn: .. method:: BaseHandler.http_error_<nnn>(req, fp, code, msg, hdrs)
*nnn* should be a three-digit HTTP error code. This method is also not defined
in :class:`BaseHandler`, but will be called, if it exists, on an instance of a
subclass, when an HTTP error with code *nnn* occurs. | .. _http_error_nnn: .. method:: BaseHandler.http_error_<nnn>(req, fp, code, msg, hdrs)
*nnn* should be a three-digit HTTP error code. This method is also not defined
in :class:`BaseHandler`, but will be called, if it exists, on an instance of a
subclass, when an HTTP error with code *nnn* occurs. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5f1105e1-e10e-412e-a108-66b1bb0177db | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,275 | supabase-export-v2 | 94517967d8800796 | (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11"``, while :mod:`urllib`'s default user agent string is ``"Python-urllib/2.6"`` (on Python 2.6). All header keys are sent in camel case.
An appropriate ``Content-Type`` header should be included if the *data*
argument is present. If this header has not been provided ... | trusted_official_docs | CPython Docs | (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11"``, while :mod:`urllib`'s default user agent string is ``"Python-urllib/2.6"`` (on Python 2.6). All header keys are sent in camel case.
An appropriate ``Content-Type`` header should be included if the *data*
argument is present. If this header has not been provided ... | (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11"``, while :mod:`urllib`'s default user agent string is ``"Python-urllib/2.6"`` (on Python 2.6). All header keys are sent in camel case.
An appropriate ``Content-Type`` header should be included if the *data*
argument is present. If this header has not been provided ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
608c4364-16e7-423d-a676-a09b3bd679c5 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,527 | supabase-export-v2 | 1f336ccdb76c612f | Open the file locally, if there is no host name, or the host name is ``'localhost'``.
.. versionchanged:: 3.2
This method is applicable only for local hostnames. When a remote
hostname is given, a :exc:`~urllib.error.URLError` is raised. | trusted_official_docs | CPython Docs | Open the file locally, if there is no host name, or the host name is ``'localhost'``.
.. versionchanged:: 3.2
This method is applicable only for local hostnames. When a remote
hostname is given, a :exc:`~urllib.error.URLError` is raised. | Open the file locally, if there is no host name, or the host name is ``'localhost'``.
.. versionchanged:: 3.2
This method is applicable only for local hostnames. When a remote
hostname is given, a :exc:`~urllib.error.URLError` is raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
63fab82d-2f43-467e-9317-6e6c78b8e648 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,461 | supabase-export-v2 | e51afe6848368941 | .. method:: HTTPRedirectHandler.http_error_308(req, fp, code, msg, hdrs)
The same as :meth:`http_error_301`, but called for the 'permanent redirect'
response. It does not allow changing the request method from ``POST``
to ``GET``. | trusted_official_docs | CPython Docs | .. method:: HTTPRedirectHandler.http_error_308(req, fp, code, msg, hdrs)
The same as :meth:`http_error_301`, but called for the 'permanent redirect'
response. It does not allow changing the request method from ``POST``
to ``GET``. | .. method:: HTTPRedirectHandler.http_error_308(req, fp, code, msg, hdrs)
The same as :meth:`http_error_301`, but called for the 'permanent redirect'
response. It does not allow changing the request method from ``POST``
to ``GET``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
65c68376-6b4c-492c-97a0-336c8bcca217 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,460 | supabase-export-v2 | 3b52e9c40a2c5c0c | The same as :meth:`http_error_301`, but called for the 'temporary redirect' response. It does not allow changing the request method from ``POST`` to ``GET``.
.. method:: HTTPRedirectHandler.http_error_308(req, fp, code, msg, hdrs) | trusted_official_docs | CPython Docs | The same as :meth:`http_error_301`, but called for the 'temporary redirect' response. It does not allow changing the request method from ``POST`` to ``GET``.
.. method:: HTTPRedirectHandler.http_error_308(req, fp, code, msg, hdrs) | The same as :meth:`http_error_301`, but called for the 'temporary redirect' response. It does not allow changing the request method from ``POST`` to ``GET``.
.. method:: HTTPRedirectHandler.http_error_308(req, fp, code, msg, hdrs) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
65d9baa0-f9f5-4ed1-8f84-f583c895f3f4 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,603 | supabase-export-v2 | 94d36d4eac0ee820 | was less than the expected amount (which is the size reported by a *Content-Length* header). This can occur, for example, when the download is interrupted.
The *Content-Length* is treated as a lower bound: if there's more data to read,
urlretrieve reads more data, but if less data is available, it raises the
exceptio... | trusted_official_docs | CPython Docs | was less than the expected amount (which is the size reported by a *Content-Length* header). This can occur, for example, when the download is interrupted.
The *Content-Length* is treated as a lower bound: if there's more data to read,
urlretrieve reads more data, but if less data is available, it raises the
exceptio... | was less than the expected amount (which is the size reported by a *Content-Length* header). This can occur, for example, when the download is interrupted.
The *Content-Length* is treated as a lower bound: if there's more data to read,
urlretrieve reads more data, but if less data is available, it raises the
exceptio... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
65e32fe3-99a4-48a5-85c1-7b9173aff330 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,613 | supabase-export-v2 | c5e5c7e7e06a7b78 | * The caching feature of :func:`urlretrieve` has been disabled until someone finds the time to hack proper processing of Expiration time headers.
* There should be a function to query whether a particular URL is in the cache. | trusted_official_docs | CPython Docs | * The caching feature of :func:`urlretrieve` has been disabled until someone finds the time to hack proper processing of Expiration time headers.
* There should be a function to query whether a particular URL is in the cache. | * The caching feature of :func:`urlretrieve` has been disabled until someone finds the time to hack proper processing of Expiration time headers.
* There should be a function to query whether a particular URL is in the cache. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
666eeef0-6cc3-4b15-8760-7eb8b4a37c0a | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,336 | supabase-export-v2 | 01f35f29b0a374dc | Request Objects ---------------
The following methods describe :class:`Request`'s public interface,
and so all may be overridden in subclasses. It also defines several
public attributes that can be used by clients to inspect the parsed
request. | trusted_official_docs | CPython Docs | Request Objects ---------------
The following methods describe :class:`Request`'s public interface,
and so all may be overridden in subclasses. It also defines several
public attributes that can be used by clients to inspect the parsed
request. | Request Objects ---------------
The following methods describe :class:`Request`'s public interface,
and so all may be overridden in subclasses. It also defines several
public attributes that can be used by clients to inspect the parsed
request. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6894ef93-d569-40c4-b9a4-0622a9cf44f9 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,531 | supabase-export-v2 | 710917b71f14ecc6 | .. method:: DataHandler.data_open(req)
Read a data URL. This kind of URL contains the content encoded in the URL
itself. The data URL syntax is specified in :rfc:`2397`. This implementation
ignores white spaces in base64 encoded data URLs so the URL may be wrapped
in whatever source file it comes from. But even thou... | trusted_official_docs | CPython Docs | .. method:: DataHandler.data_open(req)
Read a data URL. This kind of URL contains the content encoded in the URL
itself. The data URL syntax is specified in :rfc:`2397`. This implementation
ignores white spaces in base64 encoded data URLs so the URL may be wrapped
in whatever source file it comes from. But even thou... | .. method:: DataHandler.data_open(req)
Read a data URL. This kind of URL contains the content encoded in the URL
itself. The data URL syntax is specified in :rfc:`2397`. This implementation
ignores white spaces in base64 encoded data URLs so the URL may be wrapped
in whatever source file it comes from. But even thou... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6a1f4101-73da-4adb-933d-5c3bf5aeb450 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,435 | supabase-export-v2 | 587d18d0e8c4b41b | not defined in :class:`BaseHandler`, but will be called, if it exists, on an instance of a subclass, when an HTTP error with code *nnn* occurs.
Subclasses should override this method to handle specific HTTP errors. | trusted_official_docs | CPython Docs | not defined in :class:`BaseHandler`, but will be called, if it exists, on an instance of a subclass, when an HTTP error with code *nnn* occurs.
Subclasses should override this method to handle specific HTTP errors. | not defined in :class:`BaseHandler`, but will be called, if it exists, on an instance of a subclass, when an HTTP error with code *nnn* occurs.
Subclasses should override this method to handle specific HTTP errors. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
705e960e-894a-4196-8a51-7446ce8083c0 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,591 | supabase-export-v2 | 3932bff94f2792a6 | The following example uses an explicitly specified HTTP proxy, overriding environment settings::
>>> import urllib.request
>>> proxies = {'http': 'http://proxy.example.com:8080/'}
>>> opener = urllib.request.build_opener(urllib.request.ProxyHandler(proxies))
>>> with opener.open("http://www.python.org") as f:
... f... | trusted_official_docs | CPython Docs | The following example uses an explicitly specified HTTP proxy, overriding environment settings::
>>> import urllib.request
>>> proxies = {'http': 'http://proxy.example.com:8080/'}
>>> opener = urllib.request.build_opener(urllib.request.ProxyHandler(proxies))
>>> with opener.open("http://www.python.org") as f:
... f... | The following example uses an explicitly specified HTTP proxy, overriding environment settings::
>>> import urllib.request
>>> proxies = {'http': 'http://proxy.example.com:8080/'}
>>> opener = urllib.request.build_opener(urllib.request.ProxyHandler(proxies))
>>> with opener.open("http://www.python.org") as f:
... f... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
70b261a2-aead-47f3-b261-a66b1840f247 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,402 | supabase-export-v2 | e5e34fb5f2abe5bf | #. Every handler with a method named like :meth:`!<protocol>_request` has that method called to pre-process the request.
#. Handlers with a method named like :meth:`!<protocol>_open` are called to handle
the request. This stage ends when a handler either returns a non-\ :const:`None`
value (ie. a response), or raises... | trusted_official_docs | CPython Docs | #. Every handler with a method named like :meth:`!<protocol>_request` has that method called to pre-process the request.
#. Handlers with a method named like :meth:`!<protocol>_open` are called to handle
the request. This stage ends when a handler either returns a non-\ :const:`None`
value (ie. a response), or raises... | #. Every handler with a method named like :meth:`!<protocol>_request` has that method called to pre-process the request.
#. Handlers with a method named like :meth:`!<protocol>_open` are called to handle
the request. This stage ends when a handler either returns a non-\ :const:`None`
value (ie. a response), or raises... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
729ba2a3-24e9-41b4-bf32-4391c9844492 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,220 | supabase-export-v2 | 4dd07c5d9e595574 | Open *url*, which can be either a string containing a valid, properly encoded URL, or a :class:`Request` object.
*data* must be an object specifying additional data to be sent to the
server, or ``None`` if no such data is needed. See :class:`Request`
for details. | trusted_official_docs | CPython Docs | Open *url*, which can be either a string containing a valid, properly encoded URL, or a :class:`Request` object.
*data* must be an object specifying additional data to be sent to the
server, or ``None`` if no such data is needed. See :class:`Request`
for details. | Open *url*, which can be either a string containing a valid, properly encoded URL, or a :class:`Request` object.
*data* must be an object specifying additional data to be sent to the
server, or ``None`` if no such data is needed. See :class:`Request`
for details. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
75d57d9b-729a-4e00-b0b5-f6c286c92936 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,281 | supabase-export-v2 | 2236796addad3f07 | authentication. The *data* is sent to the HTTP server right away after the headers. There is no support for a 100-continue expectation in the library.
.. versionchanged:: 3.3
:attr:`Request.method` argument is added to the Request class. | trusted_official_docs | CPython Docs | authentication. The *data* is sent to the HTTP server right away after the headers. There is no support for a 100-continue expectation in the library.
.. versionchanged:: 3.3
:attr:`Request.method` argument is added to the Request class. | authentication. The *data* is sent to the HTTP server right away after the headers. There is no support for a 100-continue expectation in the library.
.. versionchanged:: 3.3
:attr:`Request.method` argument is added to the Request class. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
767fa087-7372-4d04-a184-cac0c3c9b512 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,623 | supabase-export-v2 | a61d9d101bc20b6e | .. module:: urllib.response :synopsis: Response classes used by urllib.
The :mod:`!urllib.response` module defines functions and classes which define a
minimal file-like interface, including ``read()`` and ``readline()``. Functions defined by this module are used internally by the :mod:`!urllib.request` module. The typ... | trusted_official_docs | CPython Docs | .. module:: urllib.response :synopsis: Response classes used by urllib.
The :mod:`!urllib.response` module defines functions and classes which define a
minimal file-like interface, including ``read()`` and ``readline()``. Functions defined by this module are used internally by the :mod:`!urllib.request` module. The typ... | .. module:: urllib.response :synopsis: Response classes used by urllib.
The :mod:`!urllib.response` module defines functions and classes which define a
minimal file-like interface, including ``read()`` and ``readline()``. Functions defined by this module are used internally by the :mod:`!urllib.request` module. The typ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7a7f9fd8-7f18-4ee2-b09e-36981ddc5c47 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,276 | supabase-export-v2 | 8effc0f6f7d08553 | the *data* argument is present. If this header has not been provided and *data* is not ``None``, ``Content-Type: application/x-www-form-urlencoded`` will be added as a default.
The next two arguments are only of interest for correct handling
of third-party HTTP cookies: | trusted_official_docs | CPython Docs | the *data* argument is present. If this header has not been provided and *data* is not ``None``, ``Content-Type: application/x-www-form-urlencoded`` will be added as a default.
The next two arguments are only of interest for correct handling
of third-party HTTP cookies: | the *data* argument is present. If this header has not been provided and *data* is not ``None``, ``Content-Type: application/x-www-form-urlencoded`` will be added as a default.
The next two arguments are only of interest for correct handling
of third-party HTTP cookies: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7c6605ca-7368-4bf6-9313-192590ec9a42 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,395 | supabase-export-v2 | 92d86f778c26476e | .. method:: OpenerDirector.open(url, data=None[, timeout])
Open the given *url* (which can be a request object or a string), optionally
passing the given *data*. Arguments, return values and exceptions raised are
the same as those of :func:`urlopen` (which simply calls the :meth:`open`
method on the currently instal... | trusted_official_docs | CPython Docs | .. method:: OpenerDirector.open(url, data=None[, timeout])
Open the given *url* (which can be a request object or a string), optionally
passing the given *data*. Arguments, return values and exceptions raised are
the same as those of :func:`urlopen` (which simply calls the :meth:`open`
method on the currently instal... | .. method:: OpenerDirector.open(url, data=None[, timeout])
Open the given *url* (which can be a request object or a string), optionally
passing the given *data*. Arguments, return values and exceptions raised are
the same as those of :func:`urlopen` (which simply calls the :meth:`open`
method on the currently instal... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7de81d6a-3b40-47e9-a772-a69cf3928f92 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,563 | supabase-export-v2 | 2c6582af20a8f010 | For additional information, see the W3C document: https://www.w3.org/International/questions/qa-html-encoding-declarations.
As the python.org website uses *utf-8* encoding as specified in its meta tag, we
will use the same for decoding the bytes object:: | trusted_official_docs | CPython Docs | For additional information, see the W3C document: https://www.w3.org/International/questions/qa-html-encoding-declarations.
As the python.org website uses *utf-8* encoding as specified in its meta tag, we
will use the same for decoding the bytes object:: | For additional information, see the W3C document: https://www.w3.org/International/questions/qa-html-encoding-declarations.
As the python.org website uses *utf-8* encoding as specified in its meta tag, we
will use the same for decoding the bytes object:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7eb04f8d-480a-488d-af15-461127f2afc4 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,267 | supabase-export-v2 | 725bcf65ff60e09d | .. note::
If the environment variable ``REQUEST_METHOD`` is set, which usually
indicates your script is running in a CGI environment, the environment
variable ``HTTP_PROXY`` (uppercase ``_PROXY``) will be ignored. This is
because that variable can be injected by a client using the "Proxy:" HTTP
header. If you need ... | trusted_official_docs | CPython Docs | .. note::
If the environment variable ``REQUEST_METHOD`` is set, which usually
indicates your script is running in a CGI environment, the environment
variable ``HTTP_PROXY`` (uppercase ``_PROXY``) will be ignored. This is
because that variable can be injected by a client using the "Proxy:" HTTP
header. If you need ... | .. note::
If the environment variable ``REQUEST_METHOD`` is set, which usually
indicates your script is running in a CGI environment, the environment
variable ``HTTP_PROXY`` (uppercase ``_PROXY``) will be ignored. This is
because that variable can be injected by a client using the "Proxy:" HTTP
header. If you need ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
81255c33-8b29-45e1-ada6-7313e484dcad | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,420 | supabase-export-v2 | 758f6c5ba77fd949 | This method is *not* defined in :class:`BaseHandler`, but subclasses should define it if they want to catch all URLs.
This method, if implemented, will be called by the parent
:class:`OpenerDirector`. It should return a file-like object as described in
the return value of the :meth:`~OpenerDirector.open` method of :c... | trusted_official_docs | CPython Docs | This method is *not* defined in :class:`BaseHandler`, but subclasses should define it if they want to catch all URLs.
This method, if implemented, will be called by the parent
:class:`OpenerDirector`. It should return a file-like object as described in
the return value of the :meth:`~OpenerDirector.open` method of :c... | This method is *not* defined in :class:`BaseHandler`, but subclasses should define it if they want to catch all URLs.
This method, if implemented, will be called by the parent
:class:`OpenerDirector`. It should return a file-like object as described in
the return value of the :meth:`~OpenerDirector.open` method of :c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
82d33fc3-d5da-4024-a23c-cac1a15959b0 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,552 | supabase-export-v2 | b8ad10e5320f51ac | For 200 error codes, the response object is returned immediately.
For non-200 error codes, this simply passes the job on to the
:meth:`!http_error_\<type\>` handler methods, via :meth:`OpenerDirector.error`. Eventually, :class:`HTTPDefaultErrorHandler` will raise an
:exc:`~urllib.error.HTTPError` if no other handler ... | trusted_official_docs | CPython Docs | For 200 error codes, the response object is returned immediately.
For non-200 error codes, this simply passes the job on to the
:meth:`!http_error_\<type\>` handler methods, via :meth:`OpenerDirector.error`. Eventually, :class:`HTTPDefaultErrorHandler` will raise an
:exc:`~urllib.error.HTTPError` if no other handler ... | For 200 error codes, the response object is returned immediately.
For non-200 error codes, this simply passes the job on to the
:meth:`!http_error_\<type\>` handler methods, via :meth:`OpenerDirector.error`. Eventually, :class:`HTTPDefaultErrorHandler` will raise an
:exc:`~urllib.error.HTTPError` if no other handler ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8333c86b-3eef-49bc-941d-862c314d6b38 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,280 | supabase-export-v2 | 2623eaffab84fb8d | is ``'GET'`` if *data* is ``None`` or ``'POST'`` otherwise. Subclasses may indicate a different default method by setting the :attr:`~Request.method` attribute in the class itself.
.. note::
The request will not work as expected if the data object is unable
to deliver its content more than once (e.g. a file or an ite... | trusted_official_docs | CPython Docs | is ``'GET'`` if *data* is ``None`` or ``'POST'`` otherwise. Subclasses may indicate a different default method by setting the :attr:`~Request.method` attribute in the class itself.
.. note::
The request will not work as expected if the data object is unable
to deliver its content more than once (e.g. a file or an ite... | is ``'GET'`` if *data* is ``None`` or ``'POST'`` otherwise. Subclasses may indicate a different default method by setting the :attr:`~Request.method` attribute in the class itself.
.. note::
The request will not work as expected if the data object is unable
to deliver its content more than once (e.g. a file or an ite... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
84b28aa4-fc43-43ad-853d-bfa62954be0c | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,448 | supabase-export-v2 | c45c84a2b691cd62 | :exc:`~urllib.error.HTTPError` exception raised as a security consideration if the HTTPRedirectHandler is presented with a redirected URL which is not an HTTP, HTTPS or FTP URL.
.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl) | trusted_official_docs | CPython Docs | :exc:`~urllib.error.HTTPError` exception raised as a security consideration if the HTTPRedirectHandler is presented with a redirected URL which is not an HTTP, HTTPS or FTP URL.
.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl) | :exc:`~urllib.error.HTTPError` exception raised as a security consideration if the HTTPRedirectHandler is presented with a redirected URL which is not an HTTP, HTTPS or FTP URL.
.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
862ec30f-ae23-4204-ab50-da0bec6e9c6f | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,617 | supabase-export-v2 | 06db268e62774723 | .. index:: single: HTML pair: HTTP; protocol
* The data returned by :func:`urlopen` or :func:`urlretrieve` is the raw data
returned by the server. This may be binary data (such as an image), plain text
or (for example) HTML. The HTTP protocol provides type information in the reply
header, which can be inspected by l... | trusted_official_docs | CPython Docs | .. index:: single: HTML pair: HTTP; protocol
* The data returned by :func:`urlopen` or :func:`urlretrieve` is the raw data
returned by the server. This may be binary data (such as an image), plain text
or (for example) HTML. The HTTP protocol provides type information in the reply
header, which can be inspected by l... | .. index:: single: HTML pair: HTTP; protocol
* The data returned by :func:`urlopen` or :func:`urlretrieve` is the raw data
returned by the server. This may be binary data (such as an image), plain text
or (for example) HTML. The HTTP protocol provides type information in the reply
header, which can be inspected by l... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
88bbf887-81d0-49f1-84a9-9ee92c82fe25 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,404 | supabase-export-v2 | aae50337884f85db | return :const:`None`, the algorithm is repeated for methods named like :meth:`!<protocol>_open`. If all such methods return :const:`None`, the algorithm is repeated for methods named :meth:`~BaseHandler.unknown_open`.
Note that the implementation of these methods may involve calls of the parent
:class:`OpenerDirector`... | trusted_official_docs | CPython Docs | return :const:`None`, the algorithm is repeated for methods named like :meth:`!<protocol>_open`. If all such methods return :const:`None`, the algorithm is repeated for methods named :meth:`~BaseHandler.unknown_open`.
Note that the implementation of these methods may involve calls of the parent
:class:`OpenerDirector`... | return :const:`None`, the algorithm is repeated for methods named like :meth:`!<protocol>_open`. If all such methods return :const:`None`, the algorithm is repeated for methods named :meth:`~BaseHandler.unknown_open`.
Note that the implementation of these methods may involve calls of the parent
:class:`OpenerDirector`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
88fbf225-9d20-423f-88a4-0979d6d8b455 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,224 | supabase-export-v2 | 99e9b914614126fd | If *context* is specified, it must be a :class:`ssl.SSLContext` instance describing the various SSL options. See :class:`~http.client.HTTPSConnection` for more details.
This function always returns an object which can work as a
:term:`context manager` and has the properties *url*, *headers*, and *status*. See :class:`... | trusted_official_docs | CPython Docs | If *context* is specified, it must be a :class:`ssl.SSLContext` instance describing the various SSL options. See :class:`~http.client.HTTPSConnection` for more details.
This function always returns an object which can work as a
:term:`context manager` and has the properties *url*, *headers*, and *status*. See :class:`... | If *context* is specified, it must be a :class:`ssl.SSLContext` instance describing the various SSL options. See :class:`~http.client.HTTPSConnection` for more details.
This function always returns an object which can work as a
:term:`context manager` and has the properties *url*, *headers*, and *status*. See :class:`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8913db07-4f43-46e2-91c0-7b6d6f0557d0 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,231 | supabase-export-v2 | e2e6372e30f99f19 | :func:`urllib.request.urlopen` corresponds to the old ``urllib2.urlopen``. Proxy handling, which was done by passing a dictionary parameter to ``urllib.urlopen``, can be obtained by using :class:`ProxyHandler` objects.
.. audit-event:: urllib.Request fullurl,data,headers,method urllib.request.urlopen | trusted_official_docs | CPython Docs | :func:`urllib.request.urlopen` corresponds to the old ``urllib2.urlopen``. Proxy handling, which was done by passing a dictionary parameter to ``urllib.urlopen``, can be obtained by using :class:`ProxyHandler` objects.
.. audit-event:: urllib.Request fullurl,data,headers,method urllib.request.urlopen | :func:`urllib.request.urlopen` corresponds to the old ``urllib2.urlopen``. Proxy handling, which was done by passing a dictionary parameter to ``urllib.urlopen``, can be obtained by using :class:`ProxyHandler` objects.
.. audit-event:: urllib.Request fullurl,data,headers,method urllib.request.urlopen | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
894995c4-759d-4e7e-991e-600d058d9361 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,277 | supabase-export-v2 | 5369908279441b44 | The next two arguments are only of interest for correct handling of third-party HTTP cookies:
*origin_req_host* should be the request-host of the origin
transaction, as defined by :rfc:`2965`. It defaults to
``http.cookiejar.request_host(self)``. This is the host name or IP
address of the original request that was i... | trusted_official_docs | CPython Docs | The next two arguments are only of interest for correct handling of third-party HTTP cookies:
*origin_req_host* should be the request-host of the origin
transaction, as defined by :rfc:`2965`. It defaults to
``http.cookiejar.request_host(self)``. This is the host name or IP
address of the original request that was i... | The next two arguments are only of interest for correct handling of third-party HTTP cookies:
*origin_req_host* should be the request-host of the origin
transaction, as defined by :rfc:`2965`. It defaults to
``http.cookiejar.request_host(self)``. This is the host name or IP
address of the original request that was i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8987b343-f8f8-417c-a243-28f0aa57f3bd | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,228 | supabase-export-v2 | cc2cf7a2fb63c4a5 | Raises :exc:`~urllib.error.URLError` on protocol errors.
Note that ``None`` may be returned if no handler handles the request (though
the default installed global :class:`OpenerDirector` uses
:class:`UnknownHandler` to ensure this never happens). | trusted_official_docs | CPython Docs | Raises :exc:`~urllib.error.URLError` on protocol errors.
Note that ``None`` may be returned if no handler handles the request (though
the default installed global :class:`OpenerDirector` uses
:class:`UnknownHandler` to ensure this never happens). | Raises :exc:`~urllib.error.URLError` on protocol errors.
Note that ``None`` may be returned if no handler handles the request (though
the default installed global :class:`OpenerDirector` uses
:class:`UnknownHandler` to ensure this never happens). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
89991236-ca3c-470b-bdbf-148c268d8985 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,358 | supabase-export-v2 | 69ac0beecfb5bbd4 | is not ``None``, return its value, otherwise return ``'GET'`` if :attr:`Request.data` is ``None``, or ``'POST'`` if it's not. This is only meaningful for HTTP requests.
.. versionchanged:: 3.3
get_method now looks at the value of :attr:`Request.method`. | trusted_official_docs | CPython Docs | is not ``None``, return its value, otherwise return ``'GET'`` if :attr:`Request.data` is ``None``, or ``'POST'`` if it's not. This is only meaningful for HTTP requests.
.. versionchanged:: 3.3
get_method now looks at the value of :attr:`Request.method`. | is not ``None``, return its value, otherwise return ``'GET'`` if :attr:`Request.data` is ``None``, or ``'POST'`` if it's not. This is only meaningful for HTTP requests.
.. versionchanged:: 3.3
get_method now looks at the value of :attr:`Request.method`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
89a770dd-744d-46db-a4ba-83d6ce78ee2e | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,421 | supabase-export-v2 | f450bedb93235b3d | :meth:`~OpenerDirector.open` method of :class:`OpenerDirector`, or ``None``. It should raise :exc:`~urllib.error.URLError`, unless a truly exceptional thing happens (for example, :exc:`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`).
This method will be called before any protocol-specific open metho... | trusted_official_docs | CPython Docs | :meth:`~OpenerDirector.open` method of :class:`OpenerDirector`, or ``None``. It should raise :exc:`~urllib.error.URLError`, unless a truly exceptional thing happens (for example, :exc:`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`).
This method will be called before any protocol-specific open metho... | :meth:`~OpenerDirector.open` method of :class:`OpenerDirector`, or ``None``. It should raise :exc:`~urllib.error.URLError`, unless a truly exceptional thing happens (for example, :exc:`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`).
This method will be called before any protocol-specific open metho... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8f815299-013d-4853-83d3-94e4f13d234c | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,260 | supabase-export-v2 | cb3ab48c9744596b | >>> from urllib.request import url2pathname >>> url = 'file:///C:/Program%20Files' >>> url2pathname(url, require_scheme=True) 'C:\\Program Files'
.. versionchanged:: 3.14
Windows drive letters are no longer converted to uppercase, and ``:``
characters not following a drive letter no longer cause an
:exc:`OSError` ex... | trusted_official_docs | CPython Docs | >>> from urllib.request import url2pathname >>> url = 'file:///C:/Program%20Files' >>> url2pathname(url, require_scheme=True) 'C:\\Program Files'
.. versionchanged:: 3.14
Windows drive letters are no longer converted to uppercase, and ``:``
characters not following a drive letter no longer cause an
:exc:`OSError` ex... | >>> from urllib.request import url2pathname >>> url = 'file:///C:/Program%20Files' >>> url2pathname(url, require_scheme=True) 'C:\\Program Files'
.. versionchanged:: 3.14
Windows drive letters are no longer converted to uppercase, and ``:``
characters not following a drive letter no longer cause an
:exc:`OSError` ex... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8fb63e11-58e7-4746-877a-a970c801f4e3 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,615 | supabase-export-v2 | 4e549b2cbb4cfac5 | to a local file but the file can't be opened, the URL is re-interpreted using the FTP protocol. This can sometimes cause confusing error messages.
* The :func:`urlopen` and :func:`urlretrieve` functions can cause arbitrarily
long delays while waiting for a network connection to be set up. This means
that it is diffic... | trusted_official_docs | CPython Docs | to a local file but the file can't be opened, the URL is re-interpreted using the FTP protocol. This can sometimes cause confusing error messages.
* The :func:`urlopen` and :func:`urlretrieve` functions can cause arbitrarily
long delays while waiting for a network connection to be set up. This means
that it is diffic... | to a local file but the file can't be opened, the URL is re-interpreted using the FTP protocol. This can sometimes cause confusing error messages.
* The :func:`urlopen` and :func:`urlretrieve` functions can cause arbitrarily
long delays while waiting for a network connection to be set up. This means
that it is diffic... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
91890c41-0494-420f-aa27-22f9e7e05713 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,561 | supabase-export-v2 | ff0836b3a7a7c5de | receives from the HTTP server. In general, a program will decode the returned bytes object to string once it determines or guesses the appropriate encoding.
The following HTML spec document, https://html.spec.whatwg.org/#charset, lists
the various ways in which an HTML or an XML document could have specified its
encodi... | trusted_official_docs | CPython Docs | receives from the HTTP server. In general, a program will decode the returned bytes object to string once it determines or guesses the appropriate encoding.
The following HTML spec document, https://html.spec.whatwg.org/#charset, lists
the various ways in which an HTML or an XML document could have specified its
encodi... | receives from the HTTP server. In general, a program will decode the returned bytes object to string once it determines or guesses the appropriate encoding.
The following HTML spec document, https://html.spec.whatwg.org/#charset, lists
the various ways in which an HTML or an XML document could have specified its
encodi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
923ab539-f299-4b48-b3f9-29f418c2eac6 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,597 | supabase-export-v2 | d370caa816ec9bbb | .. function:: urlretrieve(url, filename=None, reporthook=None, data=None)
Copy a network object denoted by a URL to a local file. If the URL
points to a local file, the object will not be copied unless filename is supplied. Return a tuple ``(filename, headers)`` where *filename* is the
local file name under which the... | trusted_official_docs | CPython Docs | .. function:: urlretrieve(url, filename=None, reporthook=None, data=None)
Copy a network object denoted by a URL to a local file. If the URL
points to a local file, the object will not be copied unless filename is supplied. Return a tuple ``(filename, headers)`` where *filename* is the
local file name under which the... | .. function:: urlretrieve(url, filename=None, reporthook=None, data=None)
Copy a network object denoted by a URL to a local file. If the URL
points to a local file, the object will not be copied unless filename is supplied. Return a tuple ``(filename, headers)`` where *filename* is the
local file name under which the... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
933cb95e-beb7-4011-9e26-35c4ba2bd82d | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,612 | supabase-export-v2 | 94d7a8fa1f0998a6 | .. versionchanged:: 3.4 Added support for data URLs.
* The caching feature of :func:`urlretrieve` has been disabled until someone
finds the time to hack proper processing of Expiration time headers. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.4 Added support for data URLs.
* The caching feature of :func:`urlretrieve` has been disabled until someone
finds the time to hack proper processing of Expiration time headers. | .. versionchanged:: 3.4 Added support for data URLs.
* The caching feature of :func:`urlretrieve` has been disabled until someone
finds the time to hack proper processing of Expiration time headers. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
96c37d8f-b6ed-484c-8271-d09e62db07a6 | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,312 | supabase-export-v2 | 4b0486ec598f147e | .. class:: HTTPBasicAuthHandler(password_mgr=None)
Handle authentication with the remote host. *password_mgr*, if given, should
be something that is compatible with :class:`HTTPPasswordMgr`; refer to
section :ref:`http-password-mgr` for information on the interface that must
be supported. HTTPBasicAuthHandler will r... | trusted_official_docs | CPython Docs | .. class:: HTTPBasicAuthHandler(password_mgr=None)
Handle authentication with the remote host. *password_mgr*, if given, should
be something that is compatible with :class:`HTTPPasswordMgr`; refer to
section :ref:`http-password-mgr` for information on the interface that must
be supported. HTTPBasicAuthHandler will r... | .. class:: HTTPBasicAuthHandler(password_mgr=None)
Handle authentication with the remote host. *password_mgr*, if given, should
be something that is compatible with :class:`HTTPPasswordMgr`; refer to
section :ref:`http-password-mgr` for information on the interface that must
be supported. HTTPBasicAuthHandler will r... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
96d9897d-0a0b-44bd-bbda-926a60ac013a | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,373 | supabase-export-v2 | 38854a6fcb216736 | .. method:: Request.set_proxy(host, type)
Prepare the request by connecting to a proxy server. The *host* and *type* will
replace those of the instance, and the instance's selector will be the original
URL given in the constructor. | trusted_official_docs | CPython Docs | .. method:: Request.set_proxy(host, type)
Prepare the request by connecting to a proxy server. The *host* and *type* will
replace those of the instance, and the instance's selector will be the original
URL given in the constructor. | .. method:: Request.set_proxy(host, type)
Prepare the request by connecting to a proxy server. The *host* and *type* will
replace those of the instance, and the instance's selector will be the original
URL given in the constructor. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9715fd63-f5c2-4f47-a16a-c90bdc1fa60f | CPython Docs | file://datasets/cpython/Doc/library/urllib.request.rst | unknown | 084996aa-b93f-4bc6-b685-d2a7d483f970 | 37,605 | supabase-export-v2 | 81576f4e1a42f92c | You can still retrieve the downloaded data in this case, it is stored in the :attr:`!content` attribute of the exception instance.
If no *Content-Length* header was supplied, urlretrieve can not check the size
of the data it has downloaded, and just returns it. In this case you just have
to assume that the download w... | trusted_official_docs | CPython Docs | You can still retrieve the downloaded data in this case, it is stored in the :attr:`!content` attribute of the exception instance.
If no *Content-Length* header was supplied, urlretrieve can not check the size
of the data it has downloaded, and just returns it. In this case you just have
to assume that the download w... | You can still retrieve the downloaded data in this case, it is stored in the :attr:`!content` attribute of the exception instance.
If no *Content-Length* header was supplied, urlretrieve can not check the size
of the data it has downloaded, and just returns it. In this case you just have
to assume that the download w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.