Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39988 - xml will not work with python2.3
Summary: xml will not work with python2.3
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-31 09:26 UTC by D. Bernard
Modified: 2004-02-14 02:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description D. Bernard 2004-01-31 09:26:05 UTC
when I run python code to create an xml object reader with the command 
FromXmlStream(file)


it geves me the error

 File "/usr/lib/python2.3/sre_compile.py", line 316, in _optimize_unicode
    mapping = array.array('b', mapping).tostring()
AttributeError: 'module' object has no attribute 'array'



Reproducible: Always
Steps to Reproduce:
1.run the python  code

2.import os
import sys
from xml.dom.ext.reader.Sax2  import FromXmlStream
file = open( "ddd.xml", "r")
dom = FromXmlStream(file)

3.sample xml file

<start>
<doseUnits>cGy</doseUnits>
</start>


Actual Results:  
 File "tot.py", line 10, in ?
    dom = FromXmlStream(file)
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/ext/reader/Sax2.py", line 387
, in FromXmlStream
    return reader.fromStream(stream, ownerDocument)
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/ext/reader/Sax2.py", line 373
, in fromStream
    self.parser.parse(s)
  File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", line 107, in
 parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.3/site-packages/_xmlplus/sax/xmlreader.py", line 123, in p
arse
    self.feed(buffer)
  File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", line 207, in
 feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", line 300, in
 start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/ext/reader/Sax2.py", line 57,
 in startElement
    self._initRootNode(nameSpace, name)
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/ext/reader/Sax2.py", line 123
, in _initRootNode
    self._ownerDoc = self._impl.createDocument(docElementUri, docElementName,
self.                            _dt)
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/DOMImplementation.py",
line 5                            6, in createDocument
    el = doc.createElementNS(namespaceURI, qualifiedName)
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/Document.py", line 168, in
cr                            eateElementNS
    if not get_name_pattern().match(qualifiedName):
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/FtNode.py", line 43, in
get_n                            ame_pattern
    _namePattern = re.compile(xml.utils.characters.Name+'\Z')
  File "/usr/lib/python2.3/sre.py", line 179, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.3/sre.py", line 227, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python2.3/sre_compile.py", line 469, in compile
    code = _code(p, flags)
  File "/usr/lib/python2.3/sre_compile.py", line 450, in _code
    _compile_info(code, p, flags)
  File "/usr/lib/python2.3/sre_compile.py", line 428, in _compile_info
    _compile_charset(charset, flags, code)
  File "/usr/lib/python2.3/sre_compile.py", line 156, in _compile_charset
    for op, av in _optimize_charset(charset, fixup):
  File "/usr/lib/python2.3/sre_compile.py", line 198, in _optimize_charset
    return _optimize_unicode(charset, fixup)
  File "/usr/lib/python2.3/sre_compile.py", line 316, in _optimize_unicode
    mapping = array.array('b', mapping).tostring()
AttributeError: 'module' object has no attribute 'array'


Expected Results:  
It should read the file as it did in python 2.2
Comment 1 Rob Cakebread (RETIRED) gentoo-dev 2004-01-31 22:48:32 UTC
I noticed your messages in the forums on this. Is it solved? I couldn't tell from your last message in:
http://forums.gentoo.org/posting.php?mode=quote&p=824311
Comment 2 Alastair Tse (RETIRED) gentoo-dev 2004-02-01 03:35:16 UTC
can you try merging pyxml-0.8.3 and see if that fixes it? it could be that 0.8.2 

http://sourceforge.net/project/shownotes.php?release_id=174846

and can you please post your LANG environment variable and also emerge info? emerge info should always accompnay bug reports.
Comment 3 Alastair Tse (RETIRED) gentoo-dev 2004-02-14 02:44:13 UTC
needinfo