-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python35/36: Fix build with expat-2.6.0 (Issue #1129)
- Loading branch information
Showing
4 changed files
with
166 additions
and
10 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
10.9-libcxx/stable/main/finkinfo/languages/python35-expat26_minidom.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
diff -Nurd Python-3.6.15.orig/Lib/test/test_minidom.py Python-3.6.15/Lib/test/test_minidom.py | ||
--- Python-3.6.15.orig/Lib/test/test_minidom.py 2021-09-03 23:49:41.000000000 -0400 | ||
+++ Python-3.6.15/Lib/test/test_minidom.py 2024-03-06 08:41:19.000000000 -0500 | ||
@@ -5,10 +5,12 @@ | ||
from test import support | ||
import unittest | ||
|
||
+import pyexpat | ||
import xml.dom.minidom | ||
|
||
from xml.dom.minidom import parse, Node, Document, parseString | ||
from xml.dom.minidom import getDOMImplementation | ||
+from xml.parsers.expat import ExpatError | ||
|
||
|
||
tstfile = support.findfile("test.xml", subdir="xmltestdata") | ||
@@ -60,17 +62,7 @@ | ||
def testDocumentAsyncAttr(self): | ||
doc = Document() | ||
self.assertFalse(doc.async_) | ||
- with self.assertWarns(DeprecationWarning): | ||
- self.assertFalse(getattr(doc, 'async', True)) | ||
- with self.assertWarns(DeprecationWarning): | ||
- setattr(doc, 'async', True) | ||
- with self.assertWarns(DeprecationWarning): | ||
- self.assertTrue(getattr(doc, 'async', False)) | ||
- self.assertTrue(doc.async_) | ||
- | ||
self.assertFalse(Document.async_) | ||
- with self.assertWarns(DeprecationWarning): | ||
- self.assertFalse(getattr(Document, 'async', True)) | ||
|
||
def testParseFromBinaryFile(self): | ||
with open(tstfile, 'rb') as file: | ||
@@ -1156,7 +1148,13 @@ | ||
|
||
# Verify that character decoding errors raise exceptions instead | ||
# of crashing | ||
- self.assertRaises(UnicodeDecodeError, parseString, | ||
+ if pyexpat.version_info >= (2, 4, 5): | ||
+ self.assertRaises(ExpatError, parseString, | ||
+ b'<fran\xe7ais></fran\xe7ais>') | ||
+ self.assertRaises(ExpatError, parseString, | ||
+ b'<franais>Comment \xe7a va ? Tr\xe8s bien ?</franais>') | ||
+ else: | ||
+ self.assertRaises(UnicodeDecodeError, parseString, | ||
b'<fran\xe7ais>Comment \xe7a va ? Tr\xe8s bien ?</fran\xe7ais>') | ||
|
||
doc.unlink() | ||
@@ -1602,7 +1600,12 @@ | ||
self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE) | ||
|
||
def testExceptionOnSpacesInXMLNSValue(self): | ||
- with self.assertRaisesRegex(ValueError, 'Unsupported syntax'): | ||
+ if pyexpat.version_info >= (2, 4, 5): | ||
+ context = self.assertRaisesRegex(ExpatError, 'syntax error') | ||
+ else: | ||
+ context = self.assertRaisesRegex(ValueError, 'Unsupported syntax') | ||
+ | ||
+ with context: | ||
parseString('<element xmlns:abc="http:abc.com/de f g/hi/j k"><abc:foo /></element>') | ||
|
||
def testDocRemoveChild(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
10.9-libcxx/stable/main/finkinfo/languages/python36-expat26_minidom.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
diff -Nurd Python-3.6.15.orig/Lib/test/test_minidom.py Python-3.6.15/Lib/test/test_minidom.py | ||
--- Python-3.6.15.orig/Lib/test/test_minidom.py 2021-09-03 23:49:41.000000000 -0400 | ||
+++ Python-3.6.15/Lib/test/test_minidom.py 2024-03-06 08:41:19.000000000 -0500 | ||
@@ -5,10 +5,12 @@ | ||
from test import support | ||
import unittest | ||
|
||
+import pyexpat | ||
import xml.dom.minidom | ||
|
||
from xml.dom.minidom import parse, Node, Document, parseString | ||
from xml.dom.minidom import getDOMImplementation | ||
+from xml.parsers.expat import ExpatError | ||
|
||
|
||
tstfile = support.findfile("test.xml", subdir="xmltestdata") | ||
@@ -60,17 +62,7 @@ | ||
def testDocumentAsyncAttr(self): | ||
doc = Document() | ||
self.assertFalse(doc.async_) | ||
- with self.assertWarns(DeprecationWarning): | ||
- self.assertFalse(getattr(doc, 'async', True)) | ||
- with self.assertWarns(DeprecationWarning): | ||
- setattr(doc, 'async', True) | ||
- with self.assertWarns(DeprecationWarning): | ||
- self.assertTrue(getattr(doc, 'async', False)) | ||
- self.assertTrue(doc.async_) | ||
- | ||
self.assertFalse(Document.async_) | ||
- with self.assertWarns(DeprecationWarning): | ||
- self.assertFalse(getattr(Document, 'async', True)) | ||
|
||
def testParseFromBinaryFile(self): | ||
with open(tstfile, 'rb') as file: | ||
@@ -1156,7 +1148,13 @@ | ||
|
||
# Verify that character decoding errors raise exceptions instead | ||
# of crashing | ||
- self.assertRaises(UnicodeDecodeError, parseString, | ||
+ if pyexpat.version_info >= (2, 4, 5): | ||
+ self.assertRaises(ExpatError, parseString, | ||
+ b'<fran\xe7ais></fran\xe7ais>') | ||
+ self.assertRaises(ExpatError, parseString, | ||
+ b'<franais>Comment \xe7a va ? Tr\xe8s bien ?</franais>') | ||
+ else: | ||
+ self.assertRaises(UnicodeDecodeError, parseString, | ||
b'<fran\xe7ais>Comment \xe7a va ? Tr\xe8s bien ?</fran\xe7ais>') | ||
|
||
doc.unlink() | ||
@@ -1602,7 +1600,12 @@ | ||
self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE) | ||
|
||
def testExceptionOnSpacesInXMLNSValue(self): | ||
- with self.assertRaisesRegex(ValueError, 'Unsupported syntax'): | ||
+ if pyexpat.version_info >= (2, 4, 5): | ||
+ context = self.assertRaisesRegex(ExpatError, 'syntax error') | ||
+ else: | ||
+ context = self.assertRaisesRegex(ValueError, 'Unsupported syntax') | ||
+ | ||
+ with context: | ||
parseString('<element xmlns:abc="http:abc.com/de f g/hi/j k"><abc:foo /></element>') | ||
|
||
def testDocRemoveChild(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters