Bugs item #1463043, was opened at 2006-04-02 16:03 Message generated for change (Comment added) made by tobixx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1463043&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Build Group: None Status: Open Resolution: None Priority: 5 Submitted By: Richard Townsend (rptownsend) Assigned to: Martin v. Löwis (loewis) Summary: test_minidom.py fails for Python-2.4.3 on SUSE 9.3 Initial Comment: I built Python-2.4.3 from source on SUSE 9.3 and get the following error for test_minidom.py /usr/local/src/Python-2.4.3: ./python Lib/test/test_minidom.py Failed Test Test Failed: testAltNewline Traceback (most recent call last): File "Lib/test/test_minidom.py", line 1384, in ? func() File "Lib/test/test_minidom.py", line 427, in testAltNewline confirm(domstr == str.replace("\n", "\r\n")) File "Lib/test/test_minidom.py", line 28, in confirm raise Exception Exception <exceptions.Exception instance at 0x4036d6cc> Failed testEncodings - encoding EURO SIGN Test Failed: testEncodings Traceback (most recent call last): File "Lib/test/test_minidom.py", line 1384, in ? func() File "Lib/test/test_minidom.py", line 891, in testEncodings "testEncodings - encoding EURO SIGN") File "Lib/test/test_minidom.py", line 28, in confirm raise Exception Exception <exceptions.Exception instance at 0x4037e46c> Failed After replaceChild() Test Failed: testPatch1094164 Traceback (most recent call last): File "Lib/test/test_minidom.py", line 1384, in ? func() File "Lib/test/test_minidom.py", line 1137, in testPatch1094164 confirm(e.parentNode is elem, "After replaceChild()") File "Lib/test/test_minidom.py", line 28, in confirm raise Exception Exception <exceptions.Exception instance at 0x4037ec4c> Failed Test Test Failed: testWriteXML Traceback (most recent call last): File "Lib/test/test_minidom.py", line 1384, in ? func() File "Lib/test/test_minidom.py", line 420, in testWriteXML confirm(str == domstr) File "Lib/test/test_minidom.py", line 28, in confirm raise Exception Exception <exceptions.Exception instance at 0x403b160c> **** Check for failures in these tests: testAltNewline testEncodings testPatch1094164 testWriteXML ---------------------------------------------------------------------- Comment By: Steffen Tobias Oschatz (tobixx) Date: 2006-06-23 11:44 Message: 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. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2006-04-10 09:01 Message: Logged In: YES user_id=21627 It's no surprise that the error didn't occur in 2.5a1: the PyXML-0.8.4 installation on rptownsend's machine was for 2.4; the 2.5 sandbox won't see 2.4's xmlplus. Even if PyXML was installed on 2.5, the test suite would still refer to xmlcore, thus bypassing PyXML. ---------------------------------------------------------------------- Comment By: Richard Townsend (rptownsend) Date: 2006-04-07 12:07 Message: Logged In: YES user_id=200117 I added a few print statements to the tests - see attached file py_243.txt for the results while running on Python- 2.4.3 ---------------------------------------------------------------------- Comment By: Richard Townsend (rptownsend) Date: 2006-04-06 14:31 Message: Logged In: YES user_id=200117 Interestingly, the error doesn't occur with Python-2.5a1 ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2006-04-04 08:27 Message: Logged In: YES user_id=33168 Martin maintains PyXML AFAIK. Maybe he has some ideas. I suspect this might be even worse in 2.5. Element Tree was added and there was a name change. Some of those things still need to be addressed. ---------------------------------------------------------------------- Comment By: Richard Townsend (rptownsend) Date: 2006-04-03 15:37 Message: Logged In: YES user_id=200117 Hi Neal, I've just built 2.4.3 on a Red Hat Enterpeise Edition WS V4.2 machine and this gives the same error. I've had this vague feeling that I've seen something like this before, but couldn't find anything when I searched the tracker... I've now realised that the error is due to a conflict with PyXML-0.8.4 which was already installed on both machines. If I rename the ../site_packages/_xmlplus directory to a different name then the error goes away (on the Red Hat machine at least, the SUSE machine is at home). ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2006-04-03 07:37 Message: Logged In: YES user_id=33168 Thanks for letting us know about where the regression occurred. Can you do a little more debugging to try to find the cause and some ideas about how to fix it? I'm not sure that any developer runs on a system that exhibits this error. So it will probably be very difficult for us to figure it out since we can't reproduce it. ---------------------------------------------------------------------- Comment By: Richard Townsend (rptownsend) Date: 2006-04-02 16:28 Message: Logged In: YES user_id=200117 I've just retested with earlier versions. No error with Python-2.4.1 Similar error with Python-2.4.2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1463043&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com