This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author schlamar
Recipients schlamar
Date 2015-12-21.10:02:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450692127.84.0.492153161721.issue25918@psf.upfronthosting.co.za>
In-reply-to
Content
This simple test case results in a lib2to3 crash with an AssertionError in 2.7.11


source = '''

class Test(object):

    tests = []


'''

from lib2to3.refactor import RefactoringTool


def main():
    tool = RefactoringTool([])
    tool.refactor_string(source, '')

        
Exception:

Traceback (most recent call last):
  File "test.py", line 21, in <module>
    main()
  File "test.py", line 16, in main
    tool.refactor_string(source, '')
  File "c:\Python27\Lib\lib2to3\refactor.py", line 380, in refactor_string
    name, err.__class__.__name__, err)
  File "c:\Python27\Lib\lib2to3\refactor.py", line 377, in refactor_string
    tree = self.driver.parse_string(data)
  File "c:\Python27\Lib\lib2to3\pgen2\driver.py", line 106, in parse_string
    return self.parse_tokens(tokens, debug)
  File "c:\Python27\Lib\lib2to3\pgen2\driver.py", line 71, in parse_tokens
    if p.addtoken(type, value, (prefix, start)):
  File "c:\Python27\Lib\lib2to3\pgen2\parse.py", line 127, in addtoken
    assert t < 256
AssertionError

Pretty weird: A manually built Python 2.7.11 with VS 2008 doesn't show this issue.
History
Date User Action Args
2015-12-21 10:02:07schlamarsetrecipients: + schlamar
2015-12-21 10:02:07schlamarsetmessageid: <1450692127.84.0.492153161721.issue25918@psf.upfronthosting.co.za>
2015-12-21 10:02:07schlamarlinkissue25918 messages
2015-12-21 10:02:07schlamarcreate