Changeset View
Changeset View
Standalone View
Standalone View
files/itstool-2.0.5-fix-crash-wrong-encoding.patch
| Show All 36 Lines | |||||
| + return s | + return s | ||||
| + else: | + else: | ||||
| + # print may not work on unicode if the output encoding cannot be | + # print may not work on unicode if the output encoding cannot be | ||||
| + # detected, so just encode with UTF-8 | + # detected, so just encode with UTF-8 | ||||
| + return unicode.encode(s, 'utf-8') | + return unicode.encode(s, 'utf-8') | ||||
| NS_ITS = 'http://www.w3.org/2005/11/its' | NS_ITS = 'http://www.w3.org/2005/11/its' | ||||
| NS_ITST = 'http://itstool.org/extensions/' | NS_ITST = 'http://itstool.org/extensions/' | ||||
| @@ -1060,9 +1073,9 @@ | @@ -1077,9 +1090,9 @@ | ||||
| if strict: | if strict: | ||||
| raise | raise | ||||
| else: | else: | ||||
| - sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % ( | - sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % ( | ||||
| + sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % ( | + sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % ( | ||||
| (lang + ' ') if lang is not None else '', | (lang + ' ') if lang is not None else '', | ||||
| - msgstr.encode('utf-8'))) | - msgstr.encode('utf-8'))) | ||||
| + msgstr))) | + msgstr))) | ||||
| self._xml_err = '' | self._xml_err = '' | ||||
| return node | return node | ||||
| def scan_node(node): | def scan_node(node): | ||||
| @@ -1087,9 +1100,9 @@ | @@ -1104,9 +1117,9 @@ | ||||
| if strict: | if strict: | ||||
| raise | raise | ||||
| else: | else: | ||||
| - sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % ( | - sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % ( | ||||
| + sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % ( | + sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % ( | ||||
| (lang + ' ') if lang is not None else '', | (lang + ' ') if lang is not None else '', | ||||
| - msgstr.encode('utf-8'))) | - msgstr.encode('utf-8'))) | ||||
| + msgstr))) | + msgstr))) | ||||
| self._xml_err = '' | self._xml_err = '' | ||||
| ctxt.doc().freeDoc() | ctxt.doc().freeDoc() | ||||
| return node | return node | ||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.