Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

iPython doesn't show exception.add_note()

未關閉
#1,115 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
jupyter-notebook, python
領域
backend

研究方向

在使用 Python 3.11 核心的 Jupyter notebook 中重現問題,然後將其 traceback 與報告中顯示的 Python REPL 輸出進行比較。追蹤核心如何格式化和傳送例外,並在例外註記如同 REPL 中一樣出現在 notebook traceback 中時,將問題視為完成。

由索引模型根據 Issue 內容生成。

描述

PEP 678 added in 3.11 allows enriching exceptions with notes. This works in the REPL:

>>> try:
...   raise TypeError('bad type')
... except Exception as e:
...   e.add_note('Add some information')
...   raise
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
TypeError: bad type
Add some information

Entering the same in a Jupyter notebook using a 3.11 kernel, I don't see the note:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Untitled-1.ipynb Cell 1 in 2
      1 try:
----> 2   raise TypeError('bad type')
      3 except Exception as e:
      4   e.add_note('Add some information')

TypeError: bad type

Related issue: https://github.com/microsoft/vscode-jupyter/issues/13446

主要語言
Python
星號
734
分支
412
平均合併
1 天 10 小時
30 天內合併 PR
12

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ipython/ipykernel 的其他 Issue

查看 ipython/ipykernel 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。