mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-02-09 13:37:42 -08:00
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
95 lines
3.8 KiB
Diff
95 lines
3.8 KiB
Diff
|
|
# 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
|