Title: Uncaught exception when a component has a property whose getter raises (intended?) · Issue #672 · google/python-fire · GitHub
Open Graph Title: Uncaught exception when a component has a property whose getter raises (intended?) · Issue #672 · google/python-fire
X Title: Uncaught exception when a component has a property whose getter raises (intended?) · Issue #672 · google/python-fire
Description: When a component has a @property whose getter raises, fire.Fire(component) crashes with the property's raw traceback on bare invocation and on --help, instead of showing usage/help. A direct call to an unrelated method works fine. Repro ...
Open Graph Description: When a component has a @property whose getter raises, fire.Fire(component) crashes with the property's raw traceback on bare invocation and on --help, instead of showing usage/help. A direct call t...
X Description: When a component has a @property whose getter raises, fire.Fire(component) crashes with the property's raw traceback on bare invocation and on --help, instead of showing usage/help. A direct ca...
Opengraph URL: https://github.com/google/python-fire/issues/672
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Uncaught exception when a component has a property whose getter raises (intended?)","articleBody":"When a component has a `@property` whose getter raises, `fire.Fire(component)` crashes with the property's raw traceback on bare invocation and on `--help`, instead of showing usage/help. A direct call to an unrelated method works fine.\n\nRepro (fire 0.7.1):\n\n```python\nimport fire\n\nclass App:\n @property\n def status(self):\n raise RuntimeError(\"backend unavailable\") # e.g. a lazy / fallible getter\n\n def greet(self, who=\"world\"):\n return f\"hi {who}\"\n\nif __name__ == \"__main__\":\n fire.Fire(App())\n```\n\n```\n$ python app.py --help\n ...\n value = getter(object, key)\n File \"app.py\", line 5, in status\n raise RuntimeError(\"backend unavailable\")\nRuntimeError: backend unavailable\n\n$ python app.py greet # works\nhi world\n```\n\nFire enumerates members (and reads property *values*) during help/listing, so any property getter that can raise (lazy config, DB or network access, etc.) takes down `--help` and bare invocation, even though those properties are never invoked.\n\nIs this intended, or should Fire surface a clean error (or skip properties that raise) during member enumeration? Happy to send a PR if a fix would be welcome.\n\n\u003csub\u003eFound via automated analysis and confirmed with the reproducer above on fire 0.7.1.\u003c/sub\u003e\n","author":{"url":"https://github.com/Lougarou","@type":"Person","name":"Lougarou"},"datePublished":"2026-06-06T08:04:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/672/python-fire/issues/672"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:01052e8d-2ded-c8d0-ae37-1b52160e1cdd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B51A:358B3C:5AE0BB:7CC6C0:6A4F3798 |
| html-safe-nonce | 93face2b1ca9ab8ec5d6a8f87283a1ab15d34aca08a83162ea56b86d614a895d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTFBOjM1OEIzQzo1QUUwQkI6N0NDNkMwOjZBNEYzNzk4IiwidmlzaXRvcl9pZCI6IjI2NjMzMzI1MzA4MjA2OTE4NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a76bd668f452ef912b1446010c798020ad49eb986eca36bc8ac0a7b61070c381 |
| hovercard-subject-tag | issue:4602553897 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/python-fire/672/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3f15feeb25cc57026625bcd0aafea5a4539c2db08dcc98de74c58b6ee0f453b5/google/python-fire/issues/672 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3f15feeb25cc57026625bcd0aafea5a4539c2db08dcc98de74c58b6ee0f453b5/google/python-fire/issues/672 |
| og:image:alt | When a component has a @property whose getter raises, fire.Fire(component) crashes with the property's raw traceback on bare invocation and on --help, instead of showing usage/help. A direct call t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Lougarou |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/google/python-fire git https://github.com/google/python-fire.git |
| octolytics-dimension-user_id | 1342004 |
| octolytics-dimension-user_login | |
| octolytics-dimension-repository_id | 82729529 |
| octolytics-dimension-repository_nwo | google/python-fire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 82729529 |
| octolytics-dimension-repository_network_root_nwo | google/python-fire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width