Use unicode for debug string

On Python2, the "line" variable here is a unicode string, but the
LOG.debug statement is trying to format it with a bytes string; this
leads to a conversion error when the line has unicode characters in
it.  Ensure the logging format string is a unicode object to avoid
this.

Change-Id: I9948ffcea3fd10c4b6695593fa2a42731b44c02f
This commit is contained in:
Ian Wienand 2018-09-11 07:35:03 +10:00
parent 8acb2a36d3
commit 355e1674be
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class ReleaseNotesDirective(rst.Directive):
source_name = '<%s %s>' % (__name__, branch or 'current branch')
result = statemachine.ViewList()
for line_num, line in enumerate(text.splitlines(), 1):
LOG.debug('{:>4d}: {}'.format(line_num, line))
LOG.debug(u'{:>4d}: {}'.format(line_num, line))
result.append(line, source_name, line_num)
node = nodes.section()