gcobb321 / icloud3

iCloud3 v3 - iCloud3 is an advanced iDevice tracker that uses Apple iCloud account and HA Companion App data for presence detection and location based automations.
MIT License
498 stars 52 forks source link

iCloud3 integration creating warning "using blocking call to open()" in 2024.6.1 #345

Open andrew-kennedy opened 3 weeks ago

andrew-kennedy commented 3 weeks ago

Getting a bunch of these warnings in my log from icloud3:

2024-06-09 18:00:00.164 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'icloud3' at custom_components/icloud3/support/hacs_ic3.py, line 70: with open(hacs_repository_file, 'r') as f: (offender: /config/custom_components/icloud3/support/hacs_ic3.py, line 70: with open(hacs_repository_file, 'r') as f:), please create a bug report at https://github.com/gcobb321/icloud3_v3/issues
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/config/custom_components/icloud3/support/hacs_ic3.py", line 38, in check_hacs_icloud3_update_available
    hacs_ic3_items  = _get_hacs_ic3_data(hacs_repository_file)
  File "/config/custom_components/icloud3/support/hacs_ic3.py", line 70, in _get_hacs_ic3_data
    with open(hacs_repository_file, 'r') as f:
gcobb321 commented 3 weeks ago

I’ve fixed this on the v3.0.5.2 release now on the iCloud3 Developers repository. I’ll release it on the regular iCloud3 repository in a few days. But it’s nothing to be concerned about.