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 gregory.p.smith
Recipients eric.araujo, gregory.p.smith, gvanrossum, pitrou
Date 2012-08-19.03:34:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1345347303.25.0.0269274341346.issue15719@psf.upfronthosting.co.za>
In-reply-to
Content
-1 on doing this from me.

While I don't see it hurting anything when "type(query) is dict" I'd much rather encourage people to write better tests that do not take the lazy way out.  Tests that get by comparing a generated string to a "golden" string are soo often wrong because the golden string is not what they actually wanted to test. Instead the author meant to test the meaning of the result rather than the specific incantation of it that they pasted in their code for an assertEqual check.

(This does suggest that some additional unittest methods to make comparing common things like this in a safe manner would be useful to people. urls, html and xml with attributes, json, etc)

Ex: We've run into many tests that were failing due to hash randomization because they compared json strings... rather than suggest that json.dumps sort dictionaries before generating output, having the tests use json.loads and compare the actual data structure rather than a golden value string is much better.

If a change like this is made, it needs to be conditional in 2.7 and 3.2 to only sort when hash randomization is enabled to avoid altering the existing behavior of urlencode for the default PYTHONHASHSEED=0 case on 2.7 and 3.2.

As far as this being an enhancement rather than a bugfix... I sort of agree that this is an enhancement.  And if this is an enhancement, we don't need to do it at all: People will already have done the right thing making their code work with 3.3's hash randomization by default before long before 3.4 is out.
History
Date User Action Args
2012-08-19 03:35:03gregory.p.smithsetrecipients: + gregory.p.smith, gvanrossum, pitrou, eric.araujo
2012-08-19 03:35:03gregory.p.smithsetmessageid: <1345347303.25.0.0269274341346.issue15719@psf.upfronthosting.co.za>
2012-08-19 03:34:42gregory.p.smithlinkissue15719 messages
2012-08-19 03:34:41gregory.p.smithcreate