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
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 would be great.
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 certainly be done,
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 updating
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'
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.
Stefanif isinstance(s, unicode):
Stefans = s.encode('utf-8')
Stefan
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 stdin, line 1, in ?
File C:\Python24\lib\urllib.py, line 1117, in quote
res =
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
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, unicode):
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
10 matches
Mail list logo