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

Error: TypeError: expected str, bytes or os.PathLike object, not NoneType

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

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
django, prometheus, python
領域
observability

研究方向

從 django_q/cluster.py 第 233-234 行附近開始,追蹤對 prometheus_client.multiprocess.mark_process_dead 的呼叫。重現該失敗,並檢查為什麼傳遞給 os.path.join 的路徑是 None。確認原因,並為失敗情境定義及驗證行為,即視為完成。

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

描述

Sometimes i get this error:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/opt/homebrew/Cellar/[email protected]/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/django_q/cluster.py", line 165, in __init__
    self.start()
  File "/opt/homebrew/lib/python3.10/site-packages/django_q/cluster.py", line 174, in start
    self.guard()
  File "/opt/homebrew/lib/python3.10/site-packages/django_q/cluster.py", line 315, in guard
    self.reincarnate(p)
  File "/opt/homebrew/lib/python3.10/site-packages/django_q/cluster.py", line 234, in reincarnate
    prometheus_multiprocess.mark_process_dead(process.pid)
  File "/opt/homebrew/lib/python3.10/site-packages/prometheus_client/multiprocess.py", line 169, in mark_process_dead
    for f in glob.glob(os.path.join(path, f'gauge_{mode}_{pid}.db')):
  File "/opt/homebrew/Cellar/[email protected]/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

It happen here:

https://github.com/django-q2/django-q2/blob/337a5782d9113a6e9d058743488e7517aebb8280/django_q/cluster.py#L233-L234

When mark_process_dead is called.

Can you help me?

Thanks.

主要語言
Python
星號
4.4k
分支
876
平均合併
8 天 4 小時
30 天內合併 PR
1

環境準備

從這裡開始

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

prometheus/client_python 的其他 Issue

查看 prometheus/client_python 的全部 Issue

相似的 Issue

更多 Python Issue

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

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