This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lys.nikolaou
Recipients BTaskaya, gvanrossum, lys.nikolaou, pablogsal
Date 2020-05-07.23:53:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588895622.03.0.435436260208.issue40546@roundup.psfhosted.org>
In-reply-to
Content
> But if the col_offset points way past the text, what should happen? The clipping there seems reasonable.

Note that if a file is being parsed and not a string the behaviour is this:
╰─ cat -e t.py
x = 1 | 2 |    $
╰─ ./python.exe t.py
  File "/Users/lysnikolaou/repos/cpython/t.py", line 1
    x = 1 | 2 |
                  ^
SyntaxError: invalid syntax
╰─ ./python.exe -X oldparser t.py
  File "/Users/lysnikolaou/repos/cpython/t.py", line 1
    x = 1 | 2 |
                  ^
SyntaxError: invalid syntax

Would we want to also change this? If not, then I guess that we should as closely as possible match this behaviour with strings as well, which means not clipping.
History
Date User Action Args
2020-05-07 23:53:42lys.nikolaousetrecipients: + lys.nikolaou, gvanrossum, pablogsal, BTaskaya
2020-05-07 23:53:42lys.nikolaousetmessageid: <1588895622.03.0.435436260208.issue40546@roundup.psfhosted.org>
2020-05-07 23:53:42lys.nikolaoulinkissue40546 messages
2020-05-07 23:53:41lys.nikolaoucreate