[issue4733] Add a "decode to declared encoding" version of urlopen to urllib

Senthil Kumaran report at bugs.python.org
Thu Oct 20 05:52:04 CEST 2011


Senthil Kumaran <senthil at uthcode.com> added the comment:

- page.encoding is a good idea.

- page.decode_content sounds definitely better than page.decode which can be confusing as page is not a bytes object, but a file-like object.

I am thinking if an attribute to urlopen would be better? Not exactly the mode like attribute of the builtin open, but something like decoded=False

The downside is that the attr is now for the implementation detail of the method in py3k and upside is it gives an idea to users as what return value they can/should expect.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4733>
_______________________________________


More information about the Python-bugs-list mailing list