Skip to content

Commit 7dc1020

Browse files
committed
tools/gitlog2changelog.py.in: when authorMustBeASCII, only parse str via unicode() if we did not shortcut it earlier, and fix a typo in encoding value
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 0b38251 commit 7dc1020

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/gitlog2changelog.py.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ for line in fin:
132132
author = author[0 : len(author) - fin_chop]
133133
if authorMustBeASCII:
134134
try:
135-
if isinstance(author, str):
136-
author = unicodedata.normalize(u'NFKD', unicode(author, "UTF=8")).encode('ascii', 'ignore').decode('utf8')
135+
if isinstance(author, str) and unicode != str:
136+
author = unicodedata.normalize(u'NFKD', unicode(author, "utf-8")).encode('ascii', 'ignore').decode('utf8')
137137
else:
138138
author = unicodedata.normalize(u'NFKD', author).encode('ascii', 'ignore').decode('utf8')
139139
except Exception as e:

0 commit comments

Comments
 (0)