New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doctest gets line numbers wrongs with <> in name #48907
Comments
When writing the unit tests for running doctests from inside a zipfile, With that name, the line numbers coming back for all of the examples Changing the name to "anon" eliminated the errors. (Both "<anon" and I suspect there may be a problem with __LINECACHE_FILENAME_RE when "<" |
@nick: could you provide a patch that addresses this issue? |
On Sat, Jul 31, 2010 at 9:30 PM, Mark Lawrence <report@bugs.python.org> wrote:
Probably, but the "don't do that" work around is trivial enough that It's still a genuine bug though. Since my original post isn't all that To reproduce it, edit Lib/test/test_zipimport_support.py to pass Then pass "anon" (no angle brackets) to see that the reported doctest (Note: regrtest's "-v" option is actually more confusing than helpful |
Note that this appears to have been fixed already in the 3.x series (I haven't investigated the differences to see what makes this a 2.x only problem) |
I have a vague memory of changing some code, in linecache I think, that involved anonymous names. I might have fixed it by accident. |
I tested on 3.10 (macos) and can confirm that it is fixed. Details: I changed _run_object_doctest as Nick explained, and made it display the output of the finder.find() call - the line number was the same with and without the <>s. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: