classification
Title: HTTP result code in urllib2.urlopen() file object undocumented
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: eric.araujo, ezio.melotti, orsenthil, python-dev, tazle
Priority: normal Keywords: patch

Created on 2013-01-29 11:29 by tazle, last changed 2013-02-07 09:05 by ezio.melotti. This issue is now closed.

Files
File name Uploaded Description Edit
Issue17069-default.patch orsenthil, 2013-02-04 08:51 review
Messages (7)
msg180900 - (view) Author: Tuure Laurinolli (tazle) Date: 2013-01-29 11:29
As per documentation at http://docs.python.org/2/library/urllib2.html the file-like object returned by urllib2.urlopen() should have methods geturl() and info(). It actually also has getcode(), which appears to do the same as getcode() on urllib.urlopen() responses.

This should be a documented feature of urllib2.
msg181311 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2013-02-04 08:51
Here is he patch against the default that would address this reported issue. Same would go for other 3.x branches. The 2.7 only can just see the addition of getcode() documented.
msg181338 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2013-02-04 15:50
Are these the addinfourl getters that Ezio wants to deprecate?
msg181376 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2013-02-04 19:13
Éric, thanks for the comment. URLopener and FancyURLopener is deprecated, so that reference to that can be removed from 3.4 (after removing the URLopener and FancyURLopener class). Rest of the patch can stay the same.
msg181583 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2013-02-07 08:39
I shall go ahead with this change. And when the URLopener and FancyURLopener removed, all their references in the docs (including this change) will be removed.
msg181584 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-02-07 08:49
New changeset fae8e212e870 by Senthil Kumaran in branch '3.2':
Fix Issue17069: Document getcode method in urllib.request.rst
http://hg.python.org/cpython/rev/fae8e212e870

New changeset e15d2ad42d93 by Senthil Kumaran in branch '3.3':
Fix Issue17069: Document getcode method in urllib.request.rst
http://hg.python.org/cpython/rev/e15d2ad42d93

New changeset b79df3e8a9a0 by Senthil Kumaran in branch 'default':
Fix Issue17069: Document getcode method in urllib.request.rst
http://hg.python.org/cpython/rev/b79df3e8a9a0

New changeset 5630f0aff6ac by Senthil Kumaran in branch '2.7':
Fix Issue17069: Document getcode method in urllib.request.rst
http://hg.python.org/cpython/rev/5630f0aff6ac
msg181585 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-02-07 09:05
> Are these the addinfourl getters that Ezio wants to deprecate?

Yes, see #12707
History
Date User Action Args
2013-02-07 09:05:06ezio.melottisetmessages: + msg181585
2013-02-07 08:50:25orsenthilsetstatus: open -> closed
resolution: fixed
2013-02-07 08:49:53python-devsetnosy: + python-dev
messages: + msg181584
2013-02-07 08:39:28orsenthilsetmessages: + msg181583
2013-02-04 19:13:42orsenthilsetmessages: + msg181376
2013-02-04 15:50:48eric.araujosetmessages: + msg181338
2013-02-04 08:51:06orsenthilsetfiles: + Issue17069-default.patch

assignee: orsenthil
versions: + Python 3.2, Python 3.3, Python 3.4, - Python 2.6
keywords: + patch
type: behavior
messages: + msg181311
stage: patch review
2013-02-01 19:06:49orsenthilsetnosy: + orsenthil
2013-02-01 19:05:45eric.araujosetnosy: + ezio.melotti, eric.araujo
2013-01-29 11:29:17tazlecreate