Fix for python3, add a test for the clear before data case


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/branches/linereceiver-complexity-6357@37889 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb