This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: The documentation for urllib.request should mention http.client.HTTPException
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, iritkatriel, jon orebro, martin.panter
Priority: normal Keywords:

Created on 2015-11-16 08:42 by jon orebro, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg254720 - (view) Author: jon orebro (jon orebro) Date: 2015-11-16 08:42
The documentation for urllib.request should mention that a robust client using urllib.request must be prepared for exceptions of type http.client.HTTPException in addition to urllib.error.URLError.

Example: the server breaks HTTP and returns an empty status line and we get a http.client.BadStatusLine.
msg254762 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-11-16 22:17
Closely related: Issue 22797 proposes documenting some circumstances where ValueError is raised directly. Perhaps you can review and enhance the patch already there.

Also related:

Issue 13736 proposes to wrap http.client exceptions (which I disagree with), and add extra wrapping for socket.error (which I may agree with for consistency), and document existing “exception leaks”.

Issue 6471 discusses awkwardnesses of getting at the underlying exception that URLError wraps.
msg407400 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-11-30 20:23
Issue22797 was resolved by being more specific about when a URLError is raised, rather than mentioning other exceptions as well. Do we want to do more than that, or can this be closed as well?
History
Date User Action Args
2022-04-11 14:58:23adminsetgithub: 69819
2021-12-06 23:31:14iritkatrielsetstatus: pending -> closed
resolution: out of date
stage: needs patch -> resolved
2021-11-30 20:23:03iritkatrielsetstatus: open -> pending
nosy: + iritkatriel
messages: + msg407400

2015-11-16 22:17:41martin.pantersetnosy: + martin.panter

messages: + msg254762
stage: needs patch
2015-11-16 08:42:51jon orebrocreate