[issue32028] Syntactically wrong suggestions by the new custom print statement error message

2018-01-19 Thread Nick Coghlan

Nick Coghlan  added the comment:

Thanks CuriousLearner for the PR and mdraw for the original issue report!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32028] Syntactically wrong suggestions by the new custom print statement error message

2018-01-19 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset 4002d5dbf4c058bbf2462f9f5dea057956d1caff by Nick Coghlan (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-32028: Fix suggestions for indented print statements (GH-5249)
https://github.com/python/cpython/commit/4002d5dbf4c058bbf2462f9f5dea057956d1caff


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32028] Syntactically wrong suggestions by the new custom print statement error message

2018-01-19 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5096

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32028] Syntactically wrong suggestions by the new custom print statement error message

2018-01-19 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset d57f26c753dce61f72b52b96db3a3253d9f2fc3e by Nick Coghlan (Sanyam 
Khurana) in branch 'master':
bpo-32028: Fix suggestions for indented print statements (GH-4688)
https://github.com/python/cpython/commit/d57f26c753dce61f72b52b96db3a3253d9f2fc3e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32028] Syntactically wrong suggestions by the new custom print statement error message

2017-12-03 Thread Sanyam Khurana

Change by Sanyam Khurana :


--
keywords: +patch
pull_requests: +4601
stage: test needed -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32028] Syntactically wrong suggestions by the new custom print statement error message

2017-11-14 Thread Sanyam Khurana

Sanyam Khurana  added the comment:

Sure, let me have a look at it and work on fix.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32028] Syntactically wrong suggestions by the new custom print statement error message

2017-11-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Given the symptoms (stripping 4 spaces + "pr" from the start of the line, 
leaving "int " behind), it looks like we're not stripping the leading 
whitespace when determining the text to include in the suggested print() call.

To reproduce this at the REPL, you can use an if statement (first example uses 
a 4 space indent, the second uses an 8 space indent):

```
>>> if 1:
... print 123
  File "", line 2
print 123
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int 
123)?
>>> if 1:
... print 123
  File "", line 2
print 123
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print 
123)?

```

--
stage:  -> test needed
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32028] Syntactically wrong suggestions by the new custom print statement error message

2017-11-14 Thread Martin Drawitsch

New submission from Martin Drawitsch :

I think I found a bug in the new print syntax suggestion introduced by 
https://bugs.python.org/issue30597.


When the following code is executed by Python 3.6.3 inside of a .py file:

def f():
print '%d' % 2

, then Python gives the following error message:

SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int 
'%d' % 2)?

The "int" next to the left brace of the suggested print function is obviously 
wrong.
The expected message would be:

SyntaxError: Missing parentheses in call to 'print'. Did you mean 
print('%d' % 2)?

Using other values or "%s" in the formatted string in a print statement 
produces the same wrong message.
This bug only seems to happen when the print statement is inside of a function 
AND when it is is run inside of a .py file. At least I could not reproduce it 
in the python3 REPL or outside of a function.

I am attaching the minimal example file in this bug report. Running it with "$ 
python3 print.py" should show the mentioned bug.

--
components: Interpreter Core
files: print.py
messages: 306231
nosy: CuriousLearner, mdraw, ncoghlan
priority: normal
severity: normal
status: open
title: Syntactically wrong suggestions by the new custom print statement error 
message
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47265/print.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com