Fix unicode regressions
Commit 74877d2 added improved support for python3 but introduced some regressions around unicode handling. Inspired-By: James E. Blair <jeblair@linux.vnet.ibm.com> Change-Id: I424a921d80959777ff72df499c5931a21dc0dccb
This commit is contained in:
parent
74abd8e318
commit
8377e0ac28
@ -12,6 +12,10 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# Test changes:
|
||||
# https://review.openstack.org/275862
|
||||
# https://review.openstack.org/119302
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import difflib
|
||||
@ -87,11 +91,11 @@ class CommitContext(object):
|
||||
if isinstance(author.email, six.text_type):
|
||||
author_email = author.email
|
||||
else:
|
||||
author_email = six.u(author.email)
|
||||
author_email = author.email.decode('utf8')
|
||||
if isinstance(committer.email, six.text_type):
|
||||
committer_email = committer.email
|
||||
else:
|
||||
committer_email = six.u(committer.email)
|
||||
committer_email = committer.email.decode('utf8')
|
||||
return [u"Parent: %s\n" % parentsha,
|
||||
u"Author: %s <%s>\n" % (author.name, author_email),
|
||||
u"AuthorDate: %s\n" % author_date,
|
||||
@ -409,11 +413,7 @@ class Repo(object):
|
||||
oldchunk = []
|
||||
newchunk = []
|
||||
prev_key = ''
|
||||
if isinstance(diff_context.diff, six.string_types):
|
||||
diff_text = six.b(diff_context.diff).decode('utf-8')
|
||||
else:
|
||||
diff_text = diff_context.diff.decode('utf-8')
|
||||
diff_lines = diff_text.split('\n')
|
||||
diff_lines = diff_context.diff.split('\n')
|
||||
for i, line in enumerate(diff_lines):
|
||||
last_line = (i == len(diff_lines)-1)
|
||||
if line.startswith('---'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user