[issue22221] ast.literal_eval confused by coding declarations

2014-09-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue22221] ast.literal_eval confused by coding declarations

2014-09-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 13cd8ea4cafe by Serhiy Storchaka in branch '3.4': Issue #1: Add tests for compile() with source encoding cookie. http://hg.python.org/cpython/rev/13cd8ea4cafe New changeset 9d335a54d728 by Serhiy Storchaka in branch 'default': Issue #1: Add

[issue22221] ast.literal_eval confused by coding declarations

2014-09-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset dd1e21f17b1c by Serhiy Storchaka in branch '2.7': Issue #1: Backported fixes from Python 3 (issue #18960). http://hg.python.org/cpython/rev/dd1e21f17b1c -- nosy: +python-dev ___ Python tracker

[issue22221] ast.literal_eval confused by coding declarations

2014-08-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is the same issue as issue18960. Here is backported patch with additional test. -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file36442/source_encoding_second_line-2.7.patch __

[issue22221] ast.literal_eval confused by coding declarations

2014-08-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: [When responding, please do not quote more than a line or two. If responding by email, please delete the rest. Otherwise, the result is extra noise when viewing online.] You are right, I missed the outer 's, though my examples are not completely irrelevant. E

[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 clarify

[issue22221] ast.literal_eval confused by coding declarations

2014-08-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: This issue is about the SyntaxError message for eval functions, not the ast module per se. My first response is that the reported message is not a bug and that this issue should be closed as 'not a bug'. (General reason) Trying to eval an expression preceded b

[issue22221] ast.literal_eval confused by coding declarations

2014-08-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: eval() is affected too. 3.x isn't affected. -- assignee: -> serhiy.storchaka components: +Interpreter Core -Library (Lib) nosy: +serhiy.storchaka stage: -> needs patch type: -> behavior ___ Python tracker

[issue22221] ast.literal_eval confused by coding declarations

2014-08-17 Thread David Halter
Changes by David Halter : -- nosy: +davidhalter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[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 """\ # -*- coding: utf-8 -*- """ >>> ast.literal_eval(s) Traceback (most recent call last):