[issue26581] Double coding cookie

2016-03-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue26581] Double coding cookie

2016-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1c44cea2ea8f by Serhiy Storchaka in branch '3.5': Issue #26581: Use the first coding cookie on a line, not the last one. https://hg.python.org/cpython/rev/1c44cea2ea8f New changeset 8506d127d482 by Serhiy Storchaka in branch '2.7': Issue #26581: Use

[issue26581] Double coding cookie

2016-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 23a7481eafd4 by Serhiy Storchaka in branch 'default': Issues #25643, #26581: Added new tests for detecting Python source code encoding. https://hg.python.org/cpython/rev/23a7481eafd4 -- nosy: +python-dev ___

[issue26581] Double coding cookie

2016-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, I made a mistake! In 2.7 the first coding on the same line wins. And that behavior was from start. Regression was unintentionally introduced in issue18470. Thus *there is* a bug in Python 3. PEP 263 doesn't need more changes, but Python tokenizer and re

[issue26581] Double coding cookie

2016-03-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: When Python source file contains double coding cookies on different lines, the first wins. When it contains double coding cookies on the same line, the last wins. PEP 263 was sufficiently vague about this. Now this is clarified (22490711c870). The first c

[issue26581] Double coding cookie

2016-03-19 Thread Guido van Rossum
Guido van Rossum added the comment: Right. Please go ahead with both. I am fine with defining the current behavior correct. --Guido (mobile) On Mar 19, 2016 9:37 AM, "Serhiy Storchaka" wrote: > > Serhiy Storchaka added the comment: > > Yes, I have. But I were not sure what behavior should be c

[issue26581] Double coding cookie

2016-03-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, I have. But I were not sure what behavior should be correct in Python. On one side, always choosing the first declaration (on the same or on different lines) looks more consistent. On other side, current behavior was in CPython from the initial implemen

[issue26581] Double coding cookie

2016-03-19 Thread Guido van Rossum
Guido van Rossum added the comment: Do you have write permission to the PEP? Just update it. -- ___ Python tracker ___ ___ Python-bugs

[issue26581] Double coding cookie

2016-03-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I just tested with Emacs, and it looks that when specify different codings on two different lines, the first coding wins, but when specify different codings on the same line, the last coding wins. Therefore current CPython behavior can be correct, and the re