-
Notifications
You must be signed in to change notification settings - Fork 751
Give more explicit ImportErrors #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
related? #111 |
Could be. I just recognised this today as a problem, when I (again) had to do an |
@filmor the problem is that some third-party packages try to import some libraries and have backup logic if no success. So how would we distinguish between package -handled and -unhandled imports? |
We should still raise an import error, we should just add information to the message, which assembly could not be loaded and why, basically the information that the.NET exception contains. |
what I meant is actually cases like this and we would bug down the user with optional imports failing: https://github.com/pydata/pandas/blob/master/pandas/computation/__init__.py |
10000
That's not what I'm saying, I'm suggesting keeping the |
@filmor agreed! we need to extend the passed information. |
…missing dependencies with ImportError Exceptions
…missing dependencies with ImportError Exceptions
…missing dependencies with ImportError Exceptions
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
@filmor the right way to do it is to enable Fusion Log on Windows or set Mono debug environment variables for Mono. |
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses pythonnet#261 It is an alternative to pythonnet#298
…ore info when CLR assemblies are failed to be loaded 1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning. 2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportError BREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException. Additional: a few uses of BorrowedReference This addresses #261 It is an alternative to #298
Currently, an
ImportError
raised from Python.NET does not include information on the actual dependency that failed to load.The text was updated successfully, but these errors were encountered: