[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-31 Thread Senthil
Senthil added the comment: Fixed and Committed revision 74608 - trunk Committed revision 74609 - py3k -- resolution: -> fixed ___ Python tracker ___ ___

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-20 Thread Senthil
Senthil added the comment: I see adding this information to the docs, might clarify a bit. "By default, this function is intended for quoting the path section of the URL." This is already present in the function docstring. If there is no objection, I shall commit the attached patch and clos

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-09 Thread Senthil
Senthil added the comment: On Sun, Aug 09, 2009 at 03:40:47PM +, Nir Soffer wrote: > for query string. This will break exiting code that assume the default > safe parameters. > > Other characters may be unsafe in other parts of the url - I did not I agree with your comments and I had simil

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-09 Thread Nir Soffer
Nir Soffer added the comment: Here is one example of code that would break if the safe parameter is changed in a careless way mentioned here (look for url_encode): http://dev.pocoo.org/projects/werkzeug/browser/werkzeug/urls.py#L112 I'm sure we can find similar code in every web application.

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-09 Thread Nir Soffer
Nir Soffer added the comment: Senthil said: > The way to handle this issue would be add these characters > '%/:=&?~#+!$,;'@()*[]' to always_safe list. This is wrong - for example, '&=?' are NOT safe when quoting parameters for query string. This will break exiting code that assume the default

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-08 Thread Senthil
Senthil added the comment: The way to handle this issue would be add these characters '%/:=&?~#+!$,;'@()*[]' to always_safe list. There has been a similar issue in the past Issue918368, tough in a different context. And if you see, urllib.urlopen function always passes these values as the sa

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-08 Thread Nir Soffer
Nir Soffer added the comment: You can control what is safe in your particular context using the safe keyword argument. How do you want to support unicode? you must decide which character encoding you like, which depends on the server side decoding the url. Just document the fact that this fu

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-06 Thread Rodrigo Steinmuller Wanderley
Rodrigo Steinmuller Wanderley added the comment: > Unreserved characters can be escaped without changing the semantics > of the URI, but this should not be done unless the URI is being used > in a context that does not allow the unescaped character to appear. How can we identify "a context that

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-02-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-02-12 Thread Daniel Diniz
Daniel Diniz added the comment: @Tom: issue 1712522 tracks Unicode support. -- assignee: -> georg.brandl components: +Documentation dependencies: +urllib.quote throws exception on Unicode URL keywords: +easy nosy: +ajaksu2, ezio.melotti, georg.brandl, haypo, orsenthil stage: -> test n

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2008-05-06 Thread Tom Pinckney
Tom Pinckney <[EMAIL PROTECTED]> added the comment: It also looks like urllib.quote (and quote_plus) do not properly handle unicode strings. urllib.urlencode() properly converts unicode strings to utf-8 encoded ascii strings before then calling urllib.quote() on them. -- nosy: +thomasp

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2008-04-15 Thread Tim Lesher
New submission from Tim Lesher <[EMAIL PROTECTED]>: The urllib.quote docstring implies that it quotes only characters in RFC 2396's "reserved" set. However, urllib.quote currently escapes all characters except those in an "always_safe" list, which consists of alphanumerics and three punctuation