4Suite's XML parsing capabilities are provided by Expat.
4Suite 1.0b1 and newer
Installing or upgrading Expat / PyExpat on your system is not a prerequisite for using 4Suite 1.0b1 and up, which should not be subject to external Expat issues at all.
Older versions of 4Suite
If you're using an older version of 4Suite, you are still probably OK, but there may be some circumstances in which some other Expat already on your system gets used instead of the one that comes with 4Suite, and in some situations this can be a problem. For example, mod_python users reported byte-order issues related to mod_python's Python interpreter using whatever version of Expat was linked to by Apache, on certain platforms.
Below is just some general information that may or may not be relevant. It is hard to remember all of these details, so we are archiving them here.
What is Expat?
- Expat is a fast, open-source, event-based XML parser written in C.
- Expat is installed on many systems. Since Python 2.3 it has been included with Python (see below).
- It is possible there is more than one copy of Expat on your system.
- The Domlette XML Reader API in 4Suite (NonvalidatingReader, etc.) use Expat as their underlying parser implementation.
- 4Suite comes bundled with its own copy of Expat. Prior to the 1.0b1 release of 4Suite, it was still possible, in certain situations (such as stylesheet or XML Catalog reading) to be using some other version of Expat on your system, depending on whether PyExpat was installed.
What is PyExpat?
- PyExpat is a Python wrapper for the Expat XML parser's C libraries. It provides a 'pyexpat' module.
- In Python 2.0-2.2, PyExpat was typically installed if the Expat C libraries were on the system at the time Python was built. In Python 2.3 and up, Expat was included with Python and thus PyExpat was almost always installed. However, some packagers chose not to distribute it; e.g., FreeBSD didn't have it until its python-2.3.2_2 port/package was created in November 2003.
- You can verify whether PyExpat is installed by entering 'import pyexpat' at the Python interpreter prompt. If you get a traceback, you don't have PyExpat.
- PyExpat can be added to an existing Python installation that was built without it, as long as the Expat C libraries are installed.
- The easiest way to get PyExpat and Expat, if you don't have them, is to just install PyXML. PyXML will not replace your existing Expat, if you have one, but PyXML will install its own Expat, along with a version of PyExpat to wrap it (actually it's all in one pyexpat.so file).
Expat version caveats
- The most stable versions are 1.95.2, which was very widely distributed, 1.95.6, and 1.95.8.
- Expat version 1.95.6 might misreport its version as 1.95.4.
- Expat 1.95.5 has severe issues with memory violations, resulting in crashes and core dumps. This version was, unfortunately, widely distributed, and was also distributed with PyXML 0.8.1. If you happened to install PyXML 0.8.1, please upgrade to the most recent version.
- Expat versions prior to 1.95.0 do not support DTDs, the internal subset of which must be read by nonvalidating parsers in order to find entity and default attribute declarations, so no one should be using these outdated versions.
Links
- Expat project home
- PyXML project home - PyExpat is now part of PyXML
