[Python-Dev] Supporting raw bytes data in urllib.parse.* (was Re: Polymorphic best practices)
ncoghlan at gmail.com
Tue Sep 21 23:33:19 CEST 2010
On Wed, Sep 22, 2010 at 1:10 AM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> Nick Coghlan writes:
> > (Basically, while the issue of programmers assuming 'latin-1' or
> > 'utf-8' or similar ASCII friendly encodings when they shouldn't is
> > real, I don't believe a polymorphic API here will make things any
> > *worse* than what would happen with a parallel API)
> That depends on how far the polymorphic API goes. As long as the
> polymorphic API *never ever* does anything that involves decoding wire
> format (and I include URL-quoting here), the programmer will have to
> explicitly do some decoding to get into much trouble, and at that
> point it's really their problem; you can't stop them.
> But I don't know whether the web apps programmers will be satisfied
> with such a minimal API. If not, you're going to have to make some
> delicate judgments about what to provide and what not, and whether/how
> to provide a safety net of some kind. I don't envy you that task.
As Chris pointed out, Issue 3300 means that particular boat has
already sailed where quote/unquote are concerned. Those are the only
APIs which ever need to do any encoding or decoding, as they deal with
percent-encoding of Unicode characters.
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev