Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Exception in script in ~/.ipython/profile_default/startup causes other scripts to not execute

Đang mở
#1,158 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
jupyter-notebook, python
Lĩnh vực
backend

Hướng nghiên cứu

Tái hiện lỗi với ~/.ipython/profile_default/startup/a.py và b.py, sau đó lần theo điểm vào thực thi các startup-script của kernel. Xác minh hành vi trong một Jupyter notebook: các script phía sau vẫn phải chạy sau khi có exception ở script trước đó, và script bị lỗi phải tạo ra một số dấu hiệu về lỗi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

  1. Run these commands:
echo 'raise Exception' > ~/.ipython/profile_default/startup/a.py
echo 'x = 123' > ~/.ipython/profile_default/startup/b.py
  1. Open a Jupyter notebook, type x into 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).

Ngôn ngữ chính
Python
Star
734
Fork
411
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
9

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ipython/ipykernel

Tất cả issue của ipython/ipykernel

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.