Commit 45a75e51 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[common] Decode inputs before feeding to difflib

parent 07dc01a2
Pipeline #19479 passed with stage
in 2 minutes and 6 seconds
......@@ -736,6 +736,12 @@ def diff(webapi, prefix, type_, name, fields):
def _eval_diff(remote, local, ext):
'''Calculates differences between two string buffers'''
if not isinstance(local, six.string_types):
local = local.decode('utf-8')
if not isinstance(remote, six.string_types):
remote = remote.decode('utf-8')
return difflib.unified_diff(remote.split('\n'), local.split('\n'),
os.path.join('remote', type_, name + ext),
os.path.join('local', type_, name + ext))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment