PR#3413: Fix wrong encoding in changelog entries
Merges #3413 https://pagure.io/koji/pull-request/3413 Fixes: #3412 https://pagure.io/koji/issue/3412 Fix broken changelogs
This commit is contained in:
commit
9a1ee191a6
1 changed files with 4 additions and 2 deletions
|
|
@ -3541,9 +3541,11 @@ if six.PY3:
|
|||
def removeNonprintable(value):
|
||||
# expects raw-encoded string, not unicode
|
||||
if six.PY2:
|
||||
return value.translate(None, NONPRINTABLE_CHARS)
|
||||
value = value.translate(None, NONPRINTABLE_CHARS)
|
||||
else:
|
||||
return value.translate(NONPRINTABLE_CHARS_TABLE)
|
||||
value = value.translate(NONPRINTABLE_CHARS_TABLE)
|
||||
# remove broken unicode chars (some changelogs, etc.)
|
||||
return value.encode('utf-8', errors='replace').decode()
|
||||
|
||||
|
||||
def _fix_print(value):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue