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.

Author ezio.melotti
Recipients ezio.melotti, orsenthil, sandro.tosi
Date 2011-08-07.23:46:09
SpamBayes Score 0.000354858
Marked as misclassified No
Message-id <>
The documentation for urllib.request.urlopen [0] says that:
This function returns a file-like object [addinfourl] with two additional methods from the urllib.response module
    geturl() — return the URL of the resource retrieved, [...]
    info() — return the meta-information of the page, [...]

There's also a third undocumented method: getcode().  Looking at the code[1] ISTM that the 3 getters (geturl(), info(), and getcode()):
  1) have an inconsistent interface (why not getinfo() or getheaders()?);
  2) they just return the url, headers, and code attributes;

For these two reasons I propose to:
  * document the 3 attributes as the suggested way to access this information;
  * deprecate the 3 getters;
  * avoid to document the now undocumented getcode();

[1]: Lib/urllib/
Date User Action Args
2011-08-07 23:46:10ezio.melottisetrecipients: + ezio.melotti, orsenthil, sandro.tosi
2011-08-07 23:46:10ezio.melottisetmessageid: <>
2011-08-07 23:46:10ezio.melottilinkissue12707 messages
2011-08-07 23:46:09ezio.melotticreate