3781: Problem generating diff files containing UNICODE characters (Fix in description)

francoi*******@gmai***** (Google Code) (Is this you? Claim this profile.)
david
david
March 13, 2015
What version are you running?
RBTools 0.7.1 with Python 2.7

What's the URL of the page containing the problem?
None, problem lies in RBTools while generating a diff

What steps will reproduce the problem?
1. Have a file encoded in something else than ASCII
2. try to generate a diff using RBTools
3. It will fail with a message stating the 'ascii' converter cannot process a character > 128

What is the expected output? What do you see instead?
Expected output, a valid diff

What operating system are you using? What browser?
Windows 7, Chrome

Please provide any additional information below.
Here's the culprit:

Python27\Lib\site-packages\RBTools-0.7.1-py2.7.egg\rbtools\utils\process.py
Line 93

       logging.debug('Command exited with rc %s: %s\n%s---'
                      % (rc, command, data))

It is logging what was read from the file "data" which can be encoded in UNICODE. The logging fails and the whole diff file fails because of it.

Commenting out the logging statement successfully generates a diff. Logging should probably be moved AFTER the conversion of the variable data in ASCII
david
#1 david
  • +PendingReview
  • +Component-RBTools
  • +david
david
#2 david
Fixed in rbtools release-0.7.x (c2cb0ea). Thanks!
  • -PendingReview
    +Fixed