Here is a memory leak fix + small optimization  in the xmlreader.py (trunk).<br><br>-- Cheers, Dmitry<br>
<br><br>--- pywikipedia/xmlreader.py    2010-04-27 17:04:34.376531862 -0700<br>+++ xmlreader.py    2010-04-27 23:17:53.956531055 -0700<br>@@ -321,6 +321,7 @@<br> <br>             revision = elem.find(&quot;{%s}revision&quot; % self.uri)<br>

             yield self._create_revision(revision)<br>+            elem.clear()<br>             self.root.clear()<br> <br>     def _parse_all(self, event, elem):<br>@@ -330,6 +331,7 @@<br> <br>         if event == &quot;end&quot; and elem.tag == &quot;{%s}revision&quot; % self.uri:<br>

             yield self._create_revision(elem)<br>+            elem.clear()<br>             self.root.clear()<br>     <br>     def _headers(self, elem):<br>@@ -337,6 +339,8 @@<br>         self.pageid = elem.findtext(&quot;{%s}id&quot; % self.uri)<br>

         self.restrictions = elem.findtext(&quot;{%s}restrictions&quot; % self.uri)<br>         self.isredirect = elem.findtext(&quot;{%s}redirect&quot; % self.uri) is not None<br>+        self.editRestriction, self.moveRestriction \<br>

+                = parseRestrictions(self.restrictions)<br> <br>     def _create_revision(self, revision):<br>         &quot;&quot;&quot;Creates a Single revision&quot;&quot;&quot;<br>@@ -348,16 +352,14 @@<br>         username = ipeditor or contributor.findtext(&quot;{%s}username&quot; % self.uri)<br>

         # could get comment, minor as well<br>         text = revision.findtext(&quot;{%s}text&quot; % self.uri)<br>-        editRestriction, moveRestriction \<br>-                = parseRestrictions(self.restrictions)<br>

         return XmlEntry(title=self.title,<br>                         id=self.pageid,<br>                         text=text or u&#39;&#39;,<br>                         username=username or u&#39;&#39;, #username might be deleted<br>

                         ipedit=bool(ipeditor),<br>                         timestamp=timestamp,<br>-                        editRestriction=editRestriction,<br>-                        moveRestriction=moveRestriction,<br>

+                        editRestriction=self.editRestriction,<br>+                        moveRestriction=self.moveRestriction,<br>                         revisionid=revisionid,<br>                         comment=comment,<br>

                         redirect=self.isredirect<br><br><br>