pythonnet / pythonnet/clr-loader
netfx loader with LOAD_LIBRARY_SEARCH_USER_DIRS
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 42
- フォーク
- 32
- 平均マージ
- 14時間 1分
- マージ済み PR(30日)
- 1
説明
If the win32 API SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_USER_DIRS) is used, the default clr_loader doesn't work.
import ctypes
from ctypes import wintypes
dll = ctypes.CDLL("Kernel32.dll")
dll.SetDefaultDllDirectories.argtypes=[wintypes.DWORD]
LOAD_LIBRARY_SEARCH_USER_DIRS = 0x00000400
dll.SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_USER_DIRS)
import clr # <---- crash
This search mode is documented here
It is used in the python distribution from the windows store (although I don't know if this issue is reproducible there) as well as some embedders of Python.
I tried the following as a workaround:
import os
os.add_dll_directory(r"C:\Windows\Microsoft.NET\Framework64\v4.0.30319")
os.add_dll_directory(r"C:\path\to\python\env\site-packages\clr_loader\ffi\dlls\amd64")
And it didn't work.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、clr をインポートする前に SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_USER_DIRS) を呼び出す Python スニペットを再現します。clr_loader の DLL 読み込みパスと、その ffi/dlls/amd64 ディレクトリを調べたうえで、この Windows 検索モードで、報告されている回避策に依存せずに clr をインポートできることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools, operating-systems
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100