From 355e1674be8c37e67f59e8bcd39bf7d6a0aac792 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 11 Sep 2018 07:35:03 +1000 Subject: [PATCH] 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 --- reno/sphinxext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reno/sphinxext.py b/reno/sphinxext.py index 4ceeef0..e805e7c 100644 --- a/reno/sphinxext.py +++ b/reno/sphinxext.py @@ -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()