Re: [Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-15 Thread Mike Brown
Stefan Rank wrote: > Well, originally, I would have expected it to return a byte str(ing), I'd assume unicode in, unicode out, and str in, str out, but since it's always going to produce ASCII-range characters, it wouldn't matter. Moot point anyway. > BUT > I am now converted and think it is best

Re: [Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-13 Thread Stefan Rank
on 13.07.2006 10:26 Mike Brown said the following: > Stefan Rank wrote: >> on 12.07.2006 07:53 Martin v. Löwis said the following: >>> Anthony Baxter wrote: > The right thing to do is IRIs. For 2.5, should we at least detect that it's unicode and raise a useful error? >>> That can c

Re: [Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-13 Thread Mike Brown
Stefan Rank wrote: > on 12.07.2006 07:53 Martin v. Löwis said the following: > > Anthony Baxter wrote: > >>> The right thing to do is IRIs. > >> For 2.5, should we at least detect that it's unicode and raise a > >> useful error? > > > > That can certainly be done, sure. > > > > Martin > > That

Re: [Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-12 Thread Stefan Rank
on 12.07.2006 07:53 Martin v. Löwis said the following: > Anthony Baxter wrote: >>> The right thing to do is IRIs. >> For 2.5, should we at least detect that it's unicode and raise a >> useful error? > > That can certainly be done, sure. > > Martin That would be great. And I agree that updati

Re: [Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-11 Thread Martin v. Löwis
Anthony Baxter wrote: >> The right thing to do is IRIs. > > For 2.5, should we at least detect that it's unicode and raise a > useful error? That can certainly be done, sure. Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python

Re: [Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-11 Thread Anthony Baxter
On Wednesday 12 July 2006 07:16, Martin v. Löwis wrote: > Stefan Rank wrote: > > I suggest to add (after 2.5 I assume) one of the following to the > > beginning of urllib.quote to either fail early and consistently > > on unicode arguments and improve the error message:: > > > >if isinstance(s,

Re: [Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-11 Thread Martin v. Löwis
Stefan Rank wrote: > I suggest to add (after 2.5 I assume) one of the following to the > beginning of urllib.quote to either fail early and consistently on > unicode arguments and improve the error message:: > >if isinstance(s, unicode): >raise TypeError("quote needs a byte string ar

Re: [Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-11 Thread John J Lee
On Tue, 11 Jul 2006, Stefan Rank wrote: > urllib.quote fails on unicode strings and in an unhelpful way:: [...] > >>> urllib.quote(u'a\xf1a') > Traceback (most recent call last): > File "", line 1, in ? > File "C:\Python24\lib\urllib.py", line 1117, in quote > res = map(safe_map.

Re: [Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-11 Thread skip
Stefan> According to a message I found on quixote-users, Stefan> http://mail.mems-exchange.org/durusmail/quixote-users/5363/ it Stefan> might have worked prior to 2.4.2. Confirmed with 2.3.5. Stefan>if isinstance(s, unicode): Stefan>s = s.encode('utf-8') Stef

[Python-Dev] urllib.quote and unicode bug resuscitation attempt

2006-07-11 Thread Stefan Rank
Hi, urllib.quote fails on unicode strings and in an unhelpful way:: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import urllib >>> urllib.quote('a\xf1a') 'a%F1a' >>> url