Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ModuleObject __getattribute__ doesn't treat exceptions ocurred during internal GetAttribute #1047

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

Closed
andreydani opened this issue Feb 20, 2020 · 1 comment

Comments

@andreydani
Copy link

Environment

  • Pythonnet version: 2.4.0
  • Python version: 3.7.6
  • Operating System: Windows 10

Details

From Python code, using clr, when trying to access a class 'Plugin' inside a ModuleObject an exception System.IO.FileNotFoundException is thrown (this isn't a bug on pythonnet) and is never caught, so it isn't converted into a python exception.
The program aborts abnormally, and the Python code never receives the exception.

   module_clr = __import__(namespace_assembly)
   if 'ModuleObject' in self.modulo_clr.__class__.__name__:
      plugin = module_clr.Plugin
andreydani pushed a commit to andreydani/pythonnet that referenced this issue Feb 20, 2020
andreydani pushed a commit to andreydani/pythonnet that referenced this issue Feb 20, 2020
lostmsu added a commit that referenced this issue Feb 22, 2020
#1047 ModuleObject __getattribute__ doesn't treat exceptions ocurred during internal GetAttribute
@lostmsu
Copy link
Member

lostmsu commented Feb 22, 2020

Since #1048 is merged, I am closing this issue. Please, open if it resurfaces on master

@lostmsu lostmsu closed this as completed Feb 22, 2020
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this issue Jun 29, 2020
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this issue Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants