[issue32685] Erroneous suggestion in print statement

2018-01-28 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the patches, Sanyam & Nitish, and for the original bug report Mayank. Thanks also to Cheryl for nudging us to get it resolved :) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue32685] Erroneous suggestion in print statement

2018-01-28 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset b3b4b81d0147534151941105eba4af984acdc763 by Nick Coghlan (Miss Islington (bot)) in branch '3.6': bpo-32685: Improve suggestion for print statement (GH-5380)

[issue32685] Erroneous suggestion in print statement

2018-01-28 Thread miss-islington
Change by miss-islington : -- pull_requests: +5221 stage: backport needed -> patch review ___ Python tracker

[issue32685] Erroneous suggestion in print statement

2018-01-28 Thread Nick Coghlan
Change by Nick Coghlan : -- stage: patch review -> backport needed ___ Python tracker ___

[issue32685] Erroneous suggestion in print statement

2018-01-28 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 43c0f1ac5ed8bc9c3bd048d2ce4de4c98a83de99 by Nick Coghlan (Nitish Chandra) in branch 'master': bpo-32685: Improve suggestion for print statement (GH-5375)

[issue32685] Erroneous suggestion in print statement

2018-01-27 Thread Sanyam Khurana
Change by Sanyam Khurana : -- pull_requests: +5217 ___ Python tracker ___ ___

[issue32685] Erroneous suggestion in print statement

2018-01-27 Thread Nitish
Change by Nitish : -- keywords: +patch pull_requests: +5216 stage: needs patch -> patch review ___ Python tracker ___

[issue32685] Erroneous suggestion in print statement

2018-01-27 Thread Nick Coghlan
Nick Coghlan added the comment: They're the only characters we won't want to include as part of the suggestion, since they indicate the end of the statement. -- ___ Python tracker

[issue32685] Erroneous suggestion in print statement

2018-01-27 Thread Nitish
Nitish added the comment: > For the right offset, I think we'll want to drop the initial XStrip call > added for bpo-32028 entirely, and instead calculate the right offset as a > PyUnicode_FindChar search for ";" (replacing it with the length of the input > string if

[issue32685] Erroneous suggestion in print statement

2018-01-27 Thread Nick Coghlan
Nick Coghlan added the comment: Re-reading the code for _set_legacy_print_statement_msg, I noticed that we're not currently taking the "start" parameter into account, and that's the offset the compiler passes in to tell us where on the line it found the text "print ".

[issue32685] Erroneous suggestion in print statement

2018-01-27 Thread Sanyam Khurana
Sanyam Khurana added the comment: Thanks for the report Mayank! As we discussed offline, it is indeed reproducible if someone uses `print` on the same line (such as in this case, where a loop is used). I will look into this issue. --

[issue32685] Erroneous suggestion in print statement

2018-01-27 Thread Cheryl Sabella
Cheryl Sabella added the comment: Thank you for the report. The change to the exception message was added in #30597, but it looks like it may be too greedy. Adding the developer to the nosy list. -- nosy: +CuriousLearner, csabella, ncoghlan stage: -> needs patch

[issue32685] Erroneous suggestion in print statement

2018-01-27 Thread Mayank Singhal
New submission from Mayank Singhal <17mayanksing...@gmail.com>: The suggestion given when a for and print with the syntax for python 2.x are used together seems erroneous. Steps to reproduce: Just type following in the python interpreter (3.x): for p in some_list: print p The error