[Jython-checkins] jython (merge 2.5 -> default): merge w/2.5: #1537: Fix for classloading issues with MATLAB/OpenJDK

alan.kennedy jython-checkins at python.org
Sun Apr 1 19:33:20 CEST 2012


http://hg.python.org/jython/rev/491a9451d21d
changeset:   6524:491a9451d21d
parent:      6521:22450f53ce82
parent:      6523:e2f76787357c
user:        Alan Kennedy <alan at xhaus.com>
date:        Sun Apr 01 18:32:03 2012 +0100
summary:
  merge w/2.5: #1537: Fix for classloading issues with MATLAB/OpenJDK

files:
  Lib/xml/parsers/expat.py |  14 +++++++-------
  NEWS                     |   2 ++
  2 files changed, 9 insertions(+), 7 deletions(-)


diff --git a/Lib/xml/parsers/expat.py b/Lib/xml/parsers/expat.py
--- a/Lib/xml/parsers/expat.py
+++ b/Lib/xml/parsers/expat.py
@@ -47,12 +47,8 @@
 from org.xml.sax.ext import DefaultHandler2
 
 # Xerces
-try:
-    # Name mangled by jarjar?
-    import org.python.apache.xerces.parsers.SAXParser
-    _xerces_parser = "org.python.apache.xerces.parsers.SAXParser"
-except ImportError:
-    _xerces_parser = "org.apache.xerces.parsers.SAXParser"
+_mangled_xerces_parser_name = "org.python.apache.xerces.parsers.SAXParser"
+_xerces_parser_name = "org.apache.xerces.parsers.SAXParser"
 
 
 # @expat args registry
@@ -88,7 +84,11 @@
                      "not %s" % type(namespace_separator).__name__)
             raise TypeError(error)
 
-        self._reader = XMLReaderFactory.createXMLReader(_xerces_parser)
+        # See http://bugs.jython.org/issue1537
+        try:
+            self._reader = XMLReaderFactory.createXMLReader(_mangled_xerces_parser_name)
+        except:
+            self._reader = XMLReaderFactory.createXMLReader(_xerces_parser_name)
 
         if self.namespace_separator is None:
             try:
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@
 
 Jython 2.5.3b2
   Bugs Fixed
+    - [ 1537 ] expat: org.python.apache.xerces.parsers.SAXParser
+    - [ 1268 ] SAX parsers wants to load external DTDs, causing an exception
     - [ 1805 ] threading.Thread always gets name "Thread" instead of a discriminating one
     - [ 1866 ] Parser does not have mismatch token error messages caught by BaseRecognizer
     - [ 1837 ] gderived.py and template Ant target fail on Windows

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list