[Largely rewritten mid-2016 to bring up to date.]
html5lib doesn't support Jython 2.5, and never has. Some degree of support was introduced in html5lib 0.9999, but that requires Jython 2.7 (notably, support isn't guaranteed, but in principle it works).
If you want to try and get it working with Jython 2.5, you need to more than just replace invalid_unicode_re
, see this bug. I'd suggest trying to run the testsuite with your modifications. Note also that nowadays we require Python 2.6 as a minimum, and support for any variant of 2.5 will take a large amount of work now.