[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Pablo: that works fine, thanks! I will look into updating the doctest docs, and will close this issue later today ( or you can close it if you like). -- ___ Python tracker

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Can you try a doctest that fails on something that is not a SyntaxError. Something like: >>> def foo(x): ...return x + 42 >>> foo(None) -- ___ Python tracker

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Ah, but that is a different issue. This is not PEP 657, this is a SyntaxError, so is related how those are printed, which I think is separared. -- ___ Python tracker

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Sorry, I should have noted I’m referring to the line 1 1 Which is underlined by a single caret, but on the command line it has 3 carets as expected. -- ___ Python tracker

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Hu, could you explain a bit more in detail what is the expected output? I can see highlighting in the exec call that you pasted: exec(compile(example.source, filename, "single", ^^^ The

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've ran into this when looking at doctest docs, the issue is that they use the old example where a single column is highlighted, I want to update it to explain why doctest output differs from the one you get from REPL, but I probably need to understand why

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Andrei Kulakov
New submission from Andrei Kulakov : It seems like fine grained error locations do not work in failed doctest traceback output: version 3.11.0a0 file contents: -- def a(x): """ >>> 1 1 1 """ import doctest doctest.testmod() OUTPUT --- Failed example: