id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc 540,Upstream change in Python breaks genshi test suite,robie.basak@…,cmlenz,"The genshi test suite gets stuck in an infinite loop when run against the latest upstream `2.7` branch. Python issue http://bugs.python.org/issue16152 now has a fix that is committed to the `2.7` branch. This changes the definition of `tokenize.PseudoToken`. This constant is used in `genshi.template.interpolation`. The change to this constant causes the test `genshi.template.tests.interpolation.py` `InterpolateTestCase.test_interpolate_full_mismatched_brackets` to end up in an infinite loop. A test case that demonstrates the problem is below. It fails on a build of Python 2.7 from the Python upstream `2.7` hg branch. The current Ubuntu development release is based on the Python upstream `2.7` hg branch, so this causes genshi to fail to build on Ubuntu. This affects both your 0.6 release and your svn trunk (r1209). A workaround is to hardcode a local definition of `PseudoToken` as it was in previous Python versions. But it isn't clear to me if this is an acceptable fix. Please could you provide some guidance on what should be going on here, and how we might patch Ubuntu so that we can build genshi? Steps to reproduce: 1. Install Python 2.7 from Python upstream hg branch `2.7`, or use the current Ubuntu development release (Raring). 2. `python setup.py build` 3. `python setup.py test` Expected result: test suite should complete Actual result: test suite hangs on `test_interpolate_full_mismatched_brackets` Test case: {{{ #!py #!/usr/bin/python import re import unittest from tokenize import ( Whitespace, Number, Funny, ContStr, Name, Comment, Triple, group ) token_re = re.compile('%s|%s(?s)' % ( r'[uU]?[rR]?(""""""|\'\'\')((?= 2.7.4) Comment, Triple), Number, Funny, ContStr, Name) )) class TestCase(unittest.TestCase): def test_regexp_does_not_match(self): self.assertEqual(token_re.match('${{1:2}', 7), None) if __name__ == '__main__': unittest.main() }}}",defect,closed,major,0.7,General,0.6,fixed,,