Revert #1831, the __file__ injection in safe_execfile / safe_execfile_ipy.#2432
Merged
Conversation
Member
|
I haven't been following this one, but is there an easy way to add a test, so we don't break the same thing next time we try to do that? |
Contributor
Author
|
Yes, I think so. I've been working on a better solution in bfroehle/ipy_file_inject. |
Contributor
Author
|
Well, some tests are easy to write, like verifying that |
Member
|
It's possible using pexpect, but probably not worth it. |
Contributor
|
It sounds like this issue might be related as well #2356 |
Contributor
Author
|
Without objection, I'm planning on merging this tomorrow. I got hit with the Mayavi bug (#2279) yesterday when doing a demo. |
Member
|
Merging. |
Carreau
added a commit
that referenced
this pull request
Sep 30, 2012
Revert #1831, the `__file__` injection in safe_execfile / safe_execfile_ipy. This reverts commit 2717feb, reversing changes made to ea4f608. Pull request #1831 (fix #1814 set __file__ when running .ipy files) has been the source of a lot of grief: #2279: Setting __file__ to None breaks Mayavi import #2429: Using warnings.warn() results in TypeError In general the patch was inappropriate because it: 1. Fails to properly restore the context, by setting __file__ to None rather than deleting it. 2. Sets __file__ in the wrong dictionary (self.user_ns rather than where[0]).
mattvonrocketstein
pushed a commit
to mattvonrocketstein/ipython
that referenced
this pull request
Nov 3, 2014
Revert ipython#1831, the `__file__` injection in safe_execfile / safe_execfile_ipy. This reverts commit 2717feb, reversing changes made to ea4f608. Pull request ipython#1831 (fix ipython#1814 set __file__ when running .ipy files) has been the source of a lot of grief: ipython#2279: Setting __file__ to None breaks Mayavi import ipython#2429: Using warnings.warn() results in TypeError In general the patch was inappropriate because it: 1. Fails to properly restore the context, by setting __file__ to None rather than deleting it. 2. Sets __file__ in the wrong dictionary (self.user_ns rather than where[0]).
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This reverts commit 2717feb, reversing changes made to ea4f608.
Pull request #1831 (fix #1814 set
__file__when running .ipy files) has been the source of a lot of grief:__file__to None breaks Mayavi import #2279: Setting__file__toNonebreaks Mayavi importwarnings.warn()results inTypeErrorIn general the patch was inappropriate because it:
__file__to None rather than deleting it.__file__in the wrong dictionary (self.user_nsrather thanwhere[0]).I suggest that we revert pull request #1831 and reopen the original issue (#1814).