Merge lp:~allenap/maas/urlencode-is-duckist into lp:~maas-committers/maas/trunk
Proposed by
Gavin Panella
Status: | Merged |
---|---|
Approved by: | Gavin Panella |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1083 |
Proposed branch: | lp:~allenap/maas/urlencode-is-duckist |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
56 lines (+28/-1) 2 files modified
src/maascli/api.py (+1/-1) src/maascli/tests/test_api.py (+27/-0) |
To merge this branch: | bzr merge lp:~allenap/maas/urlencode-is-duckist |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+126584@code.launchpad.net |
Commit message
Always return a 2-tuple from name_value_pair.
urllib.urlencode has some fairly duckist code. It doesn't let the data it consumes walk and quack like a duck. It insists that the first item in a non-dict sequence is a tuple. Of any size. It does this in the name of avoiding *string* input.
Description of the change
urllib.urlencode has some fairly duckist code. It doesn't let the data
it consumes walk and quack like a duck. It insists that the first item
in a non-dict sequence is a tuple. Of any size. It does this in the
name of avoiding *string* input.
To post a comment you must log in.
Looks ok.
34 + # The tuple is important because this is used as input to urlencode,
35 + # which refuses to let ducks quack.
I'd expand this to include this explanation you've got in the commit msg about urlencode's requirement for a tuple. It just reads as a rant otherwise :)