public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-java/jython/files: jython-2.5.2-sax-parser-fix.patch
@ 2012-07-31  8:44 Ralph Sennhauser (sera)
  0 siblings, 0 replies; only message in thread
From: Ralph Sennhauser (sera) @ 2012-07-31  8:44 UTC (permalink / raw
  To: gentoo-commits

sera        12/07/31 08:44:48

  Added:                jython-2.5.2-sax-parser-fix.patch
  Log:
  Backport upstream sax fix, needed for javatoolkit and possibly others.
  JYTHON_SYSTEM_CACHEDIR is buggy, every ebuild not inheriting python.eclass and calling python_pkg_setup would have to set it, also it's a per user system cache dir and so with reduced previleges can't even be created -> drop it.
  Install sandbox control file as the jvm opens the classfiles rw.
  Compile class files during src phases instead of creating orphans.
  
  (Portage version: 2.1.11.9/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch?rev=1.1&content-type=text/plain

Index: jython-2.5.2-sax-parser-fix.patch
===================================================================

# HG changeset patch
# User Alan Kennedy <jython-dev@xhaus.com>
# Date 1319980040 0
# Node ID 936bd1b132eb9c591cf915b060c6567ae8e16914
# Parent  71b3f883f6c5f0f39f0ae8aff097a439d4970f46
Fix for xml attribute namespaces issue
http://bugs.jython.org/issue1768

diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -390,22 +390,23 @@ def test_expat_nsattrs_wattr():
     gather = AttrGatherer()
     parser.setContentHandler(gather)
 
-    parser.parse(StringIO("<doc xmlns:ns='%s' ns:attr='val'/>" % ns_uri))
+    a_name = "id" ; a_val = "val"
+    parser.parse(StringIO("<doc xmlns:ns='%s' ns:%s='%s'/>" % (ns_uri, a_name, a_val) ))
 
     attrs = gather._attrs
 
     return attrs.getLength() == 1 and \
-           attrs.getNames() == [(ns_uri, "attr")] and \
-           attrs.getQNames() == ["ns:attr"] and \
+           attrs.getNames() == [(ns_uri, a_name)] and \
+           attrs.getQNames() == ["ns:%s" % a_name] and \
            len(attrs) == 1 and \
-           attrs.has_key((ns_uri, "attr")) and \
-           attrs.keys() == [(ns_uri, "attr")] and \
-           attrs.get((ns_uri, "attr")) == "val" and \
-           attrs.get((ns_uri, "attr"), 25) == "val" and \
-           attrs.items() == [((ns_uri, "attr"), "val")] and \
-           attrs.values() == ["val"] and \
-           attrs.getValue((ns_uri, "attr")) == "val" and \
-           attrs[(ns_uri, "attr")] == "val"
+           attrs.has_key((ns_uri, a_name)) and \
+           attrs.keys() == [(ns_uri, a_name)] and \
+           attrs.get((ns_uri, a_name)) == a_val and \
+           attrs.get((ns_uri, a_name), 25) == a_val and \
+           attrs.items() == [((ns_uri, a_name), a_val)] and \
+           attrs.values() == [a_val] and \
+           attrs.getValue((ns_uri, a_name)) == a_val and \
+           attrs[(ns_uri, a_name)] == a_val
 
 def test_expat_nsattrs_no_namespace():
     parser = make_parser()
@@ -413,22 +414,23 @@ def test_expat_nsattrs_no_namespace():
     gather = AttrGatherer()
     parser.setContentHandler(gather)
 
-    parser.parse(StringIO("<doc attr='val'/>"))
+    a_name = "id" ; a_val = "val"
+    parser.parse(StringIO("<doc %s='%s'/>" % (a_name, a_val) ))
 
     attrs = gather._attrs
 
     return attrs.getLength() == 1 and \
-           attrs.getNames() == [(None, "attr")] and \
-           attrs.getQNames() == ["attr"] and \
+           attrs.getNames() == [(None, a_name)] and \
+           attrs.getQNames() == [a_name] and \
            len(attrs) == 1 and \
-           attrs.has_key((None, "attr")) and \
-           attrs.keys() == [(None, "attr")] and \
-           attrs.get((None, "attr")) == "val" and \
-           attrs.get((None, "attr"), 25) == "val" and \
-           attrs.items() == [((None, "attr"), "val")] and \
-           attrs.values() == ["val"] and \
-           attrs.getValue((None, "attr")) == "val" and \
-           attrs[(None, "attr")] == "val"
+           attrs.has_key((None, a_name)) and \
+           attrs.keys() == [(None, a_name)] and \
+           attrs.get((None, a_name)) == a_val and \
+           attrs.get((None, a_name), 25) == a_val and \
+           attrs.items() == [((None, a_name), a_val)] and \
+           attrs.values() == [a_val] and \
+           attrs.getValue((None, a_name)) == a_val and \
+           attrs[(None, a_name)] == a_val
 
 # ===== InputSource support
 
diff --git a/Lib/xml/sax/drivers2/drv_javasax.py b/Lib/xml/sax/drivers2/drv_javasax.py
--- a/Lib/xml/sax/drivers2/drv_javasax.py
+++ b/Lib/xml/sax/drivers2/drv_javasax.py
@@ -238,7 +238,7 @@ class JavaSAXParser(xmlreader.XMLReader,
         pass # TODO
 
 def _fixTuple(nsTuple, frm, to):
-    if len(nsTuple) == 2:
+    if isinstance(nsTuple, tuple) and len(nsTuple) == 2:
         nsUri, localName = nsTuple
         if nsUri == frm:
             nsUri = to





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-31  8:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31  8:44 [gentoo-commits] gentoo-x86 commit in dev-java/jython/files: jython-2.5.2-sax-parser-fix.patch Ralph Sennhauser (sera)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox