FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-17735: make inspect.findsource raise OsError instead of IndexError wh… by iritkatriel · Pull Request #23633 · python/cpython · GitHub

Repository navigation

bpo-17735: make inspect.findsource raise OsError instead of IndexError wh… - #23633

Merged
taleinat merged 3 commits into
python:masterfrom
iritkatriel:bpo-17735
Dec 4, 2020
Merged

taleinat merged 3 commits into
python:masterfrom
iritkatriel:bpo-17735

Conversation

iritkatriel commented Dec 3, 2020 •
edited by taleinat
Loading

Copy link
Copy Markdown
Member

…en co_lineno is larger than length of file (can happen if file was updated since import)

The docstring says this function raises OSError when it can't find the source, so we make it so.
(The bpo is about the consequence of help() not handling IndexError.)

https://bugs.python.org/issue17735

iritkatriel changed the title bpo-17735: inspect.findsource raises OsError instead of IndexError wh… bpo-17735: make inspect.findsource raise OsError instead of IndexError wh… Dec 3, 2020
iritkatriel requested a review from taleinat December 3, 2020 22:27
iritkatriel and others added 2 commits December 4, 2020 17:01
…en co_lineno is larger than length of file (can happen if file was updated since import)

taleinat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

taleinat merged commit 2e0760b into python:master Dec 4, 2020
taleinat added needs backport to 3.8 type-bug An unexpected behavior, bug, or error labels Dec 4, 2020

Copy link
Copy Markdown
Contributor

Thanks @iritkatriel for the PR, and @taleinat for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

Copy link
Copy Markdown
Contributor

Thanks @iritkatriel for the PR, and @taleinat for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 4, 2020
…t of range (pythonGH-23633)

This can happen when a file was edited after it was imported.
(cherry picked from commit 2e0760b)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>

Copy link
Copy Markdown

GH-23646 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 4, 2020
…t of range (pythonGH-23633)

This can happen when a file was edited after it was imported.
(cherry picked from commit 2e0760b)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>

Copy link
Copy Markdown

GH-23647 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Dec 4, 2020
…t of range (GH-23633)

This can happen when a file was edited after it was imported.
(cherry picked from commit 2e0760b)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
taleinat pushed a commit that referenced this pull request Dec 4, 2020
…t of range (GH-23633)

This can happen when a file was edited after it was imported.
(cherry picked from commit 2e0760b)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…t of range (pythonGH-23633)

This can happen when a file was edited after it was imported.
iritkatriel deleted the bpo-17735 branch June 18, 2021 19:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL