ctypes.CDLL on Linux creates a "main program" object when passed an empty string
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 46/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
まず、報告された ctypes.CDLL('') の reproducer を Linux 上で実行し、ライブラリ名が存在しない場合と比較します。ctypes.CDLL のロードパスを追跡し、空文字列の場合にダミーオブジェクトを作成するのではなく例外を発生させるようにします。この動作が回帰テストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Bug report
ctypes.CDLL throws an exception when it can't find a library in the path pointed at by its name argument; however, if name is an empty string a dummy object is created:
>>> import ctypes
>>> ctypes.CDLL('')
<CDLL '', handle 7fb30d2d3190 at 0x7fb30c2caa60>
I don't think this is correct, since that dummy object will break things when trying to use it later on.
Your environment
- CPython versions tested on: 3.8.10, 3.10.8
- Operating system and architecture: Ubuntu 20.04.5 LTS for x86_64
This doesn't happen on Windows with Python 3.10.7; there I see an exception being thrown for the empty string.
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 558
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/cpython のほかの issue
-
docs pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
build type-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
stdlib topic-email type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
PolicyEngine/policyengine-us#9559 ·
-
priority: p3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
googleapis/librarian#7636 ·
-
from:qa priority:P2 reliability tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
spec-kitty/spec-kitty#4874 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100