Skip to content

Do not propagate property getter errors from GetPropertiesImpl - #2211

Open
romangolev wants to merge 1 commit into
IronLanguages:mainfrom
pyrevitlabs:fix/customtypedesc-getter-errors
Open

romangolev wants to merge 1 commit into
IronLanguages:mainfrom
pyrevitlabs:fix/customtypedesc-getter-errors

Conversation

@romangolev

Copy link
Copy Markdown

CustomTypeDescHelpers.GetPropertiesImpl reads every attribute of a Python object to learn its type. A getter that raises made TypeDescriptor.GetProperties throw, which fails WPF binding resolution (Window.Show()) for a data context that has such a property.

A property whose getter raises is now typed object. Other types are unchanged, and SystemExit, KeyboardInterrupt and fatal exceptions still propagate. Attributes excluded by the attribute filters are no longer read. Tests are in CustomTypeDescriptorTest.cs; three fail without the change. Tested locally on net8.0.

A getter that raises made TypeDescriptor.GetProperties fail, which broke WPF bindings. Such a property is now typed as object.
@romangolev

Copy link
Copy Markdown
Author

@dotnet-policy-service agree company="pyrevitlabs"

@romangolev
romangolev marked this pull request as ready for review December 5, 2026 13:40
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

Successfully merging this pull request may close these issues.

1 participant