Skip to content

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

Merged
hugovk merged 1 commit into
python:3.15from
miss-islington:backport-025e7d2-3.15
Aug 14, 2026
Merged

[3.15] gh-113329: Catch OSError in doctest finder and document that inspect.getsourcefile/getfile can raise OSError (GH-113335)#155658
hugovk merged 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

@hugovk
hugovk merged commit 791f38c into python:3.15 Aug 14, 2026
60 checks passed
@miss-islington
miss-islington deleted the backport-025e7d2-3.15 branch August 14, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants