Gentoo Archives: gentoo-dev

From: Arfrever Frehtes Taifersar Arahesis <Arfrever@g.o>
To: Gentoo Development <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] PyXML
Date: Tue, 17 May 2011 18:20:50
Message-Id: 201105172019.54440.Arfrever@gentoo.org
In Reply to: Re: [gentoo-dev] PyXML by Markos Chandras
1 2011-05-17 19:32:23 Markos Chandras napisaƂ(a):
2 > On Tue, May 17, 2011 at 01:11:57PM -0400, Mark Loeser wrote:
3 > > Arfrever Frehtes Taifersar Arahesis <Arfrever@g.o> said:
4 > > > PyXML is dead:
5 > > > http://mail.python.org/pipermail/xml-sig/2004-November/010735.html
6 > > > http://mail.python.org/pipermail/xml-sig/2006-June/011545.html
7 > > >
8 > > > PyXML provides _xmlplus module, which replaces xml module (from standard library) at run time,
9 > > > which might result in various problems.
10 > > >
11 > > > I'm planning to implement the following solution:
12 > > > - Python >=2.7.1-r2:2.7 will provide xml.use_pyxml() function. Calling of this function will be
13 > > > necessary to use replace xml module with _xmlplus module. Python >=2.7.1-r2:2.7 will be added
14 > > > to the tree in next week and will be temporarily package.masked. Later this change will be
15 > > > backported to new versions in older slots.
16 > > > - All packages, which use PyXML, will have to be patched to call xml.use_pyxml(). The following
17 > > > code should be added before first import of anything from xml module:
18 > > >
19 > > > import xml
20 > > > if hasattr(xml, "use_pyxml"):
21 > > > xml.use_pyxml()
22 > >
23 > > Is this "use_pyxml" upstream? From what you are saying, it is not. In
24 > > that case, we have just made patches for every package that will never
25 > > be allowed upstream. Why not do something more worthwhile than waste the
26 > > time of having to support something that might just become a problem to
27 > > maintain in the future?
28 > >
29 >
30 > I second that. Why do we need to make all the work fixing packages
31 > instead of letting upstream do their job? I am not so excited to
32 > fix every package I maintain as it is quite possible to introduce
33 > regressions in the process. Furthermore, I don't understand your first
34 > message. You say that you will provide xml.use_pyxml() function on
35 > python-2.7. Is this code official or you are just patching the official
36 > python releases?
37 > Anyway, as I said, I'd rather wait for upstream to fix their packages
38 > instead of me.
39
40 Some upstreams are dead and some packages using PyXML will never be ported by upstreams to use
41 something else than PyXML (e.g. lxml).
42
43 $ python2.7
44 Python 2.7.1+ (2.7:572fbd9ca28f+, May 16 2011, 21:40:05)
45 [GCC 4.5.2] on linux2
46 Type "help", "copyright", "credits" or "license" for more information.
47 >>> import xml, _xmlplus
48 >>> xml_modules = set(xml.__all__)
49 >>> _xmlplus_modules = set(_xmlplus.__all__)
50 >>> xml_modules - _xmlplus_modules
51 set(['etree'])
52 >>> _xmlplus_modules - xml_modules
53 set(['xpath', 'utils', 'schema', 'marshal', 'xslt'])
54 >>>
55
56 --
57 Arfrever Frehtes Taifersar Arahesis

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] PyXML Mark Loeser <halcy0n@g.o>