This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tobixx
Recipients
Date 2006-06-23.09:44:53
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=694396

I can confirm this behavior for Red Hat Enterprise 3.
I installed Python 2.4.3 . The tests failed for pyexpat
(complaining that there is no expat.so) and minidom.
I installed PyXML-0.8.4 - that solves expat error, minidom
error was still there. Tests for PyXML all run fine.

I have looked into the test and find the following reason:

testAltNewline: 
---------------
str= '<?xml version="1.0" ?>\n<a b="c"/>\n'
dom.toprettyxml(newl="\r\n")
>>> u'<?xml version="1.0" ?>\n<a b="c"/>\r\n' 
str.replace("\n", "\r\n")
>>> '<?xml version="1.0" ?>\r\n<a b="c"/>\r\n' 
domstr == str.replace("\n", "\r\n")
>>> False

I assume the test should be: domstr == str.replace("\r\n"),
"\n") to pass it. But by the way: why is there an '\n' in
the pretty string? And i would suggest: unicode(str).

testWriteXML:
------------
str= '<?xml version="1.0" ?><a b="c"/>'
domstr=dom.toxml()
>>>  u'<?xml version="1.0" ?>\n<a b="c"/>'
str == domstr
>>> False

Whoops, where does the '\n' coming from ? :
toxml
  toprettyxml
    writexml:
    if encoding is None:
        writer.write('<?xml version="1.0" ?>\n')

I'm not a xml guy, but i ask myself: should such formating
really be in this place ?

testEncodings:
--------------
same as before

testPyth1094164:
----------------
I can confirm this behavior for Red Hat Enterprise 3.
I installed Python 2.4.3 . The tests failed for pyexpat
(complaining that there is no expat.so) and minidom.
I installed PyXML-0.8.4 - that solves expat error, minidom
error was still there. Tests for PyXML all run fine.

I have looked into the test and find the following reason:

testAltNewline: 
---------------
str= '<?xml version="1.0" ?>\n<a b="c"/>\n'
dom.toprettyxml(newl="\r\n")
>>> u'<?xml version="1.0" ?>\n<a b="c"/>\r\n' 
str.replace("\n", "\r\n")
>>> '<?xml version="1.0" ?>\r\n<a b="c"/>\r\n' 
domstr == str.replace("\n", "\r\n")
>>> False

I assume the test should be: domstr == str.replace("\r\n"),
"\n") to pass it. But by the way: why is there an '\n' in
the pretty string? And i would suggest: unicode(str).

testWriteXML:
------------
str= '<?xml version="1.0" ?><a b="c"/>'
domstr=dom.toxml()
>>>  u'<?xml version="1.0" ?>\n<a b="c"/>'
str == domstr
>>> False

Whoops, where does the '\n' coming from ? :
toxml
  toprettyxml
    writexml:
    if encoding is None:
        writer.write('<?xml version="1.0" ?>\n')

I'm not a xml guy, but i ask myself: should such formating
really be in this place ?

testEncodings:
--------------
same as before

testPyth1094164:
----------------
after elem.replaceChild(e, e) the dom is gone:

--------> type(elem.firstChild)
Out[129]: <type 'NoneType'>

--------> type(e.parentNode)
Out[130]: <type 'NoneType'>

And why ? 
replaceChild:

if newChild.parentNode is not None:
   newChild.parentNode.removeChild(newChild)
if newChild is oldChild:
   return

I assume the order of this if statement should be reversed.
History
Date User Action Args
2007-08-23 14:39:03adminlinkissue1463043 messages
2007-08-23 14:39:03admincreate