Do not try to encode binary types as unicode

Review Request #7294 — Created May 8, 2015 and submitted

Information

RBTools
release-0.7.x
3dac015...

Reviewers

Previously, when trying to encode the form fields for a request, the
fields were always being encoded as UTF-8, even when they were a binary
type (e.g., unicode text encoded as UTF-8). This lead to encoding
errors and has been rectified.

A new unit test has been added to ensure this heaviour does not
regress.

Ran unit tests. The new unit test fails without the rest of this patch
applied.

Successfully used the RBClient to send requests with fields
containing string values and unicode values.

Successfully uploaded a review request that had UTF-8 characters in the
diff, summary, and description.

Description From Last Updated

""" on the next line.

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/request.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/request.py
    
    
  2. 
      
david
  1. Can you test that posting a review request with unicode in the diff and commit message still works?

  2. 
      
brennie
chipx86
  1. This particular change looks fine, but the rest of this file is still acting like we're working with Unicode. We should be using bytestrings everywhere, and never assuming any encoding for anything, I don't think.

    We should probably also have unit tests added along with any changes to this, to test various encoding setups.

  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/tests.py
        rbtools/api/request.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/tests.py
        rbtools/api/request.py
    
    
  2. 
      
chipx86
  1. 
      
  2. rbtools/api/tests.py (Diff revision 2)
     
     
    Show all issues

    """ on the next line.

  3. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.7.x (ccf4387)