Fix test_pyexpat failure with Expat 2.2.0

This commit is contained in:
Charalampos Stratakis 2016-07-08 16:47:33 +02:00
parent 4d924b173b
commit ac1e8eda41
2 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,17 @@
diff -r 682a8e36dd18 Lib/test/test_pyexpat.py
--- a/Lib/test/test_pyexpat.py Tue Jul 05 17:08:52 2016 +0300
+++ b/Lib/test/test_pyexpat.py Thu Jul 07 17:04:35 2016 +0800
@@ -656,11 +656,9 @@
# \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE)
xml = b"<?xml version\xc2\x85='1.0'?>\r\n"
parser = expat.ParserCreate()
- try:
+ err_pattern = r'XML declaration not well-formed: line 1, column \d+'
+ with self.assertRaisesRegex(expat.ExpatError, err_pattern):
parser.Parse(xml, True)
- self.fail()
- except expat.ExpatError as e:
- self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14')
class ErrorMessageTest(unittest.TestCase):
def test_codes(self):

View File

@ -112,7 +112,7 @@
Summary: Version 3 of the Python programming language aka Python 3000
Name: python3
Version: %{pybasever}.1
Release: 10%{?dist}
Release: 11%{?dist}
License: Python
Group: Development/Languages
@ -480,6 +480,12 @@ Patch209: 00209-prevent-buffer-overflow-in-zipimport-module.patch
# Raise an error when STARTTLS fails
Patch210: 00210-Raise-an-error-when-STARTTLS-fails.patch
# 00211 #
# Fix test breakage with version 2.2.0 of Expat
# rhbz#1353918: https://bugzilla.redhat.com/show_bug.cgi?id=1353918
# NOT YET FIXED UPSTREAM: http://bugs.python.org/issue27369
Patch211: 00211-fix-test-pyexpat-failure.patch
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17 onwards,
@ -747,6 +753,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en
%patch208 -p1
%patch209 -p1
%patch210 -p1
%patch211 -p1
# Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there
# are many differences between 2.6 and the Python 3 library.
@ -1648,6 +1655,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
* Fri Jul 08 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.5.1-11
- Fix test_pyexpat failure with Expat version of 2.2.0
* Fri Jul 08 2016 Miro Hrončok <mhroncok@redhat.com> - 3.5.1-10
- Move xml module to system-python-libs