!12 Solve the problem of upgrading to python3

From: @xu-think-about-it 
Reviewed-by: @dwl301 
Signed-off-by: @dwl301
This commit is contained in:
openeuler-ci-bot 2023-02-15 08:15:22 +00:00 committed by Gitee
commit 067d10ed3e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,22 @@
diff --git a/xml2po/xml2po/__init__.py b/xml2po/xml2po/__init__.py
index 00f4bbd..100f19b 100644
--- a/xml2po/xml2po/__init__.py
+++ b/xml2po/xml2po/__init__.py
@@ -464,7 +464,7 @@ class XMLDocument(object):
norm_outtxt = self.normalizeString(outtxt, self.app.isSpacePreserveNode(node))
translation = self.app.getTranslation(norm_outtxt)
else:
- translation = outtxt.decode('utf-8')
+ translation = outtxt.encode('utf-8').decode('utf-8')
starttag = self.startTagForNode(node)
endtag = self.endTagForNode(node)
@@ -556,7 +556,7 @@ class Main(object):
elif output == '-':
self.out = sys.stdout
else:
- self.out = file(output, 'w')
+ self.out = open(output, 'w')
def load_mode(self, modename):
try:

View File

@ -1,12 +1,13 @@
Name: gnome-doc-utils
Version: 0.20.10
Release: 20
Release: 21
Summary: A collection of documentation utilities for the Gnome project
License: GPL-2.0-or-later and LGPL-2.0-or-later and GFDL-1.1-only
URL: https://wiki.gnome.org/Projects/GnomeDocUtils
Source: https://download.gnome.org/sources/%{name}/0.20/%{name}-%{version}.tar.xz
Patch0001: gnome-doc-utils-0.14.0-package.patch
Patch0002: gnome-doc-utils-0.20.10-python3.patch
Patch0003: gnome-doc-utils-0.20.10-python3-issues.patch
BuildArch: noarch
BuildRequires: gcc
@ -65,6 +66,9 @@ sed -i -e '/^Requires:/d' %{buildroot}%{_datadir}/pkgconfig/xml2po.pc
%{_mandir}/man1/xml2po.1*
%changelog
* Mon Jan 30 2023 xuxiangxiang <xiangxiang.xu@i-soft.com.cn> -0.20.10-21
- Solve the problem of upgrading to python3
* Tue Jul 26 2022 yaoxin <yaoxin30@h-partners.com> - 0.20.10-20
- License compliance rectification