[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-08-21 Thread STINNER Victor


STINNER Victor  added the comment:

The initial issue has been fixed in master by the commit 
5b94f3578c662d5f1ee90c0e6b81481d9ec82d89:

commit 5b94f3578c662d5f1ee90c0e6b81481d9ec82d89
Author: Anthony Sottile 
Date:   Mon Jul 29 06:59:13 2019 -0700

Fix `SyntaxError` indicator printing too many spaces for multi-line strings 
(GH-14433)

Backport to 3.8: commit cf52bd0b9b1c1b7ecdd91e1ebebd15ae5c213a2c.

Thanks Anthony Sottile! I close the issue.

--

If there is a different issue in Python 3.7 and you consider that it must be 
fixed, please file a new issue. Python 3.5 and 3.6 don't accept bugfixes 
anymore:
https://devguide.python.org/#status-of-python-branches

--
nosy: +vstinner
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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-08-03 Thread Anthony Sottile


Anthony Sottile  added the comment:

seems unrelated and does the same on older versions of python:

```
$ python3.5 t.py
  File "t.py", line 4

^
SyntaxError: EOF while scanning triple-quoted string literal
```

I'd suggest a new issue or finding the dupe

--

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-08-02 Thread Aaron Meurer


Aaron Meurer  added the comment:

This seems related. It's also possible I'm misunderstanding what is supposed to 
happen here.

If you create test.py with just the 2 lines:

"""
a

and run python test.py from CPython master, you get

$./python.exe test.py
  File "/Users/aaronmeurer/Documents/cpython/test.py", line 4
a
^
SyntaxError: EOF while scanning triple-quoted string literal

Notice that it reports line 4 even though the file only has 2 lines.

The offset in the syntax error is 6 columns (line numbers and column offsets
in SyntaxErrors count from 1)

>>> try:
... compile('"""\na', '', 'exec')
... except SyntaxError as e:
... print(repr(e))
...
SyntaxError('EOF while scanning triple-quoted string literal', ('', 2, 6, 
'"""\na\n'))

--

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14771
pull_request: https://github.com/python/cpython/pull/15005

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +14769
pull_request: https://github.com/python/cpython/pull/15003

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread Anthony Sottile


Anthony Sottile  added the comment:

sure! the only other case I could come up with involves multi-line strings and 
invalid escape sequences + Werror

let me see if I can fold that in as well

--

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks Anthony Sottile for the fix!

I suggest adding more test cases that do not involve f-strings, what do you 
think? Can you create another PR for those?

--
nosy: +pablogsal

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14767
pull_request: https://github.com/python/cpython/pull/15001

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-06-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

OK, very obnoxious.  Fix restores behavior above.

--

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-06-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg346872

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-06-28 Thread Anthony Sottile


Anthony Sottile  added the comment:

just an f-string doesn't trigger this, there needs to be tokens before it

--

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-06-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On Windows 10 with current 3.8 I see correct output, so the bug seems OS 
specific, even though the simple fix (see PR) is not.

C:\Users\Terry>py f:/python/a/tem4.py
  File "f:/python/a/tem4.py", line 1
f'''{}
^
SyntaxError: f-string: empty expression not allowed

--
nosy: +terry.reedy
title: syntax error in f-string in multiline string produces ~40k spaces of 
output -> syntax error in multiline f-string produces ~40k spaces output

___
Python tracker 

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