
Xavier Morel schrieb am 09.06.20 um 08:24:
Specifically, that lxml currently treats a text of `None` and a text of an empty string differently, and only creates a self-closing element in the former case:
e = etree.Element('foo') etree.tostring(e, encoding='unicode') '<foo/>' e.text = '' etree.tostring(e, encoding='unicode') '<foo></foo>' e.text = None etree.tostring(e, encoding='unicode') '<foo/>'
this property seems to hold from 3.3.6 to 4.5.1 (though I have not tested every intermediate version), but a cursory search didn't yield hard evidence that it's part of lxml's "contract" that would hold in the future.
Yes, that's a feature. Probably also documented … somewhere. :)
Incidentally, since gmane is apparently dead the archive link on the info page[0]. Various links to the mailing list in the documentation also link to gmane archives[1] and are thus dead, it's unclear that all of them are recoverable (some show up in the wayback machine, others don't), although most of them seem somewhat outdated e.g. a solution for building debian packages from "SVN sources" or old (10+ years) testimonials, so maybe removing them entirely would be just as well?
[0] https://mailman-mail5.webfaction.com/listinfo/lxml
[1] https://github.com/lxml/lxml/search?q=gmane&unscoped_q=gmane
The pipermail list archives are still available. We copied them over when moving the mailing list to a new place, so they should be complete. http://mailman-mail5.webfaction.com/pipermail/lxml/ Turns out, they are not currently getting indexed in search engines. Let me see if I can change that somehow. I'll also see if I can get other archive(s) to pick up the mails. Stefan