Skip to content

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

@andreydani

Description

@andreydani

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions