pycryptodome icon indicating copy to clipboard operation
pycryptodome copied to clipboard

Raise ImportError along with OSError when .so files can't be imported

Open DUOLabs333 opened this issue 3 years ago • 2 comments

Is it possible for Crypto to raise OSError as well as ImportError when an so file can't be loaded during importing?

DUOLabs333 avatar Dec 16 '22 19:12 DUOLabs333

What is the reason for doing so?

Legrandin avatar Jan 27 '23 22:01 Legrandin

If you install PyCryptodome but remove the .so files, then try to use yt-dlp, it will fail because youtube-dl doesn't catch OSError when importing PyCryptodome. I tried to get them to also catch OSError, but they weren't receptive.

So, it's mostly to work around one program in one specific use-case.

DUOLabs333 avatar Jan 27 '23 23:01 DUOLabs333