[stdlib-sig] urllib.parrrrse does not supporrrrt bytes
brett at python.org
Sat Sep 19 22:56:21 CEST 2009
Initially I thought your 'r' key was having sticking issues. I really
do hate Talk Like A Pirate Day.
On Sat, Sep 19, 2009 at 12:27, Armin Ronacher
<armin.ronacher at active-4.com> wrote:
> Aye, me mateys,
> In Python 3 the parrrsing function of urllib do not work with bytes.
> What's the prrrroblem? I tell you: U'RLs only have a charrrrrset
> rrecommendation and sometimes you have to deal with URL encoded stuff
> that does not contain unicode data.
> I tried to crrreate a patch for urllib but it appears that you have to
> rrrrrreplicate ParseResult for byte strrrrings which seems wrong to me.
> Does anyone rrremember the rrreasons why urllib was not designed to
> work on bytes interrrnaly and only convert to unicode before/after
See, you are assuming any design went into other than to make the
thing pass the unit tests. Most modules did not go through some
rigorous design discussion to decide how to make it work with bytes.
Someone just took it upon themselves to make the thing work and that
was that. I am willing to guess this is more or less what happened
with urllib, especially since it was a bit tricky to get it merged
between urllib and urllib2.
More information about the stdlib-sig