CHANGES.txt 91 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329
  1. ==============
  2. lxml changelog
  3. ==============
  4. 3.3.6 (2014-08-28)
  5. ==================
  6. Bugs fixed
  7. ----------
  8. * Prevent tree cycle creation when adding Elements as siblings.
  9. * LP#1361948: crash when deallocating Element siblings without parent.
  10. * LP#1354652: crash when traversing internally loaded documents in XSLT
  11. extension functions.
  12. 3.3.5 (2014-04-18)
  13. ==================
  14. Bugs fixed
  15. ----------
  16. * HTML cleaning could fail to strip javascript links that mix control
  17. characters into the link scheme.
  18. 3.3.4 (2014-04-03)
  19. ==================
  20. Features added
  21. --------------
  22. * Source line numbers above 65535 are available on Elements when
  23. using libxml2 2.9 or later.
  24. Bugs fixed
  25. ----------
  26. * ``lxml.html.fragment_fromstring()`` failed for bytes input in Py3.
  27. Other changes
  28. -------------
  29. 3.3.3 (2014-03-04)
  30. ==================
  31. Bugs fixed
  32. ----------
  33. * LP#1287118: Crash when using Element subtypes with ``__slots__``.
  34. Other changes
  35. -------------
  36. * The internal classes ``_LogEntry`` and ``_Attrib`` can no longer be
  37. subclassed from Python code.
  38. 3.3.2 (2014-02-26)
  39. ==================
  40. Bugs fixed
  41. ----------
  42. * The properties ``resolvers`` and ``version``, as well as the methods
  43. ``set_element_class_lookup()`` and ``makeelement()``, were lost from
  44. ``iterparse`` objects in 3.3.0.
  45. * LP#1222132: instances of ``XMLSchema``, ``Schematron`` and ``RelaxNG``
  46. did not clear their local ``error_log`` before running a validation.
  47. * LP#1238500: lxml.doctestcompare mixed up "expected" and "actual" in
  48. attribute values.
  49. * Some file I/O tests were failing in MS-Windows due to non-portable temp
  50. file usage. Initial patch by Gabi Davar.
  51. * LP#910014: duplicate IDs in a document were not reported by DTD validation.
  52. * LP#1185332: ``tostring(method="html")`` did not use HTML serialisation
  53. semantics for trailing tail text. Initial patch by Sylvain Viollon.
  54. * LP#1281139: ``.attrib`` value of Comments lost its mutation methods
  55. in 3.3.0. Even though it is empty and immutable, it should still
  56. provide the same interface as that returned for Elements.
  57. 3.3.1 (2014-02-12)
  58. ==================
  59. Features added
  60. --------------
  61. Bugs fixed
  62. ----------
  63. * LP#1014290: HTML documents parsed with ``parser.feed()`` failed to find
  64. elements during tag iteration.
  65. * LP#1273709: Building in PyPy failed due to missing support for
  66. ``PyUnicode_Compare()`` and ``PyByteArray_*()`` in PyPy's C-API.
  67. * LP#1274413: Compilation in MSVC failed due to missing "stdint.h" standard
  68. header file.
  69. * LP#1274118: iterparse() failed to parse BOM prefixed files.
  70. Other changes
  71. -------------
  72. 3.3.0 (2014-01-26)
  73. ==================
  74. Features added
  75. --------------
  76. Bugs fixed
  77. ----------
  78. * The heuristic that distinguishes file paths from URLs was tightened
  79. to produce less false negatives.
  80. Other changes
  81. -------------
  82. 3.3.0beta5 (2014-01-18)
  83. =======================
  84. Features added
  85. --------------
  86. * The PEP 393 unicode parsing support gained a fallback for wchar strings
  87. which might still be somewhat common on Windows systems.
  88. Bugs fixed
  89. ----------
  90. * Several error handling problems were fixed throughout the code base that
  91. could previously lead to exceptions being silently swallowed or not
  92. properly reported.
  93. * The C-API function ``appendChild()`` is now deprecated as it does not
  94. propagate exceptions (its return type is ``void``). The new function
  95. ``appendChildToElement()`` was added as a safe replacement.
  96. * Passing a string into ``fromstringlist()`` raises an exception instead of
  97. parsing the string character by character.
  98. Other changes
  99. -------------
  100. * Document cleanup code was simplified using the new GC features in
  101. Cython 0.20.
  102. 3.3.0beta4 (2014-01-12)
  103. =======================
  104. Features added
  105. --------------
  106. Bugs fixed
  107. ----------
  108. * The (empty) value returned by the ``attrib`` property of Entity and Comment
  109. objects was mutable.
  110. * Element class lookup wasn't available for the new pull parsers or when using
  111. a custom parser target.
  112. * Setting Element attributes on instantiation with both the ``attrib`` argument
  113. and keyword arguments could modify the mapping passed as ``attrib``.
  114. * LP#1266171: DTDs instantiated from internal/external subsets (i.e. through
  115. the docinfo property) lost their attribute declarations.
  116. Other changes
  117. -------------
  118. * Built with Cython 0.20pre (gitrev 012ae82eb) to prepare support for
  119. Python 3.4.
  120. 3.3.0beta3 (2014-01-02)
  121. =======================
  122. Features added
  123. --------------
  124. * Unicode string parsing was optimised for Python 3.3 (PEP 393).
  125. Bugs fixed
  126. ----------
  127. * HTML parsing of Unicode strings could misdecode the input on some platforms.
  128. * Crash in xmlfile() when closing open elements out of order in an error case.
  129. Other changes
  130. -------------
  131. 3.3.0beta2 (2013-12-20)
  132. =======================
  133. Features added
  134. --------------
  135. * ``iterparse()`` supports the ``recover`` option.
  136. Bugs fixed
  137. ----------
  138. * Crash in ``iterparse()`` for HTML parsing.
  139. * Crash in target parsing with attributes.
  140. Other changes
  141. -------------
  142. * The safety check in the read-only tree implementation (e.g. used by
  143. ``PythonElementClassLookup``) raises a more appropriate ``ReferenceError``
  144. for illegal access after tree disposal instead of an ``AssertionError``.
  145. This should only impact test code that specifically checks the original
  146. behaviour.
  147. 3.3.0beta1 (2013-12-12)
  148. =======================
  149. Features added
  150. --------------
  151. * New option ``handle_failures`` in ``make_links_absolute()`` and
  152. ``resolve_base_href()`` (lxml.html) that enables ignoring or
  153. discarding links that fail to parse as URLs.
  154. * New parser classes ``XMLPullParser`` and ``HTMLPullParser`` for
  155. incremental parsing, as implemented for ElementTree in Python 3.4.
  156. * ``iterparse()`` enables recovery mode by default for HTML parsing
  157. (``html=True``).
  158. Bugs fixed
  159. ----------
  160. * LP#1255132: crash when trying to run validation over non-Element (e.g.
  161. comment or PI).
  162. * Error messages in the log and in exception messages that originated
  163. from libxml2 could accidentally be picked up from preceding warnings
  164. instead of the actual error.
  165. * The ``ElementMaker`` in lxml.objectify did not accept a dict as
  166. argument for adding attributes to the element it's building. This
  167. works as in lxml.builder now.
  168. * LP#1228881: ``repr(XSLTAccessControl)`` failed in Python 3.
  169. * Raise ``ValueError`` when trying to append an Element to itself or
  170. to one of its own descendants, instead of running into an infinite
  171. loop.
  172. * LP#1206077: htmldiff discarded whitespace from the output.
  173. * Compressed plain-text serialisation to file-like objects was broken.
  174. * lxml.html.formfill: Fix textarea form filling.
  175. The textarea used to be cleared before the new content was set,
  176. which removed the name attribute.
  177. Other changes
  178. -------------
  179. * Some basic API classes use freelists internally for faster
  180. instantiation. This can speed up some ``iterparse()`` scenarios,
  181. for example.
  182. * ``iterparse()`` was rewritten to use the new ``*PullParser``
  183. classes internally instead of being a parser itself.
  184. 3.2.5 (2014-01-02)
  185. ==================
  186. Features added
  187. --------------
  188. Bugs fixed
  189. ----------
  190. * Crash in xmlfile() when closing open elements out of order in an error case.
  191. * Crash in target parsing with attributes.
  192. * LP#1255132: crash when trying to run validation over non-Element (e.g.
  193. comment or PI).
  194. Other changes
  195. -------------
  196. 3.2.4 (2013-11-07)
  197. ==================
  198. Features added
  199. --------------
  200. Bugs fixed
  201. ----------
  202. * Memory leak when creating an XPath evaluator in a thread.
  203. * LP#1228881: ``repr(XSLTAccessControl)`` failed in Python 3.
  204. * Raise ``ValueError`` when trying to append an Element to itself or
  205. to one of its own descendants.
  206. * LP#1206077: htmldiff discarded whitespace from the output.
  207. * Compressed plain-text serialisation to file-like objects was broken.
  208. Other changes
  209. -------------
  210. 3.2.3 (2013-07-28)
  211. ==================
  212. Bugs fixed
  213. ----------
  214. * Fix support for Python 2.4 which was lost in 3.2.2.
  215. 3.2.2 (2013-07-28)
  216. ==================
  217. Features added
  218. --------------
  219. Bugs fixed
  220. ----------
  221. * LP#1185701: spurious XMLSyntaxError after finishing iterparse().
  222. * Crash in lxml.objectify during xsi annotation.
  223. Other changes
  224. -------------
  225. * Return values of user provided element class lookup methods are now
  226. validated against the type of the XML node they represent to prevent
  227. API class mismatches.
  228. 3.2.1 (2013-05-11)
  229. ==================
  230. Features added
  231. --------------
  232. * The methods ``apply_templates()`` and ``process_children()`` of XSLT
  233. extension elements have gained two new boolean options ``elements_only``
  234. and ``remove_blank_text`` that discard either all strings or whitespace-only
  235. strings from the result list.
  236. Bugs fixed
  237. ----------
  238. * When moving Elements to another tree, the namespace cleanup mechanism
  239. no longer drops namespace prefixes from attributes for which it finds
  240. a default namespace declaration, to prevent them from appearing as
  241. unnamespaced attributes after serialisation.
  242. * Returning non-type objects from a custom class lookup method could lead
  243. to a crash.
  244. * Instantiating and using subtypes of Comments and ProcessingInstructions
  245. crashed.
  246. Other changes
  247. -------------
  248. 3.2.0 (2013-04-28)
  249. ==================
  250. Features added
  251. --------------
  252. Bugs fixed
  253. ----------
  254. * LP#690319: Leading whitespace could change the behaviour of the string
  255. parsing functions in ``lxml.html``.
  256. * LP#599318: The string parsing functions in ``lxml.html`` are more robust
  257. in the face of uncommon HTML content like framesets or missing body tags.
  258. Patch by Stefan Seelmann.
  259. * LP#712941: I/O errors while trying to access files with paths that contain
  260. non-ASCII characters could raise ``UnicodeDecodeError`` instead of properly
  261. reporting the ``IOError``.
  262. * LP#673205: Parsing from in-memory strings disabled network access in the
  263. default parser and made subsequent attempts to parse from a URL fail.
  264. * LP#971754: lxml.html.clean appends 'nofollow' to 'rel' attributes instead
  265. of overwriting the current value.
  266. * LP#715687: lxml.html.clean no longer discards scripts that are explicitly
  267. allowed by the user provided whitelist. Patch by Christine Koppelt.
  268. Other changes
  269. -------------
  270. 3.1.2 (2013-04-12)
  271. ==================
  272. Features added
  273. --------------
  274. Bugs fixed
  275. ----------
  276. * LP#1136509: Passing attributes through the namespace-unaware API of
  277. the sax bridge (i.e. the ``handler.startElement()`` method) failed
  278. with a ``TypeError``. Patch by Mike Bayer.
  279. * LP#1123074: Fix serialisation error in XSLT output when converting
  280. the result tree to a Unicode string.
  281. * GH#105: Replace illegal usage of ``xmlBufLength()`` in libxml2 2.9.0
  282. by properly exported API function ``xmlBufUse()``.
  283. Other changes
  284. -------------
  285. 3.1.1 (2013-03-29)
  286. ==================
  287. Features added
  288. --------------
  289. Bugs fixed
  290. ----------
  291. * LP#1160386: Write access to ``lxml.html.FormElement.fields`` raised
  292. an AttributeError in Py3.
  293. * Illegal memory access during cleanup in incremental xmlfile writer.
  294. Other changes
  295. -------------
  296. * The externally useless class ``lxml.etree._BaseParser`` was removed
  297. from the module dict.
  298. 3.1.0 (2013-02-10)
  299. ==================
  300. Features added
  301. --------------
  302. * GH#89: lxml.html.clean allows overriding the set of attributes that it
  303. considers 'safe'. Patch by Francis Devereux.
  304. Bugs fixed
  305. ----------
  306. * LP#1104370: ``copy.copy(el.attrib)`` raised an exception. It now returns
  307. a copy of the attributes as a plain Python dict.
  308. * GH#95: When used with namespace prefixes, the ``el.find*()`` methods
  309. always used the first namespace mapping that was provided for each
  310. path expression instead of using the one that was actually passed
  311. in for the current run.
  312. * LP#1092521, GH#91: Fix undefined C symbol in Python runtimes compiled
  313. without threading support. Patch by Ulrich Seidl.
  314. Other changes
  315. -------------
  316. 3.1beta1 (2012-12-21)
  317. =====================
  318. Features added
  319. --------------
  320. * New build-time option ``--with-unicode-strings`` for Python 2 that
  321. makes the API always return Unicode strings for names and text
  322. instead of byte strings for plain ASCII content.
  323. * New incremental XML file writing API ``etree.xmlfile()``.
  324. * E factory in lxml.objectify is callable to simplify the creation of
  325. tags with non-identifier names without having to resort to getattr().
  326. Bugs fixed
  327. ----------
  328. * When starting from a non-namespaced element in lxml.objectify, searching
  329. for a child without explicitly specifying a namespace incorrectly found
  330. namespaced elements with the requested local name, instead of restricting
  331. the search to non-namespaced children.
  332. * GH#85: Deprecation warnings were fixed for Python 3.x.
  333. * GH#33: lxml.html.fromstring() failed to accept bytes input in Py3.
  334. * LP#1080792: Static build of libxml2 2.9.0 failed due to missing file.
  335. Other changes
  336. -------------
  337. * The externally useless class ``_ObjectifyElementMakerCaller`` was
  338. removed from the module API of lxml.objectify.
  339. * LP#1075622: lxml.builder is faster for adding text to elements with
  340. many children. Patch by Anders Hammarquist.
  341. 3.0.2 (2012-12-14)
  342. ==================
  343. Features added
  344. --------------
  345. Bugs fixed
  346. ----------
  347. * Fix crash during interpreter shutdown by switching to Cython 0.17.3 for building.
  348. Other changes
  349. -------------
  350. 3.0.1 (2012-10-14)
  351. ==================
  352. Features added
  353. --------------
  354. Bugs fixed
  355. ----------
  356. * LP#1065924: Element proxies could disappear during garbage collection
  357. in PyPy without proper cleanup.
  358. * GH#71: Failure to work with libxml2 2.6.x.
  359. * LP#1065139: static MacOS-X build failed in Py3.
  360. Other changes
  361. -------------
  362. 3.0 (2012-10-08)
  363. ================
  364. Features added
  365. --------------
  366. Bugs fixed
  367. ----------
  368. * End-of-file handling was incorrect in iterparse() when reading from
  369. a low-level C file stream and failed in libxml2 2.9.0 due to its
  370. improved consistency checks.
  371. Other changes
  372. -------------
  373. * The build no longer uses Cython by default unless the generated C files
  374. are missing. To use Cython, pass the option "--with-cython". To ignore
  375. the fatal build error when Cython is required but not available (e.g. to
  376. run special setup.py commands that do not actually run a build), pass
  377. "--without-cython".
  378. 3.0beta1 (2012-09-26)
  379. =====================
  380. Features added
  381. --------------
  382. * Python level access to (optional) libxml2 memory debugging features
  383. to simplify debugging of memory leaks etc.
  384. Bugs fixed
  385. ----------
  386. * Fix a memory leak in XPath by switching to Cython 0.17.1.
  387. * Some tests were adapted to work with PyPy.
  388. Other changes
  389. -------------
  390. * The code was adapted to work with the upcoming libxml2 2.9.0 release.
  391. 3.0alpha2 (2012-08-23)
  392. ======================
  393. Features added
  394. --------------
  395. * The ``.iter()`` method of elements now accepts ``tag`` arguments like
  396. ``"{*}name"`` to search for elements with a given local name in any
  397. namespace. With this addition, all combinations of wildcards now work
  398. as expected:
  399. ``"{ns}name"``, ``"{}name"``, ``"{*}name"``, ``"{ns}*"``, ``"{}*"``
  400. and ``"{*}*"``. Note that ``"name"`` is equivalent to ``"{}name"``,
  401. but ``"*"`` is ``"{*}*"``.
  402. The same change applies to the ``.getiterator()``, ``.itersiblings()``,
  403. ``.iterancestors()``, ``.iterdescendants()``, ``.iterchildren()``
  404. and ``.itertext()`` methods;the ``strip_attributes()``,
  405. ``strip_elements()`` and ``strip_tags()`` functions as well as the
  406. ``iterparse()`` class. Patch by Simon Sapin.
  407. * C14N allows specifying the inclusive prefixes to be promoted
  408. to top-level during exclusive serialisation.
  409. Bugs fixed
  410. ----------
  411. * Passing long Unicode strings into the ``feed()`` parser interface
  412. failed to read the entire string.
  413. Other changes
  414. -------------
  415. 3.0alpha1 (2012-07-31)
  416. ======================
  417. Features added
  418. --------------
  419. * Initial support for building in PyPy (through cpyext).
  420. * DTD objects gained an API that allows read access to their
  421. declarations.
  422. * ``xpathgrep.py`` gained support for parsing line-by-line (e.g.
  423. from grep output) and for surrounding the output with a new root
  424. tag.
  425. * ``E-factory`` in ``lxml.builder`` accepts subtypes of known data
  426. types (such as string subtypes) when building elements around them.
  427. * Tree iteration and ``iterparse()`` with a selective ``tag``
  428. argument supports passing a set of tags. Tree nodes will be
  429. returned by the iterators if they match any of the tags.
  430. Bugs fixed
  431. ----------
  432. * The ``.find*()`` methods in ``lxml.objectify`` no longer use XPath
  433. internally, which makes them faster in many cases (especially when
  434. short circuiting after a single or couple of elements) and fixes
  435. some behavioural differences compared to ``lxml.etree``. Note that
  436. this means that they no longer support arbitrary XPath expressions
  437. but only the subset that the ``ElementPath`` language supports.
  438. The previous implementation was also redundant with the normal
  439. XPath support, which can be used as a replacement.
  440. * ``el.find('*')`` could accidentally return a comment or processing
  441. instruction that happened to be in the wrong spot. (Same for the
  442. other ``.find*()`` methods.)
  443. * The error logging is less intrusive and avoids a global setup where
  444. possible.
  445. * Fixed undefined names in html5lib parser.
  446. * ``xpathgrep.py`` did not work in Python 3.
  447. * ``Element.attrib.update()`` did not accept an ``attrib`` of
  448. another Element as parameter.
  449. * For subtypes of ``ElementBase`` that make the ``.text`` or ``.tail``
  450. properties immutable (as in objectify, for example), inserting text
  451. when creating Elements through the E-Factory feature of the class
  452. constructor would fail with an exception, stating that the text
  453. cannot be modified.
  454. Other changes
  455. --------------
  456. * The code base was overhauled to properly use 'const' where the API
  457. of libxml2 and libxslt requests it. This also has an impact on the
  458. public C-API of lxml itself, as defined in ``etreepublic.pxd``, as
  459. well as the provided declarations in the ``lxml/includes/`` directory.
  460. Code that uses these declarations may have to be adapted. On the
  461. plus side, this fixes several C compiler warnings, also for user
  462. code, thus making it easier to spot real problems again.
  463. * The functionality of "lxml.cssselect" was moved into a separate PyPI
  464. package called "cssselect". To continue using it, you must install
  465. that package separately. The "lxml.cssselect" module is still
  466. available and provides the same interface, provided the "cssselect"
  467. package can be imported at runtime.
  468. * Element attributes passed in as an ``attrib`` dict or as keyword
  469. arguments are now sorted by (namespaced) name before being created
  470. to make their order predictable for serialisation and iteration.
  471. Note that adding or deleting attributes afterwards does not take
  472. that order into account, i.e. setting a new attribute appends it
  473. after the existing ones.
  474. * Several classes that are for internal use only were removed
  475. from the ``lxml.etree`` module dict:
  476. ``_InputDocument, _ResolverRegistry, _ResolverContext, _BaseContext,
  477. _ExsltRegExp, _IterparseContext, _TempStore, _ExceptionContext,
  478. __ContentOnlyElement, _AttribIterator, _NamespaceRegistry,
  479. _ClassNamespaceRegistry, _FunctionNamespaceRegistry,
  480. _XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
  481. _FileReaderContext, _ParserContext, _PythonSaxParserTarget,
  482. _TargetParserContext, _ReadOnlyProxy, _ReadOnlyPIProxy,
  483. _ReadOnlyEntityProxy, _ReadOnlyElementProxy, _OpaqueNodeWrapper,
  484. _OpaqueDocumentWrapper, _ModifyContentOnlyProxy,
  485. _ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
  486. _AppendOnlyElementProxy, _SaxParserContext, _FilelikeWriter,
  487. _ParserSchemaValidationContext, _XPathContext,
  488. _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam``
  489. * Several internal classes can no longer be inherited from:
  490. ``_InputDocument, _ResolverRegistry, _ExsltRegExp, _ElementUnicodeResult,
  491. _IterparseContext, _TempStore, _AttribIterator, _ClassNamespaceRegistry,
  492. _XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
  493. _FileReaderContext, _PythonSaxParserTarget, _TargetParserContext,
  494. _ReadOnlyPIProxy, _ReadOnlyEntityProxy, _OpaqueDocumentWrapper,
  495. _ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
  496. _AppendOnlyElementProxy, _FilelikeWriter, _ParserSchemaValidationContext,
  497. _XPathContext, _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam,
  498. _XSLTResultTree, _XSLTProcessingInstruction``
  499. 2.3.6 (2012-09-28)
  500. ==================
  501. Features added
  502. --------------
  503. Bugs fixed
  504. ----------
  505. * Passing long Unicode strings into the ``feed()`` parser interface
  506. failed to read the entire string.
  507. Other changes
  508. --------------
  509. 2.3.5 (2012-07-31)
  510. ==================
  511. Features added
  512. --------------
  513. Bugs fixed
  514. ----------
  515. * Crash when merging text nodes in ``element.remove()``.
  516. * Crash in sax/target parser when reporting empty doctype.
  517. Other changes
  518. --------------
  519. 2.3.4 (2012-03-26)
  520. ==================
  521. Features added
  522. --------------
  523. Bugs fixed
  524. ----------
  525. * Crash when building an nsmap (Element property) with empty
  526. namespace URIs.
  527. * Crash due to race condition when errors (or user messages) occur
  528. during threaded XSLT processing.
  529. * XSLT stylesheet compilation could ignore compilation errors.
  530. Other changes
  531. --------------
  532. 2.3.3 (2012-01-04)
  533. ==================
  534. Features added
  535. --------------
  536. * ``lxml.html.tostring()`` gained new serialisation options
  537. ``with_tail`` and ``doctype``.
  538. Bugs fixed
  539. ----------
  540. * Fixed a crash when using ``iterparse()`` for HTML parsing and
  541. requesting start events.
  542. * Fixed parsing of more selectors in cssselect. Whitespace before
  543. pseudo-elements and pseudo-classes is significant as it is a
  544. descendant combinator.
  545. "E :pseudo" should parse the same as "E \*:pseudo", not "E:pseudo".
  546. Patch by Simon Sapin.
  547. * lxml.html.diff no longer raises an exception when hitting
  548. 'img' tags without 'src' attribute.
  549. Other changes
  550. --------------
  551. 2.3.2 (2011-11-11)
  552. ==================
  553. Features added
  554. --------------
  555. * ``lxml.objectify.deannotate()`` has a new boolean option
  556. ``cleanup_namespaces`` to remove the objectify namespace
  557. declarations (and generally clean up the namespace declarations)
  558. after removing the type annotations.
  559. * ``lxml.objectify`` gained its own ``SubElement()`` function as a
  560. copy of ``etree.SubElement`` to avoid an otherwise redundant import
  561. of ``lxml.etree`` on the user side.
  562. Bugs fixed
  563. ----------
  564. * Fixed the "descendant" bug in cssselect a second time (after a first
  565. fix in lxml 2.3.1). The previous change resulted in a serious
  566. performance regression for the XPath based evaluation of the
  567. translated expression. Note that this breaks the usage of some of
  568. the generated XPath expressions as XSLT location paths that
  569. previously worked in 2.3.1.
  570. * Fixed parsing of some selectors in cssselect. Whitespace after combinators
  571. ">", "+" and "~" is now correctly ignored. Previously is was parsed as
  572. a descendant combinator. For example, "div> .foo" was parsed the same as
  573. "div>* .foo" instead of "div>.foo". Patch by Simon Sapin.
  574. Other changes
  575. --------------
  576. 2.3.1 (2011-09-25)
  577. ==================
  578. Features added
  579. --------------
  580. * New option ``kill_tags`` in ``lxml.html.clean`` to remove specific
  581. tags and their content (i.e. their whole subtree).
  582. * ``pi.get()`` and ``pi.attrib`` on processing instructions to parse
  583. pseudo-attributes from the text content of processing instructions.
  584. * ``lxml.get_include()`` returns a list of include paths that can be
  585. used to compile external C code against lxml.etree. This is
  586. specifically required for statically linked lxml builds when code
  587. needs to compile against the exact same header file versions as lxml
  588. itself.
  589. * ``Resolver.resolve_file()`` takes an additional option
  590. ``close_file`` that configures if the file(-like) object will be
  591. closed after reading or not. By default, the file will be closed,
  592. as the user is not expected to keep a reference to it.
  593. Bugs fixed
  594. ----------
  595. * HTML cleaning didn't remove 'data:' links.
  596. * The html5lib parser integration now uses the 'official'
  597. implementation in html5lib itself, which makes it work with newer
  598. releases of the library.
  599. * In ``lxml.sax``, ``endElementNS()`` could incorrectly reject a plain
  600. tag name when the corresponding start event inferred the same plain
  601. tag name to be in the default namespace.
  602. * When an open file-like object is passed into ``parse()`` or
  603. ``iterparse()``, the parser will no longer close it after use. This
  604. reverts a change in lxml 2.3 where all files would be closed. It is
  605. the users responsibility to properly close the file(-like) object,
  606. also in error cases.
  607. * Assertion error in lxml.html.cleaner when discarding top-level elements.
  608. * In lxml.cssselect, use the xpath 'A//B' (short for
  609. 'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for
  610. the css descendant selector ('A B'). This makes a few edge cases
  611. like ``"div *:last-child"`` consistent with the selector behavior in
  612. WebKit and Firefox, and makes more css expressions valid location
  613. paths (for use in xsl:template match).
  614. * In lxml.html, non-selected ``<option>`` tags no longer show up in the
  615. collected form values.
  616. * Adding/removing ``<option>`` values to/from a multiple select form
  617. field properly selects them and unselects them.
  618. Other changes
  619. --------------
  620. * Static builds can specify the download directory with the
  621. ``--download-dir`` option.
  622. 2.3 (2011-02-06)
  623. ================
  624. Features added
  625. --------------
  626. * When looking for children, ``lxml.objectify`` takes '{}tag' as
  627. meaning an empty namespace, as opposed to the parent namespace.
  628. Bugs fixed
  629. ----------
  630. * When finished reading from a file-like object, the parser
  631. immediately calls its ``.close()`` method.
  632. * When finished parsing, ``iterparse()`` immediately closes the input
  633. file.
  634. * Work-around for libxml2 bug that can leave the HTML parser in a
  635. non-functional state after parsing a severly broken document (fixed
  636. in libxml2 2.7.8).
  637. * ``marque`` tag in HTML cleanup code is correctly named ``marquee``.
  638. Other changes
  639. --------------
  640. * Some public functions in the Cython-level C-API have more explicit
  641. return types.
  642. 2.3beta1 (2010-09-06)
  643. =====================
  644. Features added
  645. --------------
  646. Bugs fixed
  647. ----------
  648. * Crash in newer libxml2 versions when moving elements between
  649. documents that had attributes on replaced XInclude nodes.
  650. * ``XMLID()`` function was missing the optional ``parser`` and
  651. ``base_url`` parameters.
  652. * Searching for wildcard tags in ``iterparse()`` was broken in Py3.
  653. * ``lxml.html.open_in_browser()`` didn't work in Python 3 due to the
  654. use of os.tempnam. It now takes an optional 'encoding' parameter.
  655. Other changes
  656. --------------
  657. 2.3alpha2 (2010-07-24)
  658. ======================
  659. Features added
  660. --------------
  661. Bugs fixed
  662. ----------
  663. * Crash in XSLT when generating text-only result documents with a
  664. stylesheet created in a different thread.
  665. Other changes
  666. --------------
  667. * ``repr()`` of Element objects shows the hex ID with leading 0x
  668. (following ElementTree 1.3).
  669. 2.3alpha1 (2010-06-19)
  670. ======================
  671. Features added
  672. --------------
  673. * Keyword argument ``namespaces`` in ``lxml.cssselect.CSSSelector()``
  674. to pass a prefix-to-namespace mapping for the selector.
  675. * New function ``lxml.etree.register_namespace(prefix, uri)`` that
  676. globally registers a namespace prefix for a namespace that newly
  677. created Elements in that namespace will use automatically. Follows
  678. ElementTree 1.3.
  679. * Support 'unicode' string name as encoding parameter in
  680. ``tostring()``, following ElementTree 1.3.
  681. * Support 'c14n' serialisation method in ``ElementTree.write()`` and
  682. ``tostring()``, following ElementTree 1.3.
  683. * The ElementPath expression syntax (``el.find*()``) was extended to
  684. match the upcoming ElementTree 1.3 that will ship in the standard
  685. library of Python 3.2/2.7. This includes extended support for
  686. predicates as well as namespace prefixes (as known from XPath).
  687. * During regular XPath evaluation, various ESXLT functions are
  688. available within their namespace when using libxslt 1.1.26 or later.
  689. * Support passing a readily configured logger instance into
  690. ``PyErrorLog``, instead of a logger name.
  691. * On serialisation, the new ``doctype`` parameter can be used to
  692. override the DOCTYPE (internal subset) of the document.
  693. * New parameter ``output_parent`` to ``XSLTExtension.apply_templates()``
  694. to append the resulting content directly to an output element.
  695. * ``XSLTExtension.process_children()`` to process the content of the
  696. XSLT extension element itself.
  697. * ISO-Schematron support based on the de-facto Schematron reference
  698. 'skeleton implementation'.
  699. * XSLT objects now take XPath object as ``__call__`` stylesheet
  700. parameters.
  701. * Enable path caching in ElementPath (``el.find*()``) to avoid parsing
  702. overhead.
  703. * Setting the value of a namespaced attribute always uses a prefixed
  704. namespace instead of the default namespace even if both declare the
  705. same namespace URI. This avoids serialisation problems when an
  706. attribute from a default namespace is set on an element from a
  707. different namespace.
  708. * XSLT extension elements: support for XSLT context nodes other than
  709. elements: document root, comments, processing instructions.
  710. * Support for strings (in addition to Elements) in node-sets returned
  711. by extension functions.
  712. * Forms that lack an ``action`` attribute default to the base URL of
  713. the document on submit.
  714. * XPath attribute result strings have an ``attrname`` property.
  715. * Namespace URIs get validated against RFC 3986 at the API level
  716. (required by the XML namespace specification).
  717. * Target parsers show their target object in the ``.target`` property
  718. (compatible with ElementTree).
  719. Bugs fixed
  720. ----------
  721. * API is hardened against invalid proxy instances to prevent crashes
  722. due to incorrectly instantiated Element instances.
  723. * Prevent crash when instantiating ``CommentBase`` and friends.
  724. * Export ElementTree compatible XML parser class as
  725. ``XMLTreeBuilder``, as it is called in ET 1.2.
  726. * ObjectifiedDataElements in lxml.objectify were not hashable. They
  727. now use the hash value of the underlying Python value (string,
  728. number, etc.) to which they compare equal.
  729. * Parsing broken fragments in lxml.html could fail if the fragment
  730. contained an orphaned closing '</div>' tag.
  731. * Using XSLT extension elements around the root of the output document
  732. crashed.
  733. * ``lxml.cssselect`` did not distinguish between ``x[attr="val"]`` and
  734. ``x [attr="val"]`` (with a space). The latter now matches the
  735. attribute independent of the element.
  736. * Rewriting multiple links inside of HTML text content could end up
  737. replacing unrelated content as replacements could impact the
  738. reported position of subsequent matches. Modifications are now
  739. simplified by letting the ``iterlinks()`` generator in ``lxml.html``
  740. return links in reversed order if they appear inside the same text
  741. node. Thus, replacements and link-internal modifications no longer
  742. change the position of links reported afterwards.
  743. * The ``.value`` attribute of ``textarea`` elements in lxml.html did
  744. not represent the complete raw value (including child tags etc.). It
  745. now serialises the complete content on read and replaces the
  746. complete content by a string on write.
  747. * Target parser didn't call ``.close()`` on the target object if
  748. parsing failed. Now it is guaranteed that ``.close()`` will be
  749. called after parsing, regardless of the outcome.
  750. Other changes
  751. -------------
  752. * Official support for Python 3.1.2 and later.
  753. * Static MS Windows builds can now download their dependencies
  754. themselves.
  755. * ``Element.attrib`` no longer uses a cyclic reference back to its
  756. Element object. It therefore no longer requires the garbage
  757. collector to clean up.
  758. * Static builds include libiconv, in addition to libxml2 and libxslt.
  759. 2.2.8 (2010-09-02)
  760. ==================
  761. Bugs fixed
  762. ----------
  763. * Crash in newer libxml2 versions when moving elements between
  764. documents that had attributes on replaced XInclude nodes.
  765. * Import fix for urljoin in Python 3.1+.
  766. 2.2.7 (2010-07-24)
  767. ==================
  768. Bugs fixed
  769. ----------
  770. * Crash in XSLT when generating text-only result documents with a
  771. stylesheet created in a different thread.
  772. 2.2.6 (2010-03-02)
  773. ==================
  774. Bugs fixed
  775. ----------
  776. * Fixed several Python 3 regressions by building with Cython 0.11.3.
  777. 2.2.5 (2010-02-28)
  778. ==================
  779. Features added
  780. --------------
  781. * Support for running XSLT extension elements on the input root node
  782. (e.g. in a template matching on "/").
  783. Bugs fixed
  784. ----------
  785. * Crash in XPath evaluation when reading smart strings from a document
  786. other than the original context document.
  787. * Support recent versions of html5lib by not requiring its
  788. ``XHTMLParser`` in ``htmlparser.py`` anymore.
  789. * Manually instantiating the custom element classes in
  790. ``lxml.objectify`` could crash.
  791. * Invalid XML text characters were not rejected by the API when they
  792. appeared in unicode strings directly after non-ASCII characters.
  793. * lxml.html.open_http_urllib() did not work in Python 3.
  794. * The functions ``strip_tags()`` and ``strip_elements()`` in
  795. ``lxml.etree`` did not remove all occurrences of a tag in all cases.
  796. * Crash in XSLT extension elements when the XSLT context node is not
  797. an element.
  798. 2.2.4 (2009-11-11)
  799. ==================
  800. Bugs fixed
  801. ----------
  802. * Static build of libxml2/libxslt was broken.
  803. 2.2.3 (2009-10-30)
  804. ==================
  805. Features added
  806. --------------
  807. Bugs fixed
  808. ----------
  809. * The ``resolve_entities`` option did not work in the incremental feed
  810. parser.
  811. * Looking up and deleting attributes without a namespace could hit a
  812. namespaced attribute of the same name instead.
  813. * Late errors during calls to ``SubElement()`` (e.g. attribute related
  814. ones) could leave a partially initialised element in the tree.
  815. * Modifying trees that contain parsed entity references could result
  816. in an infinite loop.
  817. * ObjectifiedElement.__setattr__ created an empty-string child element when the
  818. attribute value was rejected as a non-unicode/non-ascii string
  819. * Syntax errors in ``lxml.cssselect`` could result in misleading error
  820. messages.
  821. * Invalid syntax in CSS expressions could lead to an infinite loop in
  822. the parser of ``lxml.cssselect``.
  823. * CSS special character escapes were not properly handled in
  824. ``lxml.cssselect``.
  825. * CSS Unicode escapes were not properly decoded in ``lxml.cssselect``.
  826. * Select options in HTML forms that had no explicit ``value``
  827. attribute were not handled correctly. The HTML standard dictates
  828. that their value is defined by their text content. This is now
  829. supported by lxml.html.
  830. * XPath raised a TypeError when finding CDATA sections. This is now
  831. fully supported.
  832. * Calling ``help(lxml.objectify)`` didn't work at the prompt.
  833. * The ``ElementMaker`` in lxml.objectify no longer defines the default
  834. namespaces when annotation is disabled.
  835. * Feed parser failed to honout the 'recover' option on parse errors.
  836. * Diverting the error logging to Python's logging system was broken.
  837. Other changes
  838. -------------
  839. 2.2.2 (2009-06-21)
  840. ==================
  841. Features added
  842. --------------
  843. * New helper functions ``strip_attributes()``, ``strip_elements()``,
  844. ``strip_tags()`` in lxml.etree to remove attributes/subtrees/tags
  845. from a subtree.
  846. Bugs fixed
  847. ----------
  848. * Namespace cleanup on subtree insertions could result in missing
  849. namespace declarations (and potentially crashes) if the element
  850. defining a namespace was deleted and the namespace was not used by
  851. the top element of the inserted subtree but only in deeper subtrees.
  852. * Raising an exception from a parser target callback didn't always
  853. terminate the parser.
  854. * Only {true, false, 1, 0} are accepted as the lexical representation for
  855. BoolElement ({True, False, T, F, t, f} not any more), restoring lxml <= 2.0
  856. behaviour.
  857. Other changes
  858. -------------
  859. 2.2.1 (2009-06-02)
  860. ==================
  861. Features added
  862. --------------
  863. * Injecting default attributes into a document during XML Schema
  864. validation (also at parse time).
  865. * Pass ``huge_tree`` parser option to disable parser security
  866. restrictions imposed by libxml2 2.7.
  867. Bugs fixed
  868. ----------
  869. * The script for statically building libxml2 and libxslt didn't work
  870. in Py3.
  871. * ``XMLSchema()`` also passes invalid schema documents on to libxml2
  872. for parsing (which could lead to a crash before release 2.6.24).
  873. Other changes
  874. -------------
  875. 2.2 (2009-03-21)
  876. ================
  877. Features added
  878. --------------
  879. * Support for ``standalone`` flag in XML declaration through
  880. ``tree.docinfo.standalone`` and by passing ``standalone=True/False``
  881. on serialisation.
  882. Bugs fixed
  883. ----------
  884. * Crash when parsing an XML Schema with external imports from a
  885. filename.
  886. 2.2beta4 (2009-02-27)
  887. =====================
  888. Features added
  889. --------------
  890. * Support strings and instantiable Element classes as child arguments
  891. to the constructor of custom Element classes.
  892. * GZip compression support for serialisation to files and file-like
  893. objects.
  894. Bugs fixed
  895. ----------
  896. * Deep-copying an ElementTree copied neither its sibling PIs and
  897. comments nor its internal/external DTD subsets.
  898. * Soupparser failed on broken attributes without values.
  899. * Crash in XSLT when overwriting an already defined attribute using
  900. ``xsl:attribute``.
  901. * Crash bug in exception handling code under Python 3. This was due
  902. to a problem in Cython, not lxml itself.
  903. * ``lxml.html.FormElement._name()`` failed for non top-level forms.
  904. * ``TAG`` special attribute in constructor of custom Element classes
  905. was evaluated incorrectly.
  906. Other changes
  907. -------------
  908. * Official support for Python 3.0.1.
  909. * ``Element.findtext()`` now returns an empty string instead of None
  910. for Elements without text content.
  911. 2.2beta3 (2009-02-17)
  912. =====================
  913. Features added
  914. --------------
  915. * ``XSLT.strparam()`` class method to wrap quoted string parameters
  916. that require escaping.
  917. Bugs fixed
  918. ----------
  919. * Memory leak in XPath evaluators.
  920. * Crash when parsing indented XML in one thread and merging it with
  921. other documents parsed in another thread.
  922. * Setting the ``base`` attribute in ``lxml.objectify`` from a unicode
  923. string failed.
  924. * Fixes following changes in Python 3.0.1.
  925. * Minor fixes for Python 3.
  926. Other changes
  927. -------------
  928. * The global error log (which is copied into the exception log) is now
  929. local to a thread, which fixes some race conditions.
  930. * More robust error handling on serialisation.
  931. 2.2beta2 (2009-01-25)
  932. =====================
  933. Bugs fixed
  934. ----------
  935. * Potential memory leak on exception handling. This was due to a
  936. problem in Cython, not lxml itself.
  937. * ``iter_links`` (and related link-rewriting functions) in
  938. ``lxml.html`` would interpret CSS like ``url("link")`` incorrectly
  939. (treating the quotation marks as part of the link).
  940. * Failing import on systems that have an ``io`` module.
  941. 2.1.5 (2009-01-06)
  942. ==================
  943. Bugs fixed
  944. ----------
  945. * Potential memory leak on exception handling. This was due to a
  946. problem in Cython, not lxml itself.
  947. * Failing import on systems that have an ``io`` module.
  948. 2.2beta1 (2008-12-12)
  949. =====================
  950. Features added
  951. --------------
  952. * Allow ``lxml.html.diff.htmldiff`` to accept Element objects, not
  953. just HTML strings.
  954. Bugs fixed
  955. ----------
  956. * Crash when using an XPath evaluator in multiple threads.
  957. * Fixed missing whitespace before ``Link:...`` in ``lxml.html.diff``.
  958. Other changes
  959. -------------
  960. * Export ``lxml.html.parse``.
  961. 2.1.4 (2008-12-12)
  962. ==================
  963. Bugs fixed
  964. ----------
  965. * Crash when using an XPath evaluator in multiple threads.
  966. 2.0.11 (2008-12-12)
  967. ===================
  968. Bugs fixed
  969. ----------
  970. * Crash when using an XPath evaluator in multiple threads.
  971. 2.2alpha1 (2008-11-23)
  972. ======================
  973. Features added
  974. --------------
  975. * Support for XSLT result tree fragments in XPath/XSLT extension
  976. functions.
  977. * QName objects have new properties ``namespace`` and ``localname``.
  978. * New options for exclusive C14N and C14N without comments.
  979. * Instantiating a custom Element classes creates a new Element.
  980. Bugs fixed
  981. ----------
  982. * XSLT didn't inherit the parse options of the input document.
  983. * 0-bytes could slip through the API when used inside of Unicode
  984. strings.
  985. * With ``lxml.html.clean.autolink``, links with balanced parenthesis,
  986. that end in a parenthesis, will be linked in their entirety (typical
  987. with Wikipedia links).
  988. Other changes
  989. -------------
  990. 2.1.3 (2008-11-17)
  991. ==================
  992. Features added
  993. --------------
  994. Bugs fixed
  995. ----------
  996. * Ref-count leaks when lxml enters a try-except statement while an
  997. outside exception lives in sys.exc_*(). This was due to a problem in
  998. Cython, not lxml itself.
  999. * Parser Unicode decoding errors could get swallowed by other
  1000. exceptions.
  1001. * Name/import errors in some Python modules.
  1002. * Internal DTD subsets that did not specify a system or public ID were
  1003. not serialised and did not appear in the docinfo property of
  1004. ElementTrees.
  1005. * Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.
  1006. * Test suite fixes for libxml2 2.7.
  1007. * Resolver.resolve_string() did not work for non-ASCII byte strings.
  1008. * Resolver.resolve_file() was broken.
  1009. * Overriding the parser encoding didn't work for many encodings.
  1010. Other changes
  1011. -------------
  1012. 2.0.10 (2008-11-17)
  1013. ===================
  1014. Bugs fixed
  1015. ----------
  1016. * Ref-count leaks when lxml enters a try-except statement while an
  1017. outside exception lives in sys.exc_*(). This was due to a problem in
  1018. Cython, not lxml itself.
  1019. 2.1.2 (2008-09-05)
  1020. ==================
  1021. Features added
  1022. --------------
  1023. * lxml.etree now tries to find the absolute path name of files when
  1024. parsing from a file-like object. This helps custom resolvers when
  1025. resolving relative URLs, as lixbml2 can prepend them with the path
  1026. of the source document.
  1027. Bugs fixed
  1028. ----------
  1029. * Memory problem when passing documents between threads.
  1030. * Target parser did not honour the ``recover`` option and raised an
  1031. exception instead of calling ``.close()`` on the target.
  1032. Other changes
  1033. -------------
  1034. 2.0.9 (2008-09-05)
  1035. ==================
  1036. Bugs fixed
  1037. ----------
  1038. * Memory problem when passing documents between threads.
  1039. * Target parser did not honour the ``recover`` option and raised an
  1040. exception instead of calling ``.close()`` on the target.
  1041. 2.1.1 (2008-07-24)
  1042. ==================
  1043. Features added
  1044. --------------
  1045. Bugs fixed
  1046. ----------
  1047. * Crash when parsing XSLT stylesheets in a thread and using them in
  1048. another.
  1049. * Encoding problem when including text with ElementInclude under
  1050. Python 3.
  1051. Other changes
  1052. -------------
  1053. 2.0.8 (2008-07-24)
  1054. ==================
  1055. Features added
  1056. --------------
  1057. * ``lxml.html.rewrite_links()`` strips links to work around documents
  1058. with whitespace in URL attributes.
  1059. Bugs fixed
  1060. ----------
  1061. * Crash when parsing XSLT stylesheets in a thread and using them in
  1062. another.
  1063. * CSS selector parser dropped remaining expression after a function
  1064. with parameters.
  1065. Other changes
  1066. -------------
  1067. 2.1 (2008-07-09)
  1068. ================
  1069. Features added
  1070. --------------
  1071. * Smart strings can be switched off in XPath (``smart_strings``
  1072. keyword option).
  1073. * ``lxml.html.rewrite_links()`` strips links to work around documents
  1074. with whitespace in URL attributes.
  1075. Bugs fixed
  1076. ----------
  1077. * Custom resolvers were not used for XMLSchema includes/imports and
  1078. XInclude processing.
  1079. * CSS selector parser dropped remaining expression after a function
  1080. with parameters.
  1081. Other changes
  1082. -------------
  1083. * ``objectify.enableRecursiveStr()`` was removed, use
  1084. ``objectify.enable_recursive_str()`` instead
  1085. * Speed-up when running XSLTs on documents from other threads
  1086. 2.0.7 (2008-06-20)
  1087. ==================
  1088. Features added
  1089. --------------
  1090. * Pickling ``ElementTree`` objects in lxml.objectify.
  1091. Bugs fixed
  1092. ----------
  1093. * Descending dot-separated classes in CSS selectors were not resolved
  1094. correctly.
  1095. * ``ElementTree.parse()`` didn't handle target parser result.
  1096. * Potential threading problem in XInclude.
  1097. * Crash in Element class lookup classes when the __init__() method of
  1098. the super class is not called from Python subclasses.
  1099. Other changes
  1100. -------------
  1101. * Non-ASCII characters in attribute values are no longer escaped on
  1102. serialisation.
  1103. 2.1beta3 (2008-06-19)
  1104. =====================
  1105. Features added
  1106. --------------
  1107. * Major overhaul of ``tools/xpathgrep.py`` script.
  1108. * Pickling ``ElementTree`` objects in lxml.objectify.
  1109. * Support for parsing from file-like objects that return unicode
  1110. strings.
  1111. * New function ``etree.cleanup_namespaces(el)`` that removes unused
  1112. namespace declarations from a (sub)tree (experimental).
  1113. * XSLT results support the buffer protocol in Python 3.
  1114. * Polymorphic functions in ``lxml.html`` that accept either a tree or
  1115. a parsable string will return either a UTF-8 encoded byte string, a
  1116. unicode string or a tree, based on the type of the input.
  1117. Previously, the result was always a byte string or a tree.
  1118. * Support for Python 2.6 and 3.0 beta.
  1119. * File name handling now uses a heuristic to convert between byte
  1120. strings (usually filenames) and unicode strings (usually URLs).
  1121. * Parsing from a plain file object frees the GIL under Python 2.x.
  1122. * Running ``iterparse()`` on a plain file (or filename) frees the GIL
  1123. on reading under Python 2.x.
  1124. * Conversion functions ``html_to_xhtml()`` and ``xhtml_to_html()`` in
  1125. lxml.html (experimental).
  1126. * Most features in lxml.html work for XHTML namespaced tag names
  1127. (experimental).
  1128. Bugs fixed
  1129. ----------
  1130. * ``ElementTree.parse()`` didn't handle target parser result.
  1131. * Crash in Element class lookup classes when the __init__() method of
  1132. the super class is not called from Python subclasses.
  1133. * A number of problems related to unicode/byte string conversion of
  1134. filenames and error messages were fixed.
  1135. * Building on MacOS-X now passes the "flat_namespace" option to the C
  1136. compiler, which reportedly prevents build quirks and crashes on this
  1137. platform.
  1138. * Windows build was broken.
  1139. * Rare crash when serialising to a file object with certain encodings.
  1140. Other changes
  1141. -------------
  1142. * Non-ASCII characters in attribute values are no longer escaped on
  1143. serialisation.
  1144. * Passing non-ASCII byte strings or invalid unicode strings as .tag,
  1145. namespaces, etc. will result in a ValueError instead of an
  1146. AssertionError (just like the tag well-formedness check).
  1147. * Up to several times faster attribute access (i.e. tree traversal) in
  1148. lxml.objectify.
  1149. 2.0.6 (2008-05-31)
  1150. ==================
  1151. Features added
  1152. --------------
  1153. Bugs fixed
  1154. ----------
  1155. * Incorrect evaluation of ``el.find("tag[child]")``.
  1156. * Windows build was broken.
  1157. * Moving a subtree from a document created in one thread into a
  1158. document of another thread could crash when the rest of the source
  1159. document is deleted while the subtree is still in use.
  1160. * Rare crash when serialising to a file object with certain encodings.
  1161. Other changes
  1162. -------------
  1163. * lxml should now build without problems on MacOS-X.
  1164. 2.1beta2 (2008-05-02)
  1165. =====================
  1166. Features added
  1167. --------------
  1168. * All parse functions in lxml.html take a ``parser`` keyword argument.
  1169. * lxml.html has a new parser class ``XHTMLParser`` and a module
  1170. attribute ``xhtml_parser`` that provide XML parsers that are
  1171. pre-configured for the lxml.html package.
  1172. Bugs fixed
  1173. ----------
  1174. * Moving a subtree from a document created in one thread into a
  1175. document of another thread could crash when the rest of the source
  1176. document is deleted while the subtree is still in use.
  1177. * Passing an nsmap when creating an Element will no longer strip
  1178. redundantly defined namespace URIs. This prevented the definition
  1179. of more than one prefix for a namespace on the same Element.
  1180. Other changes
  1181. -------------
  1182. * If the default namespace is redundantly defined with a prefix on the
  1183. same Element, the prefix will now be preferred for subelements and
  1184. attributes. This allows users to work around a problem in libxml2
  1185. where attributes from the default namespace could serialise without
  1186. a prefix even when they appear on an Element with a different
  1187. namespace (i.e. they would end up in the wrong namespace).
  1188. 2.0.5 (2008-05-01)
  1189. ==================
  1190. Features added
  1191. --------------
  1192. Bugs fixed
  1193. ----------
  1194. * Resolving to a filename in custom resolvers didn't work.
  1195. * lxml did not honour libxslt's second error state "STOPPED", which
  1196. let some XSLT errors pass silently.
  1197. * Memory leak in Schematron with libxml2 >= 2.6.31.
  1198. Other changes
  1199. -------------
  1200. 2.1beta1 (2008-04-15)
  1201. =====================
  1202. Features added
  1203. --------------
  1204. * Error logging in Schematron (requires libxml2 2.6.32 or later).
  1205. * Parser option ``strip_cdata`` for normalising or keeping CDATA
  1206. sections. Defaults to ``True`` as before, thus replacing CDATA
  1207. sections by their text content.
  1208. * ``CDATA()`` factory to wrap string content as CDATA section.
  1209. Bugs fixed
  1210. ----------
  1211. * Resolving to a filename in custom resolvers didn't work.
  1212. * lxml did not honour libxslt's second error state "STOPPED", which
  1213. let some XSLT errors pass silently.
  1214. * Memory leak in Schematron with libxml2 >= 2.6.31.
  1215. * lxml.etree accepted non well-formed namespace prefix names.
  1216. Other changes
  1217. -------------
  1218. * Major cleanup in internal ``moveNodeToDocument()`` function, which
  1219. takes care of namespace cleanup when moving elements between
  1220. different namespace contexts.
  1221. * New Elements created through the ``makeelement()`` method of an HTML
  1222. parser or through lxml.html now end up in a new HTML document
  1223. (doctype HTML 4.01 Transitional) instead of a generic XML document.
  1224. This mostly impacts the serialisation and the availability of a DTD
  1225. context.
  1226. 2.0.4 (2008-04-13)
  1227. ==================
  1228. Features added
  1229. --------------
  1230. Bugs fixed
  1231. ----------
  1232. * Hanging thread in conjunction with GTK threading.
  1233. * Crash bug in iterparse when moving elements into other documents.
  1234. * HTML elements' ``.cssselect()`` method was broken.
  1235. * ``ElementTree.find*()`` didn't accept QName objects.
  1236. Other changes
  1237. -------------
  1238. 2.1alpha1 (2008-03-27)
  1239. ======================
  1240. Features added
  1241. --------------
  1242. * New event types 'comment' and 'pi' in ``iterparse()``.
  1243. * ``XSLTAccessControl`` instances have a property ``options`` that
  1244. returns a dict of access configuration options.
  1245. * Constant instances ``DENY_ALL`` and ``DENY_WRITE`` on
  1246. ``XSLTAccessControl`` class.
  1247. * Extension elements for XSLT (experimental!)
  1248. * ``Element.base`` property returns the xml:base or HTML base URL of
  1249. an Element.
  1250. * ``docinfo.URL`` property is writable.
  1251. Bugs fixed
  1252. ----------
  1253. * Default encoding for plain text serialisation was different from
  1254. that of XML serialisation (UTF-8 instead of ASCII).
  1255. Other changes
  1256. -------------
  1257. * Minor API speed-ups.
  1258. * The benchmark suite now uses tail text in the trees, which makes the
  1259. absolute numbers incomparable to previous results.
  1260. * Generating the HTML documentation now requires Pygments_, which is
  1261. used to enable syntax highlighting for the doctest examples.
  1262. .. _Pygments: http://pygments.org/
  1263. Most long-time deprecated functions and methods were removed:
  1264. - ``etree.clearErrorLog()``, use ``etree.clear_error_log()``
  1265. - ``etree.useGlobalPythonLog()``, use
  1266. ``etree.use_global_python_log()``
  1267. - ``etree.ElementClassLookup.setFallback()``, use
  1268. ``etree.ElementClassLookup.set_fallback()``
  1269. - ``etree.getDefaultParser()``, use ``etree.get_default_parser()``
  1270. - ``etree.setDefaultParser()``, use ``etree.set_default_parser()``
  1271. - ``etree.setElementClassLookup()``, use
  1272. ``etree.set_element_class_lookup()``
  1273. Note that ``parser.setElementClassLookup()`` has not been removed
  1274. yet, although ``parser.set_element_class_lookup()`` should be used
  1275. instead.
  1276. - ``xpath_evaluator.registerNamespace()``, use
  1277. ``xpath_evaluator.register_namespace()``
  1278. - ``xpath_evaluator.registerNamespaces()``, use
  1279. ``xpath_evaluator.register_namespaces()``
  1280. - ``objectify.setPytypeAttributeTag``, use
  1281. ``objectify.set_pytype_attribute_tag``
  1282. - ``objectify.setDefaultParser()``, use
  1283. ``objectify.set_default_parser()``
  1284. 2.0.3 (2008-03-26)
  1285. ==================
  1286. Features added
  1287. --------------
  1288. * soupparser.parse() allows passing keyword arguments on to
  1289. BeautifulSoup.
  1290. * ``fromstring()`` method in ``lxml.html.soupparser``.
  1291. Bugs fixed
  1292. ----------
  1293. * ``lxml.html.diff`` didn't treat empty tags properly (e.g.,
  1294. ``<br>``).
  1295. * Handle entity replacements correctly in target parser.
  1296. * Crash when using ``iterparse()`` with XML Schema validation.
  1297. * The BeautifulSoup parser (soupparser.py) did not replace entities,
  1298. which made them turn up in text content.
  1299. * Attribute assignment of custom PyTypes in objectify could fail to
  1300. correctly serialise the value to a string.
  1301. Other changes
  1302. -------------
  1303. * ``lxml.html.ElementSoup`` was replaced by a new module
  1304. ``lxml.html.soupparser`` with a more consistent API. The old module
  1305. remains for compatibility with ElementTree's own ElementSoup module.
  1306. * Setting the XSLT_CONFIG and XML2_CONFIG environment variables at
  1307. build time will let setup.py pick up the ``xml2-config`` and
  1308. ``xslt-config`` scripts from the supplied path name.
  1309. * Passing ``--with-xml2-config=/path/to/xml2-config`` to setup.py will
  1310. override the ``xml2-config`` script that is used to determine the C
  1311. compiler options. The same applies for the ``--with-xslt-config``
  1312. option.
  1313. 2.0.2 (2008-02-22)
  1314. ==================
  1315. Features added
  1316. --------------
  1317. * Support passing ``base_url`` to file parser functions to override
  1318. the filename of the file(-like) object.
  1319. Bugs fixed
  1320. ----------
  1321. * The prefix for objectify's pytype namespace was missing from the set
  1322. of default prefixes.
  1323. * Memory leak in Schematron (fixed only for libxml2 2.6.31+).
  1324. * Error type names in RelaxNG were reported incorrectly.
  1325. * Slice deletion bug fixed in objectify.
  1326. Other changes
  1327. -------------
  1328. * Enabled doctests for some Python modules (especially ``lxml.html``).
  1329. * Add a ``method`` argument to ``lxml.html.tostring()``
  1330. (``method="xml"`` for XHTML output).
  1331. * Make it clearer that methods like ``lxml.html.fromstring()`` take a
  1332. ``base_url`` argument.
  1333. 2.0.1 (2008-02-13)
  1334. ==================
  1335. Features added
  1336. --------------
  1337. * Child iteration in ``lxml.pyclasslookup``.
  1338. * Loads of new docstrings reflect the signature of functions and
  1339. methods to make them visible in API docs and ``help()``
  1340. Bugs fixed
  1341. ----------
  1342. * The module ``lxml.html.builder`` was duplicated as
  1343. ``lxml.htmlbuilder``
  1344. * Form elements would return None for ``form.fields.keys()`` if there
  1345. was an unnamed input field. Now unnamed input fields are completely
  1346. ignored.
  1347. * Setting an element slice in objectify could insert slice-overlapping
  1348. elements at the wrong position.
  1349. Other changes
  1350. -------------
  1351. * The generated API documentation was cleaned up and disburdened from
  1352. non-public classes etc.
  1353. * The previously public module ``lxml.html.setmixin`` was renamed to
  1354. ``lxml.html._setmixin`` as it is not an official part of lxml. If
  1355. you want to use it, feel free to copy it over to your own source
  1356. base.
  1357. * Passing ``--with-xslt-config=/path/to/xslt-config`` to setup.py will
  1358. override the ``xslt-config`` script that is used to determine the C
  1359. compiler options.
  1360. 2.0 (2008-02-01)
  1361. ================
  1362. Features added
  1363. --------------
  1364. * Passing the ``unicode`` type as ``encoding`` to ``tostring()`` will
  1365. serialise to unicode. The ``tounicode()`` function is now
  1366. deprecated.
  1367. * ``XMLSchema()`` and ``RelaxNG()`` can parse from StringIO.
  1368. * ``makeparser()`` function in ``lxml.objectify`` to create a new
  1369. parser with the usual objectify setup.
  1370. * Plain ASCII XPath string results are no longer forced into unicode
  1371. objects as in 2.0beta1, but are returned as plain strings as before.
  1372. * All XPath string results are 'smart' objects that have a
  1373. ``getparent()`` method to retrieve their parent Element.
  1374. * ``with_tail`` option in serialiser functions.
  1375. * More accurate exception messages in validator creation.
  1376. * Parse-time XML schema validation (``schema`` parser keyword).
  1377. * XPath string results of the ``text()`` function and attribute
  1378. selection make their Element container accessible through a
  1379. ``getparent()`` method. As a side-effect, they are now always
  1380. unicode objects (even ASCII strings).
  1381. * ``XSLT`` objects are usable in any thread - at the cost of a deep
  1382. copy if they were not created in that thread.
  1383. * Invalid entity names and character references will be rejected by
  1384. the ``Entity()`` factory.
  1385. * ``entity.text`` returns the textual representation of the entity,
  1386. e.g. ``&amp;``.
  1387. * New properties ``position`` and ``code`` on ParseError exception (as
  1388. in ET 1.3)
  1389. * Rich comparison of ``element.attrib`` proxies.
  1390. * ElementTree compatible TreeBuilder class.
  1391. * Use default prefixes for some common XML namespaces.
  1392. * ``lxml.html.clean.Cleaner`` now allows for a ``host_whitelist``, and
  1393. two overridable methods: ``allow_embedded_url(el, url)`` and the
  1394. more general ``allow_element(el)``.
  1395. * Extended slicing of Elements as in ``element[1:-1:2]``, both in
  1396. etree and in objectify
  1397. * Resolvers can now provide a ``base_url`` keyword argument when
  1398. resolving a document as string data.
  1399. * When using ``lxml.doctestcompare`` you can give the doctest option
  1400. ``NOPARSE_MARKUP`` (like ``# doctest: +NOPARSE_MARKUP``) to suppress
  1401. the special checking for one test.
  1402. * Separate ``feed_error_log`` property for the feed parser interface.
  1403. The normal parser interface and ``iterparse`` continue to use
  1404. ``error_log``.
  1405. * The normal parsers and the feed parser interface are now separated
  1406. and can be used concurrently on the same parser instance.
  1407. * ``fromstringlist()`` and ``tostringlist()`` functions as in
  1408. ElementTree 1.3
  1409. * ``iterparse()`` accepts an ``html`` boolean keyword argument for
  1410. parsing with the HTML parser (note that this interface may be
  1411. subject to change)
  1412. * Parsers accept an ``encoding`` keyword argument that overrides the encoding
  1413. of the parsed documents.
  1414. * New C-API function ``hasChild()`` to test for children
  1415. * ``annotate()`` function in objectify can annotate with Python types and XSI
  1416. types in one step. Accompanied by ``xsiannotate()`` and ``pyannotate()``.
  1417. * ``ET.write()``, ``tostring()`` and ``tounicode()`` now accept a keyword
  1418. argument ``method`` that can be one of 'xml' (or None), 'html' or 'text' to
  1419. serialise as XML, HTML or plain text content.
  1420. * ``iterfind()`` method on Elements returns an iterator equivalent to
  1421. ``findall()``
  1422. * ``itertext()`` method on Elements
  1423. * Setting a QName object as value of the .text property or as an attribute
  1424. will resolve its prefix in the respective context
  1425. * ElementTree-like parser target interface as described in
  1426. http://effbot.org/elementtree/elementtree-xmlparser.htm
  1427. * ElementTree-like feed parser interface on XMLParser and HTMLParser
  1428. (``feed()`` and ``close()`` methods)
  1429. * Reimplemented ``objectify.E`` for better performance and improved
  1430. integration with objectify. Provides extended type support based on
  1431. registered PyTypes.
  1432. * XSLT objects now support deep copying
  1433. * New ``makeSubElement()`` C-API function that allows creating a new
  1434. subelement straight with text, tail and attributes.
  1435. * XPath extension functions can now access the current context node
  1436. (``context.context_node``) and use a context dictionary
  1437. (``context.eval_context``) from the context provided in their first
  1438. parameter
  1439. * HTML tag soup parser based on BeautifulSoup in ``lxml.html.ElementSoup``
  1440. * New module ``lxml.doctestcompare`` by Ian Bicking for writing simplified
  1441. doctests based on XML/HTML output. Use by importing ``lxml.usedoctest`` or
  1442. ``lxml.html.usedoctest`` from within a doctest.
  1443. * New module ``lxml.cssselect`` by Ian Bicking for selecting Elements with CSS
  1444. selectors.
  1445. * New package ``lxml.html`` written by Ian Bicking for advanced HTML
  1446. treatment.
  1447. * Namespace class setup is now local to the ``ElementNamespaceClassLookup``
  1448. instance and no longer global.
  1449. * Schematron validation (incomplete in libxml2)
  1450. * Additional ``stringify`` argument to ``objectify.PyType()`` takes a
  1451. conversion function to strings to support setting text values from arbitrary
  1452. types.
  1453. * Entity support through an ``Entity`` factory and element classes. XML
  1454. parsers now have a ``resolve_entities`` keyword argument that can be set to
  1455. False to keep entities in the document.
  1456. * ``column`` field on error log entries to accompany the ``line`` field
  1457. * Error specific messages in XPath parsing and evaluation
  1458. NOTE: for evaluation errors, you will now get an XPathEvalError instead of
  1459. an XPathSyntaxError. To catch both, you can except on ``XPathError``
  1460. * The regular expression functions in XPath now support passing a node-set
  1461. instead of a string
  1462. * Extended type annotation in objectify: new ``xsiannotate()`` function
  1463. * EXSLT RegExp support in standard XPath (not only XSLT)
  1464. Bugs fixed
  1465. ----------
  1466. * Missing import in ``lxml.html.clean``.
  1467. * Some Python 2.4-isms prevented lxml from building/running under
  1468. Python 2.3.
  1469. * XPath on ElementTrees could crash when selecting the virtual root
  1470. node of the ElementTree.
  1471. * Compilation ``--without-threading`` was buggy in alpha5/6.
  1472. * Memory leak in the ``parse()`` function.
  1473. * Minor bugs in XSLT error message formatting.
  1474. * Result document memory leak in target parser.
  1475. * Target parser failed to report comments.
  1476. * In the ``lxml.html`` ``iter_links`` method, links in ``<object>``
  1477. tags weren't recognized. (Note: plugin-specific link parameters
  1478. still aren't recognized.) Also, the ``<embed>`` tag, though not
  1479. standard, is now included in ``lxml.html.defs.special_inline_tags``.
  1480. * Using custom resolvers on XSLT stylesheets parsed from a string
  1481. could request ill-formed URLs.
  1482. * With ``lxml.doctestcompare`` if you do ``<tag xmlns="...">`` in your
  1483. output, it will then be namespace-neutral (before the ellipsis was
  1484. treated as a real namespace).
  1485. * AttributeError in feed parser on parse errors
  1486. * XML feed parser setup problem
  1487. * Type annotation for unicode strings in ``DataElement()``
  1488. * lxml failed to serialise namespace declarations of elements other than the
  1489. root node of a tree
  1490. * Race condition in XSLT where the resolver context leaked between concurrent
  1491. XSLT calls
  1492. * lxml.etree did not check tag/attribute names
  1493. * The XML parser did not report undefined entities as error
  1494. * The text in exceptions raised by XML parsers, validators and XPath
  1495. evaluators now reports the first error that occurred instead of the last
  1496. * Passing '' as XPath namespace prefix did not raise an error
  1497. * Thread safety in XPath evaluators
  1498. Other changes
  1499. -------------
  1500. * Exceptions carry only the part of the error log that is related to
  1501. the operation that caused the error.
  1502. * ``XMLSchema()`` and ``RelaxNG()`` now enforce passing the source
  1503. file/filename through the ``file`` keyword argument.
  1504. * The test suite now skips most doctests under Python 2.3.
  1505. * ``make clean`` no longer removes the .c files (use ``make
  1506. realclean`` instead)
  1507. * Minor performance tweaks for Element instantiation and subelement
  1508. creation
  1509. * Various places in the XPath, XSLT and iteration APIs now require
  1510. keyword-only arguments.
  1511. * The argument order in ``element.itersiblings()`` was changed to
  1512. match the order used in all other iteration methods. The second
  1513. argument ('preceding') is now a keyword-only argument.
  1514. * The ``getiterator()`` method on Elements and ElementTrees was
  1515. reverted to return an iterator as it did in lxml 1.x. The ET API
  1516. specification allows it to return either a sequence or an iterator,
  1517. and it traditionally returned a sequence in ET and an iterator in
  1518. lxml. However, it is now deprecated in favour of the ``iter()``
  1519. method, which should be used in new code wherever possible.
  1520. * The 'pretty printed' serialisation of ElementTree objects now
  1521. inserts newlines at the root level between processing instructions,
  1522. comments and the root tag.
  1523. * A 'pretty printed' serialisation is now terminated with a newline.
  1524. * Second argument to ``lxml.etree.Extension()`` helper is no longer
  1525. required, third argument is now a keyword-only argument ``ns``.
  1526. * ``lxml.html.tostring`` takes an ``encoding`` argument.
  1527. * The module source files were renamed to "lxml.*.pyx", such as
  1528. "lxml.etree.pyx". This was changed for consistency with the way
  1529. Pyrex commonly handles package imports. The main effect is that
  1530. classes now know about their fully qualified class name, including
  1531. the package name of their module.
  1532. * Keyword-only arguments in some API functions, especially in the
  1533. parsers and serialisers.
  1534. * Tag name validation in lxml.etree (and lxml.html) now distinguishes
  1535. between HTML tags and XML tags based on the parser that was used to
  1536. parse or create them. HTML tags no longer reject any non-ASCII
  1537. characters in tag names but only spaces and the special characters
  1538. ``<>&/"'``.
  1539. * lxml.etree now emits a warning if you use XPath with libxml2 2.6.27
  1540. (which can crash on certain XPath errors)
  1541. * Type annotation in objectify now preserves the already annotated type by
  1542. default to prevent loosing type information that is already there.
  1543. * ``element.getiterator()`` returns a list, use ``element.iter()`` to retrieve
  1544. an iterator (ElementTree 1.3 compatible behaviour)
  1545. * objectify.PyType for None is now called "NoneType"
  1546. * ``el.getiterator()`` renamed to ``el.iter()``, following ElementTree 1.3 -
  1547. original name is still available as alias
  1548. * In the public C-API, ``findOrBuildNodeNs()`` was replaced by the more
  1549. generic ``findOrBuildNodeNsPrefix``
  1550. * Major refactoring in XPath/XSLT extension function code
  1551. * Network access in parsers disabled by default
  1552. 1.3.6 (2007-10-29)
  1553. ==================
  1554. Bugs fixed
  1555. ----------
  1556. * Backported decref crash fix from 2.0
  1557. * Well hidden free-while-in-use crash bug in ObjectPath
  1558. Other changes
  1559. -------------
  1560. * The test suites now run ``gc.collect()`` in the ``tearDown()``
  1561. methods. While this makes them take a lot longer to run, it also
  1562. makes it easier to link a specific test to garbage collection
  1563. problems that would otherwise appear in later tests.
  1564. 1.3.5 (2007-10-22)
  1565. ==================
  1566. Features added
  1567. --------------
  1568. Bugs fixed
  1569. ----------
  1570. * lxml.etree could crash when adding more than 10000 namespaces to a
  1571. document
  1572. * lxml failed to serialise namespace declarations of elements other
  1573. than the root node of a tree
  1574. 1.3.4 (2007-08-30)
  1575. ==================
  1576. Features added
  1577. --------------
  1578. * The ``ElementMaker`` in ``lxml.builder`` now accepts the keyword arguments
  1579. ``namespace`` and ``nsmap`` to set a namespace and nsmap for the Elements it
  1580. creates.
  1581. * The ``docinfo`` on ElementTree objects has new properties ``internalDTD``
  1582. and ``externalDTD`` that return a DTD object for the internal or external
  1583. subset of the document respectively.
  1584. * Serialising an ElementTree now includes any internal DTD subsets that are
  1585. part of the document, as well as comments and PIs that are siblings of the
  1586. root node.
  1587. Bugs fixed
  1588. ----------
  1589. * Parsing with the ``no_network`` option could fail
  1590. Other changes
  1591. -------------
  1592. * lxml now raises a TagNameWarning about tag names containing ':' instead of
  1593. an Error as 1.3.3 did. The reason is that a number of projects currently
  1594. misuse the previous lack of tag name validation to generate namespace
  1595. prefixes without declaring namespaces. Apart from the danger of generating
  1596. broken XML this way, it also breaks most of the namespace-aware tools in
  1597. XML, including XPath, XSLT and validation. lxml 1.3.x will continue to
  1598. support this bug with a Warning, while lxml 2.0 will be strict about
  1599. well-formed tag names (not only regarding ':').
  1600. * Serialising an Element no longer includes its comment and PI siblings (only
  1601. ElementTree serialisation includes them).
  1602. 1.3.3 (2007-07-26)
  1603. ==================
  1604. Features added
  1605. --------------
  1606. * ElementTree compatible parser ``ETCompatXMLParser`` strips processing
  1607. instructions and comments while parsing XML
  1608. * Parsers now support stripping PIs (keyword argument 'remove_pis')
  1609. * ``etree.fromstring()`` now supports parsing both HTML and XML, depending on
  1610. the parser you pass.
  1611. * Support ``base_url`` keyword argument in ``HTML()`` and ``XML()``
  1612. Bugs fixed
  1613. ----------
  1614. * Parsing from Python Unicode strings failed on some platforms
  1615. * ``Element()`` did not raise an exception on tag names containing ':'
  1616. * ``Element.getiterator(tag)`` did not accept ``Comment`` and
  1617. ``ProcessingInstruction`` as tags. It also accepts ``Element`` now.
  1618. 1.3.2 (2007-07-03)
  1619. ==================
  1620. Features added
  1621. --------------
  1622. Bugs fixed
  1623. ----------
  1624. * "deallocating None" crash bug
  1625. 1.3.1 (2007-07-02)
  1626. ==================
  1627. Features added
  1628. --------------
  1629. * objectify.DataElement now supports setting values from existing data
  1630. elements (not just plain Python types) and reuses defined namespaces etc.
  1631. * E-factory support for lxml.objectify (``objectify.E``)
  1632. Bugs fixed
  1633. ----------
  1634. * Better way to prevent crashes in Element proxy cleanup code
  1635. * objectify.DataElement didn't set up None value correctly
  1636. * objectify.DataElement didn't check the value against the provided type hints
  1637. * Reference-counting bug in ``Element.attrib.pop()``
  1638. 1.3 (2007-06-24)
  1639. ================
  1640. Features added
  1641. --------------
  1642. * Module ``lxml.pyclasslookup`` module implements an Element class lookup
  1643. scheme that can access the entire tree in read-only mode to help determining
  1644. a suitable Element class
  1645. * Parsers take a ``remove_comments`` keyword argument that skips over comments
  1646. * ``parse()`` function in ``objectify``, corresponding to ``XML()`` etc.
  1647. * ``Element.addnext(el)`` and ``Element.addprevious(el)`` methods to support
  1648. adding processing instructions and comments around the root node
  1649. * ``Element.attrib`` was missing ``clear()`` and ``pop()`` methods
  1650. * Extended type annotation in objectify: cleaner annotation namespace setup
  1651. plus new ``deannotate()`` function
  1652. * Support for custom Element class instantiation in lxml.sax: passing a
  1653. ``makeelement`` function to the ElementTreeContentHandler will reuse the
  1654. lookup context of that function
  1655. * '.' represents empty ObjectPath (identity)
  1656. * ``Element.values()`` to accompany the existing ``.keys()`` and ``.items()``
  1657. * ``collectAttributes()`` C-function to build a list of attribute
  1658. keys/values/items for a libxml2 node
  1659. * ``DTD`` validator class (like ``RelaxNG`` and ``XMLSchema``)
  1660. * HTML generator helpers by Fredrik Lundh in ``lxml.htmlbuilder``
  1661. * ``ElementMaker`` XML generator by Fredrik Lundh in ``lxml.builder.E``
  1662. * Support for pickeling ``objectify.ObjectifiedElement`` objects to XML
  1663. * ``update()`` method on Element.attrib
  1664. * Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
  1665. a better handling of namespaces when moving elements between documents.
  1666. Bugs fixed
  1667. ----------
  1668. * Removing Elements from a tree could make them loose their namespace
  1669. declarations
  1670. * ``ElementInclude`` didn't honour base URL of original document
  1671. * Replacing the children slice of an Element would cut off the tails of the
  1672. original children
  1673. * ``Element.getiterator(tag)`` did not accept ``Comment`` and
  1674. ``ProcessingInstruction`` as tags
  1675. * API functions now check incoming strings for XML conformity. Zero bytes or
  1676. low ASCII characters are no longer accepted (AssertionError).
  1677. * XSLT parsing failed to pass resolver context on to imported documents
  1678. * passing '' as namespace prefix in nsmap could be passed through to libxml2
  1679. * Objectify couldn't handle prefixed XSD type names in ``xsi:type``
  1680. * More ET compatible behaviour when writing out XML declarations or not
  1681. * More robust error handling in ``iterparse()``
  1682. * Documents lost their top-level PIs and comments on serialisation
  1683. * lxml.sax failed on comments and PIs. Comments are now properly ignored and
  1684. PIs are copied.
  1685. * Possible memory leaks in namespace handling when moving elements between
  1686. documents
  1687. Other changes
  1688. -------------
  1689. * major restructuring in the documentation
  1690. 1.2.1 (2007-02-27)
  1691. ==================
  1692. Bugs fixed
  1693. ----------
  1694. * Build fixes for MS compiler
  1695. * Item assignments to special names like ``element["text"]`` failed
  1696. * Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
  1697. to access
  1698. * The pattern for attribute names in ObjectPath was too restrictive
  1699. 1.2 (2007-02-20)
  1700. ================
  1701. Features added
  1702. --------------
  1703. * Rich comparison of QName objects
  1704. * Support for regular expressions in benchmark selection
  1705. * get/set emulation (not .attrib!) for attributes on processing instructions
  1706. * ElementInclude Python module for ElementTree compatible XInclude processing
  1707. that honours custom resolvers registered with the source document
  1708. * ElementTree.parser property holds the parser used to parse the document
  1709. * setup.py has been refactored for greater readability and flexibility
  1710. * --rpath flag to setup.py to induce automatic linking-in of dynamic library
  1711. runtime search paths has been renamed to --auto-rpath. This makes it
  1712. possible to pass an --rpath directly to distutils; previously this was being
  1713. shadowed.
  1714. Bugs fixed
  1715. ----------
  1716. * Element instantiation now uses locks to prevent race conditions with threads
  1717. * ElementTree.write() did not raise an exception when the file was not writable
  1718. * Error handling could crash under Python <= 2.4.1 - fixed by disabling thread
  1719. support in these environments
  1720. * Element.find*() did not accept QName objects as path
  1721. Other changes
  1722. -------------
  1723. * code cleanup: redundant _NodeBase super class merged into _Element class
  1724. Note: although the impact should be zero in most cases, this change breaks
  1725. the compatibiliy of the public C-API
  1726. 1.1.2 (2006-10-30)
  1727. ==================
  1728. Features added
  1729. --------------
  1730. * Data elements in objectify support repr(), which is now used by dump()
  1731. * Source distribution now ships with a patched Pyrex
  1732. * New C-API function makeElement() to create new elements with text,
  1733. tail, attributes and namespaces
  1734. * Reuse original parser flags for XInclude
  1735. * Simplified support for handling XSLT processing instructions
  1736. Bugs fixed
  1737. ----------
  1738. * Parser resources were not freed before the next parser run
  1739. * Open files and XML strings returned by Python resolvers were not
  1740. closed/freed
  1741. * Crash in the IDDict returned by XMLDTDID
  1742. * Copying Comments and ProcessingInstructions failed
  1743. * Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()
  1744. * Memory leak when garbage collecting tailed root elements
  1745. * HTML script/style content was not propagated to .text
  1746. * Show text xincluded between text nodes correctly in .text and .tail
  1747. * 'integer * objectify.StringElement' operation was not supported
  1748. 1.1.1 (2006-09-21)
  1749. ==================
  1750. Features added
  1751. --------------
  1752. * XSLT profiling support (``profile_run`` keyword)
  1753. * countchildren() method on objectify.ObjectifiedElement
  1754. * Support custom elements for tree nodes in lxml.objectify
  1755. Bugs fixed
  1756. ----------
  1757. * lxml.objectify failed to support long data values (e.g., "123L")
  1758. * Error messages from XSLT did not reach ``XSLT.error_log``
  1759. * Factories objectify.Element() and objectify.DataElement() were missing
  1760. ``attrib`` and ``nsmap`` keyword arguments
  1761. * Changing the default parser in lxml.objectify did not update the factories
  1762. Element() and DataElement()
  1763. * Let lxml.objectify.Element() always generate tree elements (not data
  1764. elements)
  1765. * Build under Windows failed ('\0' bug in patched Pyrex version)
  1766. 1.1 (2006-09-13)
  1767. ================
  1768. Features added
  1769. --------------
  1770. * Comments and processing instructions return '<!-- coment -->' and
  1771. '<?pi-target content?>' for repr()
  1772. * Parsers are now the preferred (and default) place where element class lookup
  1773. schemes should be registered. Namespace lookup is no longer supported by
  1774. default.
  1775. * Support for Python 2.5 beta
  1776. * Unlock the GIL for deep copying documents and for XPath()
  1777. * New ``compact`` keyword argument for parsing read-only documents
  1778. * Support for parser options in iterparse()
  1779. * The ``namespace`` axis is supported in XPath and returns (prefix, URI)
  1780. tuples
  1781. * The XPath expression "/" now returns an empty list instead of raising an
  1782. exception
  1783. * XML-Object API on top of lxml (lxml.objectify)
  1784. * Customizable Element class lookup:
  1785. * different pre-implemented lookup mechanisms
  1786. * support for externally provided lookup functions
  1787. * Support for processing instructions (ET-like, not compatible)
  1788. * Public C-level API for independent extension modules
  1789. * Module level ``iterwalk()`` function as 'iterparse' for trees
  1790. * Module level ``iterparse()`` function similar to ElementTree (see
  1791. documentation for differences)
  1792. * Element.nsmap property returns a mapping of all namespace prefixes known at
  1793. the Element to their namespace URI
  1794. * Reentrant threading support in RelaxNG, XMLSchema and XSLT
  1795. * Threading support in parsers and serializers:
  1796. * All in-memory operations (tostring, parse(StringIO), etc.) free the GIL
  1797. * File operations (on file names) free the GIL
  1798. * Reading from file-like objects frees the GIL and reacquires it for reading
  1799. * Serialisation to file-like objects is single-threaded (high lock overhead)
  1800. * Element iteration over XPath axes:
  1801. * Element.iterdescendants() iterates over the descendants of an element
  1802. * Element.iterancestors() iterates over the ancestors of an element (from
  1803. parent to parent)
  1804. * Element.itersiblings() iterates over either the following or preceding
  1805. siblings of an element
  1806. * Element.iterchildren() iterates over the children of an element in either
  1807. direction
  1808. * All iterators support the ``tag`` keyword argument to restrict the
  1809. generated elements
  1810. * Element.getnext() and Element.getprevious() return the direct siblings of an
  1811. element
  1812. Bugs fixed
  1813. ----------
  1814. * filenames with local 8-bit encoding were not supported
  1815. * 1.1beta did not compile under Python 2.3
  1816. * ignore unknown 'pyval' attribute values in objectify
  1817. * objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists
  1818. * objectify.ObjectPath.setattr() failed to accept Elements and Lists
  1819. * XPathSyntaxError now inherits from XPathError
  1820. * Threading race conditions in RelaxNG and XMLSchema
  1821. * Crash when mixing elements from XSLT results into other trees, concurrent
  1822. XSLT is only allowed when the stylesheet was parsed in the main thread
  1823. * The EXSLT ``regexp:match`` function now works as defined (except for some
  1824. differences in the regular expression syntax)
  1825. * Setting element.text to '' returned None on request, not the empty string
  1826. * ``iterparse()`` could crash on long XML files
  1827. * Creating documents no longer copies the parser for later URL resolving. For
  1828. performance reasons, only a reference is kept. Resolver updates on the
  1829. parser will now be reflected by documents that were parsed before the
  1830. change. Although this should rarely become visible, it is a behavioral
  1831. change from 1.0.
  1832. 1.0.4 (2006-09-09)
  1833. ==================
  1834. Features added
  1835. --------------
  1836. * List-like ``Element.extend()`` method
  1837. Bugs fixed
  1838. ----------
  1839. * Crash in tail handling in ``Element.replace()``
  1840. 1.0.3 (2006-08-08)
  1841. ==================
  1842. Features added
  1843. --------------
  1844. * Element.replace(old, new) method to replace a subelement by another one
  1845. Bugs fixed
  1846. ----------
  1847. * Crash when mixing elements from XSLT results into other trees
  1848. * Copying/deepcopying did not work for ElementTree objects
  1849. * Setting an attribute to a non-string value did not raise an exception
  1850. * Element.remove() deleted the tail text from the removed Element
  1851. 1.0.2 (2006-06-27)
  1852. ==================
  1853. Features added
  1854. --------------
  1855. * Support for setting a custom default Element class as opposed to namespace
  1856. specific classes (which still override the default class)
  1857. Bugs fixed
  1858. ----------
  1859. * Rare exceptions in Python list functions were not handled
  1860. * Parsing accepted unicode strings with XML encoding declaration in certain
  1861. cases
  1862. * Parsing 8-bit encoded strings from StringIO objects raised an exception
  1863. * Module function ``initThread()`` was removed - useless (and never worked)
  1864. * XSLT and parser exception messages include the error line number
  1865. 1.0.1 (2006-06-09)
  1866. ==================
  1867. Features added
  1868. --------------
  1869. * Repeated calls to Element.attrib now efficiently return the same instance
  1870. Bugs fixed
  1871. ----------
  1872. * Document deallocation could crash in certain garbage collection scenarios
  1873. * Extension function calls in XSLT variable declarations could break the
  1874. stylesheet and crash on repeated calls
  1875. * Deep copying Elements could loose namespaces declared in parents
  1876. * Deep copying Elements did not copy tail
  1877. * Parsing file(-like) objects failed to load external entities
  1878. * Parsing 8-bit strings from file(-like) objects raised an exception
  1879. * xsl:include failed when the stylesheet was parsed from a file-like object
  1880. * lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()
  1881. * MSVC compiler complained about long strings (supports only 2048 bytes)
  1882. 1.0 (2006-06-01)
  1883. ================
  1884. Features added
  1885. --------------
  1886. * Element.getiterator() and the findall() methods support finding arbitrary
  1887. elements from a namespace (pattern ``{namespace}*``)
  1888. * Another speedup in tree iteration code
  1889. * General speedup of Python Element object creation and deallocation
  1890. * Writing C14N no longer serializes in memory (reduced memory footprint)
  1891. * PyErrorLog for error logging through the Python ``logging`` module
  1892. * ``Element.getroottree()`` returns an ElementTree for the root node of the
  1893. document that contains the element.
  1894. * ElementTree.getpath(element) returns a simple, absolute XPath expression to
  1895. find the element in the tree structure
  1896. * Error logs have a ``last_error`` attribute for convenience
  1897. * Comment texts can be changed through the API
  1898. * Formatted output via ``pretty_print`` keyword in serialization functions
  1899. * XSLT can block access to file system and network via ``XSLTAccessControl``
  1900. * ElementTree.write() no longer serializes in memory (reduced memory
  1901. footprint)
  1902. * Speedup of Element.findall(tag) and Element.getiterator(tag)
  1903. * Support for writing the XML representation of Elements and ElementTrees to
  1904. Python unicode strings via ``etree.tounicode()``
  1905. * Support for writing XSLT results to Python unicode strings via ``unicode()``
  1906. * Parsing a unicode string no longer copies the string (reduced memory
  1907. footprint)
  1908. * Parsing file-like objects reads chunks rather than the whole file (reduced
  1909. memory footprint)
  1910. * Parsing StringIO objects from the start avoids copying the string (reduced
  1911. memory footprint)
  1912. * Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE
  1913. information, original encoding and XML version as seen by the parser
  1914. * etree module can be compiled without libxslt by commenting out the line
  1915. ``include "xslt.pxi"`` near the end of the etree.pyx source file
  1916. * Better error messages in parser exceptions
  1917. * Error reporting also works in XSLT
  1918. * Support for custom document loaders (URI resolvers) in parsers and XSLT,
  1919. resolvers are registered at parser level
  1920. * Implementation of exslt:regexp for XSLT based on the Python 're' module,
  1921. enabled by default, can be switched off with 'regexp=False' keyword argument
  1922. * Support for exslt extensions (libexslt) and libxslt extra functions
  1923. (node-set, document, write, output)
  1924. * Substantial speedup in XPath.evaluate()
  1925. * HTMLParser for parsing (broken) HTML
  1926. * XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id
  1927. implementation of libxml2 (as opposed to ET compatible XMLID)
  1928. Bugs fixed
  1929. ----------
  1930. * Memory leak in Element.__setitem__
  1931. * Memory leak in Element.attrib.items() and Element.attrib.values()
  1932. * Memory leak in XPath extension functions
  1933. * Memory leak in unicode related setup code
  1934. * Element now raises ValueError on empty tag names
  1935. * Namespace fixing after moving elements between documents could fail if the
  1936. source document was freed too early
  1937. * Setting namespace-less tag names on namespaced elements ('{ns}t' -> 't')
  1938. didn't reset the namespace
  1939. * Unknown constants from newer libxml2 versions could raise exceptions in the
  1940. error handlers
  1941. * lxml.etree compiles much faster
  1942. * On libxml2 <= 2.6.22, parsing strings with encoding declaration could fail
  1943. in certain cases
  1944. * Document reference in ElementTree objects was not updated when the root
  1945. element was moved to a different document
  1946. * Running absolute XPath expressions on an Element now evaluates against the
  1947. root tree
  1948. * Evaluating absolute XPath expressions (``/*``) on an ElementTree could fail
  1949. * Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree
  1950. objects
  1951. * Removed public function ``initThreadLogging()``, replaced by more general
  1952. ``initThread()`` which fixes a number of setup problems in threads
  1953. * Memory leak when using iconv encoders in tostring/write
  1954. * Deep copying Elements and ElementTrees maintains the document information
  1955. * Serialization functions raise LookupError for unknown encodings
  1956. * Memory deallocation crash resulting from deep copying elements
  1957. * Some ElementTree methods could crash if the root node was not initialized
  1958. (neither file nor element passed to the constructor)
  1959. * Element/SubElement failed to set attribute namespaces from passed ``attrib``
  1960. dictionary
  1961. * ``tostring()`` adds an XML declaration for non-ASCII encodings
  1962. * ``tostring()`` failed to serialize encodings that contain 0-bytes
  1963. * ElementTree.xpath() and XPathDocumentEvaluator were not using the
  1964. ElementTree root node as reference point
  1965. * Calling ``document('')`` in XSLT failed to return the stylesheet
  1966. 0.9.2 (2006-05-10)
  1967. ==================
  1968. Features added
  1969. --------------
  1970. * Speedup for Element.makeelement(): the new element reuses the original
  1971. libxml2 document instead of creating a new empty one
  1972. * Speedup for reversed() iteration over element children (Py2.4+ only)
  1973. * ElementTree compatible QName class
  1974. * RelaxNG and XMLSchema accept any Element, not only ElementTrees
  1975. Bugs fixed
  1976. ----------
  1977. * str(xslt_result) was broken for XSLT output other than UTF-8
  1978. * Memory leak if write_c14n fails to write the file after conversion
  1979. * Crash in XMLSchema and RelaxNG when passing non-schema documents
  1980. * Memory leak in RelaxNG() when RelaxNGParseError is raised
  1981. 0.9.1 (2006-03-30)
  1982. ==================
  1983. Features added
  1984. --------------
  1985. * lxml.sax.ElementTreeContentHandler checks closing elements and raises
  1986. SaxError on mismatch
  1987. * lxml.sax.ElementTreeContentHandler supports namespace-less SAX events
  1988. (startElement, endElement) and defaults to empty attributes (keyword
  1989. argument)
  1990. * Speedup for repeatedly accessing element tag names
  1991. * Minor API performance improvements
  1992. Bugs fixed
  1993. ----------
  1994. * Memory deallocation bug when using XSLT output method "html"
  1995. * sax.py was handling UTF-8 encoded tag names where it shouldn't
  1996. * lxml.tests package will no longer be installed (is still in source tar)
  1997. 0.9 (2006-03-20)
  1998. ================
  1999. Features added
  2000. --------------
  2001. * Error logging API for libxml2 error messages
  2002. * Various performance improvements
  2003. * Benchmark script for lxml, ElementTree and cElementTree
  2004. * Support for registering extension functions through new FunctionNamespace
  2005. class (see doc/extensions.txt)
  2006. * ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')
  2007. * Support for variables in XPath expressions (also in XPath class)
  2008. * XPath class for compiled XPath expressions
  2009. * XMLID module level function (ElementTree compatible)
  2010. * XMLParser API for customized libxml2 parser configuration
  2011. * Support for custom Element classes through new Namespace API (see
  2012. doc/namespace_extensions.txt)
  2013. * Common exception base class LxmlError for module exceptions
  2014. * real iterator support in iter(Element), Element.getiterator()
  2015. * XSLT objects are callable, result trees support str()
  2016. * Added MANIFEST.in for easier creation of RPM files.
  2017. * 'getparent' method on elements allows navigation to an element's
  2018. parent element.
  2019. * Python core compatible SAX tree builder and SAX event generator. See
  2020. doc/sax.txt for more information.
  2021. Bugs fixed
  2022. ----------
  2023. * Segfaults and memory leaks in various API functions of Element
  2024. * Segfault in XSLT.tostring()
  2025. * ElementTree objects no longer interfere, Elements can be root of different
  2026. ElementTrees at the same time
  2027. * document('') works in XSLT documents read from files (in-memory documents
  2028. cannot support this due to libxslt deficiencies)
  2029. 0.8 (2005-11-03)
  2030. ================
  2031. Features added
  2032. --------------
  2033. * Support for copy.deepcopy() on elements. copy.copy() works also, but
  2034. does the same thing, and does *not* create a shallow copy, as that
  2035. makes no sense in the context of libxml2 trees. This means a
  2036. potential incompatibility with ElementTree, but there's more chance
  2037. that it works than if copy.copy() isn't supported at all.
  2038. * Increased compatibility with (c)ElementTree; .parse() on ElementTree is
  2039. supported and parsing of gzipped XML files works.
  2040. * implemented index() on elements, allowing one to find the index of a
  2041. SubElement.
  2042. Bugs fixed
  2043. ----------
  2044. * Use xslt-config instead of xml2-config to find out libxml2
  2045. directories to take into account a case where libxslt is installed
  2046. in a different directory than libxslt.
  2047. * Eliminate crash condition in iteration when text nodes are changed.
  2048. * Passing 'None' to tostring() does not result in a segfault anymore,
  2049. but an AssertionError.
  2050. * Some test fixes for Windows.
  2051. * Raise XMLSyntaxError and XPathSyntaxError instead of plain python
  2052. syntax errors. This should be less confusing.
  2053. * Fixed error with uncaught exception in Pyrex code.
  2054. * Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a
  2055. segfault.
  2056. * has_key() works on attrib. 'in' tests also work correctly on attrib.
  2057. * INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
  2058. libxml2 version, as it should.
  2059. * Passing a UTF-8 encoded string to the XML() function would fail;
  2060. fixed.
  2061. 0.7 (2005-06-15)
  2062. ================
  2063. Features added
  2064. --------------
  2065. * parameters (XPath expressions) can be passed to XSLT using keyword
  2066. parameters.
  2067. * Simple XInclude support. Calling the xinclude() method on a tree
  2068. will process any XInclude statements in the document.
  2069. * XMLSchema support. Use the XMLSchema class or the convenience
  2070. xmlschema() method on a tree to do XML Schema (XSD) validation.
  2071. * Added convenience xslt() method on tree. This is less efficient
  2072. than the XSLT object, but makes it easier to write quick code.
  2073. * Added convenience relaxng() method on tree. This is less efficient
  2074. than the RelaxNG object, but makes it easier to write quick code.
  2075. * Make it possible to use XPathEvaluator with elements as well. The
  2076. XPathEvaluator in this case will retain the element so multiple
  2077. XPath queries can be made against one element efficiently. This
  2078. replaces the second argument to the .evaluate() method that existed
  2079. previously.
  2080. * Allow registerNamespace() to be called on an XPathEvaluator, after
  2081. creation, to add additional namespaces. Also allow registerNamespaces(),
  2082. which does the same for a namespace dictionary.
  2083. * Add 'prefix' attribute to element to be able to read prefix information.
  2084. This is entirely read-only.
  2085. * It is possible to supply an extra nsmap keyword parameter to
  2086. the Element() and SubElement() constructors, which supplies a
  2087. prefix to namespace URI mapping. This will create namespace
  2088. prefix declarations on these elements and these prefixes will show up
  2089. in XML serialization.
  2090. Bugs fixed
  2091. ----------
  2092. * Killed yet another memory management related bug: trees created
  2093. using newDoc would not get a libxml2-level dictionary, which caused
  2094. problems when deallocating these documents later if they contained a
  2095. node that came from a document with a dictionary.
  2096. * Moving namespaced elements between documents was problematic as
  2097. references to the original document would remain. This has been fixed
  2098. by applying xmlReconciliateNs() after each move operation.
  2099. * Can pass None to 'dump()' without segfaults.
  2100. * tostring() works properly for non-root elements as well.
  2101. * Cleaned out the tostring() method so it should handle encoding
  2102. correctly.
  2103. * Cleaned out the ElementTree.write() method so it should handle encoding
  2104. correctly. Writing directly to a file should also be faster, as there is no
  2105. need to go through a Python string in that case. Made sure the test cases
  2106. test both serializing to StringIO as well as serializing to a real file.
  2107. 0.6 (2005-05-14)
  2108. ================
  2109. Features added
  2110. --------------
  2111. * Changed setup.py so that library_dirs is also guessed. This should
  2112. help with compilation on the Mac OS X platform, where otherwise the
  2113. wrong library (shipping with the OS) could be picked up.
  2114. * Tweaked setup.py so that it picks up the version from version.txt.
  2115. Bugs fixed
  2116. ----------
  2117. * Do the right thing when handling namespaced attributes.
  2118. * fix bug where tostring() moved nodes into new documents. tostring()
  2119. had very nasty side-effects before this fix, sorry!
  2120. 0.5.1 (2005-04-09)
  2121. ==================
  2122. * Python 2.2 compatibility fixes.
  2123. * unicode fixes in Element() and Comment() as well as XML(); unicode
  2124. input wasn't properly being UTF-8 encoded.
  2125. 0.5 (2005-04-08)
  2126. ================
  2127. Initial public release.