Staging
v0.8.1
https://github.com/python/cpython
Revision 15bc9ab301d73f20bff47a12ef05326feb40f797 authored by Guido van Rossum on 15 May 2020, 02:22:48 UTC, committed by GitHub on 15 May 2020, 02:22:48 UTC


This fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following:

- Suppress caret if it points left of text
- Allow caret pointing just past end of line
- If caret points past end of line, clip to *just* past end of line

The syntax error formatting code in traceback.py was mostly rewritten; small, subtle changes were applied to the C code in pythonrun.c.

There's still a difference when the text contains embedded newlines. Neither handles these very well, and I don't think the case occurs in practice.

Automerge-Triggered-By: @gvanrossum
1 parent 1aa8767
Raw File
Tip revision: 15bc9ab301d73f20bff47a12ef05326feb40f797 authored by Guido van Rossum on 15 May 2020, 02:22:48 UTC
bpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072)
Tip revision: 15bc9ab
CODE_OF_CONDUCT.md
# Code of Conduct

Please note that all interactions on
[Python Software Foundation](https://www.python.org/psf-landing/)-supported
infrastructure is [covered](https://www.python.org/psf/records/board/minutes/2014-01-06/#management-of-the-psfs-web-properties)
by the [PSF Code of Conduct](https://www.python.org/psf/codeofconduct/),
which includes all the infrastructure used in the development of Python itself
(e.g. mailing lists, issue trackers, GitHub, etc.).

In general, this means that everyone is expected to be **open**, **considerate**, and
**respectful** of others no matter what their position is within the project.

back to top