[issue18857] urlencode of a None value uses the string 'None'

2014-02-07 Thread Joshua Johnston
Joshua Johnston added the comment: While the RFC makes no mention of empty values either way, it has become standard practice to either omit the key-value completely or pass a key (optional = sign) by itself in these situations so I would consider that as standard behavior. While I stand by

[issue18857] urlencode of a None value uses the string 'None'

2014-02-07 Thread Joshua Johnston
Joshua Johnston added the comment: If this was a function to encode a dict into something then I would see your point and agree. urlencode is specifically designed to work within the domain or URIs. In this domain, it is acceptable to have an empty value for a key in a query string. None is a

[issue18857] urlencode of a None value uses the string 'None'

2014-02-07 Thread Joshua Johnston
Joshua Johnston added the comment: In this exact example it would be an empty string. It was a fake setup to illustrate a real problem. This is the important part: params = dict(screen_name=None,count=300) url = "https://api.twitter.com/1.1/friends/ids.json?"; + urllib.urlencode(par

[issue18857] urlencode of a None value uses the string 'None'

2014-02-07 Thread Joshua Johnston
Joshua Johnston added the comment: I'm sorry to reopen this but after it biting me quite a few times more I still cannot think of a valid use-case for this behavior that someone would be depending on 'None' being passed. I think your backwards compatibility concerns are artific

[issue18857] urlencode of a None value uses the string 'None'

2013-09-30 Thread Joshua Johnston
Joshua Johnston added the comment: I agree with True == 'True' and False == 'False' but None should be empty since it represents the absence of a value akin to null, Nil, etc in other languages. Ultimately it is not my decision make so I can only agree to disagree. Th

[issue18857] urlencode of a None value uses the string 'None'

2013-09-29 Thread Joshua Johnston
Joshua Johnston added the comment: I still believe that since None represents the absence of a value it should not be urlencoded as the string 'None'. I am not sure what they best way to url encode it is, but I know that 'None' is not it. -- st

[issue18857] urlencode of a None value uses the string 'None'

2013-09-29 Thread Joshua Johnston
Joshua Johnston added the comment: Hi Senthil, You can open the html file with a browser and inspect the data posting to itself without a web server running. That is how I tested. -- ___ Python tracker <http://bugs.python.org/issue18

[issue18857] urlencode of a None value uses the string 'None'

2013-09-16 Thread Joshua Johnston
Joshua Johnston added the comment: I know that languages like php will treat ?josh= the same as ?josh Using the attached test form in Google Chrome, you will see the data passed as josh= when empty in both GET and POST requests. This is probably the way to go, key=str(value) if value is not

[issue18857] urlencode of a None value uses the string 'None'

2013-08-27 Thread Joshua Johnston
Joshua Johnston added the comment: Hi David, That is what I would expect it to do as well. I'm relatively new to Python but this is causing all kinds of problems with oauth signing using ims_lti_py as well as my own code using urle

[issue18857] urlencode of a None value uses the string 'None'

2013-08-27 Thread Joshua Johnston
New submission from Joshua Johnston: This is strange behavior. When you encode nulls in other languages you don't get the string 'null' you usually get an empy string. Shouldn't str(None) == ''? If not str(None) == 'None' and the string representation o