• 
      

    Fix UnicodeDecodeError when parsing SVN diffs with accents

    Review Request #7535 — Created July 22, 2015 and submitted

    Information

    Review Board

    Reviewers

    In ReviewBoard 2.0.x, uploading a SVN diff from a french-localized SVN yields a Unicode error when parsing the diff headers. French SVN diff have accents in them :

    Index: www/app/design/frontend/mobile/default/layout/page.xml
    ===================================================================
    --- www/app/design/frontend/mobile/default/layout/page.xml  (révision 20613)
    +++ www/app/design/frontend/mobile/default/layout/page.xml  (copie de travail)
    

    This causes the following error when uploading such a diff :

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 22: ordinal not in range(128)
    

    This patches fixes the issue by forcing a binary comparison, like the parse_diff_header function does.

    This patch fixed the bug on my RB site

    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/scmtools/svn/__init__.py
      
      
    2. 
        
    david
    1. Ship It!
    2. 
        
    MA
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.0.x (e75c132)