Exception in script in ~/.ipython/profile_default/startup causes other scripts to not execute
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
调研方向
使用 ~/.ipython/profile_default/startup/a.py 和 b.py 重现故障,然后跟踪 kernel 执行 startup-script 的入口点。在 Jupyter notebook 中验证行为:较晚的脚本在较早的脚本发生异常后仍应继续运行,并且失败的脚本应产生某种错误指示。
由索引模型根据 Issue 内容生成。
描述
Summary
If one of the files in your ~/.ipython/profile_default/startup throws an exception, then any other file that executes later (i.e. is lexicographically higher, because startup scripts are executed in lexicographical order) will not be executed.
To reproduce
- Run these commands:
echo 'raise Exception' > ~/.ipython/profile_default/startup/a.py
echo 'x = 123' > ~/.ipython/profile_default/startup/b.py
- Open a Jupyter notebook, type
xinto a cell, and press enter
Expected behavior
It outputs 123. Ideally it also shows some information indicating that a.py failed to run.
Actual behavior
It shows NameError: name 'x' is not defined. It also doesn't give any indication that a.py (or b.py) failed to run.
System configuration
Kernel version:
Python 3.11.6 (main, Oct 2 2023, 20:46:14) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.16.1 -- An enhanced Interactive Python. Type '?' for help.
Python packages:
$ python3 -m pip show ipykernel | grep Version
Version: 6.25.2
OS version: macOS 13.3.1
Notes
If you run
mv ~/.ipython/profile_default/startup/{a,c}.py
then it will successfully define x (because b.py runs before c.py).
- 主要语言
- Python
- 星标
- 734
- 派生
- 411
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 9
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ipython/ipykernel 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 68/100
查看 ipython/ipykernel 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·