Always encode GET parameters back to bytes before calling urllib.quote()

Review Request #5732 — Created April 23, 2014 and submitted

Information

Djblets
release-0.7.x
0b6bf9a...

Reviewers

When building the pagination links, the webapi code will iterate through all
the query parameters (excluding those related to pagination). These would then
be passed into urllib.quote(), which doesn't handle unicode strings (only
bytes).

This manifested itself in the users list API when a query parameter had unicode
characters in it.

Ran new unit test before and after the code change. Saw that before it
reproduced the bug, and after it worked fine.

Description From Last Updated

We should probably do some real test with the result of the get(), and not just print. Can we do …

chipx86chipx86
chipx86
  1. Testing?

    If we could get a unit test for this, that'd be awesome.

  2. 
      
david
chipx86
  1. 
      
  2. djblets/webapi/tests.py (Diff revision 2)
     
     
    Show all issues

    We should probably do some real test with the result of the get(), and not just print. Can we do a JSON parse and sanity-check what's in there?

  3. 
      
david
chipx86
  1. Ship It!

  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.7.x (6f677e8)