-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
>>> request = urllib.request.Request('https://wildorchard.com/collections/teaware', method='HEAD')
>>> response = urllib.request.urlopen(request)
>>> response.read()
b''
>>> request = urllib.request.Request('http://wildorchard.com/collections/teaware', method='HEAD')
>>> response = urllib.request.urlopen(request)
>>> response.read()
b'<!doctype html>\n<html class="no-js" lang="en">\n<head>\n\n\n
In the first request everything works finde, the HEAD method doesn't return a response
body, subsequently response.read() gives a byte sequent of length zero.
In the second request, the final URL is the same, but something goes wrong, mostlikely
during redirect the method gets lost, since now the response body is not empty.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error