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

Cell magic uses incorrect IPython shell #952

Closed
krassowski opened this issue Aug 13, 2024 · 0 comments · Fixed by #962
Closed

Cell magic uses incorrect IPython shell #952

krassowski opened this issue Aug 13, 2024 · 0 comments · Fixed by #962
Labels
bug Something isn't working

Comments

@krassowski
Copy link
Member

Description

When cell magics are spawned in a different shell than global (which may be missing) an incorrect ipython shell is used. This is because instead of using the shell passed to the constructor:

def __init__(self, shell):
super().__init__(shell)

get_ipython() gets called:

# interpolate user namespace into prompt
ip = get_ipython()
prompt = prompt.format_map(FormatDict(ip.user_ns))

Reproduce

Run nested shells, or in environment where get_ipython() returns null

Expected behavior

Proper shell is used, get_ipython is never called in library code.

Context

Latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant