A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-February/085860.html below:

[Python-Dev] teaching the new urllib

[Python-Dev] teaching the new urllib [Python-Dev] teaching the new urllibDaniel (ajax) Diniz ajaksu at gmail.com
Wed Feb 4 00:56:48 CET 2009
Tres Seaver wrote:
> Brett Cannon wrote:
>> No because you are getting back the repr for the bytes object. Str
>> does not know what the encoding is for the bytes so it has no way of
>> performing the decoding.
>
> The encoding information *is* available in the response headers, e.g.:
[snip]

That's the target of http://bugs.python.org/issue4733 cited by
Benjamin: 'Add a "decode to declared encoding" version of urlopen to
urllib' . I think it's an important use case, but the current patch is
pretty awful. Improvements/feedback welcome :)

Daniel
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4