Berker Peksag added the comment:
Just a suggestion: urlencode already has 5 parameters. We can make quote_via a
keyword-only parameter.
--
nosy: +berker.peksag
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
R. David Murray added the comment:
I don't see any particular motivation to make it keyword only.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
Martin Panter added the comment:
Forcing the “quote_via” keyword wouldn’t help that much. I suggest to leave it
as it is.
urlencode(query, True, /, ascii, strict, quote)
urlencode(query, True, /, ascii, strict, quote_via=quote)
On the other hand, forcing a keyword for the “doseq=True” flag
R. David Murray added the comment:
Thanks everyone.
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
Roundup Robot added the comment:
New changeset c7d82a7a9dea by R David Murray in branch 'default':
Issue #13866: add *quote_via* argument to urlencode.
https://hg.python.org/cpython/rev/c7d82a7a9dea
--
nosy: +python-dev
___
Python tracker
R. David Murray added the comment:
Martin, if you think the patch is complete and ready to commit, please change
the stage to commit review. I'm trying to encourage core devs to look at the
patches in commit review state and commit them :)
--
nosy: +r.david.murray
Martin Panter added the comment:
Yep I think this is ready. I’ll keep your advice in mind for other patches as
well :)
--
stage: patch review - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
Changes by Arnon Yaari wiggi...@gmail.com:
Removed file: http://bugs.python.org/file39006/issue13866.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
Arnon Yaari added the comment:
Fixed Martin's comments.
--
Added file: http://bugs.python.org/file39036/issue13866.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
Martin Panter added the comment:
New patch looks good.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
___
Python-bugs-list mailing
Martin Panter added the comment:
To be consistent, I think the documentation should mark up the parameters with
asterisks: *quote_via*. Also, you lost the markup for :func:`quote_plus`.
The test cases should probably use self.assertEqual(). The “assert” statement
is not appropriate for
Arnon Yaari added the comment:
Updated patch to the correct format, added a test and some more documentation.
--
nosy: +wiggin15
versions: +Python 3.5 -Python 3.4
Added file: http://bugs.python.org/file39006/issue13866.patch
___
Python tracker
Changes by Facundo Batista facu...@taniquetil.com.ar:
--
stage: resolved - patch review
versions: +Python 3.4 -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
Jeff Edwards added the comment:
It's interesting how long this issue has been around. It seems to be because
the form-urlencoded spec is specified as url-percent-encoding EXCEPT for ' ' -
'+', which does seem to be unintuitive.
To note, there are a few known cases where the exception does
Changes by Ronan Amicel ronan.ami...@gmail.com:
--
nosy: +ronnix
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
___
Python-bugs-list
samwyse samw...@gmail.com added the comment:
Since no one else seems willing to do it, here's a patch that adds a
'quote_via' keyword parameter to the urlencode function.
import urllib.parse
query={foo: + }
urllib.parse.urlencode(query)
'foo=%2B+'
urllib.parse.urlencode(query,
Changes by samwyse samw...@gmail.com:
--
nosy: +samwyse
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
___
Python-bugs-list mailing list
jin j...@mediatomb.cc added the comment:
I just ran into exactly the same problem and was quite disappointed to see that
urlencode does not provide an option to use percent encoding.
My use case: I'm preparing some metadata on the server side that is stored as
an url encoded string, the
Senthil Kumaran sent...@uthcode.com added the comment:
A couple of points to help summarize and to help come to a conclusion.
In the initial message, Stephen pointed out, it would be desirable to merely
encode spaces using percent encoding.
It seems to me that only in cases where a custom
Stephen Day stevv...@gmail.com added the comment:
While it's likely that adding a `quote`/`quote_plus` function paramater to
urlencode is the right solution, I want to ensure that the key point is
communicated clearly: encoding a space as a '+' is pathological, in that in the
common case, an
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
___
Python-bugs-list
Changes by Michele Orrù maker...@gmail.com:
--
nosy: +maker
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
___
Python-bugs-list mailing
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
___
Stephen Day stevv...@gmail.com added the comment:
I apologize for reopening this bug, but I find your interpretation to be
inaccurate. While technically valid, the combination of the documentation, the
function name and the main use cases yields pathological invocations of
urlencode. My bug
Senthil Kumaran sent...@uthcode.com added the comment:
Stephen - urlencode is responsible for producing the
application/x-www-form-urlencoded format, usually used in the FORMs in the web.
As per the spec, the Space characters are replaced by `+'. -
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
___
___
Python-bugs-list
Changes by Terry J. Reedy tjre...@udel.edu:
--
nosy: +orsenthil
stage: - test needed
type: - enhancement
versions: -Python 2.7, Python 3.1, Python 3.2, Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13866
New submission from Stephen Day stevv...@gmail.com:
The current behavior of the urlencode function (2.7: urllib, 3.x: urllib.parse)
encodes spaces as pluses:
from urllib import urlencode
urlencode({'a': 'some param'})
'a=some+param'
However, in most instances, it would be desirable to
28 matches
Mail list logo