This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 750694 - xmltramp fails to parse: IndexError: list index out of range
xmltramp fails to parse: IndexError: list index out of range
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: python-xmltramp (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Dan Callaghan
Fedora Extras Quality Assurance
: Patch, Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-02 00:23 EDT by Dan Callaghan
Modified: 2013-06-17 21:31 EDT (History)
2 users (show)

See Also:
Fixed In Version: python-xmltramp-2.17-12.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-17 21:29:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
patch for xmltramp.py (797 bytes, patch)
2011-11-02 00:36 EDT, Dan Callaghan
no flags Details | Diff

  None (edit)
Description Dan Callaghan 2011-11-02 00:23:34 EDT
Description of problem:
xmltramp can't parse XML documents where a namespace prefix is declared on an element which has a following sibling.


Version-Release number of selected component (if applicable):
python-xmltramp-2.17-8.fc15


How reproducible:
always


Steps to Reproduce:
python -c 'import sys, xmltramp; xmltramp.parse(sys.stdin.read())' <<EOF
<a>
  <b xmlns:str="http://exslt.org/strings"/>
  <c/>
</a>
EOF

  
Actual results:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/xmltramp.py", line 257, in parse
    return seed(StringIO(text))
  File "/usr/lib/python2.7/site-packages/xmltramp.py", line 252, in seed
    parser.parse(fileobj)
  File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib64/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 338, in start_element_ns
    AttributesNSImpl(newattrs, qnames))
  File "/usr/lib/python2.7/site-packages/xmltramp.py", line 227, in startElementNS
    for k in self.prefixes.keys(): newprefixes[k] = self.prefixes[k][-1]
IndexError: list index out of range


Expected results:
Should parse successfully.


Additional info:
Attaching patch with test.
Comment 1 Dan Callaghan 2011-11-02 00:36:04 EDT
Created attachment 531241 [details]
patch for xmltramp.py
Comment 2 Fedora End Of Life 2012-08-07 12:09:34 EDT
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 3 Dan Callaghan 2012-08-07 18:03:26 EDT
Bug still applies in F17:

$ rpm -q python-xmltramp
python-xmltramp-2.17-9.fc17.noarch
$ python -c 'import sys, xmltramp; xmltramp.parse(sys.stdin.read())' <<EOF
> <a>
>   <b xmlns:str="http://exslt.org/strings"/>
>   <c/>
> </a>
> EOF
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/xmltramp.py", line 257, in parse
    return seed(StringIO(text))
  File "/usr/lib/python2.7/site-packages/xmltramp.py", line 252, in seed
    parser.parse(fileobj)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/sax/expatreader.py", line 352, in start_element_ns
    AttributesNSImpl(newattrs, qnames))
  File "/usr/lib/python2.7/site-packages/xmltramp.py", line 227, in startElementNS
    for k in self.prefixes.keys(): newprefixes[k] = self.prefixes[k][-1]
IndexError: list index out of range
Comment 4 Amit Saha 2013-01-08 11:39:53 EST
Bug still applicable on F18.

$ rpm -q python-xmltramp
python-xmltramp-2.17-10.fc18.noarch

$ python -c 'import sys, xmltramp; xmltramp.parse(sys.stdin.read())'
<a>
<b xmlns:str="http://exslt.org/strings"/>               
<c/>
</a>
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/xmltramp.py", line 257, in parse
    return seed(StringIO(text))
  File "/usr/lib/python2.7/site-packages/xmltramp.py", line 252, in seed
    parser.parse(fileobj)
  File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib64/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 338, in start_element_ns
    AttributesNSImpl(newattrs, qnames))
  File "/usr/lib/python2.7/site-packages/xmltramp.py", line 227, in startElementNS
    for k in self.prefixes.keys(): newprefixes[k] = self.prefixes[k][-1]
IndexError: list index out of range
Comment 5 Fedora Admin XMLRPC Client 2013-06-07 01:53:45 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 6 Fedora Update System 2013-06-07 02:48:07 EDT
python-xmltramp-2.17-12.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-xmltramp-2.17-12.fc19
Comment 7 Fedora Update System 2013-06-07 02:48:48 EDT
python-xmltramp-2.17-12.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-xmltramp-2.17-12.fc18
Comment 8 Fedora Update System 2013-06-07 02:49:19 EDT
python-xmltramp-2.17-12.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-xmltramp-2.17-12.fc17
Comment 9 Fedora Update System 2013-06-07 19:52:19 EDT
Package python-xmltramp-2.17-12.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-xmltramp-2.17-12.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-10322/python-xmltramp-2.17-12.fc18
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2013-06-17 00:32:46 EDT
python-xmltramp-2.17-12.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2013-06-17 21:29:47 EDT
python-xmltramp-2.17-12.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 Fedora Update System 2013-06-17 21:31:52 EDT
python-xmltramp-2.17-12.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.