Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Due to https://github.com/python/cpython/pull/99966/files
However, this returns a bytes stream on the live run:
fromhttpimportHTTPStatusfrommailboximportMessagefromurllib.errorimportHTTPErrorfromurllib.requestimporturlopentry: urlopen("http://asadsad.sd") exceptHTTPErrorasexception: content=exception.fp.read() print(type(content)) error=HTTPError(url="url", code=HTTPStatus.IM_A_TEAPOT, msg="msg", hdrs=Message(), fp=None) print(type(error.fp.read()))<class 'bytes'> <class 'str'> Linked PRs
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error