Skip to content

Conversation

@Kojoley
Copy link
Collaborator

@Kojoley Kojoley commented Nov 15, 2021

Supersedes #13080
Closes #13079
Closes #12412

@mjpieters
Copy link

I'm wondering if enough was updated. IPython.core.oinspect calls inspect.getsource() and inspect.getsourcelines() as well, and under the hood these use inspect.getfile() just like inspect.getabsfile() does:

  • inspect.getsource() delegates to inspect.getsourcelines() and joins the result.
  • inspect.getsourcelines() calls inspect.findsource():
    • inspect.findsource() calls inspect.getsourcefile() first:
      • inspect.getsourcefile() calls inspect.getfile() -> can raise OSError.
    • if inspect.findsource() returned a false-y result, inspect.getfile() is called directly -> can raise OSError.

but the calls in IPython.core.oinspect to these two functions have not been updated yet to handle OSError.

@Kojoley
Copy link
Collaborator Author

Kojoley commented Dec 4, 2021

@mjpieters oinspect.find_file dodged the issue because it catches everything, but oinspect.getsource is affected. I opened PR #13371 with a fix.

bnavigator added a commit to bnavigator/ipython that referenced this pull request Dec 20, 2021
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.

Breaking change in Python 3.10rc1 Python 3.10 support

4 participants