Fix call to sanitize_illegal_chars_for_xml.

Review Request #6678 — Created Dec. 5, 2014 and submitted

Information

Review Board
release-2.0.x
b2b0c84...

Reviewers

The newly-added sanitize_illegal_chars_for_xml method was being called after we
had encoded the unicode string into bytes, and doing the regular expression
substitution would then try to coerce those bytes back to unicode using the
ascii codec. Doing the sanitization on the unicode object, and then encoding to
bytes works correctly.

Ran unit tests. Before the fix, this failed with the same error as the reported
issue. After, it runs successfully.

Description From Last Updated

Actually, can we compare this to the expected result, to be sure? We have other tests at the top of …

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/markdown_utils.py
        reviewboard/reviews/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/markdown_utils.py
        reviewboard/reviews/tests.py
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. reviewboard/reviews/tests.py (Diff revision 1)
     
     
     
     
     
    Show all issues

    Actually, can we compare this to the expected result, to be sure? We have other tests at the top of the class that check for things like this.

  3. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/markdown_utils.py
        reviewboard/reviews/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/markdown_utils.py
        reviewboard/reviews/tests.py
    
    
  2. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (6e33e1c)
Loading...