Skip to content

[3.15] gh-113329: Catch OSError in doctest finder and document that inspect.getsourcefile/getfile can raise OSError (GH-113335) - #155658

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-025e7d2-3.15
Open

[3.15] gh-113329: Catch OSError in doctest finder and document that inspect.getsourcefile/getfile can raise OSError (GH-113335)#155658
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-025e7d2-3.15

Conversation

@miss-islington

Copy link
Copy Markdown
Contributor

Fixes GH-113329, which occurs when running doctests in a class docstring in a REPL environment.
Since Python 3.10, an OSError is raised when the class source code cannot be found.
(cherry picked from commit 025e7d2)

Co-authored-by: Sten Wessel sten@stenwessel.nl

…spect.getsourcefile/getfile can raise OSError (pythonGH-113335)

Fixes pythonGH-113329, which occurs when running doctests in a class docstring in a REPL environment.
Since Python 3.10, an OSError is raised when the class source code cannot be found.
(cherry picked from commit 025e7d2)

Co-authored-by: Sten Wessel <sten@stenwessel.nl>
@python-cla-bot

python-cla-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants