!37 修复编译失败问题

From: @caodongxia 
Reviewed-by: @zhuchunyi 
Signed-off-by: @zhuchunyi
This commit is contained in:
openeuler-ci-bot 2022-05-16 06:51:47 +00:00 committed by Gitee
commit 2f1ea3f17d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 56 additions and 1 deletions

View File

@ -7,7 +7,7 @@
Name: mailman
Version: 3.3.2
Release: 3
Release: 4
Epoch: 3
Summary: The GNU mailing list manager
License: GPLv3
@ -21,6 +21,10 @@ Source5: mailman3-digests.service
Source6: mailman3-digests.timer
Patch11: mailman-subject-prefix.patch
Patch14: mailman-use-either-importlib_resources-or-directly-importlib.patch
#Refer: https://bugzilla.redhat.com/show_bug.cgi?id=1900668#c9
Patch15: mailman3-do-not-assume-sapce-in-banner.patch
#Refer: https://gitlab.com/mailman/mailman/-/merge_requests/772
Patch16: mailman3-test_as_string_python_bug_27321.patch
BuildArch: noarch
BuildRequires: glibc-langpack-en
BuildRequires: python%{python3_pkgversion}-devel >= 3.5 python%{python3_pkgversion}-setuptools
@ -202,6 +206,9 @@ done
%{_datadir}/selinux/*/mailman3.pp
%changelog
* Fri May 13 2022 caodongxia <caodongxia@h-partners.com> - 3:3.3.2-4
- Fix test_interact and test_message failure
* Thu Aug 12 2021 wangyue <wangyue92@huawei.com> - 3.3.2-3
- fix build error

View File

@ -0,0 +1,13 @@
diff --git a/src/mailman/utilities/tests/test_interact.py b/src/mailman/utilities/tests/test_interact.py
index 24c186c..dca1866 100644
--- a/src/mailman/utilities/tests/test_interact.py
+++ b/src/mailman/utilities/tests/test_interact.py
@@ -67,7 +67,7 @@ class TestInteract(unittest.TestCase):
self._enter(hackenv('PYTHONSTARTUP', None))
interact()
stderr = self._stderr.getvalue().splitlines()
- banner = 'Python {} on {} '.format(sys.version, sys.platform)
+ banner = 'Python {} on {}'.format(sys.version, sys.platform)
self.assertEqual(stderr[0], banner.splitlines()[0])
def test_interact_custom_banner(self):

View File

@ -0,0 +1,35 @@
From 70373ea11495164fcdf7a61b754b6ab94872ace4 Mon Sep 17 00:00:00 2001
From: Mark Sapiro <mark@msapiro.net>
Date: Fri, 5 Feb 2021 20:29:42 -0800
Subject: [PATCH] Skip test_as_string_python_bug_27321 for Python versions
where fixed.
---
src/mailman/email/tests/test_message.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/mailman/email/tests/test_message.py b/src/mailman/email/tests/test_message.py
index 098042ea7..050861c91 100644
--- a/src/mailman/email/tests/test_message.py
+++ b/src/mailman/email/tests/test_message.py
@@ -17,6 +17,7 @@
"""Test the message API."""
+import sys
import unittest
from email import message_from_binary_file
@@ -107,6 +108,10 @@ Test content
self.assertEqual(msg.get_payload(), 'Non-ascii text ?.')
def test_as_string_python_bug_27321(self):
+ # Bug 27321 is fixed in Python 3.8.7rc1, 3.9.1rc1 and later.
+ if (sys.version_info.minor == 8 and sys.hexversion >= 0x030807C1 or
+ sys.hexversion >= 0x030901C1):
+ raise unittest.SkipTest
with path('mailman.email.tests.data', 'bad_email.eml') as email_path:
with open(str(email_path), 'rb') as fp:
msg = message_from_binary_file(fp, Message)
--
GitLab