Author: ianb
Date: 2007-05-24 19:32:05 -0600 (Thu, 24 May 2007)
New Revision: 2699

Modified:
   FormEncode/trunk/docs/news.txt
   FormEncode/trunk/formencode/htmlfill.py
   FormEncode/trunk/tests/test_htmlfill.py
Log:
fix bug with no trailing newline, reported by Graham Stratton

Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt      2007-05-25 01:27:48 UTC (rev 2698)
+++ FormEncode/trunk/docs/news.txt      2007-05-25 01:32:05 UTC (rev 2699)
@@ -17,6 +17,9 @@
 * Be friendlier when loaded from a zip file (as with py2exe);
   previously only egg zip files would work.
 
+* Fixed bug in htmlfill when a document ends with no trailing text
+  after the last tag.
+
 0.7.1
 -----
 

Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py     2007-05-25 01:27:48 UTC (rev 
2698)
+++ FormEncode/trunk/formencode/htmlfill.py     2007-05-25 01:32:05 UTC (rev 
2699)
@@ -208,6 +208,7 @@
         HTMLParser.HTMLParser.feed(self, data)
 
     def close(self):
+        self.handle_misc(None)
         HTMLParser.HTMLParser.close(self)
         unused_errors = self.errors.copy()
         for key in self.used_errors.keys():

Modified: FormEncode/trunk/tests/test_htmlfill.py
===================================================================
--- FormEncode/trunk/tests/test_htmlfill.py     2007-05-25 01:27:48 UTC (rev 
2698)
+++ FormEncode/trunk/tests/test_htmlfill.py     2007-05-25 01:32:05 UTC (rev 
2699)
@@ -70,3 +70,6 @@
         print expected
         assert 0
     checker(p, listener.schema())
+
+def test_no_trailing_newline():
+    assert htmlfill.render('<html><body></body></html>',{},{}) == 
'<html><body></body></html>'


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs

Reply via email to