You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is true for Pythons 3.9 through to 3.13 (the currently supported range):
Python 3.9.19 (main, Apr 15 2024, 18:17:55)
[Clang 17.0.6 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.request import urlopen
>>> response = urlopen("https://google.com")
>>> response.headers<http.client.HTTPMessage object at 0x7f7a106ab070>
Python 3.13.0 (main, Oct 15 2024, 18:13:10) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.request import urlopen
>>> response = urlopen("https://google.com")
>>> response.headers<http.client.HTTPMessage object at 0x7fd4b9dbf100>
The text was updated successfully, but these errors were encountered:
Pook's urllib mock returns a dict for headers, whereas the standard library implementation always returns an
HTTPMessage
. The docs here say they return anemail.message.Message
, of whichHTTPMessage
is a subclass.This is true for Pythons 3.9 through to 3.13 (the currently supported range):
The text was updated successfully, but these errors were encountered: