Fix rbt patch with unicode characters.

Review Request #5213 — Created Jan. 7, 2014 and submitted

Information

RBTools
release-0.5.x

Reviewers

Fix rbt patch with unicode characters.

rbt patch was completely failing with unicode characters, presenting
errors on the console. We now encode thet content before writing it to a
temp file, and decode before feeling it to 'git commit'.

Created a change with unicode characters, and successfully applied it.

Verified the characters appeared in my editor and in the resulting commit
message.

Previously, this was breaking at two points: When it tried to run the editor,
and when it tried to create the commit from the editor's contents.

Description From Last Updated

Don't we want to pass utf8 in the arguments? .decode() returns a unicode object, which probably gets re-encoded using the …

daviddavid
david
  1. 
      
  2. rbtools/clients/git.py (Diff revision 1)
     
     
    Show all issues

    Don't we want to pass utf8 in the arguments? .decode() returns a unicode object, which probably gets re-encoded using the default encoding

    1. I honestly wasn't sure what the right route was, but passing it in without this gives us another unicode error.

    2. Hmmm. Let me read through and figure out where modified_message comes from.

    3. OK, I think what would make more sense is if the .decode() call happened inside the edit_text() function.

    4. Yeah, that makes more sense.

  3. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...