| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,7 +187,7 @@ modules using the Distutils: | |||
| 187 | 187 | module distribution | |
| 188 | 188 | a collection of Python modules distributed together as a single downloadable | |
| 189 | 189 | resource and meant to be installed *en masse*. Examples of some well-known | |
| 190 | - module distributions are Numeric Python, PyXML, PIL (the Python Imaging | ||
| 190 | + module distributions are NumPy, SciPy, PIL (the Python Imaging | ||
| 191 | 191 | Library), or mxBase. (This would be called a *package*, except that term is | |
| 192 | 192 | already taken in the Python context: a single module distribution may contain | |
| 193 | 193 | zero, one, or many Python packages.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,8 +25,7 @@ report of the imported modules will be printed. | |||
| 25 | 25 | .. function:: ReplacePackage(oldname, newname) | |
| 26 | 26 | ||
| 27 | 27 | Allows specifying that the module named *oldname* is in fact the package named | |
| 28 | - *newname*. The most common usage would be to handle how the :mod:`_xmlplus` | ||
| 29 | - package replaces the :mod:`xml` package. | ||
| 28 | + *newname*. | ||
| 30 | 29 | ||
| 31 | 30 | ||
| 32 | 31 | .. class:: ModuleFinder(path=None, debug=0, excludes=[], replace_paths=[]) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,12 +60,8 @@ functions do not provide a parser implementation themselves. | |||
| 60 | 60 | You can also create a :class:`Document` by calling a method on a "DOM | |
| 61 | 61 | Implementation" object. You can get this object either by calling the | |
| 62 | 62 | :func:`getDOMImplementation` function in the :mod:`xml.dom` package or the | |
| 63 | - :mod:`xml.dom.minidom` module. Using the implementation from the | ||
| 64 | - :mod:`xml.dom.minidom` module will always return a :class:`Document` instance | ||
| 65 | - from the minidom implementation, while the version from :mod:`xml.dom` may | ||
| 66 | - provide an alternate implementation (this is likely if you have the `PyXML | ||
| 67 | - package <http://pyxml.sourceforge.net/>`_ installed). Once you have a | ||
| 68 | - :class:`Document`, you can add child nodes to it to populate the DOM:: | ||
| 63 | + :mod:`xml.dom.minidom` module. Once you have a :class:`Document`, you | ||
| 64 | + can add child nodes to it to populate the DOM:: | ||
| 69 | 65 | ||
| 70 | 66 | from xml.dom.minidom import getDOMImplementation | |
| 71 | 67 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,13 +30,6 @@ The Document Object Model is being defined by the W3C in stages, or "levels" in | |||
| 30 | 30 | their terminology. The Python mapping of the API is substantially based on the | |
| 31 | 31 | DOM Level 2 recommendation. | |
| 32 | 32 | ||
| 33 | - .. XXX PyXML is dead... | ||
| 34 | - .. The mapping of the Level 3 specification, currently | ||
| 35 | - only available in draft form, is being developed by the `Python XML Special | ||
| 36 | - Interest Group <http://www.python.org/sigs/xml-sig/>`_ as part of the `PyXML | ||
| 37 | - package <http://pyxml.sourceforge.net/>`_. Refer to the documentation bundled | ||
| 38 | - with that package for information on the current state of DOM Level 3 support. | ||
| 39 | - | ||
| 40 | 33 | .. What if your needs are somewhere between SAX and the DOM? Perhaps | |
| 41 | 34 | you cannot afford to load the entire tree in memory but you find the | |
| 42 | 35 | SAX model somewhat cumbersome and low-level. There is also a module | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,9 +35,10 @@ def AddPackagePath(packagename, path): | |||
| 35 | 35 | ||
| 36 | 36 | replacePackageMap = {} | |
| 37 | 37 | ||
| 38 | - # This ReplacePackage mechanism allows modulefinder to work around the | ||
| 39 | - # way the _xmlplus package injects itself under the name "xml" into | ||
| 40 | - # sys.modules at runtime by calling ReplacePackage("_xmlplus", "xml") | ||
| 38 | + # This ReplacePackage mechanism allows modulefinder to work around | ||
| 39 | + # situations in which a package injects itself under the name | ||
| 40 | + # of another package into sys.modules at runtime by calling | ||
| 41 | + # ReplacePackage("real_package_name", "faked_package_name") | ||
| 41 | 42 | # before running ModuleFinder. | |
| 42 | 43 | ||
| 43 | 44 | def ReplacePackage(oldname, newname): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,26 +45,6 @@ def create_doc_with_doctype(): | |||
| 45 | 45 | return doc | |
| 46 | 46 | ||
| 47 | 47 | class MinidomTest(unittest.TestCase): | |
| 48 | - def tearDown(self): | ||
| 49 | - try: | ||
| 50 | - Node.allnodes | ||
| 51 | - except AttributeError: | ||
| 52 | - # We don't actually have the minidom from the standard library, | ||
| 53 | - # but are picking up the PyXML version from site-packages. | ||
| 54 | - pass | ||
| 55 | - else: | ||
| 56 | - self.confirm(len(Node.allnodes) == 0, | ||
| 57 | - "assertion: len(Node.allnodes) == 0") | ||
| 58 | - if len(Node.allnodes): | ||
| 59 | - print("Garbage left over:") | ||
| 60 | - if verbose: | ||
| 61 | - print(list(Node.allnodes.items())[0:10]) | ||
| 62 | - else: | ||
| 63 | - # Don't print specific nodes if repeatable results | ||
| 64 | - # are needed | ||
| 65 | - print(len(Node.allnodes)) | ||
| 66 | - Node.allnodes = {} | ||
| 67 | - | ||
| 68 | 48 | def confirm(self, test, testname = "Test"): | |
| 69 | 49 | self.assertTrue(test, testname) | |
| 70 | 50 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -794,51 +794,6 @@ def test_nsattrs_wattr(self): | |||
| 794 | 794 | self.assertEqual(attrs.getQNameByName((ns_uri, "attr")), "ns:attr") | |
| 795 | 795 | ||
| 796 | 796 | ||
| 797 | - # During the development of Python 2.5, an attempt to move the "xml" | ||
| 798 | - # package implementation to a new package ("xmlcore") proved painful. | ||
| 799 | - # The goal of this change was to allow applications to be able to | ||
| 800 | - # obtain and rely on behavior in the standard library implementation | ||
| 801 | - # of the XML support without needing to be concerned about the | ||
| 802 | - # availability of the PyXML implementation. | ||
| 803 | - # | ||
| 804 | - # While the existing import hackery in Lib/xml/__init__.py can cause | ||
| 805 | - # PyXML's _xmlpus package to supplant the "xml" package, that only | ||
| 806 | - # works because either implementation uses the "xml" package name for | ||
| 807 | - # imports. | ||
| 808 | - # | ||
| 809 | - # The move resulted in a number of problems related to the fact that | ||
| 810 | - # the import machinery's "package context" is based on the name that's | ||
| 811 | - # being imported rather than the __name__ of the actual package | ||
| 812 | - # containment; it wasn't possible for the "xml" package to be replaced | ||
| 813 | - # by a simple module that indirected imports to the "xmlcore" package. | ||
| 814 | - # | ||
| 815 | - # The following two tests exercised bugs that were introduced in that | ||
| 816 | - # attempt. Keeping these tests around will help detect problems with | ||
| 817 | - # other attempts to provide reliable access to the standard library's | ||
| 818 | - # implementation of the XML support. | ||
| 819 | - | ||
| 820 | - def test_sf_1511497(self): | ||
| 821 | - # Bug report: http://www.python.org/sf/1511497 | ||
| 822 | - import sys | ||
| 823 | - old_modules = sys.modules.copy() | ||
| 824 | - for modname in list(sys.modules.keys()): | ||
| 825 | - if modname.startswith("xml."): | ||
| 826 | - del sys.modules[modname] | ||
| 827 | - try: | ||
| 828 | - import xml.sax.expatreader | ||
| 829 | - module = xml.sax.expatreader | ||
| 830 | - self.assertEqual(module.__name__, "xml.sax.expatreader") | ||
| 831 | - finally: | ||
| 832 | - sys.modules.update(old_modules) | ||
| 833 | - | ||
| 834 | - def test_sf_1513611(self): | ||
| 835 | - # Bug report: http://www.python.org/sf/1513611 | ||
| 836 | - sio = StringIO("invalid") | ||
| 837 | - parser = make_parser() | ||
| 838 | - from xml.sax import SAXParseException | ||
| 839 | - self.assertRaises(SAXParseException, parser.parse, sio) | ||
| 840 | - | ||
| 841 | - | ||
| 842 | 797 | def test_main(): | |
| 843 | 798 | run_unittest(MakeParserTest, | |
| 844 | 799 | SaxutilsTest, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,24 +18,3 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | __all__ = ["dom", "parsers", "sax", "etree"] | |
| 21 | - | ||
| 22 | - _MINIMUM_XMLPLUS_VERSION = (0, 8, 4) | ||
| 23 | - | ||
| 24 | - | ||
| 25 | - try: | ||
| 26 | - import _xmlplus | ||
| 27 | - except ImportError: | ||
| 28 | - pass | ||
| 29 | - else: | ||
| 30 | - try: | ||
| 31 | - v = _xmlplus.version_info | ||
| 32 | - except AttributeError: | ||
| 33 | - # _xmlplus is too old; ignore it | ||
| 34 | - pass | ||
| 35 | - else: | ||
| 36 | - if v >= _MINIMUM_XMLPLUS_VERSION: | ||
| 37 | - import sys | ||
| 38 | - _xmlplus.__path__.extend(__path__) | ||
| 39 | - sys.modules[__name__] = _xmlplus | ||
| 40 | - else: | ||
| 41 | - del v | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -83,6 +83,8 @@ Core and Builtins | |||
| 83 | 83 | Library | |
| 84 | 84 | ------- | |
| 85 | 85 | ||
| 86 | + - Issue #11164: Stop trying to use _xmlplus in the xml module. | ||
| 87 | + | ||
| 86 | 88 | - Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch | |
| 87 | 89 | by Kasun Herath. | |
| 88 | 90 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments