Skip to content

Commit 867754e

Browse files
committed
merge 11164
2 parents 8ffaa10 + 2f48d89 commit 867754e

File tree

9 files changed

+10
-105
lines changed

9 files changed

+10
-105
lines changed

Doc/distutils/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ modules using the Distutils:
187187
module distribution
188188
a collection of Python modules distributed together as a single downloadable
189189
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
191191
Library), or mxBase. (This would be called a *package*, except that term is
192192
already taken in the Python context: a single module distribution may contain
193193
zero, one, or many Python packages.)

Doc/library/modulefinder.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ report of the imported modules will be printed.
2525
.. function:: ReplacePackage(oldname, newname)
2626

2727
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*.
3029

3130

3231
.. class:: ModuleFinder(path=None, debug=0, excludes=[], replace_paths=[])

Doc/library/xml.dom.minidom.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,8 @@ functions do not provide a parser implementation themselves.
6060
You can also create a :class:`Document` by calling a method on a "DOM
6161
Implementation" object. You can get this object either by calling the
6262
: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::
6965

7066
from xml.dom.minidom import getDOMImplementation
7167

Doc/library/xml.dom.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ The Document Object Model is being defined by the W3C in stages, or "levels" in
3030
their terminology. The Python mapping of the API is substantially based on the
3131
DOM Level 2 recommendation.
3232

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-
4033
.. What if your needs are somewhere between SAX and the DOM? Perhaps
4134
you cannot afford to load the entire tree in memory but you find the
4235
SAX model somewhat cumbersome and low-level. There is also a module

Lib/modulefinder.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ def AddPackagePath(packagename, path):
3535

3636
replacePackageMap = {}
3737

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")
4142
# before running ModuleFinder.
4243

4344
def ReplacePackage(oldname, newname):

Lib/test/test_minidom.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,6 @@ def create_doc_with_doctype():
4545
return doc
4646

4747
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-
6848
def confirm(self, test, testname = "Test"):
6949
self.assertTrue(test, testname)
7050

Lib/test/test_sax.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -794,51 +794,6 @@ def test_nsattrs_wattr(self):
794794
self.assertEqual(attrs.getQNameByName((ns_uri, "attr")), "ns:attr")
795795

796796

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-
842797
def test_main():
843798
run_unittest(MakeParserTest,
844799
SaxutilsTest,

Lib/xml/__init__.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,3 @@
1818

1919

2020
__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

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Core and Builtins
8383
Library
8484
-------
8585

86+
- Issue #11164: Stop trying to use _xmlplus in the xml module.
87+
8688
- Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch
8789
by Kasun Herath.
8890

0 commit comments

Comments
 (0)