CHANGES.txt 120 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374
  1. ==============
  2. lxml changelog
  3. ==============
  4. 4.9.1 (2022-07-01)
  5. ==================
  6. Bugs fixed
  7. ----------
  8. * A crash was resolved when using ``iterwalk()`` (or ``canonicalize()``)
  9. after parsing certain incorrect input. Note that ``iterwalk()`` can crash
  10. on *valid* input parsed with the same parser *after* failing to parse the
  11. incorrect input.
  12. 4.9.0 (2022-06-01)
  13. ==================
  14. Bugs fixed
  15. ----------
  16. * GH#341: The mixin inheritance order in ``lxml.html`` was corrected.
  17. Patch by xmo-odoo.
  18. Other changes
  19. -------------
  20. * Built with Cython 0.29.30 to adapt to changes in Python 3.11 and 3.12.
  21. * Wheels include zlib 1.2.12, libxml2 2.9.14 and libxslt 1.1.35
  22. (libxml2 2.9.12+ and libxslt 1.1.34 on Windows).
  23. * GH#343: Windows-AArch64 build support in Visual Studio.
  24. Patch by Steve Dower.
  25. 4.8.0 (2022-02-17)
  26. ==================
  27. Features added
  28. --------------
  29. * GH#337: Path-like objects are now supported throughout the API instead of just strings.
  30. Patch by Henning Janssen.
  31. * The ``ElementMaker`` now supports ``QName`` values as tags, which always override
  32. the default namespace of the factory.
  33. Bugs fixed
  34. ----------
  35. * GH#338: In lxml.objectify, the XSI float annotation "nan" and "inf" were spelled in
  36. lower case, whereas XML Schema datatypes define them as "NaN" and "INF" respectively.
  37. Patch by Tobias Deiminger.
  38. Other changes
  39. -------------
  40. * Built with Cython 0.29.28.
  41. 4.7.1 (2021-12-13)
  42. ==================
  43. Features added
  44. --------------
  45. * Chunked Unicode string parsing via ``parser.feed()`` now encodes the input data
  46. to the native UTF-8 encoding directly, instead of going through ``Py_UNICODE`` /
  47. ``wchar_t`` encoding first, which previously required duplicate recoding in most cases.
  48. Bugs fixed
  49. ----------
  50. * The standard namespace prefixes were mishandled during "C14N2" serialisation on Python 3.
  51. See https://mail.python.org/archives/list/lxml@python.org/thread/6ZFBHFOVHOS5GFDOAMPCT6HM5HZPWQ4Q/
  52. * ``lxml.objectify`` previously accepted non-XML numbers with underscores (like "1_000")
  53. as integers or float values in Python 3.6 and later. It now adheres to the number
  54. format of the XML spec again.
  55. * LP#1939031: Static wheels of lxml now contain the header files of zlib and libiconv
  56. (in addition to the already provided headers of libxml2/libxslt/libexslt).
  57. Other changes
  58. -------------
  59. * Wheels include libxml2 2.9.12+ and libxslt 1.1.34 (also on Windows).
  60. 4.7.0 (2021-12-13)
  61. ==================
  62. * Release retracted due to missing files in lxml/includes/.
  63. 4.6.5 (2021-12-12)
  64. ==================
  65. Bugs fixed
  66. ----------
  67. * A vulnerability (GHSL-2021-1038) in the HTML cleaner allowed sneaking script
  68. content through SVG images (CVE-2021-43818).
  69. * A vulnerability (GHSL-2021-1037) in the HTML cleaner allowed sneaking script
  70. content through CSS imports and other crafted constructs (CVE-2021-43818).
  71. 4.6.4 (2021-11-01)
  72. ==================
  73. Features added
  74. --------------
  75. * GH#317: A new property ``system_url`` was added to DTD entities.
  76. Patch by Thirdegree.
  77. * GH#314: The ``STATIC_*`` variables in ``setup.py`` can now be passed via env vars.
  78. Patch by Isaac Jurado.
  79. 4.6.3 (2021-03-21)
  80. ==================
  81. Bugs fixed
  82. ----------
  83. * A vulnerability (CVE-2021-28957) was discovered in the HTML Cleaner by Kevin Chung,
  84. which allowed JavaScript to pass through. The cleaner now removes the HTML5
  85. ``formaction`` attribute.
  86. 4.6.2 (2020-11-26)
  87. ==================
  88. Bugs fixed
  89. ----------
  90. * A vulnerability (CVE-2020-27783) was discovered in the HTML Cleaner by Yaniv Nizry,
  91. which allowed JavaScript to pass through. The cleaner now removes more sneaky
  92. "style" content.
  93. 4.6.1 (2020-10-18)
  94. ==================
  95. Bugs fixed
  96. ----------
  97. * A vulnerability was discovered in the HTML Cleaner by Yaniv Nizry, which allowed
  98. JavaScript to pass through. The cleaner now removes more sneaky "style" content.
  99. 4.6.0 (2020-10-17)
  100. ==================
  101. Features added
  102. --------------
  103. * GH#310: ``lxml.html.InputGetter`` supports ``__len__()`` to count the number of input fields.
  104. Patch by Aidan Woolley.
  105. * ``lxml.html.InputGetter`` has a new ``.items()`` method to ease processing all input fields.
  106. * ``lxml.html.InputGetter.keys()`` now returns the field names in document order.
  107. * GH-309: The API documentation is now generated using ``sphinx-apidoc``.
  108. Patch by Chris Mayo.
  109. Bugs fixed
  110. ----------
  111. * LP#1869455: C14N 2.0 serialisation failed for unprefixed attributes
  112. when a default namespace was defined.
  113. * ``TreeBuilder.close()`` raised ``AssertionError`` in some error cases where it
  114. should have raised ``XMLSyntaxError``. It now raises a combined exception to
  115. keep up backwards compatibility, while switching to ``XMLSyntaxError`` as an
  116. interface.
  117. 4.5.2 (2020-07-09)
  118. ==================
  119. Bugs fixed
  120. ----------
  121. * ``Cleaner()`` now validates that only known configuration options can be set.
  122. * LP#1882606: ``Cleaner.clean_html()`` discarded comments and PIs regardless of the
  123. corresponding configuration option, if ``remove_unknown_tags`` was set.
  124. * LP#1880251: Instead of globally overwriting the document loader in libxml2, lxml now
  125. sets it per parser run, which improves the interoperability with other users of libxml2
  126. such as libxmlsec.
  127. * LP#1881960: Fix build in CPython 3.10 by using Cython 0.29.21.
  128. * The setup options "--with-xml2-config" and "--with-xslt-config" were accidentally renamed
  129. to "--xml2-config" and "--xslt-config" in 4.5.1 and are now available again.
  130. 4.5.1 (2020-05-19)
  131. ==================
  132. Bugs fixed
  133. ----------
  134. * LP#1570388: Fix failures when serialising documents larger than 2GB in some cases.
  135. * LP#1865141, GH#298: ``QName`` values were not accepted by the ``el.iter()`` method.
  136. Patch by xmo-odoo.
  137. * LP#1863413, GH#297: The build failed to detect libraries on Linux that are only
  138. configured via pkg-config.
  139. Patch by Hugh McMaster.
  140. 4.5.0 (2020-01-29)
  141. ==================
  142. Features added
  143. --------------
  144. * A new function ``indent()`` was added to insert tail whitespace for pretty-printing
  145. an XML tree.
  146. Bugs fixed
  147. ----------
  148. * LP#1857794: Tail text of nodes that get removed from a document using item
  149. deletion disappeared silently instead of sticking with the node that was removed.
  150. Other changes
  151. -------------
  152. * MacOS builds are 64-bit-only by default.
  153. Set CFLAGS and LDFLAGS explicitly to override it.
  154. * Linux/MacOS Binary wheels now use libxml2 2.9.10 and libxslt 1.1.34.
  155. * LP#1840234: The package version number is now available as ``lxml.__version__``.
  156. 4.4.3 (2020-01-28)
  157. ==================
  158. Bugs fixed
  159. ----------
  160. * LP#1844674: ``itertext()`` was missing tail text of comments and PIs since 4.4.0.
  161. 4.4.2 (2019-11-25)
  162. ==================
  163. Bugs fixed
  164. ----------
  165. * LP#1835708: ``ElementInclude`` incorrectly rejected repeated non-recursive
  166. includes as recursive.
  167. Patch by Rainer Hausdorf.
  168. 4.4.1 (2019-08-11)
  169. ==================
  170. Bugs fixed
  171. ----------
  172. * LP#1838252: The order of an OrderedDict was lost in 4.4.0 when passing it as
  173. attrib mapping during element creation.
  174. * LP#1838521: The package metadata now lists the supported Python versions.
  175. 4.4.0 (2019-07-27)
  176. ==================
  177. Features added
  178. --------------
  179. * ``Element.clear()`` accepts a new keyword argument ``keep_tail=True`` to clear
  180. everything but the tail text. This is helpful in some document-style use cases
  181. and for clearing the current element in ``iterparse()`` and pull parsing.
  182. * When creating attributes or namespaces from a dict in Python 3.6+, lxml now
  183. preserves the original insertion order of that dict, instead of always sorting
  184. the items by name. A similar change was made for ElementTree in CPython 3.8.
  185. See https://bugs.python.org/issue34160
  186. * Integer elements in ``lxml.objectify`` implement the ``__index__()`` special method.
  187. * GH#269: Read-only elements in XSLT were missing the ``nsmap`` property.
  188. Original patch by Jan Pazdziora.
  189. * ElementInclude can now restrict the maximum inclusion depth via a ``max_depth``
  190. argument to prevent content explosion. It is limited to 6 by default.
  191. * The ``target`` object of the XMLParser can have ``start_ns()`` and ``end_ns()``
  192. callback methods to listen to namespace declarations.
  193. * The ``TreeBuilder`` has new arguments ``comment_factory`` and ``pi_factory`` to
  194. pass factories for creating comments and processing instructions, as well as
  195. flag arguments ``insert_comments`` and ``insert_pis`` to discard them from the
  196. tree when set to false.
  197. * A `C14N 2.0 <https://www.w3.org/TR/xml-c14n2/>`_ implementation was added as
  198. ``etree.canonicalize()``, a corresponding ``C14NWriterTarget`` class, and
  199. a ``c14n2`` serialisation method.
  200. Bugs fixed
  201. ----------
  202. * When writing to file paths that contain the URL escape character '%', the file
  203. path could wrongly be mangled by URL unescaping and thus write to a different
  204. file or directory. Code that writes to file paths that are provided by untrusted
  205. sources, but that must work with previous versions of lxml, should best either
  206. reject paths that contain '%' characters, or otherwise make sure that the path
  207. does not contain maliciously injected '%XX' URL hex escapes for paths like '../'.
  208. * Assigning to Element child slices with negative step could insert the slice at
  209. the wrong position, starting too far on the left.
  210. * Assigning to Element child slices with overly large step size could take very
  211. long, regardless of the length of the actual slice.
  212. * Assigning to Element child slices of the wrong size could sometimes fail to
  213. raise a ValueError (like a list assignment would) and instead assign outside
  214. of the original slice bounds or leave parts of it unreplaced.
  215. * The ``comment`` and ``pi`` events in ``iterwalk()`` were never triggered, and
  216. instead, comments and processing instructions in the tree were reported as
  217. ``start`` elements. Also, when walking an ElementTree (as opposed to its root
  218. element), comments and PIs outside of the root element are now reported.
  219. * LP#1827833: The RelaxNG compact syntax support was broken with recent versions
  220. of ``rnc2rng``.
  221. * LP#1758553: The HTML elements ``source`` and ``track`` were added to the list
  222. of empty tags in ``lxml.html.defs``.
  223. * Registering a prefix other than "xml" for the XML namespace is now rejected.
  224. * Failing to write XSLT output to a file could raise a misleading exception.
  225. It now raises ``IOError``.
  226. Other changes
  227. -------------
  228. * Support for Python 3.4 was removed.
  229. * When using ``Element.find*()`` with prefix-namespace mappings, the empty string
  230. is now accepted to define a default namespace, in addition to the previously
  231. supported ``None`` prefix. Empty strings are more convenient since they keep
  232. all prefix keys in a namespace dict strings, which simplifies sorting etc.
  233. * The ``ElementTree.write_c14n()`` method has been deprecated in favour of the
  234. long preferred ``ElementTree.write(f, method="c14n")``. It will be removed
  235. in a future release.
  236. 4.3.5 (2019-07-27)
  237. ==================
  238. * Rebuilt with Cython 0.29.13 to support Python 3.8.
  239. 4.3.4 (2019-06-10)
  240. ==================
  241. * Rebuilt with Cython 0.29.10 to support Python 3.8.
  242. 4.3.3 (2019-03-26)
  243. ==================
  244. Bugs fixed
  245. ----------
  246. * Fix leak of output buffer and unclosed files in ``_XSLTResultTree.write_output()``.
  247. 4.3.2 (2019-02-29)
  248. ==================
  249. Bugs fixed
  250. ----------
  251. * Crash in 4.3.1 when appending a child subtree with certain text nodes.
  252. Other changes
  253. -------------
  254. * Built with Cython 0.29.6.
  255. 4.3.1 (2019-02-08)
  256. ==================
  257. Bugs fixed
  258. ----------
  259. * LP#1814522: Crash when appending a child subtree that contains unsubstituted
  260. entity references.
  261. Other changes
  262. -------------
  263. * Built with Cython 0.29.5.
  264. 4.3.0 (2019-01-04)
  265. ==================
  266. Features added
  267. --------------
  268. * The module ``lxml.sax`` is compiled using Cython in order to speed it up.
  269. * GH#267: ``lxml.sax.ElementTreeProducer`` now preserves the namespace prefixes.
  270. If two prefixes point to the same URI, the first prefix in alphabetical order
  271. is used. Patch by Lennart Regebro.
  272. * Updated ISO-Schematron implementation to 2013 version (now MIT licensed)
  273. and the corresponding schema to the 2016 version (with optional "properties").
  274. Other changes
  275. -------------
  276. * GH#270, GH#271: Support for Python 2.6 and 3.3 was removed.
  277. Patch by hugovk.
  278. * The minimum dependency versions were raised to libxml2 2.9.2 and libxslt 1.1.27,
  279. which were released in 2014 and 2012 respectively.
  280. * Built with Cython 0.29.2.
  281. 4.2.6 (2019-01-02)
  282. ==================
  283. Bugs fixed
  284. ----------
  285. * LP#1799755: Fix a DeprecationWarning in Py3.7+.
  286. * Import warnings in Python 3.6+ were resolved.
  287. 4.2.5 (2018-09-09)
  288. ==================
  289. Bugs fixed
  290. ----------
  291. * Javascript URLs that used URL escaping were not removed by the HTML cleaner.
  292. Security problem found by Omar Eissa. (CVE-2018-19787)
  293. 4.2.4 (2018-08-03)
  294. ==================
  295. Features added
  296. --------------
  297. * GH#259: Allow using ``pkg-config`` for build configuration.
  298. Patch by Patrick Griffis.
  299. Bugs fixed
  300. ----------
  301. * LP#1773749, GH#268: Crash when moving an element to another document with
  302. ``Element.insert()``.
  303. Patch by Alexander Weggerle.
  304. 4.2.3 (2018-06-27)
  305. ==================
  306. Bugs fixed
  307. ----------
  308. * Reverted GH#265: lxml links against zlib as a shared library again.
  309. 4.2.2 (2018-06-22)
  310. ==================
  311. Bugs fixed
  312. ----------
  313. * GH#266: Fix sporadic crash during GC when parse-time schema validation is used
  314. and the parser participates in a reference cycle.
  315. Original patch by Julien Greard.
  316. * GH#265: lxml no longer links against zlib as a shared library, only on static builds.
  317. Patch by Nehal J Wani.
  318. 4.2.1 (2018-03-21)
  319. ==================
  320. Bugs fixed
  321. ----------
  322. * LP#1755825: ``iterwalk()`` failed to return the 'start' event for the initial
  323. element if a tag selector is used.
  324. * LP#1756314: Failure to import 4.2.0 into PyPy due to a missing library symbol.
  325. * LP#1727864, GH#258: Add "-isysroot" linker option on MacOS as needed by XCode 9.
  326. 4.2.0 (2018-03-13)
  327. ==================
  328. Features added
  329. --------------
  330. * GH#255: ``SelectElement.value`` returns more standard-compliant and
  331. browser-like defaults for non-multi-selects. If no option is selected, the
  332. value of the first option is returned (instead of None). If multiple options
  333. are selected, the value of the last one is returned (instead of that of the
  334. first one). If no options are present (not standard-compliant)
  335. ``SelectElement.value`` still returns ``None``.
  336. * GH#261: The ``HTMLParser()`` now supports the ``huge_tree`` option.
  337. Patch by stranac.
  338. Bugs fixed
  339. ----------
  340. * LP#1551797: Some XSLT messages were not captured by the transform error log.
  341. * LP#1737825: Crash at shutdown after an interrupted iterparse run with XMLSchema
  342. validation.
  343. Other changes
  344. -------------
  345. 4.1.1 (2017-11-04)
  346. ==================
  347. * Rebuild with Cython 0.27.3 to improve support for Py3.7.
  348. 4.1.0 (2017-10-13)
  349. ==================
  350. Features added
  351. --------------
  352. * ElementPath supports text predicates for current node, like "[.='text']".
  353. * ElementPath allows spaces in predicates.
  354. * Custom Element classes and XPath functions can now be registered with a
  355. decorator rather than explicit dict assignments.
  356. * Static Linux wheels are now built with link time optimisation (LTO) enabled.
  357. This should have a beneficial impact on the overall performance by providing
  358. a tighter compiler integration between lxml and libxml2/libxslt.
  359. Bugs fixed
  360. ----------
  361. * LP#1722776: Requesting non-Element objects like comments from a document with
  362. ``PythonElementClassLookup`` could fail with a TypeError.
  363. 4.0.0 (2017-09-17)
  364. ==================
  365. Features added
  366. --------------
  367. * The ElementPath implementation is now compiled using Cython,
  368. which speeds up the ``.find*()`` methods quite significantly.
  369. * The modules ``lxml.builder``, ``lxml.html.diff`` and ``lxml.html.clean``
  370. are also compiled using Cython in order to speed them up.
  371. * ``xmlfile()`` supports async coroutines using ``async with`` and ``await``.
  372. * ``iterwalk()`` has a new method ``skip_subtree()`` that prevents walking into
  373. the descendants of the current element.
  374. * ``RelaxNG.from_rnc_string()`` accepts a ``base_url`` argument to
  375. allow relative resource lookups.
  376. * The XSLT result object has a new method ``.write_output(file)`` that serialises
  377. output data into a file according to the ``<xsl:output>`` configuration.
  378. Bugs fixed
  379. ----------
  380. * GH#251: HTML comments were handled incorrectly by the soupparser.
  381. Patch by mozbugbox.
  382. * LP#1654544: The html5parser no longer passes the ``useChardet`` option
  383. if the input is a Unicode string, unless explicitly requested. When parsing
  384. files, the default is to enable it when a URL or file path is passed (because
  385. the file is then opened in binary mode), and to disable it when reading from
  386. a file(-like) object.
  387. Note: This is a backwards incompatible change of the default configuration.
  388. If your code parses byte strings/streams and depends on character detection,
  389. please pass the option ``guess_charset=True`` explicitly, which already worked
  390. in older lxml versions.
  391. * LP#1703810: ``etree.fromstring()`` failed to parse UTF-32 data with BOM.
  392. * LP#1526522: Some RelaxNG errors were not reported in the error log.
  393. * LP#1567526: Empty and plain text input raised a TypeError in soupparser.
  394. * LP#1710429: Uninitialised variable usage in HTML diff.
  395. * LP#1415643: The closing tags context manager in ``xmlfile()`` could continue
  396. to output end tags even after writing failed with an exception.
  397. * LP#1465357: ``xmlfile.write()`` now accepts and ignores None as input argument.
  398. * Compilation under Py3.7-pre failed due to a modified function signature.
  399. Other changes
  400. -------------
  401. * The main module source files were renamed from ``lxml.*.pyx`` to plain
  402. ``*.pyx`` (e.g. ``etree.pyx``) to simplify their handling in the build
  403. process. Care was taken to keep the old header files as fallbacks for
  404. code that compiles against the public C-API of lxml, but it might still
  405. be worth validating that third-party code does not notice this change.
  406. 3.8.0 (2017-06-03)
  407. ==================
  408. Features added
  409. --------------
  410. * ``ElementTree.write()`` has a new option ``doctype`` that writes out a
  411. doctype string before the serialisation, in the same way as ``tostring()``.
  412. * GH#220: ``xmlfile`` allows switching output methods at an element level.
  413. Patch by Burak Arslan.
  414. * LP#1595781, GH#240: added a PyCapsule Python API and C-level API for
  415. passing externally generated libxml2 documents into lxml.
  416. * GH#244: error log entries have a new property ``path`` with an XPath
  417. expression (if known, None otherwise) that points to the tree element
  418. responsible for the error. Patch by Bob Kline.
  419. * The namespace prefix mapping that can be used in ElementPath now injects
  420. a default namespace when passing a None prefix.
  421. Bugs fixed
  422. ----------
  423. * GH#238: Character escapes were not hex-encoded in the ``xmlfile`` serialiser.
  424. Patch by matejcik.
  425. * GH#229: fix for externally created XML documents. Patch by Theodore Dubois.
  426. * LP#1665241, GH#228: Form data handling in lxml.html no longer strips the
  427. option values specified in form attributes but only the text values.
  428. Patch by Ashish Kulkarni.
  429. * LP#1551797: revert previous fix for XSLT error logging as it breaks
  430. multi-threaded XSLT processing.
  431. * LP#1673355, GH#233: ``fromstring()`` html5parser failed to parse byte strings.
  432. Other changes
  433. -------------
  434. * The previously undocumented ``docstring`` option in ``ElementTree.write()``
  435. produces a deprecation warning and will eventually be removed.
  436. 3.7.4 (2017-??-??)
  437. ==================
  438. Bugs fixed
  439. ----------
  440. * LP#1551797: revert previous fix for XSLT error logging as it breaks
  441. multi-threaded XSLT processing.
  442. * LP#1673355, GH#233: ``fromstring()`` html5parser failed to parse byte strings.
  443. 3.7.3 (2017-02-18)
  444. ==================
  445. Bugs fixed
  446. ----------
  447. * GH#218 was ineffective in Python 3.
  448. * GH#222: ``lxml.html.submit_form()`` failed in Python 3.
  449. Patch by Jakub Wilk.
  450. 3.7.2 (2017-01-08)
  451. ==================
  452. * GH#220: ``xmlfile`` allows switching output methods at an element level.
  453. Patch by Burak Arslan.
  454. Bugs fixed
  455. ----------
  456. * Work around installation problems in recent Python 2.7 versions
  457. due to FTP download failures.
  458. * GH#219: ``xmlfile.element()`` was not properly quoting attribute values.
  459. Patch by Burak Arslan.
  460. * GH#218: ``xmlfile.element()`` was not properly escaping text content of
  461. script/style tags. Patch by Burak Arslan.
  462. 3.7.1 (2016-12-23)
  463. ==================
  464. * No source changes, issued only to solve problems with the
  465. binary packages released for 3.7.0.
  466. 3.7.0 (2016-12-10)
  467. ==================
  468. Features added
  469. --------------
  470. * GH#217: ``XMLSyntaxError`` now behaves more like its ``SyntaxError``
  471. baseclass. Patch by Philipp A.
  472. * GH#216: ``HTMLParser()`` now supports the same ``collect_ids`` parameter
  473. as ``XMLParser()``. Patch by Burak Arslan.
  474. * GH#210: Allow specifying a serialisation method in ``xmlfile.write()``.
  475. Patch by Burak Arslan.
  476. * GH#203: New option ``default_doctype`` in ``HTMLParser`` that allows
  477. disabling the automatic doctype creation. Patch by Shadab Zafar.
  478. * GH#201: Calling the method ``.set('attrname')`` without value argument
  479. (or ``None``) on HTML elements creates an attribute without value that
  480. serialises like ``<div attrname></div>``. Patch by Daniel Holth.
  481. * GH#197: Ignore form input fields in ``form_values()`` when they are
  482. marked as ``disabled`` in HTML. Patch by Kristian Klemon.
  483. Bugs fixed
  484. ----------
  485. * GH#206: File name and line number were missing from XSLT error messages.
  486. Patch by Marcus Brinkmann.
  487. Other changes
  488. -------------
  489. * Log entries no longer allow anything but plain string objects as message text
  490. and file name.
  491. * ``zlib`` is included in the list of statically built libraries.
  492. 3.6.4 (2016-08-20)
  493. ==================
  494. * GH#204, LP#1614693: build fix for MacOS-X.
  495. 3.6.3 (2016-08-18)
  496. ==================
  497. * LP#1614603: change linker flags to build multi-linux wheels
  498. 3.6.2 (2016-08-18)
  499. ==================
  500. * LP#1614603: release without source changes to provide cleanly built Linux wheels
  501. 3.6.1 (2016-07-24)
  502. ==================
  503. Features added
  504. --------------
  505. * GH#180: Separate option ``inline_style`` for Cleaner that only removes ``style``
  506. attributes instead of all styles. Patch by Christian Pedersen.
  507. * GH#196: Windows build support for Python 3.5. Contribution by Maximilian Hils.
  508. Bugs fixed
  509. ----------
  510. * GH#199: Exclude ``file`` fields from ``FormElement.form_values`` (as browsers do).
  511. Patch by Tomas Divis.
  512. * GH#198, LP#1568167: Try to provide base URL from ``Resolver.resolve_string()``.
  513. Patch by Michael van Tellingen.
  514. * GH#191: More accurate float serialisation in ``objectify.FloatElement``.
  515. Patch by Holger Joukl.
  516. * LP#1551797: Repair XSLT error logging. Patch by Marcus Brinkmann.
  517. 3.6.0 (2016-03-17)
  518. ==================
  519. Features added
  520. --------------
  521. * GH#187: Now supports (only) version 5.x and later of PyPy.
  522. Patch by Armin Rigo.
  523. * GH#181: Direct support for ``.rnc`` files in `RelaxNG()` if ``rnc2rng``
  524. is installed. Patch by Dirkjan Ochtman.
  525. Bugs fixed
  526. ----------
  527. * GH#189: Static builds honour FTP proxy configurations when downloading
  528. the external libs. Patch by Youhei Sakurai.
  529. * GH#186: Soupparser failed to process entities in Python 3.x.
  530. Patch by Duncan Morris.
  531. * GH#185: Rare encoding related ``TypeError`` on import was fixed.
  532. Patch by Petr Demin.
  533. 3.5.0 (2015-11-13)
  534. ==================
  535. Bugs fixed
  536. ----------
  537. * Unicode string results failed XPath queries in PyPy.
  538. * LP#1497051: HTML target parser failed to terminate on exceptions
  539. and continued parsing instead.
  540. * Deprecated API usage in doctestcompare.
  541. 3.5.0b1 (2015-09-18)
  542. ====================
  543. Features added
  544. --------------
  545. * ``cleanup_namespaces()`` accepts a new argument ``keep_ns_prefixes``
  546. that does not remove definitions of the provided prefix-namespace
  547. mapping from the tree.
  548. * ``cleanup_namespaces()`` accepts a new argument ``top_nsmap`` that
  549. moves definitions of the provided prefix-namespace mapping to the
  550. top of the tree.
  551. * LP#1490451: ``Element`` objects gained a ``cssselect()`` method as
  552. known from ``lxml.html``. Patch by Simon Sapin.
  553. * API functions and methods behave and look more like Python functions,
  554. which allows introspection on them etc. One side effect to be aware of
  555. is that the functions now bind as methods when assigned to a class
  556. variable. A quick fix is to wrap them in ``staticmethod()`` (as for
  557. normal Python functions).
  558. * ISO-Schematron support gained an option ``error_finder`` that allows
  559. passing a filter function for picking validation errors from reports.
  560. * LP#1243600: Elements in ``lxml.html`` gained a ``classes`` property
  561. that provides a set-like interface to the ``class`` attribute.
  562. Original patch by masklinn.
  563. * LP#1341964: The soupparser now handles DOCTYPE declarations, comments
  564. and processing instructions outside of the root element.
  565. Patch by Olli Pottonen.
  566. * LP#1421512: The ``docinfo`` of a tree was made editable to allow
  567. setting and removing the public ID and system ID of the DOCTYPE.
  568. Patch by Olli Pottonen.
  569. * LP#1442427: More work-arounds for quirks and bugs in pypy and pypy3.
  570. * ``lxml.html.soupparser`` now uses BeautifulSoup version 4 instead
  571. of version 3 if available.
  572. Bugs fixed
  573. ----------
  574. * Memory errors that occur during tree adaptations (e.g. moving subtrees
  575. to foreign documents) could leave the tree in a crash prone state.
  576. * Calling ``process_children()`` in an XSLT extension element without
  577. an ``output_parent`` argument failed with a ``TypeError``.
  578. Fix by Jens Tröger.
  579. * GH#162: Image data in HTML ``data`` URLs is considered safe and
  580. no longer removed by ``lxml.html.clean`` JavaScript cleaner.
  581. * GH#166: Static build could link libraries in wrong order.
  582. * GH#172: Rely a bit more on libxml2 for encoding detection rather than
  583. rolling our own in some cases. Patch by Olli Pottonen.
  584. * GH#159: Validity checks for names and string content were tightened
  585. to detect the use of illegal characters early. Patch by Olli Pottonen.
  586. * LP#1421921: Comments/PIs before the DOCTYPE declaration were not
  587. serialised. Patch by Olli Pottonen.
  588. * LP#659367: Some HTML DOCTYPE declarations were not serialised.
  589. Patch by Olli Pottonen.
  590. * LP#1238503: lxml.doctestcompare is now consistent with stdlib's doctest
  591. in how it uses ``+`` and ``-`` to refer to unexpected and missing output.
  592. * Empty prefixes are explicitly rejected when a namespace mapping is used
  593. with ElementPath to avoid hiding bugs in user code.
  594. * Several problems with PyPy were fixed by switching to Cython 0.23.
  595. 3.4.4 (2015-04-25)
  596. ==================
  597. Bugs fixed
  598. ----------
  599. * An ElementTree compatibility test added in lxml 3.4.3 that failed in
  600. Python 3.4+ was removed again.
  601. 3.4.3 (2015-04-15)
  602. ==================
  603. Bugs fixed
  604. ----------
  605. * Expression cache in ElementPath was ignored. Fix by Changaco.
  606. * LP#1426868: Passing a default namespace and a prefixed namespace mapping
  607. as nsmap into ``xmlfile.element()`` raised a ``TypeError``.
  608. * LP#1421927: DOCTYPE system URLs were incorrectly quoted when containing
  609. double quotes. Patch by Olli Pottonen.
  610. * LP#1419354: meta-redirect URLs were incorrectly processed by
  611. ``iterlinks()`` if preceded by whitespace.
  612. 3.4.2 (2015-02-07)
  613. ==================
  614. Bugs fixed
  615. ----------
  616. * LP#1415907: Crash when creating an XMLSchema from a non-root element
  617. of an XML document.
  618. * LP#1369362: HTML cleaning failed when hitting processing instructions
  619. with pseudo-attributes.
  620. * ``CDATA()`` wrapped content was rejected for tail text.
  621. * CDATA sections were not serialised as tail text of the top-level element.
  622. 3.4.1 (2014-11-20)
  623. ==================
  624. Features added
  625. --------------
  626. * New ``htmlfile`` HTML generator to accompany the incremental ``xmlfile``
  627. serialisation API. Patch by Burak Arslan.
  628. Bugs fixed
  629. ----------
  630. * ``lxml.sax.ElementTreeContentHandler`` did not initialise its superclass.
  631. 3.4.0 (2014-09-10)
  632. ==================
  633. Features added
  634. --------------
  635. * ``xmlfile(buffered=False)`` disables output buffering and flushes the
  636. content after each API operation (starting/ending element blocks or writes).
  637. A new method ``xf.flush()`` can alternatively be used to explicitly flush
  638. the output.
  639. * ``lxml.html.document_fromstring`` has a new option ``ensure_head_body=True``
  640. which will add an empty head and/or body element to the result document if
  641. missing.
  642. * ``lxml.html.iterlinks`` now returns links inside meta refresh tags.
  643. * New ``XMLParser`` option ``collect_ids=False`` to disable ID hash table
  644. creation. This can substantially speed up parsing of documents with many
  645. different IDs that are not used.
  646. * The parser uses per-document hash tables for XML IDs. This reduces the
  647. load of the global parser dict and speeds up parsing for documents with
  648. many different IDs.
  649. * ``ElementTree.getelementpath(element)`` returns a structural ElementPath
  650. expression for the given element, which can be used for lookups later.
  651. * ``xmlfile()`` accepts a new argument ``close=True`` to close file(-like)
  652. objects after writing to them. Before, ``xmlfile()`` only closed the file
  653. if it had opened it internally.
  654. * Allow "bytearray" type for ASCII text input.
  655. Bugs fixed
  656. ----------
  657. Other changes
  658. -------------
  659. * LP#400588: decoding errors have become hard errors even in recovery mode.
  660. Previously, they could lead to an internal tree representation in a mixed
  661. encoding state, which lead to very late errors or even silently incorrect
  662. behaviour during tree traversal or serialisation.
  663. * Requires Python 2.6, 2.7, 3.2 or later. No longer supports
  664. Python 2.4, 2.5 and 3.1, use lxml 3.3.x for those.
  665. * Requires libxml2 2.7.0 or later and libxslt 1.1.23 or later,
  666. use lxml 3.3.x with older versions.
  667. 3.3.6 (2014-08-28)
  668. ==================
  669. Bugs fixed
  670. ----------
  671. * Prevent tree cycle creation when adding Elements as siblings.
  672. * LP#1361948: crash when deallocating Element siblings without parent.
  673. * LP#1354652: crash when traversing internally loaded documents in XSLT
  674. extension functions.
  675. 3.3.5 (2014-04-18)
  676. ==================
  677. Bugs fixed
  678. ----------
  679. * HTML cleaning could fail to strip javascript links that mix control
  680. characters into the link scheme.
  681. 3.3.4 (2014-04-03)
  682. ==================
  683. Features added
  684. --------------
  685. * Source line numbers above 65535 are available on Elements when
  686. using libxml2 2.9 or later.
  687. Bugs fixed
  688. ----------
  689. * ``lxml.html.fragment_fromstring()`` failed for bytes input in Py3.
  690. Other changes
  691. -------------
  692. 3.3.3 (2014-03-04)
  693. ==================
  694. Bugs fixed
  695. ----------
  696. * LP#1287118: Crash when using Element subtypes with ``__slots__``.
  697. Other changes
  698. -------------
  699. * The internal classes ``_LogEntry`` and ``_Attrib`` can no longer be
  700. subclassed from Python code.
  701. 3.3.2 (2014-02-26)
  702. ==================
  703. Bugs fixed
  704. ----------
  705. * The properties ``resolvers`` and ``version``, as well as the methods
  706. ``set_element_class_lookup()`` and ``makeelement()``, were lost from
  707. ``iterparse`` objects in 3.3.0.
  708. * LP#1222132: instances of ``XMLSchema``, ``Schematron`` and ``RelaxNG``
  709. did not clear their local ``error_log`` before running a validation.
  710. * LP#1238500: lxml.doctestcompare mixed up "expected" and "actual" in
  711. attribute values.
  712. * Some file I/O tests were failing in MS-Windows due to non-portable temp
  713. file usage. Initial patch by Gabi Davar.
  714. * LP#910014: duplicate IDs in a document were not reported by DTD validation.
  715. * LP#1185332: ``tostring(method="html")`` did not use HTML serialisation
  716. semantics for trailing tail text. Initial patch by Sylvain Viollon.
  717. * LP#1281139: ``.attrib`` value of Comments lost its mutation methods
  718. in 3.3.0. Even though it is empty and immutable, it should still
  719. provide the same interface as that returned for Elements.
  720. 3.3.1 (2014-02-12)
  721. ==================
  722. Features added
  723. --------------
  724. Bugs fixed
  725. ----------
  726. * LP#1014290: HTML documents parsed with ``parser.feed()`` failed to find
  727. elements during tag iteration.
  728. * LP#1273709: Building in PyPy failed due to missing support for
  729. ``PyUnicode_Compare()`` and ``PyByteArray_*()`` in PyPy's C-API.
  730. * LP#1274413: Compilation in MSVC failed due to missing "stdint.h" standard
  731. header file.
  732. * LP#1274118: iterparse() failed to parse BOM prefixed files.
  733. Other changes
  734. -------------
  735. 3.3.0 (2014-01-26)
  736. ==================
  737. Features added
  738. --------------
  739. Bugs fixed
  740. ----------
  741. * The heuristic that distinguishes file paths from URLs was tightened
  742. to produce less false negatives.
  743. Other changes
  744. -------------
  745. 3.3.0beta5 (2014-01-18)
  746. =======================
  747. Features added
  748. --------------
  749. * The PEP 393 unicode parsing support gained a fallback for wchar strings
  750. which might still be somewhat common on Windows systems.
  751. Bugs fixed
  752. ----------
  753. * Several error handling problems were fixed throughout the code base that
  754. could previously lead to exceptions being silently swallowed or not
  755. properly reported.
  756. * The C-API function ``appendChild()`` is now deprecated as it does not
  757. propagate exceptions (its return type is ``void``). The new function
  758. ``appendChildToElement()`` was added as a safe replacement.
  759. * Passing a string into ``fromstringlist()`` raises an exception instead of
  760. parsing the string character by character.
  761. Other changes
  762. -------------
  763. * Document cleanup code was simplified using the new GC features in
  764. Cython 0.20.
  765. 3.3.0beta4 (2014-01-12)
  766. =======================
  767. Features added
  768. --------------
  769. Bugs fixed
  770. ----------
  771. * The (empty) value returned by the ``attrib`` property of Entity and Comment
  772. objects was mutable.
  773. * Element class lookup wasn't available for the new pull parsers or when using
  774. a custom parser target.
  775. * Setting Element attributes on instantiation with both the ``attrib`` argument
  776. and keyword arguments could modify the mapping passed as ``attrib``.
  777. * LP#1266171: DTDs instantiated from internal/external subsets (i.e. through
  778. the docinfo property) lost their attribute declarations.
  779. Other changes
  780. -------------
  781. * Built with Cython 0.20pre (gitrev 012ae82eb) to prepare support for
  782. Python 3.4.
  783. 3.3.0beta3 (2014-01-02)
  784. =======================
  785. Features added
  786. --------------
  787. * Unicode string parsing was optimised for Python 3.3 (PEP 393).
  788. Bugs fixed
  789. ----------
  790. * HTML parsing of Unicode strings could misdecode the input on some platforms.
  791. * Crash in xmlfile() when closing open elements out of order in an error case.
  792. Other changes
  793. -------------
  794. 3.3.0beta2 (2013-12-20)
  795. =======================
  796. Features added
  797. --------------
  798. * ``iterparse()`` supports the ``recover`` option.
  799. Bugs fixed
  800. ----------
  801. * Crash in ``iterparse()`` for HTML parsing.
  802. * Crash in target parsing with attributes.
  803. Other changes
  804. -------------
  805. * The safety check in the read-only tree implementation (e.g. used by
  806. ``PythonElementClassLookup``) raises a more appropriate ``ReferenceError``
  807. for illegal access after tree disposal instead of an ``AssertionError``.
  808. This should only impact test code that specifically checks the original
  809. behaviour.
  810. 3.3.0beta1 (2013-12-12)
  811. =======================
  812. Features added
  813. --------------
  814. * New option ``handle_failures`` in ``make_links_absolute()`` and
  815. ``resolve_base_href()`` (lxml.html) that enables ignoring or
  816. discarding links that fail to parse as URLs.
  817. * New parser classes ``XMLPullParser`` and ``HTMLPullParser`` for
  818. incremental parsing, as implemented for ElementTree in Python 3.4.
  819. * ``iterparse()`` enables recovery mode by default for HTML parsing
  820. (``html=True``).
  821. Bugs fixed
  822. ----------
  823. * LP#1255132: crash when trying to run validation over non-Element (e.g.
  824. comment or PI).
  825. * Error messages in the log and in exception messages that originated
  826. from libxml2 could accidentally be picked up from preceding warnings
  827. instead of the actual error.
  828. * The ``ElementMaker`` in lxml.objectify did not accept a dict as
  829. argument for adding attributes to the element it's building. This
  830. works as in lxml.builder now.
  831. * LP#1228881: ``repr(XSLTAccessControl)`` failed in Python 3.
  832. * Raise ``ValueError`` when trying to append an Element to itself or
  833. to one of its own descendants, instead of running into an infinite
  834. loop.
  835. * LP#1206077: htmldiff discarded whitespace from the output.
  836. * Compressed plain-text serialisation to file-like objects was broken.
  837. * lxml.html.formfill: Fix textarea form filling.
  838. The textarea used to be cleared before the new content was set,
  839. which removed the name attribute.
  840. Other changes
  841. -------------
  842. * Some basic API classes use freelists internally for faster
  843. instantiation. This can speed up some ``iterparse()`` scenarios,
  844. for example.
  845. * ``iterparse()`` was rewritten to use the new ``*PullParser``
  846. classes internally instead of being a parser itself.
  847. 3.2.5 (2014-01-02)
  848. ==================
  849. Features added
  850. --------------
  851. Bugs fixed
  852. ----------
  853. * Crash in xmlfile() when closing open elements out of order in an error case.
  854. * Crash in target parsing with attributes.
  855. * LP#1255132: crash when trying to run validation over non-Element (e.g.
  856. comment or PI).
  857. Other changes
  858. -------------
  859. 3.2.4 (2013-11-07)
  860. ==================
  861. Features added
  862. --------------
  863. Bugs fixed
  864. ----------
  865. * Memory leak when creating an XPath evaluator in a thread.
  866. * LP#1228881: ``repr(XSLTAccessControl)`` failed in Python 3.
  867. * Raise ``ValueError`` when trying to append an Element to itself or
  868. to one of its own descendants.
  869. * LP#1206077: htmldiff discarded whitespace from the output.
  870. * Compressed plain-text serialisation to file-like objects was broken.
  871. Other changes
  872. -------------
  873. 3.2.3 (2013-07-28)
  874. ==================
  875. Bugs fixed
  876. ----------
  877. * Fix support for Python 2.4 which was lost in 3.2.2.
  878. 3.2.2 (2013-07-28)
  879. ==================
  880. Features added
  881. --------------
  882. Bugs fixed
  883. ----------
  884. * LP#1185701: spurious XMLSyntaxError after finishing iterparse().
  885. * Crash in lxml.objectify during xsi annotation.
  886. Other changes
  887. -------------
  888. * Return values of user provided element class lookup methods are now
  889. validated against the type of the XML node they represent to prevent
  890. API class mismatches.
  891. 3.2.1 (2013-05-11)
  892. ==================
  893. Features added
  894. --------------
  895. * The methods ``apply_templates()`` and ``process_children()`` of XSLT
  896. extension elements have gained two new boolean options ``elements_only``
  897. and ``remove_blank_text`` that discard either all strings or whitespace-only
  898. strings from the result list.
  899. Bugs fixed
  900. ----------
  901. * When moving Elements to another tree, the namespace cleanup mechanism
  902. no longer drops namespace prefixes from attributes for which it finds
  903. a default namespace declaration, to prevent them from appearing as
  904. unnamespaced attributes after serialisation.
  905. * Returning non-type objects from a custom class lookup method could lead
  906. to a crash.
  907. * Instantiating and using subtypes of Comments and ProcessingInstructions
  908. crashed.
  909. Other changes
  910. -------------
  911. 3.2.0 (2013-04-28)
  912. ==================
  913. Features added
  914. --------------
  915. Bugs fixed
  916. ----------
  917. * LP#690319: Leading whitespace could change the behaviour of the string
  918. parsing functions in ``lxml.html``.
  919. * LP#599318: The string parsing functions in ``lxml.html`` are more robust
  920. in the face of uncommon HTML content like framesets or missing body tags.
  921. Patch by Stefan Seelmann.
  922. * LP#712941: I/O errors while trying to access files with paths that contain
  923. non-ASCII characters could raise ``UnicodeDecodeError`` instead of properly
  924. reporting the ``IOError``.
  925. * LP#673205: Parsing from in-memory strings disabled network access in the
  926. default parser and made subsequent attempts to parse from a URL fail.
  927. * LP#971754: lxml.html.clean appends 'nofollow' to 'rel' attributes instead
  928. of overwriting the current value.
  929. * LP#715687: lxml.html.clean no longer discards scripts that are explicitly
  930. allowed by the user provided whitelist. Patch by Christine Koppelt.
  931. Other changes
  932. -------------
  933. 3.1.2 (2013-04-12)
  934. ==================
  935. Features added
  936. --------------
  937. Bugs fixed
  938. ----------
  939. * LP#1136509: Passing attributes through the namespace-unaware API of
  940. the sax bridge (i.e. the ``handler.startElement()`` method) failed
  941. with a ``TypeError``. Patch by Mike Bayer.
  942. * LP#1123074: Fix serialisation error in XSLT output when converting
  943. the result tree to a Unicode string.
  944. * GH#105: Replace illegal usage of ``xmlBufLength()`` in libxml2 2.9.0
  945. by properly exported API function ``xmlBufUse()``.
  946. Other changes
  947. -------------
  948. 3.1.1 (2013-03-29)
  949. ==================
  950. Features added
  951. --------------
  952. Bugs fixed
  953. ----------
  954. * LP#1160386: Write access to ``lxml.html.FormElement.fields`` raised
  955. an AttributeError in Py3.
  956. * Illegal memory access during cleanup in incremental xmlfile writer.
  957. Other changes
  958. -------------
  959. * The externally useless class ``lxml.etree._BaseParser`` was removed
  960. from the module dict.
  961. 3.1.0 (2013-02-10)
  962. ==================
  963. Features added
  964. --------------
  965. * GH#89: lxml.html.clean allows overriding the set of attributes that it
  966. considers 'safe'. Patch by Francis Devereux.
  967. Bugs fixed
  968. ----------
  969. * LP#1104370: ``copy.copy(el.attrib)`` raised an exception. It now returns
  970. a copy of the attributes as a plain Python dict.
  971. * GH#95: When used with namespace prefixes, the ``el.find*()`` methods
  972. always used the first namespace mapping that was provided for each
  973. path expression instead of using the one that was actually passed
  974. in for the current run.
  975. * LP#1092521, GH#91: Fix undefined C symbol in Python runtimes compiled
  976. without threading support. Patch by Ulrich Seidl.
  977. Other changes
  978. -------------
  979. 3.1beta1 (2012-12-21)
  980. =====================
  981. Features added
  982. --------------
  983. * New build-time option ``--with-unicode-strings`` for Python 2 that
  984. makes the API always return Unicode strings for names and text
  985. instead of byte strings for plain ASCII content.
  986. * New incremental XML file writing API ``etree.xmlfile()``.
  987. * E factory in lxml.objectify is callable to simplify the creation of
  988. tags with non-identifier names without having to resort to getattr().
  989. Bugs fixed
  990. ----------
  991. * When starting from a non-namespaced element in lxml.objectify, searching
  992. for a child without explicitly specifying a namespace incorrectly found
  993. namespaced elements with the requested local name, instead of restricting
  994. the search to non-namespaced children.
  995. * GH#85: Deprecation warnings were fixed for Python 3.x.
  996. * GH#33: lxml.html.fromstring() failed to accept bytes input in Py3.
  997. * LP#1080792: Static build of libxml2 2.9.0 failed due to missing file.
  998. Other changes
  999. -------------
  1000. * The externally useless class ``_ObjectifyElementMakerCaller`` was
  1001. removed from the module API of lxml.objectify.
  1002. * LP#1075622: lxml.builder is faster for adding text to elements with
  1003. many children. Patch by Anders Hammarquist.
  1004. 3.0.2 (2012-12-14)
  1005. ==================
  1006. Features added
  1007. --------------
  1008. Bugs fixed
  1009. ----------
  1010. * Fix crash during interpreter shutdown by switching to Cython 0.17.3 for building.
  1011. Other changes
  1012. -------------
  1013. 3.0.1 (2012-10-14)
  1014. ==================
  1015. Features added
  1016. --------------
  1017. Bugs fixed
  1018. ----------
  1019. * LP#1065924: Element proxies could disappear during garbage collection
  1020. in PyPy without proper cleanup.
  1021. * GH#71: Failure to work with libxml2 2.6.x.
  1022. * LP#1065139: static MacOS-X build failed in Py3.
  1023. Other changes
  1024. -------------
  1025. 3.0 (2012-10-08)
  1026. ================
  1027. Features added
  1028. --------------
  1029. Bugs fixed
  1030. ----------
  1031. * End-of-file handling was incorrect in iterparse() when reading from
  1032. a low-level C file stream and failed in libxml2 2.9.0 due to its
  1033. improved consistency checks.
  1034. Other changes
  1035. -------------
  1036. * The build no longer uses Cython by default unless the generated C files
  1037. are missing. To use Cython, pass the option "--with-cython". To ignore
  1038. the fatal build error when Cython is required but not available (e.g. to
  1039. run special setup.py commands that do not actually run a build), pass
  1040. "--without-cython".
  1041. 3.0beta1 (2012-09-26)
  1042. =====================
  1043. Features added
  1044. --------------
  1045. * Python level access to (optional) libxml2 memory debugging features
  1046. to simplify debugging of memory leaks etc.
  1047. Bugs fixed
  1048. ----------
  1049. * Fix a memory leak in XPath by switching to Cython 0.17.1.
  1050. * Some tests were adapted to work with PyPy.
  1051. Other changes
  1052. -------------
  1053. * The code was adapted to work with the upcoming libxml2 2.9.0 release.
  1054. 3.0alpha2 (2012-08-23)
  1055. ======================
  1056. Features added
  1057. --------------
  1058. * The ``.iter()`` method of elements now accepts ``tag`` arguments like
  1059. ``"{*}name"`` to search for elements with a given local name in any
  1060. namespace. With this addition, all combinations of wildcards now work
  1061. as expected:
  1062. ``"{ns}name"``, ``"{}name"``, ``"{*}name"``, ``"{ns}*"``, ``"{}*"``
  1063. and ``"{*}*"``. Note that ``"name"`` is equivalent to ``"{}name"``,
  1064. but ``"*"`` is ``"{*}*"``.
  1065. The same change applies to the ``.getiterator()``, ``.itersiblings()``,
  1066. ``.iterancestors()``, ``.iterdescendants()``, ``.iterchildren()``
  1067. and ``.itertext()`` methods;the ``strip_attributes()``,
  1068. ``strip_elements()`` and ``strip_tags()`` functions as well as the
  1069. ``iterparse()`` class. Patch by Simon Sapin.
  1070. * C14N allows specifying the inclusive prefixes to be promoted
  1071. to top-level during exclusive serialisation.
  1072. Bugs fixed
  1073. ----------
  1074. * Passing long Unicode strings into the ``feed()`` parser interface
  1075. failed to read the entire string.
  1076. Other changes
  1077. -------------
  1078. 3.0alpha1 (2012-07-31)
  1079. ======================
  1080. Features added
  1081. --------------
  1082. * Initial support for building in PyPy (through cpyext).
  1083. * DTD objects gained an API that allows read access to their
  1084. declarations.
  1085. * ``xpathgrep.py`` gained support for parsing line-by-line (e.g.
  1086. from grep output) and for surrounding the output with a new root
  1087. tag.
  1088. * ``E-factory`` in ``lxml.builder`` accepts subtypes of known data
  1089. types (such as string subtypes) when building elements around them.
  1090. * Tree iteration and ``iterparse()`` with a selective ``tag``
  1091. argument supports passing a set of tags. Tree nodes will be
  1092. returned by the iterators if they match any of the tags.
  1093. Bugs fixed
  1094. ----------
  1095. * The ``.find*()`` methods in ``lxml.objectify`` no longer use XPath
  1096. internally, which makes them faster in many cases (especially when
  1097. short circuiting after a single or couple of elements) and fixes
  1098. some behavioural differences compared to ``lxml.etree``. Note that
  1099. this means that they no longer support arbitrary XPath expressions
  1100. but only the subset that the ``ElementPath`` language supports.
  1101. The previous implementation was also redundant with the normal
  1102. XPath support, which can be used as a replacement.
  1103. * ``el.find('*')`` could accidentally return a comment or processing
  1104. instruction that happened to be in the wrong spot. (Same for the
  1105. other ``.find*()`` methods.)
  1106. * The error logging is less intrusive and avoids a global setup where
  1107. possible.
  1108. * Fixed undefined names in html5lib parser.
  1109. * ``xpathgrep.py`` did not work in Python 3.
  1110. * ``Element.attrib.update()`` did not accept an ``attrib`` of
  1111. another Element as parameter.
  1112. * For subtypes of ``ElementBase`` that make the ``.text`` or ``.tail``
  1113. properties immutable (as in objectify, for example), inserting text
  1114. when creating Elements through the E-Factory feature of the class
  1115. constructor would fail with an exception, stating that the text
  1116. cannot be modified.
  1117. Other changes
  1118. --------------
  1119. * The code base was overhauled to properly use 'const' where the API
  1120. of libxml2 and libxslt requests it. This also has an impact on the
  1121. public C-API of lxml itself, as defined in ``etreepublic.pxd``, as
  1122. well as the provided declarations in the ``lxml/includes/`` directory.
  1123. Code that uses these declarations may have to be adapted. On the
  1124. plus side, this fixes several C compiler warnings, also for user
  1125. code, thus making it easier to spot real problems again.
  1126. * The functionality of "lxml.cssselect" was moved into a separate PyPI
  1127. package called "cssselect". To continue using it, you must install
  1128. that package separately. The "lxml.cssselect" module is still
  1129. available and provides the same interface, provided the "cssselect"
  1130. package can be imported at runtime.
  1131. * Element attributes passed in as an ``attrib`` dict or as keyword
  1132. arguments are now sorted by (namespaced) name before being created
  1133. to make their order predictable for serialisation and iteration.
  1134. Note that adding or deleting attributes afterwards does not take
  1135. that order into account, i.e. setting a new attribute appends it
  1136. after the existing ones.
  1137. * Several classes that are for internal use only were removed
  1138. from the ``lxml.etree`` module dict:
  1139. ``_InputDocument, _ResolverRegistry, _ResolverContext, _BaseContext,
  1140. _ExsltRegExp, _IterparseContext, _TempStore, _ExceptionContext,
  1141. __ContentOnlyElement, _AttribIterator, _NamespaceRegistry,
  1142. _ClassNamespaceRegistry, _FunctionNamespaceRegistry,
  1143. _XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
  1144. _FileReaderContext, _ParserContext, _PythonSaxParserTarget,
  1145. _TargetParserContext, _ReadOnlyProxy, _ReadOnlyPIProxy,
  1146. _ReadOnlyEntityProxy, _ReadOnlyElementProxy, _OpaqueNodeWrapper,
  1147. _OpaqueDocumentWrapper, _ModifyContentOnlyProxy,
  1148. _ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
  1149. _AppendOnlyElementProxy, _SaxParserContext, _FilelikeWriter,
  1150. _ParserSchemaValidationContext, _XPathContext,
  1151. _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam``
  1152. * Several internal classes can no longer be inherited from:
  1153. ``_InputDocument, _ResolverRegistry, _ExsltRegExp, _ElementUnicodeResult,
  1154. _IterparseContext, _TempStore, _AttribIterator, _ClassNamespaceRegistry,
  1155. _XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
  1156. _FileReaderContext, _PythonSaxParserTarget, _TargetParserContext,
  1157. _ReadOnlyPIProxy, _ReadOnlyEntityProxy, _OpaqueDocumentWrapper,
  1158. _ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
  1159. _AppendOnlyElementProxy, _FilelikeWriter, _ParserSchemaValidationContext,
  1160. _XPathContext, _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam,
  1161. _XSLTResultTree, _XSLTProcessingInstruction``
  1162. 2.3.6 (2012-09-28)
  1163. ==================
  1164. Features added
  1165. --------------
  1166. Bugs fixed
  1167. ----------
  1168. * Passing long Unicode strings into the ``feed()`` parser interface
  1169. failed to read the entire string.
  1170. Other changes
  1171. --------------
  1172. 2.3.5 (2012-07-31)
  1173. ==================
  1174. Features added
  1175. --------------
  1176. Bugs fixed
  1177. ----------
  1178. * Crash when merging text nodes in ``element.remove()``.
  1179. * Crash in sax/target parser when reporting empty doctype.
  1180. Other changes
  1181. --------------
  1182. 2.3.4 (2012-03-26)
  1183. ==================
  1184. Features added
  1185. --------------
  1186. Bugs fixed
  1187. ----------
  1188. * Crash when building an nsmap (Element property) with empty
  1189. namespace URIs.
  1190. * Crash due to race condition when errors (or user messages) occur
  1191. during threaded XSLT processing.
  1192. * XSLT stylesheet compilation could ignore compilation errors.
  1193. Other changes
  1194. --------------
  1195. 2.3.3 (2012-01-04)
  1196. ==================
  1197. Features added
  1198. --------------
  1199. * ``lxml.html.tostring()`` gained new serialisation options
  1200. ``with_tail`` and ``doctype``.
  1201. Bugs fixed
  1202. ----------
  1203. * Fixed a crash when using ``iterparse()`` for HTML parsing and
  1204. requesting start events.
  1205. * Fixed parsing of more selectors in cssselect. Whitespace before
  1206. pseudo-elements and pseudo-classes is significant as it is a
  1207. descendant combinator.
  1208. "E :pseudo" should parse the same as "E \*:pseudo", not "E:pseudo".
  1209. Patch by Simon Sapin.
  1210. * lxml.html.diff no longer raises an exception when hitting
  1211. 'img' tags without 'src' attribute.
  1212. Other changes
  1213. --------------
  1214. 2.3.2 (2011-11-11)
  1215. ==================
  1216. Features added
  1217. --------------
  1218. * ``lxml.objectify.deannotate()`` has a new boolean option
  1219. ``cleanup_namespaces`` to remove the objectify namespace
  1220. declarations (and generally clean up the namespace declarations)
  1221. after removing the type annotations.
  1222. * ``lxml.objectify`` gained its own ``SubElement()`` function as a
  1223. copy of ``etree.SubElement`` to avoid an otherwise redundant import
  1224. of ``lxml.etree`` on the user side.
  1225. Bugs fixed
  1226. ----------
  1227. * Fixed the "descendant" bug in cssselect a second time (after a first
  1228. fix in lxml 2.3.1). The previous change resulted in a serious
  1229. performance regression for the XPath based evaluation of the
  1230. translated expression. Note that this breaks the usage of some of
  1231. the generated XPath expressions as XSLT location paths that
  1232. previously worked in 2.3.1.
  1233. * Fixed parsing of some selectors in cssselect. Whitespace after combinators
  1234. ">", "+" and "~" is now correctly ignored. Previously it was parsed as
  1235. a descendant combinator. For example, "div> .foo" was parsed the same as
  1236. "div>* .foo" instead of "div>.foo". Patch by Simon Sapin.
  1237. Other changes
  1238. --------------
  1239. 2.3.1 (2011-09-25)
  1240. ==================
  1241. Features added
  1242. --------------
  1243. * New option ``kill_tags`` in ``lxml.html.clean`` to remove specific
  1244. tags and their content (i.e. their whole subtree).
  1245. * ``pi.get()`` and ``pi.attrib`` on processing instructions to parse
  1246. pseudo-attributes from the text content of processing instructions.
  1247. * ``lxml.get_include()`` returns a list of include paths that can be
  1248. used to compile external C code against lxml.etree. This is
  1249. specifically required for statically linked lxml builds when code
  1250. needs to compile against the exact same header file versions as lxml
  1251. itself.
  1252. * ``Resolver.resolve_file()`` takes an additional option
  1253. ``close_file`` that configures if the file(-like) object will be
  1254. closed after reading or not. By default, the file will be closed,
  1255. as the user is not expected to keep a reference to it.
  1256. Bugs fixed
  1257. ----------
  1258. * HTML cleaning didn't remove 'data:' links.
  1259. * The html5lib parser integration now uses the 'official'
  1260. implementation in html5lib itself, which makes it work with newer
  1261. releases of the library.
  1262. * In ``lxml.sax``, ``endElementNS()`` could incorrectly reject a plain
  1263. tag name when the corresponding start event inferred the same plain
  1264. tag name to be in the default namespace.
  1265. * When an open file-like object is passed into ``parse()`` or
  1266. ``iterparse()``, the parser will no longer close it after use. This
  1267. reverts a change in lxml 2.3 where all files would be closed. It is
  1268. the users responsibility to properly close the file(-like) object,
  1269. also in error cases.
  1270. * Assertion error in lxml.html.cleaner when discarding top-level elements.
  1271. * In lxml.cssselect, use the xpath 'A//B' (short for
  1272. 'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for
  1273. the css descendant selector ('A B'). This makes a few edge cases
  1274. like ``"div *:last-child"`` consistent with the selector behavior in
  1275. WebKit and Firefox, and makes more css expressions valid location
  1276. paths (for use in xsl:template match).
  1277. * In lxml.html, non-selected ``<option>`` tags no longer show up in the
  1278. collected form values.
  1279. * Adding/removing ``<option>`` values to/from a multiple select form
  1280. field properly selects them and unselects them.
  1281. Other changes
  1282. --------------
  1283. * Static builds can specify the download directory with the
  1284. ``--download-dir`` option.
  1285. 2.3 (2011-02-06)
  1286. ================
  1287. Features added
  1288. --------------
  1289. * When looking for children, ``lxml.objectify`` takes '{}tag' as
  1290. meaning an empty namespace, as opposed to the parent namespace.
  1291. Bugs fixed
  1292. ----------
  1293. * When finished reading from a file-like object, the parser
  1294. immediately calls its ``.close()`` method.
  1295. * When finished parsing, ``iterparse()`` immediately closes the input
  1296. file.
  1297. * Work-around for libxml2 bug that can leave the HTML parser in a
  1298. non-functional state after parsing a severely broken document (fixed
  1299. in libxml2 2.7.8).
  1300. * ``marque`` tag in HTML cleanup code is correctly named ``marquee``.
  1301. Other changes
  1302. --------------
  1303. * Some public functions in the Cython-level C-API have more explicit
  1304. return types.
  1305. 2.3beta1 (2010-09-06)
  1306. =====================
  1307. Features added
  1308. --------------
  1309. Bugs fixed
  1310. ----------
  1311. * Crash in newer libxml2 versions when moving elements between
  1312. documents that had attributes on replaced XInclude nodes.
  1313. * ``XMLID()`` function was missing the optional ``parser`` and
  1314. ``base_url`` parameters.
  1315. * Searching for wildcard tags in ``iterparse()`` was broken in Py3.
  1316. * ``lxml.html.open_in_browser()`` didn't work in Python 3 due to the
  1317. use of os.tempnam. It now takes an optional 'encoding' parameter.
  1318. Other changes
  1319. --------------
  1320. 2.3alpha2 (2010-07-24)
  1321. ======================
  1322. Features added
  1323. --------------
  1324. Bugs fixed
  1325. ----------
  1326. * Crash in XSLT when generating text-only result documents with a
  1327. stylesheet created in a different thread.
  1328. Other changes
  1329. --------------
  1330. * ``repr()`` of Element objects shows the hex ID with leading 0x
  1331. (following ElementTree 1.3).
  1332. 2.3alpha1 (2010-06-19)
  1333. ======================
  1334. Features added
  1335. --------------
  1336. * Keyword argument ``namespaces`` in ``lxml.cssselect.CSSSelector()``
  1337. to pass a prefix-to-namespace mapping for the selector.
  1338. * New function ``lxml.etree.register_namespace(prefix, uri)`` that
  1339. globally registers a namespace prefix for a namespace that newly
  1340. created Elements in that namespace will use automatically. Follows
  1341. ElementTree 1.3.
  1342. * Support 'unicode' string name as encoding parameter in
  1343. ``tostring()``, following ElementTree 1.3.
  1344. * Support 'c14n' serialisation method in ``ElementTree.write()`` and
  1345. ``tostring()``, following ElementTree 1.3.
  1346. * The ElementPath expression syntax (``el.find*()``) was extended to
  1347. match the upcoming ElementTree 1.3 that will ship in the standard
  1348. library of Python 3.2/2.7. This includes extended support for
  1349. predicates as well as namespace prefixes (as known from XPath).
  1350. * During regular XPath evaluation, various ESXLT functions are
  1351. available within their namespace when using libxslt 1.1.26 or later.
  1352. * Support passing a readily configured logger instance into
  1353. ``PyErrorLog``, instead of a logger name.
  1354. * On serialisation, the new ``doctype`` parameter can be used to
  1355. override the DOCTYPE (internal subset) of the document.
  1356. * New parameter ``output_parent`` to ``XSLTExtension.apply_templates()``
  1357. to append the resulting content directly to an output element.
  1358. * ``XSLTExtension.process_children()`` to process the content of the
  1359. XSLT extension element itself.
  1360. * ISO-Schematron support based on the de-facto Schematron reference
  1361. 'skeleton implementation'.
  1362. * XSLT objects now take XPath object as ``__call__`` stylesheet
  1363. parameters.
  1364. * Enable path caching in ElementPath (``el.find*()``) to avoid parsing
  1365. overhead.
  1366. * Setting the value of a namespaced attribute always uses a prefixed
  1367. namespace instead of the default namespace even if both declare the
  1368. same namespace URI. This avoids serialisation problems when an
  1369. attribute from a default namespace is set on an element from a
  1370. different namespace.
  1371. * XSLT extension elements: support for XSLT context nodes other than
  1372. elements: document root, comments, processing instructions.
  1373. * Support for strings (in addition to Elements) in node-sets returned
  1374. by extension functions.
  1375. * Forms that lack an ``action`` attribute default to the base URL of
  1376. the document on submit.
  1377. * XPath attribute result strings have an ``attrname`` property.
  1378. * Namespace URIs get validated against RFC 3986 at the API level
  1379. (required by the XML namespace specification).
  1380. * Target parsers show their target object in the ``.target`` property
  1381. (compatible with ElementTree).
  1382. Bugs fixed
  1383. ----------
  1384. * API is hardened against invalid proxy instances to prevent crashes
  1385. due to incorrectly instantiated Element instances.
  1386. * Prevent crash when instantiating ``CommentBase`` and friends.
  1387. * Export ElementTree compatible XML parser class as
  1388. ``XMLTreeBuilder``, as it is called in ET 1.2.
  1389. * ObjectifiedDataElements in lxml.objectify were not hashable. They
  1390. now use the hash value of the underlying Python value (string,
  1391. number, etc.) to which they compare equal.
  1392. * Parsing broken fragments in lxml.html could fail if the fragment
  1393. contained an orphaned closing '</div>' tag.
  1394. * Using XSLT extension elements around the root of the output document
  1395. crashed.
  1396. * ``lxml.cssselect`` did not distinguish between ``x[attr="val"]`` and
  1397. ``x [attr="val"]`` (with a space). The latter now matches the
  1398. attribute independent of the element.
  1399. * Rewriting multiple links inside of HTML text content could end up
  1400. replacing unrelated content as replacements could impact the
  1401. reported position of subsequent matches. Modifications are now
  1402. simplified by letting the ``iterlinks()`` generator in ``lxml.html``
  1403. return links in reversed order if they appear inside the same text
  1404. node. Thus, replacements and link-internal modifications no longer
  1405. change the position of links reported afterwards.
  1406. * The ``.value`` attribute of ``textarea`` elements in lxml.html did
  1407. not represent the complete raw value (including child tags etc.). It
  1408. now serialises the complete content on read and replaces the
  1409. complete content by a string on write.
  1410. * Target parser didn't call ``.close()`` on the target object if
  1411. parsing failed. Now it is guaranteed that ``.close()`` will be
  1412. called after parsing, regardless of the outcome.
  1413. Other changes
  1414. -------------
  1415. * Official support for Python 3.1.2 and later.
  1416. * Static MS Windows builds can now download their dependencies
  1417. themselves.
  1418. * ``Element.attrib`` no longer uses a cyclic reference back to its
  1419. Element object. It therefore no longer requires the garbage
  1420. collector to clean up.
  1421. * Static builds include libiconv, in addition to libxml2 and libxslt.
  1422. 2.2.8 (2010-09-02)
  1423. ==================
  1424. Bugs fixed
  1425. ----------
  1426. * Crash in newer libxml2 versions when moving elements between
  1427. documents that had attributes on replaced XInclude nodes.
  1428. * Import fix for urljoin in Python 3.1+.
  1429. 2.2.7 (2010-07-24)
  1430. ==================
  1431. Bugs fixed
  1432. ----------
  1433. * Crash in XSLT when generating text-only result documents with a
  1434. stylesheet created in a different thread.
  1435. 2.2.6 (2010-03-02)
  1436. ==================
  1437. Bugs fixed
  1438. ----------
  1439. * Fixed several Python 3 regressions by building with Cython 0.11.3.
  1440. 2.2.5 (2010-02-28)
  1441. ==================
  1442. Features added
  1443. --------------
  1444. * Support for running XSLT extension elements on the input root node
  1445. (e.g. in a template matching on "/").
  1446. Bugs fixed
  1447. ----------
  1448. * Crash in XPath evaluation when reading smart strings from a document
  1449. other than the original context document.
  1450. * Support recent versions of html5lib by not requiring its
  1451. ``XHTMLParser`` in ``htmlparser.py`` anymore.
  1452. * Manually instantiating the custom element classes in
  1453. ``lxml.objectify`` could crash.
  1454. * Invalid XML text characters were not rejected by the API when they
  1455. appeared in unicode strings directly after non-ASCII characters.
  1456. * lxml.html.open_http_urllib() did not work in Python 3.
  1457. * The functions ``strip_tags()`` and ``strip_elements()`` in
  1458. ``lxml.etree`` did not remove all occurrences of a tag in all cases.
  1459. * Crash in XSLT extension elements when the XSLT context node is not
  1460. an element.
  1461. 2.2.4 (2009-11-11)
  1462. ==================
  1463. Bugs fixed
  1464. ----------
  1465. * Static build of libxml2/libxslt was broken.
  1466. 2.2.3 (2009-10-30)
  1467. ==================
  1468. Features added
  1469. --------------
  1470. Bugs fixed
  1471. ----------
  1472. * The ``resolve_entities`` option did not work in the incremental feed
  1473. parser.
  1474. * Looking up and deleting attributes without a namespace could hit a
  1475. namespaced attribute of the same name instead.
  1476. * Late errors during calls to ``SubElement()`` (e.g. attribute related
  1477. ones) could leave a partially initialised element in the tree.
  1478. * Modifying trees that contain parsed entity references could result
  1479. in an infinite loop.
  1480. * ObjectifiedElement.__setattr__ created an empty-string child element when the
  1481. attribute value was rejected as a non-unicode/non-ascii string
  1482. * Syntax errors in ``lxml.cssselect`` could result in misleading error
  1483. messages.
  1484. * Invalid syntax in CSS expressions could lead to an infinite loop in
  1485. the parser of ``lxml.cssselect``.
  1486. * CSS special character escapes were not properly handled in
  1487. ``lxml.cssselect``.
  1488. * CSS Unicode escapes were not properly decoded in ``lxml.cssselect``.
  1489. * Select options in HTML forms that had no explicit ``value``
  1490. attribute were not handled correctly. The HTML standard dictates
  1491. that their value is defined by their text content. This is now
  1492. supported by lxml.html.
  1493. * XPath raised a TypeError when finding CDATA sections. This is now
  1494. fully supported.
  1495. * Calling ``help(lxml.objectify)`` didn't work at the prompt.
  1496. * The ``ElementMaker`` in lxml.objectify no longer defines the default
  1497. namespaces when annotation is disabled.
  1498. * Feed parser failed to honour the 'recover' option on parse errors.
  1499. * Diverting the error logging to Python's logging system was broken.
  1500. Other changes
  1501. -------------
  1502. 2.2.2 (2009-06-21)
  1503. ==================
  1504. Features added
  1505. --------------
  1506. * New helper functions ``strip_attributes()``, ``strip_elements()``,
  1507. ``strip_tags()`` in lxml.etree to remove attributes/subtrees/tags
  1508. from a subtree.
  1509. Bugs fixed
  1510. ----------
  1511. * Namespace cleanup on subtree insertions could result in missing
  1512. namespace declarations (and potentially crashes) if the element
  1513. defining a namespace was deleted and the namespace was not used by
  1514. the top element of the inserted subtree but only in deeper subtrees.
  1515. * Raising an exception from a parser target callback didn't always
  1516. terminate the parser.
  1517. * Only {true, false, 1, 0} are accepted as the lexical representation for
  1518. BoolElement ({True, False, T, F, t, f} not any more), restoring lxml <= 2.0
  1519. behaviour.
  1520. Other changes
  1521. -------------
  1522. 2.2.1 (2009-06-02)
  1523. ==================
  1524. Features added
  1525. --------------
  1526. * Injecting default attributes into a document during XML Schema
  1527. validation (also at parse time).
  1528. * Pass ``huge_tree`` parser option to disable parser security
  1529. restrictions imposed by libxml2 2.7.
  1530. Bugs fixed
  1531. ----------
  1532. * The script for statically building libxml2 and libxslt didn't work
  1533. in Py3.
  1534. * ``XMLSchema()`` also passes invalid schema documents on to libxml2
  1535. for parsing (which could lead to a crash before release 2.6.24).
  1536. Other changes
  1537. -------------
  1538. 2.2 (2009-03-21)
  1539. ================
  1540. Features added
  1541. --------------
  1542. * Support for ``standalone`` flag in XML declaration through
  1543. ``tree.docinfo.standalone`` and by passing ``standalone=True/False``
  1544. on serialisation.
  1545. Bugs fixed
  1546. ----------
  1547. * Crash when parsing an XML Schema with external imports from a
  1548. filename.
  1549. 2.2beta4 (2009-02-27)
  1550. =====================
  1551. Features added
  1552. --------------
  1553. * Support strings and instantiable Element classes as child arguments
  1554. to the constructor of custom Element classes.
  1555. * GZip compression support for serialisation to files and file-like
  1556. objects.
  1557. Bugs fixed
  1558. ----------
  1559. * Deep-copying an ElementTree copied neither its sibling PIs and
  1560. comments nor its internal/external DTD subsets.
  1561. * Soupparser failed on broken attributes without values.
  1562. * Crash in XSLT when overwriting an already defined attribute using
  1563. ``xsl:attribute``.
  1564. * Crash bug in exception handling code under Python 3. This was due
  1565. to a problem in Cython, not lxml itself.
  1566. * ``lxml.html.FormElement._name()`` failed for non top-level forms.
  1567. * ``TAG`` special attribute in constructor of custom Element classes
  1568. was evaluated incorrectly.
  1569. Other changes
  1570. -------------
  1571. * Official support for Python 3.0.1.
  1572. * ``Element.findtext()`` now returns an empty string instead of None
  1573. for Elements without text content.
  1574. 2.2beta3 (2009-02-17)
  1575. =====================
  1576. Features added
  1577. --------------
  1578. * ``XSLT.strparam()`` class method to wrap quoted string parameters
  1579. that require escaping.
  1580. Bugs fixed
  1581. ----------
  1582. * Memory leak in XPath evaluators.
  1583. * Crash when parsing indented XML in one thread and merging it with
  1584. other documents parsed in another thread.
  1585. * Setting the ``base`` attribute in ``lxml.objectify`` from a unicode
  1586. string failed.
  1587. * Fixes following changes in Python 3.0.1.
  1588. * Minor fixes for Python 3.
  1589. Other changes
  1590. -------------
  1591. * The global error log (which is copied into the exception log) is now
  1592. local to a thread, which fixes some race conditions.
  1593. * More robust error handling on serialisation.
  1594. 2.2beta2 (2009-01-25)
  1595. =====================
  1596. Bugs fixed
  1597. ----------
  1598. * Potential memory leak on exception handling. This was due to a
  1599. problem in Cython, not lxml itself.
  1600. * ``iter_links`` (and related link-rewriting functions) in
  1601. ``lxml.html`` would interpret CSS like ``url("link")`` incorrectly
  1602. (treating the quotation marks as part of the link).
  1603. * Failing import on systems that have an ``io`` module.
  1604. 2.1.5 (2009-01-06)
  1605. ==================
  1606. Bugs fixed
  1607. ----------
  1608. * Potential memory leak on exception handling. This was due to a
  1609. problem in Cython, not lxml itself.
  1610. * Failing import on systems that have an ``io`` module.
  1611. 2.2beta1 (2008-12-12)
  1612. =====================
  1613. Features added
  1614. --------------
  1615. * Allow ``lxml.html.diff.htmldiff`` to accept Element objects, not
  1616. just HTML strings.
  1617. Bugs fixed
  1618. ----------
  1619. * Crash when using an XPath evaluator in multiple threads.
  1620. * Fixed missing whitespace before ``Link:...`` in ``lxml.html.diff``.
  1621. Other changes
  1622. -------------
  1623. * Export ``lxml.html.parse``.
  1624. 2.1.4 (2008-12-12)
  1625. ==================
  1626. Bugs fixed
  1627. ----------
  1628. * Crash when using an XPath evaluator in multiple threads.
  1629. 2.0.11 (2008-12-12)
  1630. ===================
  1631. Bugs fixed
  1632. ----------
  1633. * Crash when using an XPath evaluator in multiple threads.
  1634. 2.2alpha1 (2008-11-23)
  1635. ======================
  1636. Features added
  1637. --------------
  1638. * Support for XSLT result tree fragments in XPath/XSLT extension
  1639. functions.
  1640. * QName objects have new properties ``namespace`` and ``localname``.
  1641. * New options for exclusive C14N and C14N without comments.
  1642. * Instantiating a custom Element classes creates a new Element.
  1643. Bugs fixed
  1644. ----------
  1645. * XSLT didn't inherit the parse options of the input document.
  1646. * 0-bytes could slip through the API when used inside of Unicode
  1647. strings.
  1648. * With ``lxml.html.clean.autolink``, links with balanced parenthesis,
  1649. that end in a parenthesis, will be linked in their entirety (typical
  1650. with Wikipedia links).
  1651. Other changes
  1652. -------------
  1653. 2.1.3 (2008-11-17)
  1654. ==================
  1655. Features added
  1656. --------------
  1657. Bugs fixed
  1658. ----------
  1659. * Ref-count leaks when lxml enters a try-except statement while an
  1660. outside exception lives in sys.exc_*(). This was due to a problem in
  1661. Cython, not lxml itself.
  1662. * Parser Unicode decoding errors could get swallowed by other
  1663. exceptions.
  1664. * Name/import errors in some Python modules.
  1665. * Internal DTD subsets that did not specify a system or public ID were
  1666. not serialised and did not appear in the docinfo property of
  1667. ElementTrees.
  1668. * Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.
  1669. * Test suite fixes for libxml2 2.7.
  1670. * Resolver.resolve_string() did not work for non-ASCII byte strings.
  1671. * Resolver.resolve_file() was broken.
  1672. * Overriding the parser encoding didn't work for many encodings.
  1673. Other changes
  1674. -------------
  1675. 2.0.10 (2008-11-17)
  1676. ===================
  1677. Bugs fixed
  1678. ----------
  1679. * Ref-count leaks when lxml enters a try-except statement while an
  1680. outside exception lives in sys.exc_*(). This was due to a problem in
  1681. Cython, not lxml itself.
  1682. 2.1.2 (2008-09-05)
  1683. ==================
  1684. Features added
  1685. --------------
  1686. * lxml.etree now tries to find the absolute path name of files when
  1687. parsing from a file-like object. This helps custom resolvers when
  1688. resolving relative URLs, as lixbml2 can prepend them with the path
  1689. of the source document.
  1690. Bugs fixed
  1691. ----------
  1692. * Memory problem when passing documents between threads.
  1693. * Target parser did not honour the ``recover`` option and raised an
  1694. exception instead of calling ``.close()`` on the target.
  1695. Other changes
  1696. -------------
  1697. 2.0.9 (2008-09-05)
  1698. ==================
  1699. Bugs fixed
  1700. ----------
  1701. * Memory problem when passing documents between threads.
  1702. * Target parser did not honour the ``recover`` option and raised an
  1703. exception instead of calling ``.close()`` on the target.
  1704. 2.1.1 (2008-07-24)
  1705. ==================
  1706. Features added
  1707. --------------
  1708. Bugs fixed
  1709. ----------
  1710. * Crash when parsing XSLT stylesheets in a thread and using them in
  1711. another.
  1712. * Encoding problem when including text with ElementInclude under
  1713. Python 3.
  1714. Other changes
  1715. -------------
  1716. 2.0.8 (2008-07-24)
  1717. ==================
  1718. Features added
  1719. --------------
  1720. * ``lxml.html.rewrite_links()`` strips links to work around documents
  1721. with whitespace in URL attributes.
  1722. Bugs fixed
  1723. ----------
  1724. * Crash when parsing XSLT stylesheets in a thread and using them in
  1725. another.
  1726. * CSS selector parser dropped remaining expression after a function
  1727. with parameters.
  1728. Other changes
  1729. -------------
  1730. 2.1 (2008-07-09)
  1731. ================
  1732. Features added
  1733. --------------
  1734. * Smart strings can be switched off in XPath (``smart_strings``
  1735. keyword option).
  1736. * ``lxml.html.rewrite_links()`` strips links to work around documents
  1737. with whitespace in URL attributes.
  1738. Bugs fixed
  1739. ----------
  1740. * Custom resolvers were not used for XMLSchema includes/imports and
  1741. XInclude processing.
  1742. * CSS selector parser dropped remaining expression after a function
  1743. with parameters.
  1744. Other changes
  1745. -------------
  1746. * ``objectify.enableRecursiveStr()`` was removed, use
  1747. ``objectify.enable_recursive_str()`` instead
  1748. * Speed-up when running XSLTs on documents from other threads
  1749. 2.0.7 (2008-06-20)
  1750. ==================
  1751. Features added
  1752. --------------
  1753. * Pickling ``ElementTree`` objects in lxml.objectify.
  1754. Bugs fixed
  1755. ----------
  1756. * Descending dot-separated classes in CSS selectors were not resolved
  1757. correctly.
  1758. * ``ElementTree.parse()`` didn't handle target parser result.
  1759. * Potential threading problem in XInclude.
  1760. * Crash in Element class lookup classes when the __init__() method of
  1761. the super class is not called from Python subclasses.
  1762. Other changes
  1763. -------------
  1764. * Non-ASCII characters in attribute values are no longer escaped on
  1765. serialisation.
  1766. 2.1beta3 (2008-06-19)
  1767. =====================
  1768. Features added
  1769. --------------
  1770. * Major overhaul of ``tools/xpathgrep.py`` script.
  1771. * Pickling ``ElementTree`` objects in lxml.objectify.
  1772. * Support for parsing from file-like objects that return unicode
  1773. strings.
  1774. * New function ``etree.cleanup_namespaces(el)`` that removes unused
  1775. namespace declarations from a (sub)tree (experimental).
  1776. * XSLT results support the buffer protocol in Python 3.
  1777. * Polymorphic functions in ``lxml.html`` that accept either a tree or
  1778. a parsable string will return either a UTF-8 encoded byte string, a
  1779. unicode string or a tree, based on the type of the input.
  1780. Previously, the result was always a byte string or a tree.
  1781. * Support for Python 2.6 and 3.0 beta.
  1782. * File name handling now uses a heuristic to convert between byte
  1783. strings (usually filenames) and unicode strings (usually URLs).
  1784. * Parsing from a plain file object frees the GIL under Python 2.x.
  1785. * Running ``iterparse()`` on a plain file (or filename) frees the GIL
  1786. on reading under Python 2.x.
  1787. * Conversion functions ``html_to_xhtml()`` and ``xhtml_to_html()`` in
  1788. lxml.html (experimental).
  1789. * Most features in lxml.html work for XHTML namespaced tag names
  1790. (experimental).
  1791. Bugs fixed
  1792. ----------
  1793. * ``ElementTree.parse()`` didn't handle target parser result.
  1794. * Crash in Element class lookup classes when the __init__() method of
  1795. the super class is not called from Python subclasses.
  1796. * A number of problems related to unicode/byte string conversion of
  1797. filenames and error messages were fixed.
  1798. * Building on MacOS-X now passes the "flat_namespace" option to the C
  1799. compiler, which reportedly prevents build quirks and crashes on this
  1800. platform.
  1801. * Windows build was broken.
  1802. * Rare crash when serialising to a file object with certain encodings.
  1803. Other changes
  1804. -------------
  1805. * Non-ASCII characters in attribute values are no longer escaped on
  1806. serialisation.
  1807. * Passing non-ASCII byte strings or invalid unicode strings as .tag,
  1808. namespaces, etc. will result in a ValueError instead of an
  1809. AssertionError (just like the tag well-formedness check).
  1810. * Up to several times faster attribute access (i.e. tree traversal) in
  1811. lxml.objectify.
  1812. 2.0.6 (2008-05-31)
  1813. ==================
  1814. Features added
  1815. --------------
  1816. Bugs fixed
  1817. ----------
  1818. * Incorrect evaluation of ``el.find("tag[child]")``.
  1819. * Windows build was broken.
  1820. * Moving a subtree from a document created in one thread into a
  1821. document of another thread could crash when the rest of the source
  1822. document is deleted while the subtree is still in use.
  1823. * Rare crash when serialising to a file object with certain encodings.
  1824. Other changes
  1825. -------------
  1826. * lxml should now build without problems on MacOS-X.
  1827. 2.1beta2 (2008-05-02)
  1828. =====================
  1829. Features added
  1830. --------------
  1831. * All parse functions in lxml.html take a ``parser`` keyword argument.
  1832. * lxml.html has a new parser class ``XHTMLParser`` and a module
  1833. attribute ``xhtml_parser`` that provide XML parsers that are
  1834. pre-configured for the lxml.html package.
  1835. Bugs fixed
  1836. ----------
  1837. * Moving a subtree from a document created in one thread into a
  1838. document of another thread could crash when the rest of the source
  1839. document is deleted while the subtree is still in use.
  1840. * Passing an nsmap when creating an Element will no longer strip
  1841. redundantly defined namespace URIs. This prevented the definition
  1842. of more than one prefix for a namespace on the same Element.
  1843. Other changes
  1844. -------------
  1845. * If the default namespace is redundantly defined with a prefix on the
  1846. same Element, the prefix will now be preferred for subelements and
  1847. attributes. This allows users to work around a problem in libxml2
  1848. where attributes from the default namespace could serialise without
  1849. a prefix even when they appear on an Element with a different
  1850. namespace (i.e. they would end up in the wrong namespace).
  1851. 2.0.5 (2008-05-01)
  1852. ==================
  1853. Features added
  1854. --------------
  1855. Bugs fixed
  1856. ----------
  1857. * Resolving to a filename in custom resolvers didn't work.
  1858. * lxml did not honour libxslt's second error state "STOPPED", which
  1859. let some XSLT errors pass silently.
  1860. * Memory leak in Schematron with libxml2 >= 2.6.31.
  1861. Other changes
  1862. -------------
  1863. 2.1beta1 (2008-04-15)
  1864. =====================
  1865. Features added
  1866. --------------
  1867. * Error logging in Schematron (requires libxml2 2.6.32 or later).
  1868. * Parser option ``strip_cdata`` for normalising or keeping CDATA
  1869. sections. Defaults to ``True`` as before, thus replacing CDATA
  1870. sections by their text content.
  1871. * ``CDATA()`` factory to wrap string content as CDATA section.
  1872. Bugs fixed
  1873. ----------
  1874. * Resolving to a filename in custom resolvers didn't work.
  1875. * lxml did not honour libxslt's second error state "STOPPED", which
  1876. let some XSLT errors pass silently.
  1877. * Memory leak in Schematron with libxml2 >= 2.6.31.
  1878. * lxml.etree accepted non well-formed namespace prefix names.
  1879. Other changes
  1880. -------------
  1881. * Major cleanup in internal ``moveNodeToDocument()`` function, which
  1882. takes care of namespace cleanup when moving elements between
  1883. different namespace contexts.
  1884. * New Elements created through the ``makeelement()`` method of an HTML
  1885. parser or through lxml.html now end up in a new HTML document
  1886. (doctype HTML 4.01 Transitional) instead of a generic XML document.
  1887. This mostly impacts the serialisation and the availability of a DTD
  1888. context.
  1889. 2.0.4 (2008-04-13)
  1890. ==================
  1891. Features added
  1892. --------------
  1893. Bugs fixed
  1894. ----------
  1895. * Hanging thread in conjunction with GTK threading.
  1896. * Crash bug in iterparse when moving elements into other documents.
  1897. * HTML elements' ``.cssselect()`` method was broken.
  1898. * ``ElementTree.find*()`` didn't accept QName objects.
  1899. Other changes
  1900. -------------
  1901. 2.1alpha1 (2008-03-27)
  1902. ======================
  1903. Features added
  1904. --------------
  1905. * New event types 'comment' and 'pi' in ``iterparse()``.
  1906. * ``XSLTAccessControl`` instances have a property ``options`` that
  1907. returns a dict of access configuration options.
  1908. * Constant instances ``DENY_ALL`` and ``DENY_WRITE`` on
  1909. ``XSLTAccessControl`` class.
  1910. * Extension elements for XSLT (experimental!)
  1911. * ``Element.base`` property returns the xml:base or HTML base URL of
  1912. an Element.
  1913. * ``docinfo.URL`` property is writable.
  1914. Bugs fixed
  1915. ----------
  1916. * Default encoding for plain text serialisation was different from
  1917. that of XML serialisation (UTF-8 instead of ASCII).
  1918. Other changes
  1919. -------------
  1920. * Minor API speed-ups.
  1921. * The benchmark suite now uses tail text in the trees, which makes the
  1922. absolute numbers incomparable to previous results.
  1923. * Generating the HTML documentation now requires Pygments_, which is
  1924. used to enable syntax highlighting for the doctest examples.
  1925. .. _Pygments: http://pygments.org/
  1926. Most long-time deprecated functions and methods were removed:
  1927. - ``etree.clearErrorLog()``, use ``etree.clear_error_log()``
  1928. - ``etree.useGlobalPythonLog()``, use
  1929. ``etree.use_global_python_log()``
  1930. - ``etree.ElementClassLookup.setFallback()``, use
  1931. ``etree.ElementClassLookup.set_fallback()``
  1932. - ``etree.getDefaultParser()``, use ``etree.get_default_parser()``
  1933. - ``etree.setDefaultParser()``, use ``etree.set_default_parser()``
  1934. - ``etree.setElementClassLookup()``, use
  1935. ``etree.set_element_class_lookup()``
  1936. Note that ``parser.setElementClassLookup()`` has not been removed
  1937. yet, although ``parser.set_element_class_lookup()`` should be used
  1938. instead.
  1939. - ``xpath_evaluator.registerNamespace()``, use
  1940. ``xpath_evaluator.register_namespace()``
  1941. - ``xpath_evaluator.registerNamespaces()``, use
  1942. ``xpath_evaluator.register_namespaces()``
  1943. - ``objectify.setPytypeAttributeTag``, use
  1944. ``objectify.set_pytype_attribute_tag``
  1945. - ``objectify.setDefaultParser()``, use
  1946. ``objectify.set_default_parser()``
  1947. 2.0.3 (2008-03-26)
  1948. ==================
  1949. Features added
  1950. --------------
  1951. * soupparser.parse() allows passing keyword arguments on to
  1952. BeautifulSoup.
  1953. * ``fromstring()`` method in ``lxml.html.soupparser``.
  1954. Bugs fixed
  1955. ----------
  1956. * ``lxml.html.diff`` didn't treat empty tags properly (e.g.,
  1957. ``<br>``).
  1958. * Handle entity replacements correctly in target parser.
  1959. * Crash when using ``iterparse()`` with XML Schema validation.
  1960. * The BeautifulSoup parser (soupparser.py) did not replace entities,
  1961. which made them turn up in text content.
  1962. * Attribute assignment of custom PyTypes in objectify could fail to
  1963. correctly serialise the value to a string.
  1964. Other changes
  1965. -------------
  1966. * ``lxml.html.ElementSoup`` was replaced by a new module
  1967. ``lxml.html.soupparser`` with a more consistent API. The old module
  1968. remains for compatibility with ElementTree's own ElementSoup module.
  1969. * Setting the XSLT_CONFIG and XML2_CONFIG environment variables at
  1970. build time will let setup.py pick up the ``xml2-config`` and
  1971. ``xslt-config`` scripts from the supplied path name.
  1972. * Passing ``--with-xml2-config=/path/to/xml2-config`` to setup.py will
  1973. override the ``xml2-config`` script that is used to determine the C
  1974. compiler options. The same applies for the ``--with-xslt-config``
  1975. option.
  1976. 2.0.2 (2008-02-22)
  1977. ==================
  1978. Features added
  1979. --------------
  1980. * Support passing ``base_url`` to file parser functions to override
  1981. the filename of the file(-like) object.
  1982. Bugs fixed
  1983. ----------
  1984. * The prefix for objectify's pytype namespace was missing from the set
  1985. of default prefixes.
  1986. * Memory leak in Schematron (fixed only for libxml2 2.6.31+).
  1987. * Error type names in RelaxNG were reported incorrectly.
  1988. * Slice deletion bug fixed in objectify.
  1989. Other changes
  1990. -------------
  1991. * Enabled doctests for some Python modules (especially ``lxml.html``).
  1992. * Add a ``method`` argument to ``lxml.html.tostring()``
  1993. (``method="xml"`` for XHTML output).
  1994. * Make it clearer that methods like ``lxml.html.fromstring()`` take a
  1995. ``base_url`` argument.
  1996. 2.0.1 (2008-02-13)
  1997. ==================
  1998. Features added
  1999. --------------
  2000. * Child iteration in ``lxml.pyclasslookup``.
  2001. * Loads of new docstrings reflect the signature of functions and
  2002. methods to make them visible in API docs and ``help()``
  2003. Bugs fixed
  2004. ----------
  2005. * The module ``lxml.html.builder`` was duplicated as
  2006. ``lxml.htmlbuilder``
  2007. * Form elements would return None for ``form.fields.keys()`` if there
  2008. was an unnamed input field. Now unnamed input fields are completely
  2009. ignored.
  2010. * Setting an element slice in objectify could insert slice-overlapping
  2011. elements at the wrong position.
  2012. Other changes
  2013. -------------
  2014. * The generated API documentation was cleaned up and disburdened from
  2015. non-public classes etc.
  2016. * The previously public module ``lxml.html.setmixin`` was renamed to
  2017. ``lxml.html._setmixin`` as it is not an official part of lxml. If
  2018. you want to use it, feel free to copy it over to your own source
  2019. base.
  2020. * Passing ``--with-xslt-config=/path/to/xslt-config`` to setup.py will
  2021. override the ``xslt-config`` script that is used to determine the C
  2022. compiler options.
  2023. 2.0 (2008-02-01)
  2024. ================
  2025. Features added
  2026. --------------
  2027. * Passing the ``unicode`` type as ``encoding`` to ``tostring()`` will
  2028. serialise to unicode. The ``tounicode()`` function is now
  2029. deprecated.
  2030. * ``XMLSchema()`` and ``RelaxNG()`` can parse from StringIO.
  2031. * ``makeparser()`` function in ``lxml.objectify`` to create a new
  2032. parser with the usual objectify setup.
  2033. * Plain ASCII XPath string results are no longer forced into unicode
  2034. objects as in 2.0beta1, but are returned as plain strings as before.
  2035. * All XPath string results are 'smart' objects that have a
  2036. ``getparent()`` method to retrieve their parent Element.
  2037. * ``with_tail`` option in serialiser functions.
  2038. * More accurate exception messages in validator creation.
  2039. * Parse-time XML schema validation (``schema`` parser keyword).
  2040. * XPath string results of the ``text()`` function and attribute
  2041. selection make their Element container accessible through a
  2042. ``getparent()`` method. As a side-effect, they are now always
  2043. unicode objects (even ASCII strings).
  2044. * ``XSLT`` objects are usable in any thread - at the cost of a deep
  2045. copy if they were not created in that thread.
  2046. * Invalid entity names and character references will be rejected by
  2047. the ``Entity()`` factory.
  2048. * ``entity.text`` returns the textual representation of the entity,
  2049. e.g. ``&amp;``.
  2050. * New properties ``position`` and ``code`` on ParseError exception (as
  2051. in ET 1.3)
  2052. * Rich comparison of ``element.attrib`` proxies.
  2053. * ElementTree compatible TreeBuilder class.
  2054. * Use default prefixes for some common XML namespaces.
  2055. * ``lxml.html.clean.Cleaner`` now allows for a ``host_whitelist``, and
  2056. two overridable methods: ``allow_embedded_url(el, url)`` and the
  2057. more general ``allow_element(el)``.
  2058. * Extended slicing of Elements as in ``element[1:-1:2]``, both in
  2059. etree and in objectify
  2060. * Resolvers can now provide a ``base_url`` keyword argument when
  2061. resolving a document as string data.
  2062. * When using ``lxml.doctestcompare`` you can give the doctest option
  2063. ``NOPARSE_MARKUP`` (like ``# doctest: +NOPARSE_MARKUP``) to suppress
  2064. the special checking for one test.
  2065. * Separate ``feed_error_log`` property for the feed parser interface.
  2066. The normal parser interface and ``iterparse`` continue to use
  2067. ``error_log``.
  2068. * The normal parsers and the feed parser interface are now separated
  2069. and can be used concurrently on the same parser instance.
  2070. * ``fromstringlist()`` and ``tostringlist()`` functions as in
  2071. ElementTree 1.3
  2072. * ``iterparse()`` accepts an ``html`` boolean keyword argument for
  2073. parsing with the HTML parser (note that this interface may be
  2074. subject to change)
  2075. * Parsers accept an ``encoding`` keyword argument that overrides the encoding
  2076. of the parsed documents.
  2077. * New C-API function ``hasChild()`` to test for children
  2078. * ``annotate()`` function in objectify can annotate with Python types and XSI
  2079. types in one step. Accompanied by ``xsiannotate()`` and ``pyannotate()``.
  2080. * ``ET.write()``, ``tostring()`` and ``tounicode()`` now accept a keyword
  2081. argument ``method`` that can be one of 'xml' (or None), 'html' or 'text' to
  2082. serialise as XML, HTML or plain text content.
  2083. * ``iterfind()`` method on Elements returns an iterator equivalent to
  2084. ``findall()``
  2085. * ``itertext()`` method on Elements
  2086. * Setting a QName object as value of the .text property or as an attribute
  2087. will resolve its prefix in the respective context
  2088. * ElementTree-like parser target interface as described in
  2089. http://effbot.org/elementtree/elementtree-xmlparser.htm
  2090. * ElementTree-like feed parser interface on XMLParser and HTMLParser
  2091. (``feed()`` and ``close()`` methods)
  2092. * Reimplemented ``objectify.E`` for better performance and improved
  2093. integration with objectify. Provides extended type support based on
  2094. registered PyTypes.
  2095. * XSLT objects now support deep copying
  2096. * New ``makeSubElement()`` C-API function that allows creating a new
  2097. subelement straight with text, tail and attributes.
  2098. * XPath extension functions can now access the current context node
  2099. (``context.context_node``) and use a context dictionary
  2100. (``context.eval_context``) from the context provided in their first
  2101. parameter
  2102. * HTML tag soup parser based on BeautifulSoup in ``lxml.html.ElementSoup``
  2103. * New module ``lxml.doctestcompare`` by Ian Bicking for writing simplified
  2104. doctests based on XML/HTML output. Use by importing ``lxml.usedoctest`` or
  2105. ``lxml.html.usedoctest`` from within a doctest.
  2106. * New module ``lxml.cssselect`` by Ian Bicking for selecting Elements with CSS
  2107. selectors.
  2108. * New package ``lxml.html`` written by Ian Bicking for advanced HTML
  2109. treatment.
  2110. * Namespace class setup is now local to the ``ElementNamespaceClassLookup``
  2111. instance and no longer global.
  2112. * Schematron validation (incomplete in libxml2)
  2113. * Additional ``stringify`` argument to ``objectify.PyType()`` takes a
  2114. conversion function to strings to support setting text values from arbitrary
  2115. types.
  2116. * Entity support through an ``Entity`` factory and element classes. XML
  2117. parsers now have a ``resolve_entities`` keyword argument that can be set to
  2118. False to keep entities in the document.
  2119. * ``column`` field on error log entries to accompany the ``line`` field
  2120. * Error specific messages in XPath parsing and evaluation
  2121. NOTE: for evaluation errors, you will now get an XPathEvalError instead of
  2122. an XPathSyntaxError. To catch both, you can except on ``XPathError``
  2123. * The regular expression functions in XPath now support passing a node-set
  2124. instead of a string
  2125. * Extended type annotation in objectify: new ``xsiannotate()`` function
  2126. * EXSLT RegExp support in standard XPath (not only XSLT)
  2127. Bugs fixed
  2128. ----------
  2129. * Missing import in ``lxml.html.clean``.
  2130. * Some Python 2.4-isms prevented lxml from building/running under
  2131. Python 2.3.
  2132. * XPath on ElementTrees could crash when selecting the virtual root
  2133. node of the ElementTree.
  2134. * Compilation ``--without-threading`` was buggy in alpha5/6.
  2135. * Memory leak in the ``parse()`` function.
  2136. * Minor bugs in XSLT error message formatting.
  2137. * Result document memory leak in target parser.
  2138. * Target parser failed to report comments.
  2139. * In the ``lxml.html`` ``iter_links`` method, links in ``<object>``
  2140. tags weren't recognized. (Note: plugin-specific link parameters
  2141. still aren't recognized.) Also, the ``<embed>`` tag, though not
  2142. standard, is now included in ``lxml.html.defs.special_inline_tags``.
  2143. * Using custom resolvers on XSLT stylesheets parsed from a string
  2144. could request ill-formed URLs.
  2145. * With ``lxml.doctestcompare`` if you do ``<tag xmlns="...">`` in your
  2146. output, it will then be namespace-neutral (before the ellipsis was
  2147. treated as a real namespace).
  2148. * AttributeError in feed parser on parse errors
  2149. * XML feed parser setup problem
  2150. * Type annotation for unicode strings in ``DataElement()``
  2151. * lxml failed to serialise namespace declarations of elements other than the
  2152. root node of a tree
  2153. * Race condition in XSLT where the resolver context leaked between concurrent
  2154. XSLT calls
  2155. * lxml.etree did not check tag/attribute names
  2156. * The XML parser did not report undefined entities as error
  2157. * The text in exceptions raised by XML parsers, validators and XPath
  2158. evaluators now reports the first error that occurred instead of the last
  2159. * Passing '' as XPath namespace prefix did not raise an error
  2160. * Thread safety in XPath evaluators
  2161. Other changes
  2162. -------------
  2163. * Exceptions carry only the part of the error log that is related to
  2164. the operation that caused the error.
  2165. * ``XMLSchema()`` and ``RelaxNG()`` now enforce passing the source
  2166. file/filename through the ``file`` keyword argument.
  2167. * The test suite now skips most doctests under Python 2.3.
  2168. * ``make clean`` no longer removes the .c files (use ``make
  2169. realclean`` instead)
  2170. * Minor performance tweaks for Element instantiation and subelement
  2171. creation
  2172. * Various places in the XPath, XSLT and iteration APIs now require
  2173. keyword-only arguments.
  2174. * The argument order in ``element.itersiblings()`` was changed to
  2175. match the order used in all other iteration methods. The second
  2176. argument ('preceding') is now a keyword-only argument.
  2177. * The ``getiterator()`` method on Elements and ElementTrees was
  2178. reverted to return an iterator as it did in lxml 1.x. The ET API
  2179. specification allows it to return either a sequence or an iterator,
  2180. and it traditionally returned a sequence in ET and an iterator in
  2181. lxml. However, it is now deprecated in favour of the ``iter()``
  2182. method, which should be used in new code wherever possible.
  2183. * The 'pretty printed' serialisation of ElementTree objects now
  2184. inserts newlines at the root level between processing instructions,
  2185. comments and the root tag.
  2186. * A 'pretty printed' serialisation is now terminated with a newline.
  2187. * Second argument to ``lxml.etree.Extension()`` helper is no longer
  2188. required, third argument is now a keyword-only argument ``ns``.
  2189. * ``lxml.html.tostring`` takes an ``encoding`` argument.
  2190. * The module source files were renamed to "lxml.*.pyx", such as
  2191. "lxml.etree.pyx". This was changed for consistency with the way
  2192. Pyrex commonly handles package imports. The main effect is that
  2193. classes now know about their fully qualified class name, including
  2194. the package name of their module.
  2195. * Keyword-only arguments in some API functions, especially in the
  2196. parsers and serialisers.
  2197. * Tag name validation in lxml.etree (and lxml.html) now distinguishes
  2198. between HTML tags and XML tags based on the parser that was used to
  2199. parse or create them. HTML tags no longer reject any non-ASCII
  2200. characters in tag names but only spaces and the special characters
  2201. ``<>&/"'``.
  2202. * lxml.etree now emits a warning if you use XPath with libxml2 2.6.27
  2203. (which can crash on certain XPath errors)
  2204. * Type annotation in objectify now preserves the already annotated type by
  2205. default to prevent losing type information that is already there.
  2206. * ``element.getiterator()`` returns a list, use ``element.iter()`` to retrieve
  2207. an iterator (ElementTree 1.3 compatible behaviour)
  2208. * objectify.PyType for None is now called "NoneType"
  2209. * ``el.getiterator()`` renamed to ``el.iter()``, following ElementTree 1.3 -
  2210. original name is still available as alias
  2211. * In the public C-API, ``findOrBuildNodeNs()`` was replaced by the more
  2212. generic ``findOrBuildNodeNsPrefix``
  2213. * Major refactoring in XPath/XSLT extension function code
  2214. * Network access in parsers disabled by default
  2215. 1.3.6 (2007-10-29)
  2216. ==================
  2217. Bugs fixed
  2218. ----------
  2219. * Backported decref crash fix from 2.0
  2220. * Well hidden free-while-in-use crash bug in ObjectPath
  2221. Other changes
  2222. -------------
  2223. * The test suites now run ``gc.collect()`` in the ``tearDown()``
  2224. methods. While this makes them take a lot longer to run, it also
  2225. makes it easier to link a specific test to garbage collection
  2226. problems that would otherwise appear in later tests.
  2227. 1.3.5 (2007-10-22)
  2228. ==================
  2229. Features added
  2230. --------------
  2231. Bugs fixed
  2232. ----------
  2233. * lxml.etree could crash when adding more than 10000 namespaces to a
  2234. document
  2235. * lxml failed to serialise namespace declarations of elements other
  2236. than the root node of a tree
  2237. 1.3.4 (2007-08-30)
  2238. ==================
  2239. Features added
  2240. --------------
  2241. * The ``ElementMaker`` in ``lxml.builder`` now accepts the keyword arguments
  2242. ``namespace`` and ``nsmap`` to set a namespace and nsmap for the Elements it
  2243. creates.
  2244. * The ``docinfo`` on ElementTree objects has new properties ``internalDTD``
  2245. and ``externalDTD`` that return a DTD object for the internal or external
  2246. subset of the document respectively.
  2247. * Serialising an ElementTree now includes any internal DTD subsets that are
  2248. part of the document, as well as comments and PIs that are siblings of the
  2249. root node.
  2250. Bugs fixed
  2251. ----------
  2252. * Parsing with the ``no_network`` option could fail
  2253. Other changes
  2254. -------------
  2255. * lxml now raises a TagNameWarning about tag names containing ':' instead of
  2256. an Error as 1.3.3 did. The reason is that a number of projects currently
  2257. misuse the previous lack of tag name validation to generate namespace
  2258. prefixes without declaring namespaces. Apart from the danger of generating
  2259. broken XML this way, it also breaks most of the namespace-aware tools in
  2260. XML, including XPath, XSLT and validation. lxml 1.3.x will continue to
  2261. support this bug with a Warning, while lxml 2.0 will be strict about
  2262. well-formed tag names (not only regarding ':').
  2263. * Serialising an Element no longer includes its comment and PI siblings (only
  2264. ElementTree serialisation includes them).
  2265. 1.3.3 (2007-07-26)
  2266. ==================
  2267. Features added
  2268. --------------
  2269. * ElementTree compatible parser ``ETCompatXMLParser`` strips processing
  2270. instructions and comments while parsing XML
  2271. * Parsers now support stripping PIs (keyword argument 'remove_pis')
  2272. * ``etree.fromstring()`` now supports parsing both HTML and XML, depending on
  2273. the parser you pass.
  2274. * Support ``base_url`` keyword argument in ``HTML()`` and ``XML()``
  2275. Bugs fixed
  2276. ----------
  2277. * Parsing from Python Unicode strings failed on some platforms
  2278. * ``Element()`` did not raise an exception on tag names containing ':'
  2279. * ``Element.getiterator(tag)`` did not accept ``Comment`` and
  2280. ``ProcessingInstruction`` as tags. It also accepts ``Element`` now.
  2281. 1.3.2 (2007-07-03)
  2282. ==================
  2283. Features added
  2284. --------------
  2285. Bugs fixed
  2286. ----------
  2287. * "deallocating None" crash bug
  2288. 1.3.1 (2007-07-02)
  2289. ==================
  2290. Features added
  2291. --------------
  2292. * objectify.DataElement now supports setting values from existing data
  2293. elements (not just plain Python types) and reuses defined namespaces etc.
  2294. * E-factory support for lxml.objectify (``objectify.E``)
  2295. Bugs fixed
  2296. ----------
  2297. * Better way to prevent crashes in Element proxy cleanup code
  2298. * objectify.DataElement didn't set up None value correctly
  2299. * objectify.DataElement didn't check the value against the provided type hints
  2300. * Reference-counting bug in ``Element.attrib.pop()``
  2301. 1.3 (2007-06-24)
  2302. ================
  2303. Features added
  2304. --------------
  2305. * Module ``lxml.pyclasslookup`` module implements an Element class lookup
  2306. scheme that can access the entire tree in read-only mode to help determining
  2307. a suitable Element class
  2308. * Parsers take a ``remove_comments`` keyword argument that skips over comments
  2309. * ``parse()`` function in ``objectify``, corresponding to ``XML()`` etc.
  2310. * ``Element.addnext(el)`` and ``Element.addprevious(el)`` methods to support
  2311. adding processing instructions and comments around the root node
  2312. * ``Element.attrib`` was missing ``clear()`` and ``pop()`` methods
  2313. * Extended type annotation in objectify: cleaner annotation namespace setup
  2314. plus new ``deannotate()`` function
  2315. * Support for custom Element class instantiation in lxml.sax: passing a
  2316. ``makeelement`` function to the ElementTreeContentHandler will reuse the
  2317. lookup context of that function
  2318. * '.' represents empty ObjectPath (identity)
  2319. * ``Element.values()`` to accompany the existing ``.keys()`` and ``.items()``
  2320. * ``collectAttributes()`` C-function to build a list of attribute
  2321. keys/values/items for a libxml2 node
  2322. * ``DTD`` validator class (like ``RelaxNG`` and ``XMLSchema``)
  2323. * HTML generator helpers by Fredrik Lundh in ``lxml.htmlbuilder``
  2324. * ``ElementMaker`` XML generator by Fredrik Lundh in ``lxml.builder.E``
  2325. * Support for pickling ``objectify.ObjectifiedElement`` objects to XML
  2326. * ``update()`` method on Element.attrib
  2327. * Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
  2328. a better handling of namespaces when moving elements between documents.
  2329. Bugs fixed
  2330. ----------
  2331. * Removing Elements from a tree could make them lose their namespace
  2332. declarations
  2333. * ``ElementInclude`` didn't honour base URL of original document
  2334. * Replacing the children slice of an Element would cut off the tails of the
  2335. original children
  2336. * ``Element.getiterator(tag)`` did not accept ``Comment`` and
  2337. ``ProcessingInstruction`` as tags
  2338. * API functions now check incoming strings for XML conformity. Zero bytes or
  2339. low ASCII characters are no longer accepted (AssertionError).
  2340. * XSLT parsing failed to pass resolver context on to imported documents
  2341. * passing '' as namespace prefix in nsmap could be passed through to libxml2
  2342. * Objectify couldn't handle prefixed XSD type names in ``xsi:type``
  2343. * More ET compatible behaviour when writing out XML declarations or not
  2344. * More robust error handling in ``iterparse()``
  2345. * Documents lost their top-level PIs and comments on serialisation
  2346. * lxml.sax failed on comments and PIs. Comments are now properly ignored and
  2347. PIs are copied.
  2348. * Possible memory leaks in namespace handling when moving elements between
  2349. documents
  2350. Other changes
  2351. -------------
  2352. * major restructuring in the documentation
  2353. 1.2.1 (2007-02-27)
  2354. ==================
  2355. Bugs fixed
  2356. ----------
  2357. * Build fixes for MS compiler
  2358. * Item assignments to special names like ``element["text"]`` failed
  2359. * Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
  2360. to access
  2361. * The pattern for attribute names in ObjectPath was too restrictive
  2362. 1.2 (2007-02-20)
  2363. ================
  2364. Features added
  2365. --------------
  2366. * Rich comparison of QName objects
  2367. * Support for regular expressions in benchmark selection
  2368. * get/set emulation (not .attrib!) for attributes on processing instructions
  2369. * ElementInclude Python module for ElementTree compatible XInclude processing
  2370. that honours custom resolvers registered with the source document
  2371. * ElementTree.parser property holds the parser used to parse the document
  2372. * setup.py has been refactored for greater readability and flexibility
  2373. * --rpath flag to setup.py to induce automatic linking-in of dynamic library
  2374. runtime search paths has been renamed to --auto-rpath. This makes it
  2375. possible to pass an --rpath directly to distutils; previously this was being
  2376. shadowed.
  2377. Bugs fixed
  2378. ----------
  2379. * Element instantiation now uses locks to prevent race conditions with threads
  2380. * ElementTree.write() did not raise an exception when the file was not writable
  2381. * Error handling could crash under Python <= 2.4.1 - fixed by disabling thread
  2382. support in these environments
  2383. * Element.find*() did not accept QName objects as path
  2384. Other changes
  2385. -------------
  2386. * code cleanup: redundant _NodeBase super class merged into _Element class
  2387. Note: although the impact should be zero in most cases, this change breaks
  2388. the compatibility of the public C-API
  2389. 1.1.2 (2006-10-30)
  2390. ==================
  2391. Features added
  2392. --------------
  2393. * Data elements in objectify support repr(), which is now used by dump()
  2394. * Source distribution now ships with a patched Pyrex
  2395. * New C-API function makeElement() to create new elements with text,
  2396. tail, attributes and namespaces
  2397. * Reuse original parser flags for XInclude
  2398. * Simplified support for handling XSLT processing instructions
  2399. Bugs fixed
  2400. ----------
  2401. * Parser resources were not freed before the next parser run
  2402. * Open files and XML strings returned by Python resolvers were not
  2403. closed/freed
  2404. * Crash in the IDDict returned by XMLDTDID
  2405. * Copying Comments and ProcessingInstructions failed
  2406. * Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()
  2407. * Memory leak when garbage collecting tailed root elements
  2408. * HTML script/style content was not propagated to .text
  2409. * Show text xincluded between text nodes correctly in .text and .tail
  2410. * 'integer * objectify.StringElement' operation was not supported
  2411. 1.1.1 (2006-09-21)
  2412. ==================
  2413. Features added
  2414. --------------
  2415. * XSLT profiling support (``profile_run`` keyword)
  2416. * countchildren() method on objectify.ObjectifiedElement
  2417. * Support custom elements for tree nodes in lxml.objectify
  2418. Bugs fixed
  2419. ----------
  2420. * lxml.objectify failed to support long data values (e.g., "123L")
  2421. * Error messages from XSLT did not reach ``XSLT.error_log``
  2422. * Factories objectify.Element() and objectify.DataElement() were missing
  2423. ``attrib`` and ``nsmap`` keyword arguments
  2424. * Changing the default parser in lxml.objectify did not update the factories
  2425. Element() and DataElement()
  2426. * Let lxml.objectify.Element() always generate tree elements (not data
  2427. elements)
  2428. * Build under Windows failed ('\0' bug in patched Pyrex version)
  2429. 1.1 (2006-09-13)
  2430. ================
  2431. Features added
  2432. --------------
  2433. * Comments and processing instructions return '<!-- comment -->' and
  2434. '<?pi-target content?>' for repr()
  2435. * Parsers are now the preferred (and default) place where element class lookup
  2436. schemes should be registered. Namespace lookup is no longer supported by
  2437. default.
  2438. * Support for Python 2.5 beta
  2439. * Unlock the GIL for deep copying documents and for XPath()
  2440. * New ``compact`` keyword argument for parsing read-only documents
  2441. * Support for parser options in iterparse()
  2442. * The ``namespace`` axis is supported in XPath and returns (prefix, URI)
  2443. tuples
  2444. * The XPath expression "/" now returns an empty list instead of raising an
  2445. exception
  2446. * XML-Object API on top of lxml (lxml.objectify)
  2447. * Customizable Element class lookup:
  2448. * different pre-implemented lookup mechanisms
  2449. * support for externally provided lookup functions
  2450. * Support for processing instructions (ET-like, not compatible)
  2451. * Public C-level API for independent extension modules
  2452. * Module level ``iterwalk()`` function as 'iterparse' for trees
  2453. * Module level ``iterparse()`` function similar to ElementTree (see
  2454. documentation for differences)
  2455. * Element.nsmap property returns a mapping of all namespace prefixes known at
  2456. the Element to their namespace URI
  2457. * Reentrant threading support in RelaxNG, XMLSchema and XSLT
  2458. * Threading support in parsers and serializers:
  2459. * All in-memory operations (tostring, parse(StringIO), etc.) free the GIL
  2460. * File operations (on file names) free the GIL
  2461. * Reading from file-like objects frees the GIL and reacquires it for reading
  2462. * Serialisation to file-like objects is single-threaded (high lock overhead)
  2463. * Element iteration over XPath axes:
  2464. * Element.iterdescendants() iterates over the descendants of an element
  2465. * Element.iterancestors() iterates over the ancestors of an element (from
  2466. parent to parent)
  2467. * Element.itersiblings() iterates over either the following or preceding
  2468. siblings of an element
  2469. * Element.iterchildren() iterates over the children of an element in either
  2470. direction
  2471. * All iterators support the ``tag`` keyword argument to restrict the
  2472. generated elements
  2473. * Element.getnext() and Element.getprevious() return the direct siblings of an
  2474. element
  2475. Bugs fixed
  2476. ----------
  2477. * filenames with local 8-bit encoding were not supported
  2478. * 1.1beta did not compile under Python 2.3
  2479. * ignore unknown 'pyval' attribute values in objectify
  2480. * objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists
  2481. * objectify.ObjectPath.setattr() failed to accept Elements and Lists
  2482. * XPathSyntaxError now inherits from XPathError
  2483. * Threading race conditions in RelaxNG and XMLSchema
  2484. * Crash when mixing elements from XSLT results into other trees, concurrent
  2485. XSLT is only allowed when the stylesheet was parsed in the main thread
  2486. * The EXSLT ``regexp:match`` function now works as defined (except for some
  2487. differences in the regular expression syntax)
  2488. * Setting element.text to '' returned None on request, not the empty string
  2489. * ``iterparse()`` could crash on long XML files
  2490. * Creating documents no longer copies the parser for later URL resolving. For
  2491. performance reasons, only a reference is kept. Resolver updates on the
  2492. parser will now be reflected by documents that were parsed before the
  2493. change. Although this should rarely become visible, it is a behavioral
  2494. change from 1.0.
  2495. 1.0.4 (2006-09-09)
  2496. ==================
  2497. Features added
  2498. --------------
  2499. * List-like ``Element.extend()`` method
  2500. Bugs fixed
  2501. ----------
  2502. * Crash in tail handling in ``Element.replace()``
  2503. 1.0.3 (2006-08-08)
  2504. ==================
  2505. Features added
  2506. --------------
  2507. * Element.replace(old, new) method to replace a subelement by another one
  2508. Bugs fixed
  2509. ----------
  2510. * Crash when mixing elements from XSLT results into other trees
  2511. * Copying/deepcopying did not work for ElementTree objects
  2512. * Setting an attribute to a non-string value did not raise an exception
  2513. * Element.remove() deleted the tail text from the removed Element
  2514. 1.0.2 (2006-06-27)
  2515. ==================
  2516. Features added
  2517. --------------
  2518. * Support for setting a custom default Element class as opposed to namespace
  2519. specific classes (which still override the default class)
  2520. Bugs fixed
  2521. ----------
  2522. * Rare exceptions in Python list functions were not handled
  2523. * Parsing accepted unicode strings with XML encoding declaration in certain
  2524. cases
  2525. * Parsing 8-bit encoded strings from StringIO objects raised an exception
  2526. * Module function ``initThread()`` was removed - useless (and never worked)
  2527. * XSLT and parser exception messages include the error line number
  2528. 1.0.1 (2006-06-09)
  2529. ==================
  2530. Features added
  2531. --------------
  2532. * Repeated calls to Element.attrib now efficiently return the same instance
  2533. Bugs fixed
  2534. ----------
  2535. * Document deallocation could crash in certain garbage collection scenarios
  2536. * Extension function calls in XSLT variable declarations could break the
  2537. stylesheet and crash on repeated calls
  2538. * Deep copying Elements could lose namespaces declared in parents
  2539. * Deep copying Elements did not copy tail
  2540. * Parsing file(-like) objects failed to load external entities
  2541. * Parsing 8-bit strings from file(-like) objects raised an exception
  2542. * xsl:include failed when the stylesheet was parsed from a file-like object
  2543. * lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()
  2544. * MSVC compiler complained about long strings (supports only 2048 bytes)
  2545. 1.0 (2006-06-01)
  2546. ================
  2547. Features added
  2548. --------------
  2549. * Element.getiterator() and the findall() methods support finding arbitrary
  2550. elements from a namespace (pattern ``{namespace}*``)
  2551. * Another speedup in tree iteration code
  2552. * General speedup of Python Element object creation and deallocation
  2553. * Writing C14N no longer serializes in memory (reduced memory footprint)
  2554. * PyErrorLog for error logging through the Python ``logging`` module
  2555. * ``Element.getroottree()`` returns an ElementTree for the root node of the
  2556. document that contains the element.
  2557. * ElementTree.getpath(element) returns a simple, absolute XPath expression to
  2558. find the element in the tree structure
  2559. * Error logs have a ``last_error`` attribute for convenience
  2560. * Comment texts can be changed through the API
  2561. * Formatted output via ``pretty_print`` keyword in serialization functions
  2562. * XSLT can block access to file system and network via ``XSLTAccessControl``
  2563. * ElementTree.write() no longer serializes in memory (reduced memory
  2564. footprint)
  2565. * Speedup of Element.findall(tag) and Element.getiterator(tag)
  2566. * Support for writing the XML representation of Elements and ElementTrees to
  2567. Python unicode strings via ``etree.tounicode()``
  2568. * Support for writing XSLT results to Python unicode strings via ``unicode()``
  2569. * Parsing a unicode string no longer copies the string (reduced memory
  2570. footprint)
  2571. * Parsing file-like objects reads chunks rather than the whole file (reduced
  2572. memory footprint)
  2573. * Parsing StringIO objects from the start avoids copying the string (reduced
  2574. memory footprint)
  2575. * Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE
  2576. information, original encoding and XML version as seen by the parser
  2577. * etree module can be compiled without libxslt by commenting out the line
  2578. ``include "xslt.pxi"`` near the end of the etree.pyx source file
  2579. * Better error messages in parser exceptions
  2580. * Error reporting also works in XSLT
  2581. * Support for custom document loaders (URI resolvers) in parsers and XSLT,
  2582. resolvers are registered at parser level
  2583. * Implementation of exslt:regexp for XSLT based on the Python 're' module,
  2584. enabled by default, can be switched off with 'regexp=False' keyword argument
  2585. * Support for exslt extensions (libexslt) and libxslt extra functions
  2586. (node-set, document, write, output)
  2587. * Substantial speedup in XPath.evaluate()
  2588. * HTMLParser for parsing (broken) HTML
  2589. * XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id
  2590. implementation of libxml2 (as opposed to ET compatible XMLID)
  2591. Bugs fixed
  2592. ----------
  2593. * Memory leak in Element.__setitem__
  2594. * Memory leak in Element.attrib.items() and Element.attrib.values()
  2595. * Memory leak in XPath extension functions
  2596. * Memory leak in unicode related setup code
  2597. * Element now raises ValueError on empty tag names
  2598. * Namespace fixing after moving elements between documents could fail if the
  2599. source document was freed too early
  2600. * Setting namespace-less tag names on namespaced elements ('{ns}t' -> 't')
  2601. didn't reset the namespace
  2602. * Unknown constants from newer libxml2 versions could raise exceptions in the
  2603. error handlers
  2604. * lxml.etree compiles much faster
  2605. * On libxml2 <= 2.6.22, parsing strings with encoding declaration could fail
  2606. in certain cases
  2607. * Document reference in ElementTree objects was not updated when the root
  2608. element was moved to a different document
  2609. * Running absolute XPath expressions on an Element now evaluates against the
  2610. root tree
  2611. * Evaluating absolute XPath expressions (``/*``) on an ElementTree could fail
  2612. * Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree
  2613. objects
  2614. * Removed public function ``initThreadLogging()``, replaced by more general
  2615. ``initThread()`` which fixes a number of setup problems in threads
  2616. * Memory leak when using iconv encoders in tostring/write
  2617. * Deep copying Elements and ElementTrees maintains the document information
  2618. * Serialization functions raise LookupError for unknown encodings
  2619. * Memory deallocation crash resulting from deep copying elements
  2620. * Some ElementTree methods could crash if the root node was not initialized
  2621. (neither file nor element passed to the constructor)
  2622. * Element/SubElement failed to set attribute namespaces from passed ``attrib``
  2623. dictionary
  2624. * ``tostring()`` adds an XML declaration for non-ASCII encodings
  2625. * ``tostring()`` failed to serialize encodings that contain 0-bytes
  2626. * ElementTree.xpath() and XPathDocumentEvaluator were not using the
  2627. ElementTree root node as reference point
  2628. * Calling ``document('')`` in XSLT failed to return the stylesheet
  2629. 0.9.2 (2006-05-10)
  2630. ==================
  2631. Features added
  2632. --------------
  2633. * Speedup for Element.makeelement(): the new element reuses the original
  2634. libxml2 document instead of creating a new empty one
  2635. * Speedup for reversed() iteration over element children (Py2.4+ only)
  2636. * ElementTree compatible QName class
  2637. * RelaxNG and XMLSchema accept any Element, not only ElementTrees
  2638. Bugs fixed
  2639. ----------
  2640. * str(xslt_result) was broken for XSLT output other than UTF-8
  2641. * Memory leak if write_c14n fails to write the file after conversion
  2642. * Crash in XMLSchema and RelaxNG when passing non-schema documents
  2643. * Memory leak in RelaxNG() when RelaxNGParseError is raised
  2644. 0.9.1 (2006-03-30)
  2645. ==================
  2646. Features added
  2647. --------------
  2648. * lxml.sax.ElementTreeContentHandler checks closing elements and raises
  2649. SaxError on mismatch
  2650. * lxml.sax.ElementTreeContentHandler supports namespace-less SAX events
  2651. (startElement, endElement) and defaults to empty attributes (keyword
  2652. argument)
  2653. * Speedup for repeatedly accessing element tag names
  2654. * Minor API performance improvements
  2655. Bugs fixed
  2656. ----------
  2657. * Memory deallocation bug when using XSLT output method "html"
  2658. * sax.py was handling UTF-8 encoded tag names where it shouldn't
  2659. * lxml.tests package will no longer be installed (is still in source tar)
  2660. 0.9 (2006-03-20)
  2661. ================
  2662. Features added
  2663. --------------
  2664. * Error logging API for libxml2 error messages
  2665. * Various performance improvements
  2666. * Benchmark script for lxml, ElementTree and cElementTree
  2667. * Support for registering extension functions through new FunctionNamespace
  2668. class (see doc/extensions.txt)
  2669. * ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')
  2670. * Support for variables in XPath expressions (also in XPath class)
  2671. * XPath class for compiled XPath expressions
  2672. * XMLID module level function (ElementTree compatible)
  2673. * XMLParser API for customized libxml2 parser configuration
  2674. * Support for custom Element classes through new Namespace API (see
  2675. doc/namespace_extensions.txt)
  2676. * Common exception base class LxmlError for module exceptions
  2677. * real iterator support in iter(Element), Element.getiterator()
  2678. * XSLT objects are callable, result trees support str()
  2679. * Added MANIFEST.in for easier creation of RPM files.
  2680. * 'getparent' method on elements allows navigation to an element's
  2681. parent element.
  2682. * Python core compatible SAX tree builder and SAX event generator. See
  2683. doc/sax.txt for more information.
  2684. Bugs fixed
  2685. ----------
  2686. * Segfaults and memory leaks in various API functions of Element
  2687. * Segfault in XSLT.tostring()
  2688. * ElementTree objects no longer interfere, Elements can be root of different
  2689. ElementTrees at the same time
  2690. * document('') works in XSLT documents read from files (in-memory documents
  2691. cannot support this due to libxslt deficiencies)
  2692. 0.8 (2005-11-03)
  2693. ================
  2694. Features added
  2695. --------------
  2696. * Support for copy.deepcopy() on elements. copy.copy() works also, but
  2697. does the same thing, and does *not* create a shallow copy, as that
  2698. makes no sense in the context of libxml2 trees. This means a
  2699. potential incompatibility with ElementTree, but there's more chance
  2700. that it works than if copy.copy() isn't supported at all.
  2701. * Increased compatibility with (c)ElementTree; .parse() on ElementTree is
  2702. supported and parsing of gzipped XML files works.
  2703. * implemented index() on elements, allowing one to find the index of a
  2704. SubElement.
  2705. Bugs fixed
  2706. ----------
  2707. * Use xslt-config instead of xml2-config to find out libxml2
  2708. directories to take into account a case where libxslt is installed
  2709. in a different directory than libxslt.
  2710. * Eliminate crash condition in iteration when text nodes are changed.
  2711. * Passing 'None' to tostring() does not result in a segfault anymore,
  2712. but an AssertionError.
  2713. * Some test fixes for Windows.
  2714. * Raise XMLSyntaxError and XPathSyntaxError instead of plain python
  2715. syntax errors. This should be less confusing.
  2716. * Fixed error with uncaught exception in Pyrex code.
  2717. * Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a
  2718. segfault.
  2719. * has_key() works on attrib. 'in' tests also work correctly on attrib.
  2720. * INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
  2721. libxml2 version, as it should.
  2722. * Passing a UTF-8 encoded string to the XML() function would fail;
  2723. fixed.
  2724. 0.7 (2005-06-15)
  2725. ================
  2726. Features added
  2727. --------------
  2728. * parameters (XPath expressions) can be passed to XSLT using keyword
  2729. parameters.
  2730. * Simple XInclude support. Calling the xinclude() method on a tree
  2731. will process any XInclude statements in the document.
  2732. * XMLSchema support. Use the XMLSchema class or the convenience
  2733. xmlschema() method on a tree to do XML Schema (XSD) validation.
  2734. * Added convenience xslt() method on tree. This is less efficient
  2735. than the XSLT object, but makes it easier to write quick code.
  2736. * Added convenience relaxng() method on tree. This is less efficient
  2737. than the RelaxNG object, but makes it easier to write quick code.
  2738. * Make it possible to use XPathEvaluator with elements as well. The
  2739. XPathEvaluator in this case will retain the element so multiple
  2740. XPath queries can be made against one element efficiently. This
  2741. replaces the second argument to the .evaluate() method that existed
  2742. previously.
  2743. * Allow registerNamespace() to be called on an XPathEvaluator, after
  2744. creation, to add additional namespaces. Also allow registerNamespaces(),
  2745. which does the same for a namespace dictionary.
  2746. * Add 'prefix' attribute to element to be able to read prefix information.
  2747. This is entirely read-only.
  2748. * It is possible to supply an extra nsmap keyword parameter to
  2749. the Element() and SubElement() constructors, which supplies a
  2750. prefix to namespace URI mapping. This will create namespace
  2751. prefix declarations on these elements and these prefixes will show up
  2752. in XML serialization.
  2753. Bugs fixed
  2754. ----------
  2755. * Killed yet another memory management related bug: trees created
  2756. using newDoc would not get a libxml2-level dictionary, which caused
  2757. problems when deallocating these documents later if they contained a
  2758. node that came from a document with a dictionary.
  2759. * Moving namespaced elements between documents was problematic as
  2760. references to the original document would remain. This has been fixed
  2761. by applying xmlReconciliateNs() after each move operation.
  2762. * Can pass None to 'dump()' without segfaults.
  2763. * tostring() works properly for non-root elements as well.
  2764. * Cleaned out the tostring() method so it should handle encoding
  2765. correctly.
  2766. * Cleaned out the ElementTree.write() method so it should handle encoding
  2767. correctly. Writing directly to a file should also be faster, as there is no
  2768. need to go through a Python string in that case. Made sure the test cases
  2769. test both serializing to StringIO as well as serializing to a real file.
  2770. 0.6 (2005-05-14)
  2771. ================
  2772. Features added
  2773. --------------
  2774. * Changed setup.py so that library_dirs is also guessed. This should
  2775. help with compilation on the Mac OS X platform, where otherwise the
  2776. wrong library (shipping with the OS) could be picked up.
  2777. * Tweaked setup.py so that it picks up the version from version.txt.
  2778. Bugs fixed
  2779. ----------
  2780. * Do the right thing when handling namespaced attributes.
  2781. * fix bug where tostring() moved nodes into new documents. tostring()
  2782. had very nasty side-effects before this fix, sorry!
  2783. 0.5.1 (2005-04-09)
  2784. ==================
  2785. * Python 2.2 compatibility fixes.
  2786. * unicode fixes in Element() and Comment() as well as XML(); unicode
  2787. input wasn't properly being UTF-8 encoded.
  2788. 0.5 (2005-04-08)
  2789. ================
  2790. Initial public release.