Bug 844603

Summary: Work on removing PyXML dependency
Product: [Community] Spacewalk Reporter: Miroslav Suchý <msuchy>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.8CC: a.badger, msuchy
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: osad-5.11.4-1 spacewalk-backend-1.8.58-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 844533 Environment:
Last Closed: 2012-11-01 16:22:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 844533    
Bug Blocks: 843176, 871344    

Description Miroslav Suchý 2012-07-31 07:25:40 UTC
+++ This bug was initially created as a clone of Bug #844533 +++

Description of problem:

For Fedora 18 we're trying to get rid of PyXML in the distribution[1]_.  The reason is that PyXML has been dead upstream for a long time and it has the dubious behaviour of overwriting the python stdlib's xml module with its own code.  The combination of these two means that code that uses the stdlib's xml module can sometimes be broken by installing the PyXML package (because of old bugs or old code in PyXML that hasn't been ported to newer python versions).

I've taken a look at spacewalk-backend-tools which has a Requires: PyXML and found two places that PyXML/the stdlib xml module is used, both in unittests:

./satellite_tools/test/testxmlparser.py:from xml.sax import make_parser, saxutils
./satellite_tools/test/testxmlparser.py:from xml.sax.handler import feature_namespaces
./satellite_tools/test/testxmlparser.py:from xml.unicode.utf8_iso import utf8_to_code

./satellite_tools/test/testxmlwriter.py:from xml.sax.saxutils import escape
./satellite_tools/test/testxmlwriter.py:from xml.unicode.utf8_iso import code_to_utf8
./satellite_tools/test/testxmlwriter.py:import xml.sax.writer

Of these, most of the API being used is present in stdlib xml module (but I don't know if the behaviour matches).  Only unicode.utf8_iso.* and xml.sax.writer are not present.

Looking at ./satellite_tools/test/testxmlwriter.py, I'm not sure that this file is even testing any code in satellite/spacewalk.  It doesn't import any spacewalk code.  It does write an xml file that may be used by some other tests.  However, I can't find any file that invokes it and in addition, it doesn't appear to be runnable:

python testxmlwriter.py
  File "testxmlwriter.py", line 65
SyntaxError: Non-ASCII character '\xa9' in file testxmlwriter.py on line 65, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

./satellite_tools/test/testxmlparser.py also doesn't look like it is testing any sattellite/spacewalk code.  If necessary, it's use of utf8_to_code looks like it may be possible to port to something from http://packages.python.org/kitchen/api-text-converters.html#transformation-to-xml

So.  Are these unittest files being used or can they simply be discarded?  If they are used, can we port them away from PyXML so that we can get rid of that dependency?

.. [1]: https://fedoraproject.org/wiki/User:Toshio/Remove_PyXML

Comment 1 Michael Mráka 2012-07-31 14:45:54 UTC
Removed in spacewalk master by
commit c184f39a3b35a7cb9048be5b68f00de6a3013aad
    844603 - removed PyXML dependency
commit 49a45aa24bd44fbe6f304642f8cfe69e5d3d9ae2
    844603 - removed PyXML from comment
commit 7071fefc1fa4b9bf7b0dcfc891c952fab5d74b43
    844603 - removed PyXML dependency
commit 3e695ebe108b372b3c89ab1db5a6cb224622a84b
    844603 - removed broken unused unittests
    these look to be the only files which require obsoleted PyXML

Comment 2 Jan Pazdziora 2012-10-30 19:27:09 UTC
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/

Comment 3 Jan Pazdziora 2012-11-01 16:22:04 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18