This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jayaddison
Recipients Claudiu.Popa, Joshua.Johnston, ezio.melotti, jayaddison, orsenthil, piotr.dobrogost, r.david.murray
Date 2020-05-05.18:27:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588703274.26.0.222738602406.issue18857@roundup.psfhosted.org>
In-reply-to
Content
Chiming in here to add that I'd appreciate the ability to render 'standalone' (i.e. no '=') query-string keys in order to distinguish between absence-of-value and empty-string situations.

The backwards-compatibility concerns in here are genuine, so perhaps this could be introduced as an argument to urlencode with a disabled default value, allowing developers to opt-in.

>> Unless someone can point to a "real" web server that does something different with "&foo" than with "&foo=", there is no reason to make a change to Python.

There's a popular nodejs library that makes this serialization distinction explicit: https://github.com/sindresorhus/query-string#falsy-values

I've developed a Python 3.7-based set of commits[1] to address this issue.  I haven't yet opened this as a pull request since I see that Python 3.7 is in maintenance/bugfix mode[2].

In case a new urlencode flag would fall under the category of feature, I'll aim to develop a subsequent set of commits against the master development branch soon.

[1] - https://github.com/jayaddison/cpython/compare/3.7..9555467

[2] - https://devguide.python.org/#status-of-python-branches
History
Date User Action Args
2020-05-05 18:27:54jayaddisonsetrecipients: + jayaddison, orsenthil, ezio.melotti, r.david.murray, Claudiu.Popa, piotr.dobrogost, Joshua.Johnston
2020-05-05 18:27:54jayaddisonsetmessageid: <1588703274.26.0.222738602406.issue18857@roundup.psfhosted.org>
2020-05-05 18:27:54jayaddisonlinkissue18857 messages
2020-05-05 18:27:53jayaddisoncreate