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/2008-July/081600.html below:

[Python-Dev] urllib.quote and unquote - Unicode issues

[Python-Dev] urllib.quote and unquote - Unicode issuesBill Janssen janssen at parc.com
Wed Jul 30 21:49:06 CEST 2008
> >  unquote() -- takes string, produces bytes or string
> >
> >     If optional "encoding" parameter is specified, decodes bytes with
> >     that encoding and returns string.  Otherwise, returns bytes.
> 
> The default of returning bytes will break almost all uses. Most code
> will uses the unquoted result as a text string, not as bytes -- e.g. a
> server has to unquote the values it receives from a form (whether POST
> or GET), but almost always the unquoted values are text, e.g.
> someone's name or address, or a draft email message.

I actually do know a lot about the uses of this function...

But:  OK, OK, I yield.  Though I still think this is a bad idea, I'll
shut up if we can also add "unquote_as_bytes" which returns a byte
sequence instead of a string.  I'll just change my code to use that.

> (Aside: I dislike functions that have a different return type based on
> the value of a parameter.)

Fair enough.

Bill
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