[issue22221] ast.literal_eval confused by coding declarations

2014-08-17 Thread Jorgen Schäfer
New submission from Jorgen Schäfer: The ast module seems to get confused for certain strings which contain coding declarations. >>> import ast >>> s = u'"""\\\n# -*- coding: utf-8 -*-\n"""' >>> print s """\ #

[issue22221] ast.literal_eval confused by coding declarations

2014-08-22 Thread Jorgen Schäfer
Jorgen Schäfer added the comment: I do not understand how your comments apply to this bug. There is no comment anywhere. There is a single string literal whose contents look like a comment. The expression parses correctly without syntax error if you add a few newlines in front. Could you