[issue40612] Make traceback module's formatting of SyntaxError more similar to system formatting

2020-05-17 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue40612] Make traceback module's formatting of SyntaxError more similar to system formatting

2020-05-14 Thread miss-islington
miss-islington added the comment: New changeset 15bc9ab301d73f20bff47a12ef05326feb40f797 by Guido van Rossum in branch 'master': bpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072) https://github.com/python/cpython/commit/15bc9ab301d73f20bff47a12ef05326feb40f797

[issue40612] Make traceback module's formatting of SyntaxError more similar to system formatting

2020-05-14 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: Understood. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40612] Make traceback module's formatting of SyntaxError more similar to system formatting

2020-05-14 Thread Guido van Rossum
Guido van Rossum added the comment: (And, to be clear, I don't *want* to strip trailing spaces.) -- ___ Python tracker ___ ___

[issue40612] Make traceback module's formatting of SyntaxError more similar to system formatting

2020-05-14 Thread Guido van Rossum
Guido van Rossum added the comment: My current PR does not strip trailing whitespace. It only strips a single trailing newline (since this is usually but not always present, and we don't want to its presence to cause an extra blank line, nor do we want its absence to cause the text line and

[issue40612] Make traceback module's formatting of SyntaxError more similar to system formatting

2020-05-14 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: Agreed on everything. One thing I don't really understand is if you propose to also strip trailing whitespace. Does "limit the offset to just past the end of the source text" include whitespace or not? For example, the linked PR does not change this

[issue40612] Make traceback module's formatting of SyntaxError more similar to system formatting

2020-05-13 Thread Guido van Rossum
Change by Guido van Rossum : -- keywords: +patch pull_requests: +19378 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20072 ___ Python tracker

[issue40612] Make traceback module's formatting of SyntaxError more similar to system formatting

2020-05-12 Thread Guido van Rossum
New submission from Guido van Rossum : The traceback module formats several edge cases of SyntaxError different than CPython's default formatting. - There's an off-by-one error if the column offset (printed as a caret) points past the last character (example: 'a +='). The clipping is wrong