Ungraceful handling of libarchive missing symbol

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

還沒有人認領這個 Issue。

評估

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

研究方向

先閱讀 src/extractcode/archive.py,以及 src/extractcode/libarchive2.py 第 635 行附近的 libarchive 載入程式碼,然後重現 issue 中所示的缺少符號的匯入失敗。完成的判定標準是:缺少的 extractcode-libarchive 相依性或符號會產生清楚的錯誤,說明應改為採取什麼措施,而不是原始的 AttributeError。

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

描述

When extractcode-libarchive isnt present, on openSUSE we see the following. A more graceful error indicating what to do would be helpful.

[   35s] src/extractcode/archive.py:29: in <module>
[   35s]     from extractcode import libarchive2
[   35s] <frozen importlib._bootstrap>:991: in _find_and_load
[   35s]     ???
[   35s] <frozen importlib._bootstrap>:975: in _find_and_load_unlocked
[   35s]     ???
[   35s] <frozen importlib._bootstrap>:671: in _load_unlocked
[   35s]     ???
[   35s] /usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
[   35s]     exec(co, module.__dict__)
[   35s] src/extractcode/libarchive2.py:635: in <module>
[   35s]     archive_reader = libarchive.archive_read_new
[   35s] /usr/lib/python3.8/ctypes/__init__.py:386: in __getattr__
[   35s]     func = self.__getitem__(name)
[   35s] /usr/lib/python3.8/ctypes/__init__.py:391: in __getitem__
[   35s]     func = self._FuncPtr((name_or_ordinal, self))
[   35s] E   AttributeError: /usr/bin/python3.8: undefined symbol: archive_read_new
主要語言
Python
星號
39
分支
23
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

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

aboutcode-org/extractcode 的其他 Issue

查看 aboutcode-org/extractcode 的全部 Issue

相似的 Issue

更多 Python Issue

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

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