Skip to content
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

Avoid reloading builtin types module. #10318

Merged
merged 1 commit into from Feb 22, 2017

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Feb 21, 2017

Closes #10235

@Carreau Carreau added this to the 6.0 milestone Feb 21, 2017
# bowels of Python and screw up the import machinery after.
# unlike other imports the `exclude` list aleady in place is not enough.

if m is types:
Copy link
Member

Choose a reason for hiding this comment

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

Bit disturbing that the exclude list doesn't work for this.

I'd like to find a way to exclude all standard library modules from deepreload(), but I don't know of a good way to check if something's in the stdlib.

Maybe the rule should be 'anything that IPython uses' - i.e. anything that's in sys.modules before user code runs. It's possibly tricky to do that now that we don't load deepreload on start.

@Carreau
Copy link
Member Author

Carreau commented Feb 22, 2017

I'd like to find a way to exclude all standard library modules from deepreload(), but I don't know of a good way to check if something's in the stdlib.

There isn't. And AFAICT Core python does not see any interest in doing it. We could check early-python-modules that have the specific file _bootstrap_external_something.

I've looked as to where the NotImplementedError but that's too far down in CPython, I I don't understand the real reason why it hits this spot. And exclude does not work, because it work on module names, and the current code fails when trying to get the modulename (via find_spec), so it does not have a chance to exclude it...

I honestly think it might be a Bug in CPython itself. But it would be nice to even have a band-aid potentially opening an issue to investigate later.

@takluyver takluyver merged commit 030ba7a into ipython:master Feb 22, 2017
@Carreau Carreau deleted the prevent-reload-types branch May 7, 2017 05:21
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.

None yet

2 participants